Skip to content

fix(bundler): map runtime paths for bundled workers#5921

Merged
killagu merged 7 commits intonextfrom
agent/egg-dev/b5dba477
May 3, 2026
Merged

fix(bundler): map runtime paths for bundled workers#5921
killagu merged 7 commits intonextfrom
agent/egg-dev/b5dba477

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented May 3, 2026

Summary

  • separate generated worker runtime outputDir from original app baseDir
  • key the bundle module loader by relKey, output absolute path, original app absolute path, and manifest resolveCache aliases
  • pass the resolved framework specifier explicitly into startEgg
  • update bundler tests, snapshot, output docs, and wiki notes

Tests

  • pnpm --filter @eggjs/egg-bundler test -- EntryGenerator.test.ts deterministic.test.ts
  • pnpm --filter @eggjs/egg-bundler typecheck
  • pnpm --filter @eggjs/egg-bundler lint
  • git diff --check

Summary by CodeRabbit

  • Documentation

    • Clarified runtime behavior and path-mapping for deployed bundles: worker uses the deploy output directory, framework is passed explicitly, and bundle lookups distinguish deploy output vs original app paths.
  • Bug Fixes

    • Improved runtime bundle resolution to reliably handle relative keys, output-dir and original-app absolute paths, plus manifest resolve-cache aliases.
  • Tests

    • Updated tests to normalize embedded app-base literals, relaxed determinism checks, and added integration checks for runtime bundle resolution.

Copilot AI review requested due to automatic review settings May 3, 2026 08:52
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The worker entry now derives runtime __outputDir from the executed entry (process.argv[1]), roots createRequire to __outputDir, and embeds a normalized inlined bundle map with relKey, output-dir absolute, original-app absolute, and manifest resolveCache aliases. startEgg is invoked as startEgg({ baseDir: __outputDir, framework, mode: 'single' }).

Changes

Runtime Path Mapping (Output Directory Separation)

Layer / File(s) Summary
Data Shape / Runtime constants
tools/egg-bundler/src/lib/EntryGenerator.ts
Emit runtime __outputDir derived from process.argv[1] and serialize __APP_ABSOLUTE_ALIASES / __APP_RESOLVE_CACHE_ALIASES into the generated worker.
Core Implementation
tools/egg-bundler/src/lib/EntryGenerator.ts
Add #collectResolveCacheAliases and #normalizeKey; replace prior bundle map with normalized __BUNDLE_MAP helpers (__normalizeBundleKey, __setBundleMap, __getBundleMap, __setBundleAliases); seed relKey entries and app-absolute aliases; apply manifest.resolveCache aliasing with absolute-output fallback.
Wiring / Runtime
tools/egg-bundler/src/lib/EntryGenerator.ts
Root external createRequire to __outputDir; update ManifestStore.fromBundle(...) and __EGG_BUNDLE_MODULE_LOADER__ to use __outputDir and normalized lookup; call startEgg({ baseDir: __outputDir, framework, mode: 'single' }).
Tests
tools/egg-bundler/test/EntryGenerator.test.ts, tools/egg-bundler/test/deterministic.test.ts
Adjust expectations for baseDir: __outputDir and explicit framework; assert presence/content of __APP_ABSOLUTE_ALIASES and __APP_RESOLVE_CACHE_ALIASES, __setBundleMap/__setBundleAliases calls; add integration execution test via execaNode; relax determinism by normalizing embedded baseDir occurrences.
Docs / Changelog
tools/egg-bundler/docs/output-structure.md, wiki/packages/egg-bundler.md, wiki/log.md
Document runtime baseDir separation, explicit framework argument, and bundle lookup keying using relKey plus output/app absolute aliases and manifest resolveCache aliasing.

Sequence Diagram(s)

sequenceDiagram
    participant Worker as Worker entry
    participant BundleMap as Inlined __BUNDLE_MAP
    participant Manifest as ManifestStore
    participant Egg as startEgg
    Worker->>BundleMap: populate normalized keys & aliases (relKey, outputPath, appPath)
    Worker->>Manifest: ManifestStore.fromBundle(__outputDir, MANIFEST_DATA)
    Worker->>Egg: startEgg({ baseDir: __outputDir, framework, mode: 'single' })
    Egg->>BundleMap: request module (relKey / output-abs / app-abs / resolveCache)
    BundleMap-->>Egg: return module
    Egg->>Worker: initialize app runtime
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • jerryliang64

Poem

🐰
I stitched the bundle map with care,
Output and app now live apart,
RelKeys hop along the trail,
startEgg finds each bundled part,
A rabbit's tidy runtime art.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(bundler): map runtime paths for bundled workers' accurately describes the main change: separating runtime outputDir from original app baseDir and implementing path mapping for bundled workers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/egg-dev/b5dba477

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 3, 2026

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7558a04
Status: ✅  Deploy successful!
Preview URL: https://2324cb79.egg-cci.pages.dev
Branch Preview URL: https://agent-egg-dev-b5dba477.egg-cci.pages.dev

View logs

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.04%. Comparing base (77fbaef) to head (7558a04).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #5921   +/-   ##
=======================================
  Coverage   85.03%   85.04%           
=======================================
  Files         667      667           
  Lines       19123    19128    +5     
  Branches     3723     3725    +2     
=======================================
+ Hits        16262    16268    +6     
+ Misses       2468     2467    -1     
  Partials      393      393           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 3, 2026

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7558a04
Status: ✅  Deploy successful!
Preview URL: https://a2ad4e79.egg-v3.pages.dev
Branch Preview URL: https://agent-egg-dev-b5dba477.egg-v3.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the egg-bundler to distinguish between the runtime output directory and the original application base directory. The generated worker entry now keys the bundle map using relative paths, output-dir absolute paths, original app absolute paths, and manifest resolveCache aliases to improve module resolution. Feedback was provided to optimize the __setBundleAliases function by skipping redundant path resolutions when the input is already an absolute path.

Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the egg bundler’s generated worker bootstrap so bundled apps run from the deploy output directory while still recognizing module lookups that refer back to the original app paths. It primarily targets bundled-worker runtime resolution and keeps the surrounding tests/docs in sync.

Changes:

  • Split bundled worker runtime baseDir handling into deploy outputDir vs original app baseDir.
  • Expanded bundle module loader keying to cover relKeys, output-dir absolute paths, original app absolute paths, and resolveCache aliases.
  • Updated EntryGenerator tests, deterministic expectations, snapshot output, and bundler documentation/wiki notes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wiki/packages/egg-bundler.md Documents the new bundled worker runtime path-mapping model.
wiki/log.md Records the wiki/documentation update for the bundler runtime change.
tools/egg-bundler/test/deterministic.test.ts Adjusts determinism expectations to ignore embedded app baseDir literals.
tools/egg-bundler/test/snapshots/EntryGenerator.worker.canonical.snap Updates the canonical generated worker snapshot to the new runtime bootstrap shape.
tools/egg-bundler/test/EntryGenerator.test.ts Revises unit tests for generated worker content and new bundle-map aliasing behavior.
tools/egg-bundler/src/lib/EntryGenerator.ts Implements the new worker entry generation logic for runtime/output path mapping.
tools/egg-bundler/docs/output-structure.md Updates public docs for how bundled workers resolve modules at runtime.

Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/egg-bundler/src/lib/EntryGenerator.ts`:
- Around line 197-198: The code currently serializes the whole this.#baseDir
into appBaseDir (JSON.stringify(this.#baseDir)) which bakes a machine-specific
checkout path into the emitted runtime; remove that serialization and instead
derive and serialize only the concrete absolute aliases the runtime actually
needs (e.g., specific entry file, asset or handler paths). Update EntryGenerator
to stop emitting __appBaseDir (and any use of this.#baseDir in the generated
source around the appBaseDir and the similar block at lines 227-245) and replace
it with JSON.stringify(...) of the exact resolved paths you need (or relative
paths computed from the bundle root), keeping framework import specifier
generation via this.#toFrameworkImportSpecifier() unchanged. Ensure no full
checkout root string is present in generated output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 157fd634-0b78-498b-978b-461f08c99e34

📥 Commits

Reviewing files that changed from the base of the PR and between 77fbaef and 3d3db03.

⛔ Files ignored due to path filters (1)
  • tools/egg-bundler/test/__snapshots__/EntryGenerator.worker.canonical.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • tools/egg-bundler/docs/output-structure.md
  • tools/egg-bundler/src/lib/EntryGenerator.ts
  • tools/egg-bundler/test/EntryGenerator.test.ts
  • tools/egg-bundler/test/deterministic.test.ts
  • wiki/log.md
  • wiki/packages/egg-bundler.md

Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts Outdated
@killagu killagu force-pushed the agent/egg-dev/b5dba477 branch from 3d3db03 to 1465573 Compare May 3, 2026 08:58
Copilot AI review requested due to automatic review settings May 3, 2026 09:03
@killagu killagu force-pushed the agent/egg-dev/b5dba477 branch from 1465573 to 553c763 Compare May 3, 2026 09:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/egg-bundler/test/deterministic.test.ts`:
- Around line 201-203: normalizeWorkerAppBaseDir currently only replaces the
platform-specific baseDir, so POSIX-normalized embedded paths (with '/') are not
replaced on Windows; update normalizeWorkerAppBaseDir to also compute a
POSIX-variant of baseDir (e.g. replace path.sep with '/') and replace both the
raw baseDir and the posixBaseDir with '<baseDir>' (call out the function name
normalizeWorkerAppBaseDir). Also change the test assertions (the assertions
around the normalized entry content) to be platform-agnostic by checking that
the resulting string contains '<baseDir>' (and/or does not contain either
baseDir or its posix variant) instead of asserting the platform-specific path
literal.

In `@tools/egg-bundler/test/EntryGenerator.test.ts`:
- Around line 193-196: The tests assert against raw path.join(tmpDir, ...) which
yields platform-specific backslashes on Windows while the generated worker
output normalizes paths to POSIX (via __normalizeBundleKey()), causing failures;
update the assertions that reference path.join(tmpDir, ...) (the expect lines
checking for controller/controller.ts and any other tmpDir assertions) to
normalize the expected paths to POSIX form (e.g., convert backslashes to forward
slashes or use path.posix.join) before JSON.stringify/comparison, and change the
snapshot regexp replacement (the regex around tmpDir at the later replacement)
to match both native and POSIX variants of tmpDir so snapshots are stable across
platforms. Ensure you modify the specific test expectations and the regex used
to scrub tmpDir in EntryGenerator.test.ts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6673d79a-34ca-4e54-bde3-50e53ddbbb45

📥 Commits

Reviewing files that changed from the base of the PR and between 1465573 and 553c763.

⛔ Files ignored due to path filters (1)
  • tools/egg-bundler/test/__snapshots__/EntryGenerator.worker.canonical.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • tools/egg-bundler/docs/output-structure.md
  • tools/egg-bundler/src/lib/EntryGenerator.ts
  • tools/egg-bundler/test/EntryGenerator.test.ts
  • tools/egg-bundler/test/deterministic.test.ts
  • wiki/log.md
  • wiki/packages/egg-bundler.md
✅ Files skipped from review due to trivial changes (2)
  • tools/egg-bundler/docs/output-structure.md
  • wiki/log.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • wiki/packages/egg-bundler.md
  • tools/egg-bundler/src/lib/EntryGenerator.ts

Comment thread tools/egg-bundler/test/deterministic.test.ts Outdated
Comment thread tools/egg-bundler/test/EntryGenerator.test.ts Outdated
@killagu killagu force-pushed the agent/egg-dev/b5dba477 branch from 553c763 to 55cca76 Compare May 3, 2026 09:13
Copilot AI review requested due to automatic review settings May 3, 2026 09:16
@killagu killagu force-pushed the agent/egg-dev/b5dba477 branch from 55cca76 to b3b9c03 Compare May 3, 2026 09:16
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
tools/egg-bundler/test/EntryGenerator.test.ts (1)

200-202: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize expected paths to POSIX form for cross-platform compatibility.

The assertions use path.join(tmpDir, ...) which produces platform-specific paths. On Windows, this generates backslash paths (e.g., "C:\\Users\\...\\app\\controller.ts"), but the generator normalizes all paths to forward slashes via #normalizeKey. Tests will fail on Windows CI.

🛠️ Proposed fix
+    const toPosix = (p: string) => p.split(path.sep).join('/');
     expect(worker).toContain('__APP_ABSOLUTE_ALIASES');
-    expect(worker).toContain(JSON.stringify(path.join(tmpDir, 'app/controller.ts')));
+    expect(worker).toContain(JSON.stringify(toPosix(path.join(tmpDir, 'app/controller.ts'))));
     expect(worker).toContain('__APP_RESOLVE_CACHE_ALIASES');
-    expect(worker).toContain(JSON.stringify(path.join(tmpDir, 'app/controller')));
+    expect(worker).toContain(JSON.stringify(toPosix(path.join(tmpDir, 'app/controller'))));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/egg-bundler/test/EntryGenerator.test.ts` around lines 200 - 202, The
test assertions fail on Windows because path.join(tmpDir, ...) produces
backslashes while the generator outputs normalized POSIX paths (see
`#normalizeKey`); update the expectations in EntryGenerator.test.ts so the path
strings are normalized to POSIX before comparing (e.g., convert path.join(...)
results to forward-slash form or use path.posix to build them) for the three
assertions referencing worker and the controller paths and the
'__APP_RESOLVE_CACHE_ALIASES' check so they match the generator's normalized
output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@tools/egg-bundler/test/EntryGenerator.test.ts`:
- Around line 200-202: The test assertions fail on Windows because
path.join(tmpDir, ...) produces backslashes while the generator outputs
normalized POSIX paths (see `#normalizeKey`); update the expectations in
EntryGenerator.test.ts so the path strings are normalized to POSIX before
comparing (e.g., convert path.join(...) results to forward-slash form or use
path.posix to build them) for the three assertions referencing worker and the
controller paths and the '__APP_RESOLVE_CACHE_ALIASES' check so they match the
generator's normalized output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f749be3c-ad25-48c3-8e7a-f4bc8958c6f7

📥 Commits

Reviewing files that changed from the base of the PR and between 553c763 and 55cca76.

⛔ Files ignored due to path filters (1)
  • tools/egg-bundler/test/__snapshots__/EntryGenerator.worker.canonical.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • tools/egg-bundler/docs/output-structure.md
  • tools/egg-bundler/src/lib/EntryGenerator.ts
  • tools/egg-bundler/test/EntryGenerator.test.ts
  • tools/egg-bundler/test/deterministic.test.ts
  • wiki/log.md
  • wiki/packages/egg-bundler.md
✅ Files skipped from review due to trivial changes (2)
  • wiki/packages/egg-bundler.md
  • tools/egg-bundler/test/deterministic.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • wiki/log.md
  • tools/egg-bundler/docs/output-structure.md

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts
Comment thread tools/egg-bundler/test/deterministic.test.ts Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1dd4b86-7dbe-4a9d-adf7-e589004269d4

📥 Commits

Reviewing files that changed from the base of the PR and between 55cca76 and b3b9c03.

⛔ Files ignored due to path filters (1)
  • tools/egg-bundler/test/__snapshots__/EntryGenerator.worker.canonical.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • tools/egg-bundler/docs/output-structure.md
  • tools/egg-bundler/src/lib/EntryGenerator.ts
  • tools/egg-bundler/test/EntryGenerator.test.ts
  • tools/egg-bundler/test/deterministic.test.ts
  • wiki/log.md
  • wiki/packages/egg-bundler.md
✅ Files skipped from review due to trivial changes (2)
  • wiki/log.md
  • wiki/packages/egg-bundler.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • tools/egg-bundler/docs/output-structure.md
  • tools/egg-bundler/test/deterministic.test.ts

Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts Outdated
Copilot AI review requested due to automatic review settings May 3, 2026 11:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread tools/egg-bundler/test/EntryGenerator.test.ts
Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts
Copilot AI review requested due to automatic review settings May 3, 2026 12:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread tools/egg-bin/src/commands/bundle.ts Outdated
Copilot AI review requested due to automatic review settings May 3, 2026 13:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread tools/egg-bundler/src/lib/Bundler.ts Outdated
Comment thread tools/egg-bundler/src/lib/EntryGenerator.ts Outdated
@killagu killagu merged commit 22fc588 into next May 3, 2026
26 checks passed
@killagu killagu deleted the agent/egg-dev/b5dba477 branch May 3, 2026 14:58
killagu added a commit that referenced this pull request May 4, 2026
## Summary
- Stack on top of PR #5921 / EGG-65 runtime mapping commit because that
dependency is not yet in origin/next.
- Complete generated startup manifests with convention-based plugin
dynamic files (agent, app, app/extend/*, and app/middleware) so bundled
single-mode workers can load files skipped by metadataOnly agent
startup.
- Add a security-like @eggjs/security fixture verifying agent, app,
app/extend/agent, app/extend/application, and app/middleware/securities
are present in the manifest.

## Validation
- pnpm exec vitest run
packages/core/test/loader/manifest_coverage.test.ts
- pnpm exec vitest run packages/core/test/loader/manifest.test.ts
packages/core/test/loader/manifest_roundtrip.test.ts
packages/core/test/loader/manifest_fingerprint.test.ts
packages/core/test/loader/manifest_query.test.ts
packages/core/test/loader/manifest_coverage.test.ts
- pnpm --filter @eggjs/egg-bundler test -- EntryGenerator.test.ts
- pnpm --filter @eggjs/core typecheck
- pnpm --filter @eggjs/egg-bundler typecheck
- pnpm exec oxfmt --check packages/core/src/loader/egg_loader.ts
packages/core/test/loader/manifest_coverage.test.ts
tools/egg-bundler/src/lib/EntryGenerator.ts
tools/egg-bundler/test/EntryGenerator.test.ts
- git diff --check origin/next...HEAD

Notes: targeted oxlint on changed files exits 0 with existing warnings
in pre-existing egg_loader.ts lines outside this patch.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Manifest post-processing now caches convention-based module resolution
and records directory-discovered middleware lists for metadata-only
runs.
* Bundler/runtime treats framework as a package specifier, validates
specifiers, and precomputes output↔original-app aliasing for
deterministic module lookup.

* **Documentation**
* Updated bundler docs, CLI help, and wiki to explain runtime path
mapping, output-dir semantics, and framework-specifier behavior.

* **Tests & Chores**
* Added fixtures and tests for manifest resolve-cache, file discovery,
deterministic worker generation, and framework-specifier validation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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