Skip to content

feat(create): set npm.scriptRunner to vp in vp create#1346

Merged
fengmk2 merged 6 commits intovoidzero-dev:mainfrom
jong-kyung:feat/vscode-npm-scriptrunner
Apr 11, 2026
Merged

feat(create): set npm.scriptRunner to vp in vp create#1346
fengmk2 merged 6 commits intovoidzero-dev:mainfrom
jong-kyung:feat/vscode-npm-scriptrunner

Conversation

@jong-kyung
Copy link
Copy Markdown
Contributor

@jong-kyung jong-kyung commented Apr 9, 2026

Summary

  • Add an optional extraVsCodeSettings parameter to writeEditorConfigs() that gets merged into .vscode/settings.json (only for the vscode editor). Existing keys in the user's settings file win during merge.
  • vp create passes { 'npm.scriptRunner': 'vp' } through this parameter so newly created projects have VS Code's NPM Scripts panel run scripts through the Vite+ task runner.
  • vp migrate intentionally does not set this — existing projects may have teammates without vp installed locally.
  • Update IDE integration docs to explain the new behavior and show how to add the setting manually for migrated/existing projects.
  • Add editor config tests covering: the setting is written on vp create, absent by default, not applied to zed, and existing npm.scriptRunner values are preserved on merge.

Closes #1337

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for viteplus-preview canceled.

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

@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".

@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

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 10, 2026

@jong-kyung Even if microsoft/vscode#308794 is not merged, it shouldn't prevent this configuration from taking effect, right?

@jong-kyung
Copy link
Copy Markdown
Contributor Author

@jong-kyung Even if microsoft/vscode#308794 is not merged, it shouldn't prevent this configuration from taking effect, right?

Yes, that's correct. It will still work without any issues even if the upstream PR isn't merged. The only side effect is a schema validation warning in settings.json ("Value is not accepted..."), but the script runner functionality itself will work exactly as intended.

@fengmk2 fengmk2 changed the title feat(editor): add npm.scriptRunner to VS Code settings feat(editor): set npm.scriptRunner to vp in vp create Apr 11, 2026
@fengmk2 fengmk2 changed the title feat(editor): set npm.scriptRunner to vp in vp create feat(editor): set npm.scriptRunner to vp in vp create Apr 11, 2026
@fengmk2 fengmk2 changed the title feat(editor): set npm.scriptRunner to vp in vp create feat(create): set npm.scriptRunner to vp in vp create Apr 11, 2026
@fengmk2 fengmk2 merged commit e22fc93 into voidzero-dev:main Apr 11, 2026
47 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.

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

2 participants