[codex] Support pnpm workspace native build deps#1999
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant User as CLI User
participant Parser as CLI Parser (index.ts)
participant SDK as SDK Layer (sdk.ts)
participant MCP as MCP Handler (server.ts)
participant BuildReq as Build Request (request.ts)
participant ZipDir as Zip Handler (zipDirectory)
participant Archive as Output Archive
User->>Parser: build request --node-modules=path1,path2
Parser->>SDK: requestBuild({ nodeModules: "path1,path2", ... })
SDK->>MCP: send build request (internalOptions incl. nodeModules)
MCP->>BuildReq: requestBuildInternal({ nodeModules: "path1,path2", ... })
BuildReq->>ZipDir: zipDirectory(projectDir, out, platform, config, { nodeModules })
ZipDir->>ZipDir: Resolve node_modules roots (incl. .pnpm)
ZipDir->>ZipDir: addFileToZip() for project files and native packages
ZipDir->>Archive: Write complete archive
Archive-->>User: build.zip with monorepo dependencies
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 2/5 reviews remaining, refill in 28 minutes and 53 seconds. Comment |
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 `@cli/src/mcp/server.ts`:
- Around line 523-527: The inline Zod object that defines appId, platform, path
and nodeModules duplicates the SDK request-build validation; instead import and
reuse the canonical request-build Zod schema (e.g., requestBuildSchema or
RequestBuildSchema) from the shared schemas module and extend it only if
necessary for MCP-specific fields (merge/augment rather than re-declare),
ensuring the nodeModules key is provided via the canonical schema or added
through schema.extend/merge; update any usages in server.ts (the object
containing nodeModules) to reference the imported schema and remove the
duplicated inline definition.
🪄 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: b6682a3a-6636-45c8-a368-5d1e28f1f3b5
📒 Files selected for processing (10)
cli/README.mdcli/skills/native-builds/SKILL.mdcli/src/build/request.tscli/src/index.tscli/src/mcp/server.tscli/src/schemas/build.tscli/src/schemas/sdk.tscli/src/sdk.tscli/test/test-build-zip-filter.mjscli/webdocs/build.mdx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40bf9e1fdd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|



Summary (AI generated)
--node-modulessupport tobuild requestso native build packaging can use explicit monorepo dependency roots..pnpmvirtual stores into flatnode_modules/<package>paths inside the build archive.Motivation (AI generated)
Customers using pnpm workspace monorepos can have app-local native dependency symlinks that point outside the Capacitor app directory.
bundle uploadalready accepts--node-modules, butbuild requestdid not, so native cloud builds could upload an archive missing the real plugin package content.Business Impact (AI generated)
This unblocks native cloud builds for pnpm workspace customers and reduces failed iOS build requests caused by unresolved monorepo symlinks on Capgo runners.
Test Plan (AI generated)
bun run test:build-zip-filter.bun run lint.bun run build.bun run test:mcp.bun run test:bundle.Generated with AI
Summary by CodeRabbit
New Features
--node-modulesoption to thebuild requestcommand, letting users supply comma-separated alternate node_modules paths (including pnpm-style layouts) so native dependencies from monorepos are bundled into build archives.Documentation
--node-modulesflag and usage examples for monorepo setups.Tests