[backport] [builders] Fix transitive local TS dep externalization in step bundles (#1609)#1900
[backport] [builders] Fix transitive local TS dep externalization in step bundles (#1609)#1900VaguelySerious wants to merge 2 commits intostablefrom
Conversation
Two issues caused local transitive dependencies to be externalized instead of bundled in step/workflow bundles: 1. The discover-entries plugin's onResolve filter only matched imports with explicit file extensions (jsTsRegex). Extensionless imports like `./helpers` were never tracked in the import graph. 2. The swc plugin only checked if a file was an ancestor of an entry (parentHasChild(resolved, entry)) but never checked if it was a descendant (parentHasChild(entry, resolved)). So even with a correct import graph, transitive local deps got externalized. Fixes: configure enhanced-resolve with TS extensions, broaden the onResolve filter to catch all relative imports, and add the reverse parentHasChild check. Add explicit symlinks: true to the discover-entries resolver to align with swc-esbuild-plugin's NODE_ESM_RESOLVE_OPTIONS for monorepos with symlinked packages. Closes #1179 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e72d917 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests💻 Local Development (410 failed)express-stable (82 failed):
fastify-stable (82 failed):
hono-stable (82 failed):
nitro-stable (82 failed):
nuxt-stable (82 failed):
📦 Local Production (410 failed)express-stable (82 failed):
fastify-stable (82 failed):
hono-stable (82 failed):
nitro-stable (82 failed):
vite-stable (82 failed):
🐘 Local Postgres (410 failed)express-stable (82 failed):
fastify-stable (82 failed):
hono-stable (82 failed):
nitro-stable (82 failed):
vite-stable (82 failed):
🪟 Windows (1 failed)nextjs-turbopack (1 failed):
🌍 Community Worlds (83 failed)mongodb (11 failed):
redis (7 failed):
turso (65 failed):
Details by Category❌ 💻 Local Development
❌ 📦 Local Production
❌ 🐘 Local Postgres
❌ 🪟 Windows
❌ 🌍 Community Worlds
❌ Some E2E test jobs failed:
Check the workflow run for details. |
PR #1609 was authored on top of #1669 (`fix(builders): improve step bundle discovery and externalization for SDK serde classes`), which is on `main` but not on `stable`. Bring along just the bits #1609 depends on: - Broaden discover-entries onResolve filter from `jsTsRegex` to `/.*/` so the import graph captures bare and extensionless imports. - Switch the new test fixtures from `Set<string>` back to `string[]` to match stable's still-array-based state interface in `createDiscoverEntriesPlugin`.
5ef1c47 to
e72d917
Compare
Backports #1609 onto `stable`. Closes #1179.
Cherry-pick of `eef34a391e` plus a follow-up adapter commit because the PR was authored on top of #1669 (`fix(builders): improve step bundle discovery and externalization for SDK serde classes`), which is on `main` but not on `stable`.
Adapter changes (second commit):
Verified locally:
🤖 Generated with Claude Code