Add node as npm script runner (#236967)

* refactor: Separate `createScriptRunnerTask` and `createInstallationTask` from `createTask`

* feat: Add `npm.scriptRunner`

* feat: Add Node.js as script runner

* refactor: Refactor `isPrePostScript`

* refactor: Extract `get*Command`

* fix: Typo

* style: Remove no-op `catch`es

* fix: `node --run` doesn't support `--silent`

* refactor: Use `.map` in `escapeCommandLine`

* chore: Remove TODO

Upstream reviewer is ok with current state
This commit is contained in:
xymopen_Official
2025-02-08 01:26:29 +08:00
committed by GitHub
parent 5a42ab46c9
commit 6a5991cfb6
8 changed files with 223 additions and 152 deletions

View File

@@ -5,12 +5,19 @@
"virtualWorkspaces": "Functionality that requires running the 'npm' command is not available in virtual workspaces.",
"config.npm.autoDetect": "Controls whether npm scripts should be automatically detected.",
"config.npm.runSilent": "Run npm commands with the `--silent` option.",
"config.npm.packageManager": "The package manager used to run scripts.",
"config.npm.packageManager.npm": "Use npm as the package manager for running scripts.",
"config.npm.packageManager.yarn": "Use yarn as the package manager for running scripts.",
"config.npm.packageManager.pnpm": "Use pnpm as the package manager for running scripts.",
"config.npm.packageManager.bun": "Use bun as the package manager for running scripts.",
"config.npm.packageManager.auto": "Auto-detect which package manager to use for running scripts based on lock files and installed package managers.",
"config.npm.packageManager": "The package manager used to install dependencies.",
"config.npm.packageManager.npm": "Use npm as the package manager.",
"config.npm.packageManager.yarn": "Use yarn as the package manager.",
"config.npm.packageManager.pnpm": "Use pnpm as the package manager.",
"config.npm.packageManager.bun": "Use bun as the package manager.",
"config.npm.packageManager.auto": "Auto-detect which package manager to use based on lock files and installed package managers.",
"config.npm.scriptRunner": "The script runner used to run scripts.",
"config.npm.scriptRunner.npm": "Use npm as the script runner.",
"config.npm.scriptRunner.yarn": "Use yarn as the script runner.",
"config.npm.scriptRunner.pnpm": "Use pnpm as the script runner.",
"config.npm.scriptRunner.bun": "Use bun as the script runner.",
"config.npm.scriptRunner.node": "Use Node.js as the script runner.",
"config.npm.scriptRunner.auto": "Auto-detect which script runner to use based on lock files and installed package managers.",
"config.npm.exclude": "Configure glob patterns for folders that should be excluded from automatic script detection.",
"config.npm.enableScriptExplorer": "Enable an explorer view for npm scripts when there is no top-level 'package.json' file.",
"config.npm.scriptExplorerAction": "The default click action used in the NPM Scripts Explorer: `open` or `run`, the default is `open`.",