Repository navigation
fix: forward env option to package manager for all operations - #280
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Environment options and command propagation src/api.ts, test/env.test.ts |
The API documents the environment option for dependency operations. installDependencies, ensureDependencyInstalled, and dedupeDependencies accept env. Package-manager commands pass the resolved environment to executeCommand. Tests check environment forwarding for the listed operations. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: pi0
Merge Risk: 
Minimal · up to 79295
-
The change is mergeable; environment options are forwarded for the supported package-manager operations.
Pre-merge checks: 
5
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
OperationOptions.envis part of the public API and is resolved byresolveOperationOptions. Until now, onlyrunScriptanddlxpassed it toexecuteCommand.installDependencies,addDependency(also used byaddDevDependencyandensureDependencyInstalled),removeDependencyanddedupeDependenciessilently ignored it.This matters for nitrojs/nitro#4919. Nitro installs a dependency on demand during a build that runs with
NODE_ENV=productionand passesenv: { NODE_ENV: "development" }so npm doesn't omit dev dependencies. Because nypm dropped that option, it had no effect.Changes:
env: resolvedOptions.envin all four missingexecuteCommandcallsenvin the narrowed option types ofinstallDependencies,dedupeDependenciesandensureDependencyInstalled, and document it in the JSDoctest/env.test.ts, which mockstinyexecand checks thatenvreaches the child process for every operation, includingensureDependencyInstalledanddedupeDependencieswithrecreateLockfile(which reinstalls throughinstallDependencies)🤖 Generated with AI assistant
Summary by CodeRabbit
dlxcommands now use the environment settings provided for the operation.