Skip to content

Commit 67c9781

Browse files
authored
Merge branch 'main' into fix/1086
2 parents c382a2b + 8159886 commit 67c9781

File tree

5 files changed

+46
-6
lines changed

5 files changed

+46
-6
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
}
2727
}
2828
}
29-
}
29+
},
30+
"postCreateCommand": "curl -fsSL https://vite.plus | bash"
3031
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
3132
// "mounts": [
3233
// {

packages/cli/AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ These commands map to their corresponding tools. For example, `vp dev --port 300
6969
- **Import JavaScript modules from `vite-plus`:** Instead of importing from `vite` or `vitest`, all modules should be imported from the project's `vite-plus` dependency. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities.
7070
- **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box.
7171

72+
## CI Integration
73+
74+
For GitHub Actions, consider using [`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) to replace separate `actions/setup-node`, package-manager setup, cache, and install steps with a single action.
75+
76+
```yaml
77+
- uses: voidzero-dev/setup-vp@v1
78+
with:
79+
cache: true
80+
- run: vp check
81+
- run: vp test
82+
```
83+
7284
## Review Checklist for Agents
7385
7486
- [ ] Run `vp install` after pulling remote changes and before getting started.

packages/cli/install.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,27 @@ function Setup-NodeManager {
205205

206206
$binPath = "$InstallDir\bin"
207207

208+
# Explicit override via environment variable
209+
if ($env:VITE_PLUS_NODE_MANAGER -eq "yes") {
210+
Refresh-Shims -BinDir $BinDir
211+
return "true"
212+
} elseif ($env:VITE_PLUS_NODE_MANAGER -eq "no") {
213+
return "false"
214+
}
215+
208216
# Check if Vite+ is already managing Node.js (bin\node.exe exists)
209217
if (Test-Path "$binPath\node.exe") {
210218
# Already managing Node.js, just refresh shims
211219
Refresh-Shims -BinDir $BinDir
212220
return "already"
213221
}
214222

215-
# Auto-enable on CI environment
216-
if ($env:CI) {
223+
# Auto-enable on CI or devcontainer environments
224+
# CI: standard CI environment variable (GitHub Actions, Travis, CircleCI, etc.)
225+
# CODESPACES: set by GitHub Codespaces (https://docs.github.com/en/codespaces)
226+
# REMOTE_CONTAINERS: set by VS Code Dev Containers extension
227+
# DEVPOD: set by DevPod (https://devpod.sh)
228+
if ($env:CI -or $env:CODESPACES -or $env:REMOTE_CONTAINERS -or $env:DEVPOD) {
217229
Refresh-Shims -BinDir $BinDir
218230
return "true"
219231
}

packages/cli/install.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# VITE_PLUS_VERSION - Version to install (default: latest)
1010
# VITE_PLUS_HOME - Installation directory (default: ~/.vite-plus)
1111
# NPM_CONFIG_REGISTRY - Custom npm registry URL (default: https://registry.npmjs.org)
12+
# VITE_PLUS_NODE_MANAGER - Set to "yes" or "no" to skip interactive prompt (for CI/devcontainers)
1213
# VITE_PLUS_LOCAL_TGZ - Path to local vite-plus.tgz (for development/testing)
1314

1415
set -e
@@ -442,15 +443,29 @@ setup_node_manager() {
442443
vp_bin="$bin_dir/vp.exe"
443444
fi
444445

446+
# Explicit override via environment variable
447+
if [ "$VITE_PLUS_NODE_MANAGER" = "yes" ]; then
448+
refresh_shims "$vp_bin"
449+
NODE_MANAGER_ENABLED="true"
450+
return 0
451+
elif [ "$VITE_PLUS_NODE_MANAGER" = "no" ]; then
452+
NODE_MANAGER_ENABLED="false"
453+
return 0
454+
fi
455+
445456
# Check if Vite+ is already managing Node.js (bin/node or bin/node.exe exists)
446457
if [ -e "$bin_path/node" ] || [ -e "$bin_path/node.exe" ]; then
447458
refresh_shims "$vp_bin"
448459
NODE_MANAGER_ENABLED="already"
449460
return 0
450461
fi
451462

452-
# Auto-enable on CI environment
453-
if [ -n "$CI" ]; then
463+
# Auto-enable on CI or devcontainer environments
464+
# CI: standard CI environment variable (GitHub Actions, Travis, CircleCI, etc.)
465+
# CODESPACES: set by GitHub Codespaces (https://docs.github.com/en/codespaces)
466+
# REMOTE_CONTAINERS: set by VS Code Dev Containers extension
467+
# DEVPOD: set by DevPod (https://devpod.sh)
468+
if [ -n "$CI" ] || [ -n "$CODESPACES" ] || [ -n "$REMOTE_CONTAINERS" ] || [ -n "$DEVPOD" ]; then
454469
refresh_shims "$vp_bin"
455470
NODE_MANAGER_ENABLED="true"
456471
return 0

packages/cli/src/utils/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const ZED_SETTINGS = {
122122
prettier: { allowed: false },
123123
formatter: [{ language_server: { name: 'oxfmt' } }],
124124
},
125-
Vue: {
125+
'Vue.js': {
126126
format_on_save: 'on',
127127
prettier: { allowed: false },
128128
formatter: [{ language_server: { name: 'oxfmt' } }],

0 commit comments

Comments
 (0)