Skip to content

fix: ship complete type declarations from version, notes, publish and release - #712

Merged
goosewobbler merged 5 commits into
mainfrom
fix/711-declaration-imports
Oct 23, 2026
Merged

goosewobbler merged 5 commits into
mainfrom
fix/711-declaration-imports

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Description

@releasekit/version, notes and publish shipped type declarations that re-exported from .ts files missing from dist/, so every export typed as any for other packages and for npm users. @releasekit/release declared types but built none.

Cause: their tsup configs set external: [/^[^.]/] to externalize bare package names. The declaration build also checks resolved import paths against external, and a resolved path is absolute (/…/src/config.ts), which that pattern matches, so the packages' own modules were left as imports.

Fix:

  • The pattern now skips relative paths, absolute paths (including Windows drive paths) and @releasekit/*: /^(?![./]|[A-Za-z]:[\\/]|@releasekit\/)/. The JS output is byte-identical; only the declarations change.
  • release builds declarations for its index entry, inlining the private packages. Its JS output is unchanged by this.
  • The declarations now import only declared dependencies (commander, zod, …; release imports @releasekit/publish, a dependency).

Bugs the real types caught in release, fixed here:

  • backfill --config <path> ignored the path when loading the publish config: it passed (cwd, path) to a function that takes { cwd, configPath } (backfill --config ignores the path when loading the publish config #710).
  • The failure report built its ledger from npm and cargo results only, so a failed pub.dev publish showed as not attempted.
  • The ledger matched results by registry name, so a crate or Dart package named differently from its npm package (my_package next to my-package) was never matched to its update. Each publish target and result now carries updatePackageName, the version step's name, and the ledger matches on it.
  • backfill read .file / .llm off releaseNotes without narrowing out false (harmless at runtime).

Related Issue(s)

Closes #711. Closes #710.

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation change
  • refactor — Code refactoring
  • test — Adding or updating tests
  • chore — Maintenance, dependencies, tooling
  • Breaking change — Requires major version bump

Scope

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release
  • @releasekit/config
  • @releasekit/core
  • CI / workflows
  • Root / monorepo

Checklist

  • Lint passes (pnpm lint)
  • Tests pass (pnpm test)
  • Typecheck passes (pnpm typecheck)
  • Documentation updated (if applicable)
  • Breaking changes noted in description

Testing Notes

  • New test/integration/type-declarations.spec.ts: for every published package that declares types, the file exists, and every import in its .d.ts files is a file in dist/ or a declared dependency. Against the old configs it fails for all four packages.
  • New unit tests: backfill --config passes { cwd, configPath } to publish's loadConfig (fails with the old call); a hybrid package's pub.dev result carries its update's name, and buildLedger matches it.
  • JS output compared by checksum before and after for version, notes, publish and release: identical (release's differs only from the two source fixes).
  • Full build, typecheck and unit tests (all packages), root lint, and the integration suite (78 tests) pass.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous failure-report issue is fixed.

Summary

The PR fixes shipped type declarations and corrects config loading and publish failure reports.

  • Published packages now ship declarations that resolve within their package.
  • Backfill now loads publish settings from the selected config path.
  • Failure reports now match results from every registry to the right package.

The previous name-mismatch finding is fixed. No new actionable issues were found in the changes since the last review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Version update: packageName"] --> B["Registry target: updatePackageName"]
  B --> C["Publish result: updatePackageName"]
  C --> D["buildLedger matches the version update"]
Loading

Reviews (2) · Last reviewed commit: "fix(publish): record the version step's ..." · Reviewed by Greptile

… release

The `external: [/^[^.]/]` pattern in version's, notes' and publish's tsup
configs also matched the resolved absolute paths the declaration build
checks, so their own modules were left as imports of `.ts` files missing
from dist, and every export typed as `any` for other packages. The pattern
now skips absolute paths and @releasekit/*. Release declares types but
built none, so it now builds them.

With real types, release's typecheck caught two bugs, fixed here:
- `backfill --config` ignored the path when loading the publish config.
- The failure report left out pub.dev results.

An integration test now checks every published package's declarations:
the declared types file exists, and each import is a file in dist or a
declared dependency.

Closes #711
Closes #710

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Standing release PR: #614 · v0.42.0 queued (4 packages) · open 82d 21h 31m · ✅ ready to merge

Release Preview — v0.41.2 → v0.41.3

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#614) when merged:

Changelog

monorepo 0.41.2 → 0.41.3

Changed

  • shorten the updatePackageName doc to fit the line limit
  • say what the external pattern matches; one doc for updatePackageName
  • document the standing-PR body as an interface, add agent guidance (PR #619 · closes #549)
  • say what the declaration build matches against the external pattern
  • add the structured enhance-and-categorize eval case (notes) (PR #617)

Fixed

  • record the version step's package name on each publish result (publish)
  • ship complete type declarations from version, notes, publish and release (#711, #710)

All packages → 0.41.3 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.42.0 0.41.3 0.42.0

Updated automatically by ReleaseKit

github-actions Bot and others added 4 commits October 23, 2026 16:13
…result

A hybrid package's crate or Dart package can have its own name
(`my_package` next to npm's `my-package`), and publish results carried
only that registry name, so the failure report couldn't match a cargo or
pub.dev result to its update and showed a failure as published or not
attempted. Each target and result now carries `updatePackageName`, and
the ledger matches on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ttern

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…geName

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@goosewobbler
goosewobbler merged commit e706869 into main Oct 23, 2026
14 checks passed
@goosewobbler
goosewobbler deleted the fix/711-declaration-imports branch October 23, 2026 15:40
@github-actions github-actions Bot mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

version, notes and publish ship type declarations that resolve to any backfill --config ignores the path when loading the publish config

1 participant