Skip to content

Commit dbdba32

Browse files
committed
Test vlt extglob member refusals end to end
Hosted scan/get and the vendored engine both refuse a vlt workspace member listed through packages/+(a|b) or packages/@(a|b) that holds a stray vlt-lock.json, as they already did for packages/* (#1542). Assisted-by: Claude Code:claude-opus-5-5
1 parent c9d8908 commit dbdba32

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

‎crates/socket-patch-cli/tests/in_process_redirect_pnpm.rs‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ async fn hosted_scan_from_npm_member_with_stray_lock_refuses() {
27702770
}
27712771
}
27722772

2773-
/// #1101 (Bun), #1134 (vlt): a workspace member holding a stray
2773+
/// #1101 (Bun), #1134 / #1542 (vlt): a workspace member holding a stray
27742774
/// `bun.lock` / `bun.lockb` / `vlt-lock.json` of its own (one its manager
27752775
/// never reads; members install from the root lock) used to skip the
27762776
/// #884 / #942 refusal. `scan` and `get` pinned the ignored member lock
@@ -2804,6 +2804,19 @@ async fn hosted_scan_from_bun_or_vlt_member_with_stray_lock_refuses() {
28042804
"vlt-lock.json",
28052805
vlt_text.as_str(),
28062806
),
2807+
// #1542: vlt lists members through extglobs too.
2808+
(
2809+
"vlt-lock.json",
2810+
Some(r#"{"workspaces":["packages/+(a|b)"]}"#),
2811+
"vlt-lock.json",
2812+
vlt_text.as_str(),
2813+
),
2814+
(
2815+
"vlt-lock.json",
2816+
Some(r#"{"workspaces":["packages/@(a|b)"]}"#),
2817+
"vlt-lock.json",
2818+
vlt_text.as_str(),
2819+
),
28072820
] {
28082821
let tmp = tempfile::tempdir().unwrap();
28092822
let member = write_package_json_workspace(tmp.path(), root_lock, false);

‎crates/socket-patch-core/src/vendor/npm_flavor.rs‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ mod tests {
19091909
);
19101910
}
19111911

1912-
/// #1101 (Bun), #1134 (vlt): a workspace member's own `bun.lock`,
1912+
/// #1101 (Bun), #1134 / #1542 (vlt): a workspace member's own `bun.lock`,
19131913
/// `bun.lockb` or `vlt-lock.json` is a lock its manager never reads
19141914
/// (members install from the workspace root's lock), so vendoring into
19151915
/// it would wire nothing. The engine and the hosted→vendored takeover
@@ -1939,6 +1939,23 @@ mod tests {
19391939
("vlt-lock.json", VLT_TEXT),
19401940
],
19411941
),
1942+
// #1542: vlt lists members through extglobs too.
1943+
(
1944+
"vlt-lock.json",
1945+
VLT_TEXT,
1946+
vec![
1947+
("vlt.json", r#"{"workspaces":["packages/+(a|b)"]}"#),
1948+
("vlt-lock.json", VLT_TEXT),
1949+
],
1950+
),
1951+
(
1952+
"vlt-lock.json",
1953+
VLT_TEXT,
1954+
vec![
1955+
("vlt.json", r#"{"workspaces":["packages/@(a|b)"]}"#),
1956+
("vlt-lock.json", VLT_TEXT),
1957+
],
1958+
),
19421959
] {
19431960
let (tmp, record) = npm_project().await;
19441961
tokio::fs::remove_file(tmp.path().join("package-lock.json"))

0 commit comments

Comments
 (0)