Skip to content

fix(bundler): normalize tegg manifest paths#5932

Merged
killagu merged 6 commits into
nextfrom
agent/egg-dev/85bc11ed
May 7, 2026
Merged

fix(bundler): normalize tegg manifest paths#5932
killagu merged 6 commits into
nextfrom
agent/egg-dev/85bc11ed

Conversation

@killagu

@killagu killagu commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Normalize tegg manifest moduleReferences paths with moduleDescriptors unitPath so LoaderFactory can match precomputed decoratedFiles in bundled runtime.
  • Include app/port decorated files in EntryGenerator coverage.
  • Let tegg LoaderUtil load pre-bundled files through the registered bundle module loader before falling back to dynamic import.

Tests

  • pnpm -C tools/egg-bundler exec vitest run test/ManifestLoader.test.ts test/EntryGenerator.test.ts
  • pnpm exec vitest run tegg/core/loader/test/Loader.test.ts
  • pnpm -C tools/egg-bundler run typecheck
  • pnpm -C tegg/core/loader run typecheck
  • pnpm -C tools/egg-bundler run lint
  • pnpm exec oxlint --type-aware tegg/core/loader/src/LoaderUtil.ts tegg/core/loader/test/Loader.test.ts
  • pnpm exec oxfmt --check tools/egg-bundler/src/lib/ManifestLoader.ts tools/egg-bundler/test/ManifestLoader.test.ts tools/egg-bundler/test/EntryGenerator.test.ts tegg/core/loader/src/LoaderUtil.ts tegg/core/loader/test/Loader.test.ts
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Enhanced module loading with improved bundler support for better module resolution and TEgg manifest handling.
  • Bug Fixes

    • Improved error handling for module loading failures with clearer error messages.
  • Tests

    • Added comprehensive test coverage for bundled module loading scenarios and manifest normalization.
  • Chores

    • Added type definitions workspace dependency.

Copilot AI review requested due to automatic review settings May 6, 2026 10:03
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

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 PR implements and integrates a bundler-based module loader mechanism. It adds support for loading pre-bundled modules via globalThis.__EGG_BUNDLE_MODULE_LOADER__ as a primary loader with dynamic import as fallback. The bundler tooling is updated to normalize module references in manifests, and typing is centralized via @eggjs/typings/global.

Changes

Bundler Module Loader Integration

Layer / File(s) Summary
Type System Integration
tegg/core/loader/src/LoaderUtil.ts, tegg/core/loader/test/Loader.test.ts, tools/egg-bundler/src/lib/EntryGenerator.ts, packages/utils/src/import.ts
Type-only imports from @eggjs/typings/global added to enable globalThis.__EGG_BUNDLE_MODULE_LOADER__ type assertions across loader infrastructure.
Manifest Data Shape
tools/egg-bundler/src/lib/ManifestLoader.ts
TeggManifestExtension extended with moduleReferences alongside moduleDescriptors; new TeggModuleReference interface introduced.
Bundler Manifest Normalization
tools/egg-bundler/src/lib/ManifestLoader.ts
#normalizeExtensions now normalizes tegg.moduleReferences and moduleDescriptors; new #normalizeTeggUnitPath helper maps absolute unit paths to normalized module-map paths or falls back to relative paths.
Worker Entry Generation
tools/egg-bundler/src/lib/EntryGenerator.ts
Generated worker entry template updated to use type-only import for globalThis typing, replacing inline type assertions while preserving bundler loader assignment logic.
Core Loader Fallback Logic
tegg/core/loader/src/LoaderUtil.ts
LoaderUtil.loadFile() refactored to attempt globalThis.__EGG_BUNDLE_MODULE_LOADER__ with normalized paths first, then Windows file:// conversion and dynamic import() as fallback; new createLoadError standardizes error handling across bundler and import failures.
Shared Utilities
packages/utils/src/import.ts
importModule() and setBundleModuleLoader() switched to read/write globalThis.__EGG_BUNDLE_MODULE_LOADER__ directly; removed cached alias pattern while preserving bundle-hit unwrapping semantics.
Tests and Dependencies
tegg/core/loader/test/Loader.test.ts, tools/egg-bundler/test/EntryGenerator.test.ts, tools/egg-bundler/test/ManifestLoader.test.ts, plugins/mock/test/mock_service_cluster.test.ts, tegg/core/loader/package.json, tools/egg-bundler/package.json
New tests validate bundler loader success, null fallback, and error paths; afterEach hook clears __EGG_BUNDLE_MODULE_LOADER__ between tests; @eggjs/typings added as workspace dependency; test timeout increased for cluster tests.

Sequence Diagram

sequenceDiagram
    actor User as Application Code
    participant Load as LoaderUtil.loadFile()
    participant Global as globalThis
    participant Bundle as __EGG_BUNDLE_MODULE_LOADER__
    participant Dynamic as import()

    User->>Load: loadFile(filePath)
    Load->>Load: normalize path (\ to /)
    Load->>Global: read __EGG_BUNDLE_MODULE_LOADER__
    Global-->>Load: loader function
    Load->>Bundle: call loader(normalizedPath)
    
    alt Bundle Returns Module
        Bundle-->>Load: module object
        Load-->>User: parsed prototypes
    else Bundle Returns null/undefined
        Bundle-->>Load: null/undefined
        Load->>Load: apply Windows file:// conversion
        Load->>Dynamic: import(filePath)
        Dynamic-->>Load: module exports
        Load-->>User: parsed prototypes
    else Bundle Throws Error
        Bundle-->>Load: Error thrown
        Load->>Load: createLoadError(filePath, error)
        Load-->>User: wrapped Error with cause
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • eggjs/egg#5896: Modifies code to use shared @eggjs/typings/global augmentation and read/write globalThis.__EGG_BUNDLE_MODULE_LOADER__.
  • eggjs/egg#5911: Modifies bundler module loader wiring and globalThis.EGG_BUNDLE_MODULE_LOADER handling with associated path normalization and error handling.
  • eggjs/egg#5867: Implements and uses the same runtime bundle-module loader on globalThis with path normalization and module unwrapping behavior.

Suggested reviewers

  • jerryliang64
  • fengmk2

Poem

🐰 A bundler loader springs to life,
With globalThis as a type-safe knife,
Manifests normalized with care,
Fallbacks flowing everywhere,
Pre-bundled modules load with glee!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 clearly summarizes the main change: normalizing tegg manifest paths for bundler integration, which is supported by path normalization work in ManifestLoader and related test updates.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/egg-dev/85bc11ed

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

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

Copy link
Copy Markdown

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 49408cc
Status: ✅  Deploy successful!
Preview URL: https://3324b18c.egg-cci.pages.dev
Branch Preview URL: https://agent-egg-dev-85bc11ed.egg-cci.pages.dev

View logs

@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.19%. Comparing base (aca1168) to head (49408cc).
⚠️ Report is 2 commits behind head on next.

Files with missing lines Patch % Lines
tegg/core/loader/src/LoaderUtil.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             next    #5932   +/-   ##
=======================================
  Coverage   85.18%   85.19%           
=======================================
  Files         668      668           
  Lines       19284    19288    +4     
  Branches     3782     3784    +2     
=======================================
+ Hits        16428    16432    +4     
  Misses       2464     2464           
  Partials      392      392           

☔ 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.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a bundle module loader mechanism to tegg/core/loader and updates tools/egg-bundler to support path normalization for moduleReferences and moduleDescriptors. The changes include adding a global hook for module loading, updating the loadFile utility, and adding comprehensive tests for the new functionality. A review comment suggests improving error handling in the catch block to safely handle non-Error exceptions.

Comment thread tegg/core/loader/src/LoaderUtil.ts Outdated
@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 49408cc
Status: ✅  Deploy successful!
Preview URL: https://aa037ac2.egg-v3.pages.dev
Branch Preview URL: https://agent-egg-dev-85bc11ed.egg-v3.pages.dev

View logs

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tegg/core/loader/src/LoaderUtil.ts`:
- Around line 73-91: The bundle loader can return null to indicate "not bundled"
but the current fallback only checks exports === undefined causing a later
TypeError; update the check around the bundle result (the local variable exports
produced by (globalThis as BundleModuleGlobalThis).__EGG_BUNDLE_MODULE_LOADER__
invocation in LoaderUtil.ts) to treat both null and undefined as "not bundled"
(e.g., use exports == null or explicit exports === undefined || exports ===
null) so the dynamic import fallback (await import(filePath)) runs when the
bundle loader returns null.
🪄 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: d8b70aa8-a84f-446c-b4dc-5f3f7812fbb7

📥 Commits

Reviewing files that changed from the base of the PR and between 0389f2d and 80a0285.

📒 Files selected for processing (5)
  • tegg/core/loader/src/LoaderUtil.ts
  • tegg/core/loader/test/Loader.test.ts
  • tools/egg-bundler/src/lib/ManifestLoader.ts
  • tools/egg-bundler/test/EntryGenerator.test.ts
  • tools/egg-bundler/test/ManifestLoader.test.ts

Comment thread tegg/core/loader/src/LoaderUtil.ts Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tegg/core/loader/src/LoaderUtil.ts`:
- Around line 73-75: The call to the global bundle loader in LoaderUtil.loadFile
is not wrapped in a try/catch so thrown values bypass the standard
"[tegg/loader] load ... failed" wrapper; update the code around the
__EGG_BUNDLE_MODULE_LOADER__ invocation in loadFile to catch any thrown value
(including non-Error), and rethrow a new Error that prefixes the original
message/stack with "[tegg/loader] load <originalFilePath> failed: " (or include
the original error message when no stack exists) so behavior matches the
import-failure handling currently used in the later catch block.
🪄 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: df572c9c-91e5-441a-bf15-9b21cb511433

📥 Commits

Reviewing files that changed from the base of the PR and between 80a0285 and 14a239b.

📒 Files selected for processing (2)
  • tegg/core/loader/src/LoaderUtil.ts
  • tegg/core/loader/test/Loader.test.ts

Comment thread tegg/core/loader/src/LoaderUtil.ts Outdated

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 updates the bundling pipeline and tegg loader integration so that tegg manifest paths and decorated files remain resolvable in a bundled runtime, and so tegg can load pre-bundled modules via the bundle module loader before falling back to dynamic import.

Changes:

  • Normalize tegg moduleReferences[].path and moduleDescriptors[].unitPath to consistent, app-relative (or moduleMap-normalized) paths during manifest normalization.
  • Expand EntryGenerator coverage to include decorated files under app/port from tegg manifest descriptors.
  • Enhance LoaderUtil.loadFile() to consult a registered globalThis.__EGG_BUNDLE_MODULE_LOADER__ first, with tests covering the fast-path and fallback behavior.

Reviewed changes

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

Show a summary per file
File Description
tools/egg-bundler/src/lib/ManifestLoader.ts Normalize tegg module reference/descriptor paths via a shared helper to ensure consistent keys at runtime.
tools/egg-bundler/test/ManifestLoader.test.ts Add regression test asserting tegg path normalization and decorated-file resolution.
tools/egg-bundler/test/EntryGenerator.test.ts Add test ensuring app/port tegg-decorated files are included in generated worker imports.
tegg/core/loader/src/LoaderUtil.ts Add bundle-module-loader fast path before dynamic import for pre-bundled file loading.
tegg/core/loader/test/Loader.test.ts Add tests for bundle-module-loader loading and fallback, plus global cleanup between tests.

Comment thread tegg/core/loader/src/LoaderUtil.ts Outdated
Comment thread tegg/core/loader/test/Loader.test.ts
Copilot AI review requested due to automatic review settings May 6, 2026 15:35

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tegg/core/loader/src/LoaderUtil.ts`:
- Around line 88-90: The import failure wrapper is using filePath (which can be
a file:// URL on Windows) when calling createLoadError; change the catch to call
createLoadError with originalFilePath instead so the error uses the
caller-facing path. Locate the catch block around the dynamic import (the line
with "exports = await import(filePath);" and the subsequent throw
createLoadError(...)) and replace the second argument from filePath to
originalFilePath; keep the original caught error (e) passed through unchanged.
🪄 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: e465c7db-34d3-4a51-9328-1ccd149139dd

📥 Commits

Reviewing files that changed from the base of the PR and between 2c6da68 and 49408cc.

⛔ Files ignored due to path filters (1)
  • tools/egg-bundler/test/__snapshots__/EntryGenerator.worker.canonical.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • packages/utils/src/import.ts
  • tegg/core/loader/src/LoaderUtil.ts
  • tegg/core/loader/test/Loader.test.ts
  • tools/egg-bundler/src/lib/EntryGenerator.ts

Comment thread tegg/core/loader/src/LoaderUtil.ts
killagu added a commit that referenced this pull request Jun 20, 2026
## Motivation

In bundle mode the tegg manifest stores `moduleReferences[].path` and
`moduleDescriptors[].unitPath` relative to baseDir (normalized by #5932).
`LoaderFactory.loadApp` matches a module reference to its descriptor by exact
path equality, and the descriptor carries the precomputed `decoratedFiles`.
For that match to feed the precomputed files into the loader, both sides must
agree on the same absolute-path contract that a non-bundle run sees.

## Scope

- EntryGenerator: the generated worker entry now resolves both
  `extensions.tegg.moduleReferences[].path` and `moduleDescriptors[].unitPath`
  to absolute paths under the runtime `__outputDir`
  (`path.isAbsolute(p) ? p : path.resolve(__outputDir, p)`). The bundler copies
  each module's package.json under `__outputDir`, so these resolve correctly.
  Canonical worker snapshot updated to match.
- tegg-config App#loadModuleConfigs: resolve `reference.path` against baseDir
  directly instead of `ModuleConfigUtil.resolveModuleDir`, which joins relative
  paths under `baseDir/config` (the `config/module.json` convention) — wrong for
  manifest-sourced references. Manifest reference paths are kept as-is in
  `#scanModuleReferences` so they keep matching the descriptor unitPath keys.

Non-bundle module references are always absolute (ModuleScanner /
`config/module.json` are resolved at read time), so their behavior is
unchanged: both the old and new code pass absolute paths through untouched.

This deliberately does NOT touch `ModuleLoader.ts` or introduce any global
bundle-store direct read; that loader-fs path is handled separately.

## Tests

- tools/egg-bundler EntryGenerator.test.ts: relative tegg manifest paths emit
  the absolutization block and collect controller/repository decorated files.
- tegg/plugin/config ManifestModuleReference.test.ts: a manifest-relative
  reference resolves under baseDir (regression: previously ENOENT under
  baseDir/config); an absolute reference is passed through unchanged.

Verified: egg-bundler EntryGenerator suite, tegg/plugin/config (5 tests),
tegg/core/loader (16 tests); lint, fmtcheck, typecheck clean on touched files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
killagu added a commit that referenced this pull request Jun 20, 2026
## Motivation

In bundle mode the tegg manifest stores `moduleReferences[].path` and
`moduleDescriptors[].unitPath` relative to baseDir (normalized by #5932).
`LoaderFactory.loadApp` matches a module reference to its descriptor by exact
path equality, and the descriptor carries the precomputed `decoratedFiles`.
For that match to feed the precomputed files into the loader, both sides must
agree on the same absolute-path contract that a non-bundle run sees.

## Scope

- EntryGenerator: the generated worker entry now resolves both
  `extensions.tegg.moduleReferences[].path` and `moduleDescriptors[].unitPath`
  to absolute paths under the runtime `__outputDir`
  (`path.isAbsolute(p) ? p : path.resolve(__outputDir, p)`). The bundler copies
  each module's package.json under `__outputDir`, so these resolve correctly.
  Canonical worker snapshot updated to match.
- tegg-config App#loadModuleConfigs: resolve `reference.path` against baseDir
  directly instead of `ModuleConfigUtil.resolveModuleDir`, which joins relative
  paths under `baseDir/config` (the `config/module.json` convention) — wrong for
  manifest-sourced references. Manifest reference paths are kept as-is in
  `#scanModuleReferences` so they keep matching the descriptor unitPath keys.

Non-bundle module references are always absolute (ModuleScanner /
`config/module.json` are resolved at read time), so their behavior is
unchanged: both the old and new code pass absolute paths through untouched.

This deliberately does NOT touch `ModuleLoader.ts` or introduce any global
bundle-store direct read; that loader-fs path is handled separately.

## Tests

- tools/egg-bundler EntryGenerator.test.ts: relative tegg manifest paths emit
  the absolutization block and collect controller/repository decorated files.
- tegg/plugin/config ManifestModuleReference.test.ts: a manifest-relative
  reference resolves under baseDir (regression: previously ENOENT under
  baseDir/config); an absolute reference is passed through unchanged.

Verified: egg-bundler EntryGenerator suite, tegg/plugin/config (5 tests),
tegg/core/loader (16 tests); lint, fmtcheck, typecheck clean on touched files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
killagu added a commit that referenced this pull request Jun 20, 2026
## Motivation

In bundle mode the tegg manifest stores `moduleReferences[].path` and
`moduleDescriptors[].unitPath` **relative to baseDir** (normalized by
#5932). `LoaderFactory.loadApp` matches a module reference to its
descriptor by **exact path equality**, and the descriptor carries the
precomputed `decoratedFiles`. For that match to feed the precomputed
files into the loader, both sides must agree on the same absolute-path
contract that a non-bundle run sees — so the decorated
controller/repository files flow through the manifest descriptor into
`LoaderFactory.loadApp` without any global-store direct read.

## Scope

Two small, self-contained changes:

1. **`tools/egg-bundler` EntryGenerator** — the generated worker entry
now resolves both `extensions.tegg.moduleReferences[].path` and
`moduleDescriptors[].unitPath` to absolute paths under the runtime
`__outputDir`:
   ```js
const __toAbs = (p) => (path.isAbsolute(p) ? p :
path.resolve(__outputDir, p));
   ```
The bundler copies each module's `package.json` under `__outputDir`, so
these resolve correctly. Canonical worker snapshot updated to match.

2. **`tegg/plugin/config` `App#loadModuleConfigs`** — resolve
`reference.path` against `baseDir` directly instead of
`ModuleConfigUtil.resolveModuleDir`, which joins relative paths under
`baseDir/config` (the `config/module.json` convention) — wrong for
manifest-sourced references. Manifest reference paths are kept as-is in
`#scanModuleReferences` so they keep matching the descriptor `unitPath`
keys.

### Non-bundle behavior is unchanged

Non-bundle module references are always **absolute** (`ModuleScanner` /
`config/module.json` are resolved at read time via `path.join(configDir,
...)`), so both the old `resolveModuleDir` and the new code pass them
through untouched.

### Out of scope

This deliberately does **not** touch `ModuleLoader.ts` or introduce any
global bundle-store direct read; that loader-fs path is handled
separately. It also does not overlap with #5932 — that PR normalized the
manifest paths to relative form; this PR re-absolutizes them at runtime
so every consumer sees the same contract.

## Tests

- `tools/egg-bundler/test/EntryGenerator.test.ts` — relative tegg
manifest paths emit the absolutization block and collect
controller/repository decorated files.
- `tegg/plugin/config/test/ManifestModuleReference.test.ts` — a
manifest-relative reference resolves under `baseDir` (regression:
previously `ENOENT` under `baseDir/config`); an absolute reference is
passed through unchanged.

Verified locally:
- egg-bundler `EntryGenerator` suite (new + existing tests pass; the 8
pre-existing `/private/var` realpath failures are macOS-local and
present on `next`)
- `tegg/plugin/config` (5 tests) and `tegg/core/loader` (16 tests)
- `oxlint --type-aware`, `oxfmt --check`, and `tsgo --noEmit` clean on
all touched files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* **Bug Fixes**
* Improved module reference path handling during app configuration
loading, keeping manifest-relative paths aligned with the configured
base directory and preserving absolute paths.
* Updated bundled worker generation to runtime-absolutize tegg manifest
`moduleReferences.path` and `moduleDescriptors.unitPath` under the
output directory, without altering already-absolute values.

* **Tests**
* Added/expanded coverage to verify correct resolution for both relative
and absolute manifest module reference paths in configuration loading
and bundled worker output.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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