fix(bootstrap): drop the redundant bun build target (unbreaks BunExportConditions) - #733
Merged
sroussey merged 3 commits intoAug 9, 2026
Conversation
The bootstrap package shipped a third `bun` entry whose source was byte-identical to `src/node.ts`, so Bun loaded the same code through a separate bundle and a separate declaration file. Removing it makes Bun resolve the default `import` condition to `dist/node.js` and restores the two-target build every other non-vendor package uses. This also unbreaks the BunExportConditions fixture, which pins the set of packages whose Bun implementation genuinely differs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013oVdDSRMJeALBPLDQf3DgH
The package holds no test files, so `bun test` exits non-zero with "0 test files matching". Every workspace that does declare `test` uses the shared vitest project form, and a package with no tests omits the key entirely — turbo then produces no task for it, and the dependent `@workglow/test` project still covers the package on a changed-files run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013oVdDSRMJeALBPLDQf3DgH
…havior
The file claimed both halves of the isolated-context example were pinned,
but it only reproduced the shapes in TypeScript — nothing read the README or
the `createOrchestrationContext` JSDoc, so either could rot back to
`task.run({ context: ctx })` with the suite still green.
Adds three cases that read the two documents: the README shows the registry
in the run config, no README fence passes the context as an input override,
and the JSDoc example matches. Blocks are selected by content rather than by
the heading above them, so a heading rename cannot make them pass vacuously.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVdDSRMJeALBPLDQf3DgH
sroussey
merged commit Aug 9, 2026
afe6a4e
into
claude/libs-issues-triage-prs-mh6x2o-574
10 of 11 checks passed
sroussey
deleted the
claude/optimistic-goldberg-9x9lby-bootstrap-bun-target
branch
August 9, 2026 19:04
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 #672, targeting its head branch.
What was broken
1.
@workglow/bootstrapdeclared a thirdbunbuild target — deterministic red CI.packages/bootstrap/src/bun.tswas byte-identical tosrc/node.ts(export * from "./common";), so the"bun"export condition bought a second bundle and a second.d.tsto keep in sync for zero behavior change — exactly what the repo's "Nobunentry unless it differs" rule exists to prevent.That rule is enforced by a fixture, and the fixture is red on the branch as it stands:
This is not flaky and not environment-dependent — it reads
package.jsonfiles off disk, so it fails on every run, for everyone, the moment this branch merges.EXPECTED_BUN_CONDITIONS,.claude/CLAUDE.md, anddocs/technical/19-build-system.mdall already state the correct three-entry set; the package manifest was the thing that was wrong, so the fixture and the prose are untouched.2.
"test": "bun test"in a package with no test files.bun --cwd packages/bootstrap testexits 1 witherror: 0 test files matching. It is the onlybun testscript in the repo: the 8 workspaces that declaretestall usevitest run --config ../../vitest.config.ts --project <name>, and the 31 that have no tests omit the key entirely.3.
BootstrapReadme.test.tsclaimed to pin documents it never read.Its header said "Both halves are pinned below", but the file only reproduced the shapes in TypeScript. Nothing read
packages/bootstrap/README.mdor thecreateOrchestrationContextJSDoc, so either could rot back toawait task.run({ context: ctx })— the bug the test was written for — with the suite still green.What changed
packages/bootstrap/package.json— droppedwatch-bun/build-bun, removedbunfrom thewatch-js/build-package/build-jsfan-outs, and deleted the"bun"branch fromexports["."]. Thescriptsblock and the exports map now matchpackages/knowledge-base(the two-target reference sibling) exactly. Also removed thetestscript.packages/bootstrap/src/bun.ts— deleted. Bun now resolves the default"import"condition todist/node.js, which is the same code it was already running.packages/bootstrap/tsconfig.json— dropped./src/bun.tsfromfiles.packages/test/src/test/util/BootstrapReadme.test.ts— kept both runtime cases, added a seconddescribethat reads the README and the JSDoc: the README shows the registry in the run config, no README fence passes the context as an input override, and the JSDoc example matches. Fenced blocks are selected by content (createOrchestrationContext() rather than by the heading above them, so renaming### Isolated contextcannot make the cases pass vacuously.No
CHANGELOGentry:0.3.38is this package's unreleased initial release in the same PR, so the removed bun target never shipped.How it was verified
Run in an isolated worktree off this PR's head, with
bun install+bun run use-source.bun scripts/test.ts util vitest— 55 files / 765 passed, 10 skipped. CoversBunExportConditions,BootstrapReadme, andBootstrapPackageExports.packages/bootstrap/package.jsonand re-runningBunExportConditions.test.tsfails with the diff quoted above; restoring the fix makes it pass.collectBunConditions()now returns exactly the three expected entries.await task.run({ context: ctx })fails cases 1 and 2; doing the same to thecreateOrchestrationContextJSDoc fails case 3. Both were restored.bun run build-clean && bun run build-packageinpackages/bootstrap— browser, node and types all exit 0;dist/containsbrowser.*,node.*,common.d.tsand nobun.*.bunx turbo run test --filter=@workglow/bootstrap— exits 0; the dry plan shows@workglow/bootstrap#testresolving to<NONEXISTENT>(no task), confirming the removed script breaks nothing.bun scripts/test.ts --check-sections— "Every test file is discovered and reachable by section+kind selection."eslintandprettier --checkclean on the changed files. (The first draft ofREGISTRY_IN_RUN_CONFIGtrippedregexp/no-super-linear-backtrackingon an ambiguous\s*,?\s*; it is now[\s,]*.)Known trade-off
The "no README code block passes the context as an input override" case scans every fence, so an author adding a deliberate counter-example snippet would trip it. That is intentional and noted in the file's header comment — the README's existing counter-example is prose, which stays legal.
Not verified here
bun run test:vitest:unit(the full CI job) was launched but had not finished at the time this description was written; theutilsection it contains — the one holding every changed and affected fixture — passed in full. Nothing outsidepackages/bootstrapand that one test file is touched.Generated by Claude Code