fix(plugins): install dev dependencies so plugin builds succeed - #1260
asiqur-rahman wants to merge 1 commit into
Conversation
The server runs with NODE_ENV=production, which makes `npm install` omit devDependencies by default. Plugin installs ran `npm install --ignore-scripts` then `npm run build`, so any plugin whose build needs devDependencies (typescript, vite, ...) failed with `tsc: not found` (exit 127) and the install reported a 500. Add --include=dev to both the install and update npm invocations. Verified end-to-end: installing cloudcli-plugin-starter through /api/plugins/install now returns 200, installs typescript, runs the plugin's build, and lists the plugin as enabled. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe plugin registry now includes development dependencies when it installs or updates plugins from Git. Both npm commands retain ChangesGit plugin dependency installation
Poem
Merge Risk: ⚪ Minimal · up to Git-based plugins can now install build-time dependencies in production-mode deployments while postinstall scripts remain disabled. The install and update paths are aligned and ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Summary
Fixes plugin installation (and update) failing with an internal error for any plugin whose build needs devDependencies — including the official
cloudcli-plugin-starter.Problem
The server runs with
NODE_ENV=production, which makesnpm installomit devDependencies by default. The plugin installer ran:git clonethe plugin reponpm install --ignore-scripts→ devDependencies skippednpm run build(when the plugin declares abuildscript)Plugins like
cloudcli-plugin-starterdeclaretypescriptunderdevDependenciesfor theirbuild: tscscript. Because typescript was never installed, step 3 failed withsh: 1: tsc: not found(exit 127) andPOST /api/plugins/installreturned HTTP 500.What changed
Added
--include=devto thenpm installinvocation in both paths that precede a plugin build:installPluginFromGit— fresh installupdatePluginFromGit— update reinstall--ignore-scriptsis kept (postinstall hooks must not run arbitrary code); only devDependency omission is corrected.Verification
NODE_ENV=production): starter plugin install returned 500,npm run build→tsc: not found.--include=dev:tscis installed,npm run buildexits 0,dist/is produced.POST /api/plugins/installforcloudcli-ai/cloudcli-plugin-starterreturns200 {"success":true,...}, and the plugin lists as enabled.npm run typecheckpasses.Summary by CodeRabbit