Description
I propose that the vp create and vp migrate commands should automatically include "npm.scriptRunner": "vp" in the generated .vscode/settings.json file when the user selects VS Code as their IDE.
Why?
UX: It allows users to run scripts from the VS Code "NPM Scripts" side panel directly using the vp runner without manual configuration.
Performance: Ensures users benefit from Vite+'s optimized task runner and caching out of the box.
Consistency: Aligns the editor experience with the CLI's recommendation to use vp run.
Suggested solution
Modify the project scaffolding and migration logic within the vp CLI to automatically populate .vscode/settings.json.
- Implementation Details:
When a user selects VS Code during the vp create or vp migrate process (or uses the --editor vscode flag), the CLI should ensure the following entry is added to the generated settings file:
{
"npm.scriptRunner": "vp"
}
- Affected Components:
Template Generator: Update the default VS Code configuration templates in packages/create-vp (or the equivalent scaffolding package) to include this property.
Migration Tool: Update the vp migrate command to append this setting if .vscode/settings.json already exists, or create it if it doesn't.
- Behavior:
If the file exists, the CLI should perform a deep merge to avoid overwriting user-defined settings.
The change should be documented as a recommended "best practice" for using Vite+ with VS Code to ensure scripts (dev, build, test) leverage the vp task runner and its caching capabilities directly from the IDE interface.
Users will be able to click 'Run' or 'Debug' icons next to scripts in the VS Code explorer, and it will execute via vp run [script] instead of the default npm/pnpm/yarn, providing immediate performance benefits without manual setup.
Alternative
No response
Additional context
No response
Validations
Description
I propose that the vp create and vp migrate commands should automatically include "npm.scriptRunner": "vp" in the generated .vscode/settings.json file when the user selects VS Code as their IDE.
Why?
UX: It allows users to run scripts from the VS Code "NPM Scripts" side panel directly using the vp runner without manual configuration.
Performance: Ensures users benefit from Vite+'s optimized task runner and caching out of the box.
Consistency: Aligns the editor experience with the CLI's recommendation to use vp run.
Suggested solution
Modify the project scaffolding and migration logic within the vp CLI to automatically populate .vscode/settings.json.
When a user selects VS Code during the vp create or vp migrate process (or uses the --editor vscode flag), the CLI should ensure the following entry is added to the generated settings file:
Template Generator: Update the default VS Code configuration templates in packages/create-vp (or the equivalent scaffolding package) to include this property.
Migration Tool: Update the vp migrate command to append this setting if .vscode/settings.json already exists, or create it if it doesn't.
If the file exists, the CLI should perform a deep merge to avoid overwriting user-defined settings.
The change should be documented as a recommended "best practice" for using Vite+ with VS Code to ensure scripts (dev, build, test) leverage the vp task runner and its caching capabilities directly from the IDE interface.
Users will be able to click 'Run' or 'Debug' icons next to scripts in the VS Code explorer, and it will execute via vp run [script] instead of the default npm/pnpm/yarn, providing immediate performance benefits without manual setup.
Alternative
No response
Additional context
No response
Validations