Repository navigation
fix(build): resolve workspace imports to source through a development condition (#1056) - #1065
Merged
Merged
Conversation
… condition (#1056) docs/TYPESCRIPT.md said every export entry had a `development` condition pointing at source; #305 had removed them because the package audit required every export target to ship, and src/ never does. Workspace packages and tests therefore read dist/, which went stale after merges until a rebuild. - Core's and each add-on's exports list `development` first (ahead of `types`, so tsc resolves source through customConditions too), naming the .ts source. - Packing strips the condition: publishedManifest drops it, add-ons are now packed from a staged copy with their published manifest like core, and workerd-parity packs the same way. The package audit reads the published manifest and refuses any export naming source. - Add-on tsconfig.build.json clears customConditions so the emit (rootDir src) reads core's built declarations. The root tsconfig paths workaround for audit and the bench's audit prebuild are gone. - create-extension scaffolds the same shape. - Tests assert the manifests' shape, that the packed manifest has no source condition, and that packages/store resolves @jimhoyd/urlcode/sqlite and @jimhoyd/urlcode-audit to source in Node and tsc. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 30, 2026 16:07
jimhoyd
added a commit
that referenced
this pull request
Sep 30, 2026
…hs-filter plan and release-please config Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #1056
Why the condition was missing
#305 ("Slim and enforce release packages", 410a23b) removed every
developmentcondition. The package audit it added requires every export target to be in the tarball, andsrc/never ships. docs/TYPESCRIPT.md kept describing the condition, so workspace packages and tests resolveddist/, which went stale after merges until someone rannpm run build.Change
package.jsonand each add-on's (audit, auth, mcp, store) now list"development": "<src>.ts"first in every JS exports entry. It has to come beforetypes, or tsc matchestypes(dist declarations) and never gets todevelopment.customConditions: ["development"]in tsconfig.base.json is now in effect.scripts/published-manifest.mjsstripsdevelopmentconditions, as it already stripsprepare. Core was already packed from a staged copy with that manifest.pack-addonsnow packs add-ons the same way (newpackPublished), which also means the checkout is never modified, andworkerd-paritypacks core that way too.package-auditchecks the published manifest, and a new assertion refuses any published export that names source.tsconfig.build.jsonsetscustomConditions: []. Its emit (rootDirsrc) reads core's built declarations instead of pulling core source outside its rootDir. The Worker build, package smoke test and examples still run fromdist/.pathsworkaround for audit is gone, and so isbench:store's audit prebuild; both are covered by the condition now.create-extensionscaffolds the same exports and build-config shape.Evidence
test/exports.test.ts:developmentfirst, pointing at an existingsrc/*.tsthat matches itsdefault;publishedManifestleaves no source condition in the exports;packages/store,node --conditions=developmentresolves@jimhoyd/urlcode/sqlite,/extensionsand@jimhoyd/urlcode-audittopackages/core/srcandpackages/audit/src, andts.resolveModuleNamewith the store's tsconfig does too (the build config resolves dist).packages/core/src/sqlite.tsand imported it frompackages/store/src, with dist not rebuilt.tsc --noEmitin store passed andnode --conditions=developmentprinted the value. Both changes were reverted.npm run verifyandnpm run test:packagepass locally (macOS, Node 26). All six package audits pass; the packed sizes are within budget and did not grow.Not run
npm run test:workerdneeds the network and is optional; I checked only that its change typechecks.🤖 Generated with Claude Code