Skip to content

fix(build): bundle declarations so types resolve under NodeNext (0.95.1)#268

Merged
drewstone merged 3 commits into
mainfrom
chore/dts-nodenext-resolution
Jun 21, 2026
Merged

fix(build): bundle declarations so types resolve under NodeNext (0.95.1)#268
drewstone merged 3 commits into
mainfrom
chore/dts-nodenext-resolution

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Re-opened (PR #267 wedged on a stale head after a force-resync glitch; same branch, same commits).

Problem

0.95.0 switched declaration emit from tsup-bundled (dts: true) to tsc --emitDeclarationOnly + a flat-alias step. tsc emits per-module .d.ts with extensionless relative re-exports (e.g. export { runJudgeFleet } from './judge-runner').

Under a consumer's moduleResolution: NodeNext/node16, those specifiers do not resolve — NodeNext requires an explicit extension and a runtime sibling, which bundled declarations don't have. When the relative module fails to resolve, every re-exported value collapses to any, so consumers' typed callbacks (ProposeFn/VerifyFn/ReviewFn, runJudgeFleet results) lose their parameter types — a noImplicitAny cascade with no consumer-side fix.

Change

Restore dts: true (bundled declarations with .js-extensioned, NodeNext-resolvable specifiers) and drop the dead tsc --emitDeclarationOnly + alias step. Bundled dts is heavier, so raise the build-step heap 4096 → 8192 in ci.yml + publish.yml (the original reason 0.95.0 moved off tsup dts was an OOM at 4096).

4 source files + 2 workflow heap bumps. No API change.

Verification

  • pnpm build / verify:package / typecheck / lint green; 2500 tests pass locally.
  • Pointed a real NodeNext consumer (starter-foundry) at the rebuilt declarations: 23 noImplicitAny errors → 0, zero source changes.

Release

Patch 0.95.1 (npm + PyPI version trio bumped). Additive packaging fix; unblocks every NodeNext consumer.

0.95.0 switched declaration emit from tsup-bundled (`dts: true`) to
`tsc --emitDeclarationOnly` + flat aliases. tsc emitted per-module
`.d.ts` with extensionless relative re-exports (`export { X } from
'./judge-runner'`). Under a consumer's `moduleResolution: NodeNext`
those specifiers do not resolve (NodeNext requires an extension and
a `.js` runtime sibling, which bundled declarations lack), so every
re-exported value collapses to `any` and consumers' typed callbacks
(`ProposeFn`/`VerifyFn`/`ReviewFn`, `runJudgeFleet` results) lose
their parameter types — a noImplicitAny cascade with no consumer-side
fix.

Restore `dts: true`: tsup bundles declarations into chunk files with
`.js`-extensioned specifiers that have both a runtime and a declaration
sibling, resolving cleanly under NodeNext, node16, and bundler alike.
The flat-alias step is no longer needed — tsup emits every exports-map
`types` target directly.

Verified: a NodeNext consumer (starter-foundry) goes from 23
noImplicitAny errors to 0 against the rebuilt types, with no source
change.

Version 0.95.1.
Bundled declaration emit (tsup `dts: true`) is heavier than the
per-module `tsc` path and OOMs the rollup-dts worker at 4096 on CI
runners. Raise the build-step heap to 8192 (runners have ~16GB) so
the bundled, NodeNext-resolvable declarations build in CI and on
the publish workflow.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — 75bcd411

Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-21T14:59:19Z

@drewstone drewstone merged commit 615049d into main Jun 21, 2026
1 check passed
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.

2 participants