[建議 / Feature] Plugin 安裝時自動安裝 Node 依賴(npm ci),與 Claude Code 對齊
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
現狀
ZCode 安裝 plugin 時只複製檔案+註冊;plugin 若攜帶 package.json / package-lock.json,不會執行 npm ci。實測(ZCode 3.10.1,macOS Apple Silicon):安裝後 cache 內 package.json / lock 都在場,但 node_modules 不落地、秒裝完成——npm 根本沒跑(兩個獨立數據點:不同版本前後安裝皆同)。
對照 Claude Code:同一份 plugin(相同 lockfile)安裝時自動執行 npm ci --ignore-scripts,node_modules 落地於 plugin cache(CC 官方 plugins-reference 的「Node.js dependency install」機制,僅 Node 依賴、--ignore-scripts 安全限制)。
請求
- Plugin 安裝/更新時,偵測
package.json(+lockfile)並自動執行npm ci --ignore-scripts - MCP server spawn 時提供
CLAUDE_PLUGIN_ROOT等價環境變數(指向 plugin 安裝根目錄),讓.mcp.json的 wrapper 能解析${CLAUDE_PLUGIN_ROOT}/node_modules/.bin/...
收益
帶平台 binary(optionalDependencies + os/cpu gating,esbuild 模式)的 CC 生態 plugin 可在 ZCode 零改動、零手動安裝全棧運作。實例:code-reality(Rust bins 以 npm 平台套件分發+uv/PyPI 雙面)目前 ZCode 端必須退回 uv 手動安裝路徑,CC 端則一鍵全棧。
環境
- ZCode 3.10.1(macOS, Apple Silicon, arm64)
- 實測 plugin:code-reality 0.3.0 / 0.3.1(npm
optionalDependencies平台套件形態)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the plugin installation/update entry points and the MCP server spawn path. Check how package.json, package-lock.json, and .mcp.json are handled, then verify the requested npm ci --ignore-scripts behavior and CLAUDE_PLUGIN_ROOT-equivalent environment variable using the code-reality plugin scenario described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100