Skip to content

fix: use --save-dev for npm and pnpm in addDependencyCommand - #256

Merged
pi0 merged 2 commits into
unjs:mainfrom
DamianGlowala:fix/npm-and-pnpm-dev-cmd
Jul 28, 2026
Merged

fix: use --save-dev for npm and pnpm in addDependencyCommand#256
pi0 merged 2 commits into
unjs:mainfrom
DamianGlowala:fix/npm-and-pnpm-dev-cmd

Conversation

@DamianGlowala

@DamianGlowala DamianGlowala commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR uses the correct long form of dev attr for npm and pnpm.

https://docs.npmjs.com/cli/v12/commands/npm-install
https://pnpm.io/cli/add#--save-dev--d--d

Summary by CodeRabbit

  • Bug Fixes
    • Corrected development dependency commands for npm and pnpm to use the appropriate --save-dev option.
    • Ensured generated commands consistently use the correct development-dependency flag across supported package managers.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 377e62b0-e1f6-49de-addb-88f139383935

📥 Commits

Reviewing files that changed from the base of the PR and between 6c58124 and 907e53c.

📒 Files selected for processing (2)
  • src/cmd.ts
  • test/cmd.test.ts

📝 Walkthrough

Walkthrough

addDependencyCommand now generates --save-dev for npm and pnpm, alongside aube and nub. Tests update the expected npm and pnpm development dependency commands.

Changes

Development dependency flags

Layer / File(s) Summary
Development flag selection and test expectations
src/cmd.ts, test/cmd.test.ts
The command generator uses --save-dev for npm and pnpm development dependencies, and fixtures verify the updated command strings.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

  • unjs/nypm#247: Updates overlapping development-dependency flag selection for addDependencyCommand.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: npm and pnpm now use --save-dev in addDependencyCommand.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.52%. Comparing base (660392f) to head (907e53c).
⚠️ Report is 159 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #256      +/-   ##
==========================================
+ Coverage   82.17%   86.52%   +4.35%     
==========================================
  Files           6        5       -1     
  Lines         516      386     -130     
  Branches       71      204     +133     
==========================================
- Hits          424      334      -90     
+ Misses         91       44      -47     
- Partials        1        8       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pi0
pi0 merged commit 193428a into unjs:main Jul 28, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants