Repository navigation
fix: build before testing on the publish path - #51
Merged
Merged
Conversation
The 0.0.4 publish failed at Test. `publish-cli.yml` runs Lint → Test → Build, where `ci.yml` builds first, and the bundled-manifest test added in #50 read `packages/common/dist/` — absent at that point, so every `exports` entry looked unbuilt. The test no longer depends on a build: it maps each `./dist/<module>.{js,d.ts}` target back to `src/<module>.ts` and asserts the source exists, flagging any target shape the mapping does not recognise so it cannot pass by accident. Guarding it with `skipIf(!existsSync(dist))` — the pattern `common`'s circular-import guard uses — would have been the worse fix: green, and testing nothing, on the one path that publishes. `prepare-package.mjs` still asserts against real `dist/` at pack time, where a build has just run. `publish-cli.yml` now builds before testing anyway, matching `ci.yml`. That also un-skips `common/test/built-output.test.ts`, which imports the compiled package to catch circular imports the source alias hides and had been skipping silently on every publish. Verified both ways from a clean tree: with no `dist/` present the suite passes and still fails on an `exports` entry with no source module; in the new order `common` reports 4 files passed rather than 3 passed and 1 skipped. The packed tarball installs clean, clears the bundle gate, and `sentinel0 start` reaches its config check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EkUWsM92gcbit4p6hEhuyV
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.
Follow-up to #50. The 0.0.4 publish failed at Test.
What broke
publish-cli.ymlruns Lint → Test → Build.ci.ymlbuilds first — which is why #50's PR checks were green and the publish was not.The
bundled-manifesttest added in #50 readpackages/common/dist/to check that everyexportsentry names a file the build emitted. On the publish path there is no build yet, so all fourteen entries looked unbuilt:The fix
The test no longer depends on a build. It maps each
./dist/<module>.{js,d.ts}target back tosrc/<module>.tsand asserts the source exists, and flags any target shape the mapping doesn't recognise so it can't pass by accident.Guarding it with
skipIf(!existsSync(dist))— the patterncommon's circular-import guard uses — would have been the worse fix: green, and testing nothing, on the one path that publishes.prepare-package.mjsstill asserts against realdist/at pack time, where a build has just run and cannot be absent.publish-cli.ymlbuilds before testing anyway, matchingci.yml. That also un-skipscommon/test/built-output.test.ts, which imports the compiled package to catch circular imports the source alias hides — it had been skipping silently on every publish.Verification
From a clean tree (
pnpm clean), both orders:dist/commonsuiteAnd the test is not vacuous — adding an
./ghostexport with no source module fails it with nodist/present:Then the full publish sequence in the new order — lint, build, test, exec-bit, pack — followed by a clean
npm installof the tarball: the bundle gate passes andsentinel0 startreaches its config check.🤖 Generated with Claude Code
https://claude.ai/code/session_01EkUWsM92gcbit4p6hEhuyV