Skip to content

Commit 0972e19

Browse files
authored
Merge branch 'main' into fix/env-pin-existing-nvmrc-2675
2 parents e05555e + 342bebf commit 0972e19

20 files changed

Lines changed: 1958 additions & 1774 deletions

File tree

Cargo.lock

Lines changed: 764 additions & 480 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ itertools = "0.15.0"
208208
itoa = "1.0.15"
209209
json-escape-simd = "3"
210210
json-strip-comments = "3"
211-
jsonschema = { version = "0.46.5", default-features = false }
211+
jsonschema = { version = "0.55.0", default-features = false }
212212
junction = "1.4.1"
213213
libtest-mimic = "0.8.2"
214214
memchr = "2.7.4"
@@ -270,7 +270,7 @@ sha1 = "0.10.6"
270270
sha2 = "0.10.9"
271271
shell-escape = "0.1.5"
272272
simdutf8 = "0.1.5"
273-
smallvec = { version = "1.15.1", features = ["union"] }
273+
smallvec = { version = "1.16.0", features = ["union"] }
274274
snapshot_test = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "d05b1dcdbaabaa69643ee0b89cebe3cd390957e9" }
275275
string_cache = "0.9.0"
276276
sugar_path = { version = "3", features = ["cached_current_dir"] }
@@ -319,7 +319,7 @@ xxhash-rust = "0.8.15"
319319
zip = { version = "7.2", default-features = false, features = ["deflate-flate2-zlib-rs"] }
320320

321321
# oxc crates with the same version
322-
oxc = { version = "0.148.0", features = [
322+
oxc = { version = "0.149.0", features = [
323323
"ast_visit",
324324
"transformer",
325325
"minifier",
@@ -331,17 +331,17 @@ oxc = { version = "0.148.0", features = [
331331
"regular_expression",
332332
"cfg",
333333
] }
334-
oxc_allocator = { version = "0.148.0", features = ["pool"] }
335-
oxc_ast = "0.148.0"
336-
oxc_ecmascript = "0.148.0"
337-
oxc_parser = "0.148.0"
338-
oxc_span = "0.148.0"
339-
oxc_napi = "0.148.0"
340-
oxc_str = "0.148.0"
341-
oxc_minify_napi = "0.148.0"
342-
oxc_parser_napi = "0.148.0"
343-
oxc_transform_napi = "0.148.0"
344-
oxc_traverse = "0.148.0"
334+
oxc_allocator = { version = "0.149.0", features = ["pool"] }
335+
oxc_ast = "0.149.0"
336+
oxc_ecmascript = "0.149.0"
337+
oxc_parser = "0.149.0"
338+
oxc_span = "0.149.0"
339+
oxc_napi = "0.149.0"
340+
oxc_str = "0.149.0"
341+
oxc_minify_napi = "0.149.0"
342+
oxc_parser_napi = "0.149.0"
343+
oxc_transform_napi = "0.149.0"
344+
oxc_traverse = "0.149.0"
345345

346346
# oxc crates in their own repos
347347
oxc_index = { version = "5", features = ["rayon", "serde"] }

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_bun/snapshots.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name = "command_dlx_bun"
33
vp = "global"
44
local-registry = true
55
skip-platforms = ["windows"]
6+
# bun x caches lockfiles under TMPDIR, separately from BUN_INSTALL_CACHE_DIR.
7+
# Isolate them so tarball URLs cannot refer to a previous test registry.
68
steps = [
79
{ argv = ["vp", "dlx", "--help"], comment = "should show help message", continue-on-failure = true },
8-
{ argv = ["vp", "dlx", "-s", "cowsay", "hello"], comment = "should run cowsay with bun x", continue-on-failure = true },
9-
{ argv = ["vp", "dlx", "-s", "cowsay@1.6.0", "hello"], comment = "should run specific version", continue-on-failure = true },
10+
{ argv = ["vp", "dlx", "-s", "cowsay", "hello"], envs = [["TMPDIR", "${workspace}"]], comment = "should run cowsay with bun x", continue-on-failure = true },
11+
{ argv = ["vp", "dlx", "-s", "cowsay@1.6.0", "hello"], envs = [["TMPDIR", "${workspace}"]], comment = "should run specific version", continue-on-failure = true },
1012
]

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_bun/snapshots/command_dlx_bun.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Options:
2323
Documentation: https://viteplus.dev/guide/vpx
2424
```
2525

26-
## `vp dlx -s cowsay hello`
26+
## `TMPDIR=${workspace} vp dlx -s cowsay hello`
2727

2828
should run cowsay with bun x
2929

@@ -38,7 +38,7 @@ should run cowsay with bun x
3838
|| ||
3939
```
4040

41-
## `vp dlx -s cowsay@1.6.0 hello`
41+
## `TMPDIR=${workspace} vp dlx -s cowsay@1.6.0 hello`
4242

4343
should run specific version
4444

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const assert = require('node:assert/strict');
2+
const { spawnSync } = require('node:child_process');
3+
const { chmodSync, copyFileSync, mkdirSync } = require('node:fs');
4+
const path = require('node:path');
5+
6+
const runtimeDir = path.resolve('custom-runtime');
7+
mkdirSync(runtimeDir);
8+
const runtime = path.join(runtimeDir, process.platform === 'win32' ? 'custom node.exe' : 'custom node');
9+
copyFileSync(process.execPath, runtime);
10+
chmodSync(runtime, 0o755);
11+
const vp = path.join(path.dirname(require.resolve('vite-plus/package.json')), 'bin', 'vp');
12+
const env = { ...process.env };
13+
for (const key of Object.keys(env)) {
14+
if (key.toUpperCase() === 'PATH') delete env[key];
15+
}
16+
env.PATH = runtimeDir;
17+
18+
for (const tool of ['lint', 'fmt']) {
19+
const child = spawnSync(runtime, [vp, tool, '--version'], { env, encoding: 'utf8', timeout: 30000 });
20+
assert.equal(child.status, 0, child.stderr || child.error?.message);
21+
assert.match(child.stdout, /\d+\.\d+\.\d+/);
22+
console.log(`${tool} reused the current runtime without node on PATH`);
23+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "current-node-runtime",
3+
"private": true
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[[case]]
2+
name = "builtin_tools_without_node_on_path"
3+
vp = "local"
4+
steps = [
5+
{ argv = ["node", "assert-runtime.cjs"], comment = "Built-in tools reuse the current runtime even when its filename is not node and PATH has no node executable." },
6+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# builtin_tools_without_node_on_path
2+
3+
## `node assert-runtime.cjs`
4+
5+
Built-in tools reuse the current runtime even when its filename is not node and PATH has no node executable.
6+
7+
```
8+
lint reused the current runtime without node on PATH
9+
fmt reused the current runtime without node on PATH
10+
```

crates/vp_static_config/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn parse_js_ts_config(source: &str, extension: &str) -> FieldMap {
148148
let parser = Parser::new(&allocator, source, source_type);
149149
let result = parser.parse();
150150

151-
if result.panicked || !result.diagnostics.is_empty() {
151+
if result.fatal_error || !result.diagnostics.is_empty() {
152152
return FieldMap::unanalyzable();
153153
}
154154

@@ -1320,6 +1320,19 @@ mod tests {
13201320

13211321
// ── Not analyzable cases ─────────────────────────────────────────────
13221322

1323+
#[test]
1324+
fn syntax_errors_require_runtime_evaluation() {
1325+
for source in [
1326+
"export default { run: { cache: true }",
1327+
"export default { run: { cache: true } }; const missing;",
1328+
] {
1329+
let result = parse(source);
1330+
assert_non_static(&result, "run");
1331+
assert_non_static(&result, "defaultPackage");
1332+
assert_eq!(result.get_declared("run"), None);
1333+
}
1334+
}
1335+
13231336
#[test]
13241337
fn returns_none_for_no_default_export() {
13251338
assert_non_static(&parse_js_ts_config("export const config = { a: 1 };", "ts"), "run");

packages/cli/binding/index.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// prettier-ignore
21
/* eslint-disable */
32
// @ts-nocheck
43
/* auto-generated by NAPI-RS */

0 commit comments

Comments
 (0)