Drop redundant bun entry points and export conditions - #711
Merged
Conversation
A `src/bun.ts` that is byte-identical to `src/node.ts` bought nothing: it produced a third bundle and a third `.d.ts` to keep in sync, while the code Bun loaded was the same either way. With no `"bun"` condition in `exports`, Bun falls through to the default `"import"` and gets the node build. Removed the duplicate entry files, their `--target=bun` build/watch scripts, their `tsconfig.json` entries, and the `"bun"` export conditions across every package that had them, including the ones whose `"bun"` condition already pointed at the node build (indexeddb, aws, postgres, supabase, duckdb, and util's ./media and ./compress) and the workglow meta-package's nine `*.bun.ts` provider re-export shims plus worker-bun.ts. Kept the two entries where the Bun code genuinely differs: @workglow/util's "." (Worker.bun vs Worker.node) and @workglow/sqlite's ./storage (bun:sqlite vs the node driver). Docs and CLAUDE.md updated to describe the two-target build and the rule for when a third Bun target is warranted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CETaNTM694Rw1WgbWwAtRF
sroussey
marked this pull request as draft
August 7, 2026 04:54
Coverage Report
File CoverageNo changed files found. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes redundant Bun-specific entry points and conditional exports across the monorepo, standardizing most packages on a two-target build (browser + node) where Bun simply consumes the node build via the default "import" condition. It keeps Bun-only targets only where Bun code genuinely differs (notably @workglow/util and @workglow/sqlite’s ./storage).
Changes:
- Removed byte-identical
src/bun.ts(and related*.bun.tsshims) plus corresponding--target=bunbuild/watch steps where Bun does not need distinct code. - Dropped
"bun"export conditions that just pointed at node artifacts, letting Bun fall through to the default node"import"/"types". - Updated tsconfigs and technical docs/CLAUDE guidance to reflect the two-target default and the “only add bun when it differs” rule.
Reviewed changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| providers/supabase/src/storage/bun.ts | Removed redundant Bun entry shim (Bun uses node build). |
| providers/supabase/src/job-queue/bun.ts | Removed redundant Bun entry shim (Bun uses node build). |
| providers/supabase/package.json | Removed "bun" conditional exports that duplicated node artifacts. |
| providers/sqlite/src/job-queue/bun.ts | Removed redundant Bun entry shim for job-queue (node build serves Bun). |
| providers/sqlite/package.json | Removed job-queue "bun" export condition and bun job-queue build/watch steps while retaining storage bun target. |
| providers/postgres/src/text/bun.ts | Removed redundant Bun entry shim (Bun uses node build). |
| providers/postgres/src/storage/bun.ts | Removed redundant Bun entry shim (Bun uses node build). |
| providers/postgres/src/job-queue/bun.ts | Removed redundant Bun entry shim (Bun uses node build). |
| providers/postgres/package.json | Removed "bun" conditional exports for server subpaths that duplicated node artifacts. |
| providers/duckdb/package.json | Removed "bun" conditional export duplicating node build. |
| providers/aws/src/job-queue/bun.ts | Removed redundant Bun barrel (node build serves Bun for job-queue). |
| providers/aws/package.json | Removed "bun" conditional export duplicating node build. |
| packages/workglow/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/workglow/src/xai.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/worker-bun.ts | Removed redundant Bun worker re-export shim. |
| packages/workglow/src/openrouter.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/openai.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/ollama.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/hf-transformers.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/hf-inference.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/google-gemini.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/deepseek.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/src/bun.ts | Removed redundant Bun entry shim for meta-package root. |
| packages/workglow/src/anthropic.bun.ts | Removed redundant Bun provider re-export shim. |
| packages/workglow/package.json | Removed "bun" conditional exports for root, provider shims, and worker entry that duplicated node artifacts. |
| packages/workglow/detect-export-collisions.ts | Updated collision detector docs to reflect removal of bun.ts barrel. |
| packages/workglow/build.ts | Updated barrel list used for export-collision detection to exclude bun.ts. |
| packages/util/package.json | Removed redundant "bun" conditions for subpaths that already map to node artifacts (keeps bun where it differs). |
| packages/test/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/test/src/bun.ts | Removed redundant Bun entry shim. |
| packages/test/package.json | Removed bun build/watch scripts (node build serves Bun). |
| packages/tasks/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/tasks/src/util/SafeFetch.server.ts | Updated docs to reflect registration now happening via node entry (which also serves Bun). |
| packages/tasks/src/bun.ts | Removed redundant Bun entry (node entry serves Bun). |
| packages/tasks/package.json | Removed bun build/watch scripts and "bun" export condition (node build serves Bun). |
| packages/task-graph/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/task-graph/src/common-server.ts | Updated comment to reflect common-server re-exported by node only (serves Bun). |
| packages/task-graph/src/bun.ts | Removed redundant Bun entry shim. |
| packages/task-graph/package.json | Removed bun build/watch scripts and "bun" export condition (node build serves Bun). |
| packages/storage/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/storage/src/bun.ts | Removed redundant Bun entry shim. |
| packages/storage/package.json | Removed bun build/watch scripts and "bun" export condition (node build serves Bun). |
| packages/mcp/src/tasks/bun.ts | Removed redundant Bun tasks entry shim. |
| packages/mcp/package.json | Removed bun build/watch scripts and "bun" export condition for tasks entry (node build serves Bun). |
| packages/knowledge-base/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/knowledge-base/src/bun.ts | Removed redundant Bun entry shim. |
| packages/knowledge-base/package.json | Removed bun build/watch scripts and "bun" export condition (node build serves Bun). |
| packages/job-queue/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/job-queue/src/bun.ts | Removed redundant Bun entry shim. |
| packages/job-queue/package.json | Removed bun build/watch scripts and "bun" export condition (node build serves Bun). |
| packages/indexeddb/src/storage/bun.ts | Removed redundant Bun entry shim. |
| packages/indexeddb/src/job-queue/bun.ts | Removed redundant Bun entry shim. |
| packages/indexeddb/package.json | Removed "bun" export conditions that duplicated node artifacts. |
| packages/ai/tsconfig.json | Removed src/bun.ts from build files list. |
| packages/ai/src/bun.ts | Removed redundant Bun entry shim. |
| packages/ai/package.json | Removed bun build/watch scripts and "bun" export condition (node build serves Bun). |
| examples/cli/package.json | Removed redundant "bun" export condition (same artifact as default import). |
| docs/technical/22-mcp-integration.md | Updated docs to reflect platform entrypoints now being browser/node (node serves Bun). |
| docs/technical/19-build-system.md | Updated build-system docs to two-target default and clarified when bun is warranted. |
| docs/technical/18-multi-runtime-abstraction.md | Updated multi-runtime abstraction docs to two-target default with bun-only exceptions. |
| docs/technical/11-ai-provider-system.md | Updated docs to remove mention of bun entry as a standard core-package target. |
| .claude/CLAUDE.md | Updated contributor guidance to reflect two-target default and bun-only exceptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Aug 7, 2026
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.
A
src/bun.tsthat is byte-identical tosrc/node.tsbought nothing: itproduced a third bundle and a third
.d.tsto keep in sync, while the codeBun loaded was the same either way. With no
"bun"condition inexports,Bun falls through to the default
"import"and gets the node build.Removed the duplicate entry files, their
--target=bunbuild/watch scripts,their
tsconfig.jsonentries, and the"bun"export conditions across everypackage that had them, including the ones whose
"bun"condition alreadypointed at the node build (indexeddb, aws, postgres, supabase, duckdb, and
util's ./media and ./compress) and the workglow meta-package's nine
*.bun.tsprovider re-export shims plus worker-bun.ts.Kept the two entries where the Bun code genuinely differs:
@workglow/util's "." (Worker.bun vs Worker.node) and @workglow/sqlite's
./storage (bun:sqlite vs the node driver).
Docs and CLAUDE.md updated to describe the two-target build and the rule for
when a third Bun target is warranted.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01CETaNTM694Rw1WgbWwAtRF