Fix/node prepack - #716
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
29399e3
into
codex/four-package-runtime-boundaries
PR Summary by QodoBuild Node package during prepack to fix npm packaging
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
65 rules 1. Prepack suggests missing script
|
| }, | ||
| "scripts": { | ||
| "build": "tsdown -c tsdown.config.ts", | ||
| "prepack": "node ../../scripts/server-manifest.mjs check && npm run build", |
There was a problem hiding this comment.
1. Prepack suggests missing script 🐞 Bug ☼ Reliability
The Node workspace prepack runs server-manifest.mjs from packages/node, but on drift the script errors with “Run npm run sync:server-manifest” even though packages/node/package.json does not define that script. This can block npm pack/publish with a remediation command that fails in the current working directory and can also reduce validation scope because server-manifest derives paths from process.cwd().
Agent Prompt
### Issue description
`packages/node` now runs `node ../../scripts/server-manifest.mjs check` during `prepack`. When the check detects drift, `server-manifest.mjs` instructs users to run `npm run sync:server-manifest`, but that script exists only in the repo root, not in `packages/node`. This makes the failure message misleading and can block packaging/publishing with an un-runnable remediation.
### Issue Context
- `server-manifest.mjs` uses `rootDir = process.cwd()` and resolves manifest paths relative to that, so invoking it from `packages/node` changes which manifests are validated.
### Fix Focus Areas
- packages/node/package.json[26-31]
- scripts/server-manifest.mjs[139-150]
- scripts/server-manifest.mjs[174-178]
- package.json[58-72]
### Suggested fix
Update the workspace `prepack` to run the repo-root check script so the validation matches CI and the remediation command exists, e.g.:
- `"prepack": "npm --prefix ../.. run check:server-manifest && npm run build"`
(Alternative: add `sync:server-manifest` (and optionally `check:server-manifest`) scripts to `packages/node/package.json`, but prefer running the root check to keep the dual-manifest validation consistent.)
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
No description provided.