Skip to content

fix(bundle): preserve external workspace packages - #56

Merged
ibgreen merged 3 commits into
masterfrom
codex/external-workspace-aliases
Aug 31, 2026
Merged

fix(bundle): preserve external workspace packages#56
ibgreen merged 3 commits into
masterfrom
codex/external-workspace-aliases

Conversation

@ibgreen

@ibgreen ibgreen commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Goal

Make ocular-bundle --externals preserve package boundaries inside vis.gl monorepos. This unblocks replacing tangram.gl's package-local esbuild wrapper with ocular-bundle.

Changes

  • remove workspace aliases for explicit external packages and peer dependencies before passing the alias map to esbuild
  • remove matching package subpath aliases as well
  • retain existing alias behavior for workspace packages that are meant to be bundled
  • add unit coverage for root and subpath alias removal
  • make the CLI integration fixture prove that an aliased external remains an import instead of being bundled

Why

Esbuild applies aliases before external package matching. An explicit external such as @vis.gl/tangram-renderer was rewritten to its workspace source directory and bundled anyway, defeating both packages: external and --externals.

Validation

  • yarn build
  • yarn lint
  • yarn test

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T20:05:57.732788Z fcfdb7f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coveralls

coveralls commented Aug 31, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33434036118

Coverage increased (+0.5%) to 54.603%

Details

  • Coverage increased (+0.5%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (8 of 9 lines covered, 88.89%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
modules/dev-tools/src/configuration/get-esbuild-config.ts 9 8 88.89%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 618
Covered Lines: 329
Line Coverage: 53.24%
Relevant Branches: 490
Covered Branches: 276
Branch Coverage: 56.33%
Branches in Coverage %: Yes
Coverage Strength: 4.56 hits per line

💛 - Coveralls

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcfdb7fa25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +59 to +60
if (alias === packageName || alias.startsWith(`${packageName}/`)) {
delete filteredAliases[alias];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove parent aliases for externalized subpaths

When a caller externalizes only a package subpath, such as --externals=@scope/pkg/worker, this condition leaves the generated parent alias @scope/pkg intact. That parent alias also rewrites imports of @scope/pkg/worker, and because esbuild applies alias substitutions before its other path-resolution logic, the requested external rule never sees the original package path and the subpath is bundled. Remove aliases that are ancestors of an external package path as well.

Useful? React with 👍 / 👎.

@ibgreen
ibgreen merged commit 972e861 into master Aug 31, 2026
1 check passed
@ibgreen
ibgreen deleted the codex/external-workspace-aliases branch August 31, 2026 20:07
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.

2 participants