fix(build): bundle declarations so types resolve under NodeNext (0.95.1)#267
Merged
Conversation
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.
tangletools
approved these changes
Jun 21, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — 98fd3acb
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:42:08Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
0.95.0 switched declaration emit from tsup-bundled (
dts: true) totsc --emitDeclarationOnly+ a flat-alias step.tscemits per-module.d.tswith 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 toany, so consumers' typed callbacks (ProposeFn/VerifyFn/ReviewFn,runJudgeFleetresults) lose their parameter types — anoImplicitAnycascade with no consumer-side fix (the named types themselves resolve toany).0.77.0 and earlier shipped a single self-contained bundled
index.d.ts(tsupdts: true), so this never surfaced. The regression is purely in the declaration packaging, not the API.Change
Restore
dts: trueand drop thetsc --emitDeclarationOnly+emit-declaration-aliasesstep from the build. tsup bundles declarations into chunk files whose relative specifiers carry.jsextensions and have both a runtime and a declaration sibling — resolving cleanly under NodeNext, node16, and bundler alike. tsup already emits everyexports-maptypestarget directly, so the flat-alias step is dead.Diff is 4 files:
tsup.config.ts(dts: false→true),package.json(build script + version), and the Python version trio.Verification
pnpm build/verify:package/typecheck/lintgreen; 2500 tests pass.starter-foundry,moduleResolution: NodeNext) at them: 23noImplicitAnyerrors → 0, with zero source changes in the consumer.index.d.tsrelative specifiers all carry.jsextensions (73/73); the broken standalonepropose-review.d.ts/judge-runner.d.tsare gone (bundled into chunks).Release
Patch
0.95.1(version trio bumped). Additive packaging fix — no API change; unblocks every NodeNext consumer.