Skip to content

fix(plugins): install dev dependencies so plugin builds succeed - #1260

Open
asiqur-rahman wants to merge 1 commit into
siteboon:mainfrom
asiqur-rahman:fix/plugin-install-include-dev
Open

asiqur-rahman wants to merge 1 commit into
siteboon:mainfrom
asiqur-rahman:fix/plugin-install-include-dev

Conversation

@asiqur-rahman

@asiqur-rahman asiqur-rahman commented Sep 5, 2026

Copy link
Copy Markdown

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 makes npm install omit devDependencies by default. The plugin installer ran:

  1. git clone the plugin repo
  2. npm install --ignore-scripts → devDependencies skipped
  3. npm run build (when the plugin declares a build script)

Plugins like cloudcli-plugin-starter declare typescript under devDependencies for their build: tsc script. Because typescript was never installed, step 3 failed with sh: 1: tsc: not found (exit 127) and POST /api/plugins/install returned HTTP 500.

What changed

Added --include=dev to the npm install invocation in both paths that precede a plugin build:

  • installPluginFromGit — fresh install
  • updatePluginFromGit — update reinstall

--ignore-scripts is kept (postinstall hooks must not run arbitrary code); only devDependency omission is corrected.

Verification

  • Reproduced the failure in the production container (NODE_ENV=production): starter plugin install returned 500, npm run buildtsc: not found.
  • With --include=dev: tsc is installed, npm run build exits 0, dist/ is produced.
  • End-to-end through the real API: POST /api/plugins/install for cloudcli-ai/cloudcli-plugin-starter returns 200 {"success":true,...}, and the plugin lists as enabled.
  • npm run typecheck passes.

Summary by CodeRabbit

  • Bug Fixes
    • Plugin installations and updates now include required development dependencies when running in production mode.

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>
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: b8637592-02bb-4459-8d4f-7d26a4f602ed

📥 Commits

Reviewing files that changed from the base of the PR and between c1be241 and d1431c1.

📒 Files selected for processing (1)
  • server/modules/plugins/plugin-registry.service.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The plugin registry now includes development dependencies when it installs or updates plugins from Git. Both npm commands retain --ignore-scripts and add --include=dev.

Changes

Git plugin dependency installation

Layer / File(s) Summary
Include development dependencies
server/modules/plugins/plugin-registry.service.ts
installPluginFromGit and updatePluginFromGit pass --include=dev to npm. Comments explain that the flag is required when NODE_ENV=production.

Poem

A rabbit watched the npm stream
Dev packages joined the dream
Install hops, update too
Scripts stay off as planned to do
Git plugins bloom anew

Merge Risk: ⚪ Minimal · up to d1431

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: installing devDependencies so plugin builds succeed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants