Conversation
📝 WalkthroughWalkthroughAdded CLI source-map support: SEA asset mapping for Changes
Sequence Diagram(s)sequenceDiagram
participant Bootstrap as Bootstrap
participant SourceMapSetup as setupSourceMap()
participant SEA as node:sea
participant SMS as source-map-support
Bootstrap->>SourceMapSetup: call setupSourceMap()
alt runtime is SEA
SourceMapSetup->>SEA: getAsset("main.js.map")
SEA-->>SourceMapSetup: return asset content (or error)
alt asset returned & parsed
SourceMapSetup->>SMS: install with retrieveSourceMap(using preloaded map)
SMS-->>SourceMapSetup: installed
else parse/load fails
SourceMapSetup-->>Bootstrap: warn and continue
end
else non-SEA runtime
SourceMapSetup->>SMS: require/install default source-map-support
SMS-->>SourceMapSetup: installed
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR improves ADC CLI error-stack UX by enabling source-map remapping (including in Node SEA single-binary builds), so stack traces can point to original source locations.
Changes:
- Add and install
source-map-support, with custom source-map retrieval when running under SEA. - Switch CLI esbuild sourcemaps from inline to linked and embed the
.mapas a SEA asset. - Update workspace deps/lockfile (including removing
@nx/webfrom root devDependencies).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds source-map-support to the catalog and adjusts pnpm workspace settings. |
| pnpm-lock.yaml | Lockfile updates reflecting new dependency and removed @nx/web. |
| package.json | Removes @nx/web from root devDependencies. |
| apps/cli/src/main.ts | Installs source-map-support and adds SEA-specific source map retrieval. |
| apps/cli/package.json | Adds deps/types for source-map support and switches esbuild sourcemap mode. |
| apps/cli/node-sea.json | Embeds the generated sourcemap as a SEA asset. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
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 `@apps/cli/src/main.ts`:
- Around line 30-31: The static import of ./command should be changed to a
dynamic import inside the async bootstrap() so setupSourceMap() runs before any
top-level code in command executes; inside bootstrap(), after calling
setupSourceMap(), perform await import('./command') (or const { default: command
} = await import('./command')) and then continue using the imported module,
removing or replacing the top-level static import; update any references to the
formerly statically imported symbols to use the dynamically imported module
within bootstrap().
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7f073c7b-aaf3-4674-ae49-48c55de6223c
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
apps/cli/node-sea.jsonapps/cli/package.jsonapps/cli/src/main.tspackage.jsonpnpm-workspace.yaml
💤 Files with no reviewable changes (1)
- package.json
There was a problem hiding this comment.
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 `@apps/cli/src/command/index.ts`:
- Around line 18-24: In setupInternal, capture the result of dotenv.config() and
handle errors explicitly: call dotenv.config(), inspect the returned object for
error, allow an ENOENT (missing .env) to pass silently, but for other errors
(parse failures) either log a clear warning or throw; update the setupInternal
function to check the config result and act accordingly so that malformed .env
files are not silently swallowed.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cc48d27a-309e-4841-b6f3-156a7420f7b4
📒 Files selected for processing (1)
apps/cli/src/command/index.ts
Description
By providing out-of-the-box source map remapping, error logs in single binary builds can display the original code paths and line and column numbers.
Checklist
Summary by CodeRabbit
Chores
Refactor
Other