Skip to content

feat(editor): add npm.scriptRunner to VS Code settings#1346

Open
jong-kyung wants to merge 5 commits intovoidzero-dev:mainfrom
jong-kyung:feat/vscode-npm-scriptrunner
Open

feat(editor): add npm.scriptRunner to VS Code settings#1346
jong-kyung wants to merge 5 commits intovoidzero-dev:mainfrom
jong-kyung:feat/vscode-npm-scriptrunner

Conversation

@jong-kyung
Copy link
Copy Markdown
Contributor

Summary

  • Add "npm.scriptRunner": "vp" to the VSCODE_SETTINGSconstant so that VS Code's NPM Scripts panel runs scripts through vp task runner
  • Update existing editor config tests with assertions for the new setting
  • Update IDE integration docs to reflect the new setting

Closes #1337

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 708c0bb
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69d7cd92c6c6a000082fac68

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 9, 2026

@fengmk2 fengmk2 self-assigned this Apr 9, 2026
@jong-kyung
Copy link
Copy Markdown
Contributor Author

@jong-kyung https://github.com/microsoft/vscode/blob/main/extensions/npm/package.json#L260 Do we need to add a vp enum value here?

Yes, I think you are right. Since vp is not currently in the allowed enum values for npm.scriptRunner, it definitely needs to be added. I will go ahead and open a PR to microsoft/vscode to add vp first, and I'll let you know here once it's created.

Copy link
Copy Markdown
Member

fengmk2 commented Apr 9, 2026

I like the goal here, especially for vp create, but I’m not fully convinced this should be a broad default yet.

npm.scriptRunner = "vp" appears to work because VS Code currently treats non-node values as <runner> run <script>. That gives us the intended behavior, but vp is not an officially declared value in the setting schema, so this feels more like relying on current implementation details than using a stable extension point.

My main concern is the repo-level impact: once this lands in .vscode/settings.json, the VS Code NPM Scripts experience now depends on vp being available locally. That seems acceptable for newly created Vite+ projects, but more surprising for migration of existing repos.

So I’d be comfortable with this in create, but I’d prefer migrate to be opt-in, or at least documented very explicitly.

@jong-kyung
Copy link
Copy Markdown
Contributor Author

I like the goal here, especially for vp create, but I’m not fully convinced this should be a broad default yet.

npm.scriptRunner = "vp" appears to work because VS Code currently treats non-node values as <runner> run <script>. That gives us the intended behavior, but vp is not an officially declared value in the setting schema, so this feels more like relying on current implementation details than using a stable extension point.

My main concern is the repo-level impact: once this lands in .vscode/settings.json, the VS Code NPM Scripts experience now depends on vp being available locally. That seems acceptable for newly created Vite+ projects, but more surprising for migration of existing repos.

So I’d be comfortable with this in create, but I’d prefer migrate to be opt-in, or at least documented very explicitly.

Thanks for the detailed feedback! That makes sense.

I'll update this PR so that npm.scriptRunner: "vp" is only included in vp create, and excluded from vp migrate.
I'll also open an upstream PR to microsoft/vscode to add vp to the npm.scriptRunner enum values so it becomes an officially supported option.

@jong-kyung
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 637d0e9192

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f945d8f6b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung jong-kyung force-pushed the feat/vscode-npm-scriptrunner branch from f945d8f to 59cb6dc Compare April 9, 2026 14:46
@jong-kyung
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59cb6dc750

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

editorId: selectedEditor,
interactive: options.interactive,
silent: compactOutput,
extraVsCodeSettings: { 'npm.scriptRunner': 'vp' },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop writing unsupported npm.scriptRunner value

Setting npm.scriptRunner to "vp" introduces a workspace setting value that is outside VS Code's npm extension enum (auto, npm, yarn, pnpm, bun, node). In projects created through this path, .vscode/settings.json will be flagged as invalid in editor diagnostics, and users cannot manage this value via the Settings UI; this is a regression in default project hygiene for every VS Code-enabled vp create run.

Useful? React with 👍 / 👎.

@jong-kyung
Copy link
Copy Markdown
Contributor Author

jong-kyung commented Apr 9, 2026

I've also opened an upstream PR to add vp to the npm.scriptRunner enum in VS Code : microsoft/vscode#308794

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.

Proposal: Automatically add "npm.scriptRunner": "vp" to VS Code settings during scaffolding

2 participants