Repository navigation
build(bindx-compiler): publish the compiler as compiled JS - #157
Merged
Merged
Conversation
The Vite and Babel plugins run in Node from a consumer's build config, and Node does not strip types from files under node_modules, so the package cannot ship TypeScript source like the runtime packages do. The root build now bundles dist/index.js next to the declarations, and the package is no longer private, so the release publishes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Makes
@contember/bindx-compilerpublishable, so the next release ships it next to the runtime packages.Why compiled JS
The runtime packages ship TypeScript source (
exports: ./src/index.ts), which consumer bundlers compile. The compiler is different: a consumer imports it fromvite.config.ts, and Node runs that config. Node does not strip types from files undernode_modules, so importing.tssource from there fails.Changes
packages/bindx-compiler/package.json:private; version aligned with the other packagesexports/main/typespoint atdist/build:jsbundlessrc/index.tswithbun build --target=node --packages=external@contember/bindx-reactis aworkspace:*peer, sobun pm packpins it to the exact release versionbuild(which the publish workflow runs) also runsbuild:js. Declarations still come fromtsc --build.README.md: installation, Vite setup, the runtime killswitch and validate mode, and numbers from a trial.Trial on a large production app
Verification
bun run typecheck: clean.bun run test: 2523 pass. Compiler suite: 242 pass.bun pm packand installed the tarball in an empty Node project.import { bindxCompiler } from '@contember/bindx-compiler'works, and the transform compiles a sample component.Status
🤖 Generated with Claude Code