Skip to content

Drop redundant bun entry points and export conditions - #711

Merged
sroussey merged 1 commit into
mainfrom
claude/redundant-bun-exports-lwdym5
Aug 7, 2026
Merged

Drop redundant bun entry points and export conditions#711
sroussey merged 1 commit into
mainfrom
claude/redundant-bun-exports-lwdym5

Conversation

@sroussey

@sroussey sroussey commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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

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 sroussey self-assigned this Aug 7, 2026
@sroussey
sroussey marked this pull request as draft August 7, 2026 04:54
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 64.44% 31804 / 49353
🔵 Statements 64.24% 32906 / 51218
🔵 Functions 65.51% 5986 / 9137
🔵 Branches 53.46% 16416 / 30702
File CoverageNo changed files found.
Generated in workflow #2901 for commit b5f0d37 by the Vitest Coverage Report Action

@sroussey
sroussey requested a lite review from Copilot August 7, 2026 07:05
@sroussey
sroussey marked this pull request as ready for review August 7, 2026 07:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts shims) plus corresponding --target=bun build/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.

@sroussey
sroussey merged commit dd3c822 into main Aug 7, 2026
15 checks passed
@sroussey
sroussey deleted the claude/redundant-bun-exports-lwdym5 branch August 13, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants