build: per-file tsc emit and published-package verification #125 #126 - #151
Merged
Conversation
Added `scripts/generate-version.ts` and the committed `src/version.ts` Rewrote `src/index.ts` to import the generated constant Rewrote the `src/index.test.ts` manifest import with a JSON attribute, keeping it as the drift guard Extended `scripts/check-version.ts` to gate `src/version.ts` sync in both modes Added the `generate:version` script Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Swapped the drift-guard comment prefix to `// ?` per comments.md Hardened `check-version.ts` against CRLF and a missing `src/version.ts` Preferred `undefined` and a single `Bun.file` handle in the generator Restored the `check:*` script grouping in package.json Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Switched tsconfig to `nodenext` and removed the dead `@/*` paths alias Replaced the four build steps with a single `tsc -p tsconfig.build.json` emit Dropped Node/Bun type packages from the build program via `types: []` Declared the CLI entry's minimal `process` surface module-locally Restored plain re-exports in `testing.ts`, moving TSDoc to `rng/mock.ts` Pointed `bin` at `dist/cli/index.js` and set its executable bit in `build` Updated `package-smoke.test.ts` and the CI cli job for the new layout Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Asserted the `chmod +x` build-script contract in the CLI smoke test Executed the built CLI directly to exercise shebang and mode together Added a `types: []` build-config pass to `typecheck` so neutrality errors surface in `check` Dropped dead Bun setup steps from the CI cli job Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dropped the redundant node10-era `main` and `types` fields (`exports` is the source of truth) Added `unpkg`/`jsdelivr` fields pointing at `dist/index.js` Extended keywords with discovery terms for dice, ESM, and browser use Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaced `../../src` imports in `site/src` with the `roll-parser` self-reference Made `typecheck` build the library so the site project resolves `dist` types Prepended the library build to `site:build` and `site:dev` Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Stopped `clean` from deleting `coverage/` during the `check` iteration loop Kept Bun ambient globals out of the browser-only site typecheck via `types: []` Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewrote `node-smoke` to npm-pack the tarball, install it in a scratch project, and exercise both entry points and the bin across Node 22.12.0, 22.x, and lts/* Added a `browser-smoke` job: esbuild `--platform=browser` bundle of both entries from the tarball install, hard-failing on Node builtins, grepped for runtime globals, then executed Asserted dist library files carry no `node:`/`bun:`/`require` specifiers Enabled Biome `noNodejsModules` for library sources, exempting `src/cli` Pinned `esbuild` as an explicit devDependency for the browser-smoke bundle Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documented the per-file emit, neutrality enforcement, and `src/version.ts` in CLAUDE.md constraints Added the `generate:version` step to the release-commit convention Noted the site consumes built `dist/` and library edits need a rebuild Replaced dead `@/` path-alias import examples in rules with `.js`-suffixed relative imports Added README notes for CDN usage and the minimum TypeScript `moduleResolution` Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Added an explicit `24.x` matrix leg so LTS drift cannot silently drop it Broadened the dist grep to catch side-effect and dynamic builtin imports Guarded both grep assertions against missing paths passing silently Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Corrected CONTRIBUTING's bundler claim, `.js`-extension rationale, and release steps Scoped CLAUDE.md's npm exception to all smoke jobs and the publish step Completed the `validate` description and noted `check`'s dist rebuild side effect Pinned the raw unpkg example to the `@next` tag Struck the resolved #22 items in GAPS.md, noting `src/` shipping is now deliberate Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bumped checkout, cache, download-artifact, and setup-node SHAs in the rebased smoke jobs to the majors master upgraded in #149 Co-Authored-By: Claude Fable 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.
Replaces the Bun-bundled
dist/with a per-filetscemit undernodenextand closes the remaining publish-path verification gaps.Build (#125): one
tsc -p tsconfig.build.jsonpass now emits JS,.d.ts, and both map kinds;binmoved todist/cli/index.js, killing the CLI double-bundle (dist shrank ~1020 KB to ~760 KB). Thetesting.tsconst-alias workaround for the Bun re-export bug is deleted (no bundler in the package path),src/version.tsis generated frompackage.jsonand gated bycheck:versionplus a drift test, and library neutrality is enforced three ways: BiomenoNodejsModules,types: []in the build config, and the new browser-smoke job. The manifest drops node10-eramain/types, gainsunpkg/jsdelivrfields and discovery keywords, and the demo site now imports the built package through the self-reference.CI (#126):
node-smokeinstalls the realnpm packtarball in a scratch project and exercises both entry points,require(esm), and the installed bin across Node 22.12.0, 22.x, 24.x, and lts/*;browser-smokebundles both entries from the tarball with esbuild--platform=browser(hard-errors on Node builtins, unlike Bun's silent stubbing), greps the minified bundle for runtime globals, and executes it.Notable trade-offs: TypeScript consumers now need
moduleResolutionbundler/node16/nodenext(documented in README);site:devno longer hot-reloads library sources (documented in CLAUDE.md and CONTRIBUTING). The issue's "stripworkspacesfrom the manifest" task was dropped — publint is verifiably green with it present. Issue #125's claims that the const-alias workaround "strips TSDoc" and "loses the error type export" were stale — both lived in the tsc-generated.d.ts; only the tree-shaking cost was real.Closes #125
Closes #126