fix(build): bundle declarations so types resolve under NodeNext (0.95.1)#268
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.
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
approved these changes
Jun 21, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ 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
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.
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) 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.Change
Restore
dts: true(bundled declarations with.js-extensioned, NodeNext-resolvable specifiers) and drop the deadtsc --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/lintgreen; 2500 tests pass locally.starter-foundry) at the rebuilt declarations: 23noImplicitAnyerrors → 0, zero source changes.Release
Patch
0.95.1(npm + PyPI version trio bumped). Additive packaging fix; unblocks every NodeNext consumer.