Skip to content

Commit efc4813

Browse files
branchseerclaude
andcommitted
revert: remove unnecessary ANSI stripping from replaceUnstableOutput
ANSI codes in snap files are deterministic and stable across platforms. The only fixes needed are `2>&1 | grep` in the two tests where cached stderr or Stdio::inherit() output leaks past stdout-only grep pipes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a71ebb4 commit efc4813

File tree

19 files changed

+86
-92
lines changed

19 files changed

+86
-92
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
> vp pm config set vite-plus-pm-config-test-key test-value --location project # should set config value in project scope (shows warning for yarn@1)
2-
warn: yarn@1 does not support --location, ignoring flag
2+
warn: yarn@1 does not support --location, ignoring flag
33
yarn config v<semver>
44
success Set "vite-plus-pm-config-test-key" to "test-value".
55
Done in <variable>ms.
66

77
> vp pm config get vite-plus-pm-config-test-key --location project # should get config value from project scope (shows warning for yarn@1)
8-
warn: yarn@1 does not support --location, ignoring flag
8+
warn: yarn@1 does not support --location, ignoring flag
99
test-value
1010

1111
> vp pm config delete vite-plus-pm-config-test-key --location project # should delete config key from project scope (shows warning for yarn@1)
12-
warn: yarn@1 does not support --location, ignoring flag
12+
warn: yarn@1 does not support --location, ignoring flag
1313
yarn config v<semver>
1414
success Deleted "vite-plus-pm-config-test-key".
1515
Done in <variable>ms.

packages/cli/snap-tests-global/command-env-use/snap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ unset VITE_PLUS_NODE_VERSION
2121
Reverted to file-based Node.js version resolution
2222

2323
[1]> vp env use d # should show friendly error for invalid version
24-
error: Invalid Node.js version: "d"
24+
error: Invalid Node.js version: "d"
2525

2626
Valid examples:
2727
vp env use 20 # Latest Node.js 20.x
@@ -30,7 +30,7 @@ Valid examples:
3030
vp env use latest # Latest version
3131

3232
[1]> vp env use abc # should show friendly error for invalid version
33-
error: Invalid Node.js version: "abc"
33+
error: Invalid Node.js version: "abc"
3434

3535
Valid examples:
3636
vp env use 20 # Latest Node.js 20.x

packages/cli/snap-tests-global/command-env-which/snap.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ v20.18.0
33

44
> vp env which node # Core tool - shows resolved Node.js binary path
55
<vite-plus-home>/js_runtime/node/<semver>/bin/node
6-
Version: <semver>
7-
Source: .node-version
6+
Version:  20.18.0
7+
Source:  .node-version
88

99
> vp env which npm # Core tool - shows resolved npm binary path
1010
<vite-plus-home>/js_runtime/node/<semver>/bin/npm
11-
Version: <semver>
12-
Source: .node-version
11+
Version:  20.18.0
12+
Source:  .node-version
1313

1414
> vp env which npx # Core tool - shows resolved npx binary path
1515
<vite-plus-home>/js_runtime/node/<semver>/bin/npx
16-
Version: <semver>
17-
Source: .node-version
16+
Version:  20.18.0
17+
Source:  .node-version
1818

1919
> vp install -g cowsay@1.6.0 # Install a global package via vp
2020
Installing cowsay@<semver> globally...
@@ -29,16 +29,16 @@ added 41 packages in <variable>ms
2929

3030
> vp env which cowsay # Global package - shows binary path with metadata
3131
<vite-plus-home>/packages/cowsay/lib/node_modules/cowsay/./cli.js
32-
Package: cowsay@<semver>
33-
Binaries: cowsay, cowthink
34-
Node: <semver>
35-
Installed: <date>
32+
Package:  cowsay@<semver>
33+
Binaries:  cowsay, cowthink
34+
Node:  20.18.0
35+
Installed: <date>
3636

3737
> vp remove -g cowsay # Cleanup
3838
Uninstalling cowsay...
3939
Uninstalled cowsay
4040

4141
[1]> vp env which unknown-tool # Unknown tool - error message
42-
error: tool 'unknown-tool' not found
42+
error: tool 'unknown-tool' not found
4343
Not a core tool (node, npm, npx) or installed global package.
4444
Run 'vp list -g' to see installed packages.

packages/cli/snap-tests-global/command-list-yarn1/snap.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,56 +32,56 @@ Done in <variable>ms.
3232
{"type":"tree","data":{"type":"list","trees":[{"name":"testnpm2@<semver>","children":[],"hint":null,"color":"bold","depth":0},{"name":"test-vite-plus-package@<semver>","children":[],"hint":null,"color":"bold","depth":0}]}}
3333

3434
> vp pm list --prod # should show warning that --prod not supported by yarn@1
35-
warn: yarn@1 does not support --prod, ignoring --prod flag
35+
warn: yarn@1 does not support --prod, ignoring --prod flag
3636
yarn list v<semver>
3737
├─ test-vite-plus-package@<semver>
3838
└─ testnpm2@<semver>
3939
Done in <variable>ms.
4040

4141
> vp pm list --dev # should show warning that --dev not supported by yarn@1
42-
warn: yarn@1 does not support --dev, ignoring --dev flag
42+
warn: yarn@1 does not support --dev, ignoring --dev flag
4343
yarn list v<semver>
4444
├─ test-vite-plus-package@<semver>
4545
└─ testnpm2@<semver>
4646
Done in <variable>ms.
4747

4848
> vp pm list --no-optional # should show warning that --no-optional not supported by yarn@1
49-
warn: yarn@1 does not support --no-optional, ignoring --no-optional flag
49+
warn: yarn@1 does not support --no-optional, ignoring --no-optional flag
5050
yarn list v<semver>
5151
├─ test-vite-plus-package@<semver>
5252
└─ testnpm2@<semver>
5353
Done in <variable>ms.
5454

5555
> vp pm list --exclude-peers # should show warning that --exclude-peers not supported by yarn@1
56-
warn: yarn@1 does not support --exclude-peers, ignoring flag
56+
warn: yarn@1 does not support --exclude-peers, ignoring flag
5757
yarn list v<semver>
5858
├─ test-vite-plus-package@<semver>
5959
└─ testnpm2@<semver>
6060
Done in <variable>ms.
6161

6262
> vp pm list --only-projects # should show warning that --only-projects not supported by yarn@1
63-
warn: yarn@1 does not support --only-projects, ignoring flag
63+
warn: yarn@1 does not support --only-projects, ignoring flag
6464
yarn list v<semver>
6565
├─ test-vite-plus-package@<semver>
6666
└─ testnpm2@<semver>
6767
Done in <variable>ms.
6868

6969
> vp pm list --find-by customFinder # should show warning that --find-by not supported by yarn@1
70-
warn: yarn@1 does not support --find-by, ignoring flag
70+
warn: yarn@1 does not support --find-by, ignoring flag
7171
yarn list v<semver>
7272
├─ test-vite-plus-package@<semver>
7373
└─ testnpm2@<semver>
7474
Done in <variable>ms.
7575

7676
> vp pm list --recursive # should show warning that --recursive not supported by yarn@1
77-
warn: yarn@1 does not support --recursive, ignoring --recursive flag
77+
warn: yarn@1 does not support --recursive, ignoring --recursive flag
7878
yarn list v<semver>
7979
├─ test-vite-plus-package@<semver>
8080
└─ testnpm2@<semver>
8181
Done in <variable>ms.
8282

8383
> vp pm list --filter app # should show warning that --filter not supported by yarn@1
84-
warn: yarn@1 does not support --filter, ignoring --filter flag
84+
warn: yarn@1 does not support --filter, ignoring --filter flag
8585
yarn list v<semver>
8686
├─ test-vite-plus-package@<semver>
8787
└─ testnpm2@<semver>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
> vp pm list # should show warning that yarn@2+ does not support list command
2-
warn: yarn@2+ does not support 'list' command
2+
warn: yarn@2+ does not support 'list' command

packages/cli/snap-tests-global/command-outdated-npm10/snap.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,42 +54,42 @@ test-vite-plus-top-package <semver> <semver> <semver> node_modules/te
5454
testnpm2 <semver> <semver> <semver> node_modules/testnpm2 command-outdated-npm10
5555

5656
[1]> vp outdated -P # should support prod output
57-
warn: --prod/--dev not supported by npm
57+
warn: --prod/--dev not supported by npm
5858
Package Current Wanted Latest Location Depended by
5959
test-vite-plus-other-optional <semver> <semver> <semver> node_modules/test-vite-plus-other-optional command-outdated-npm10
6060
test-vite-plus-top-package <semver> <semver> <semver> node_modules/test-vite-plus-top-package command-outdated-npm10
6161
testnpm2 <semver> <semver> <semver> node_modules/testnpm2 command-outdated-npm10
6262

6363
[1]> vp outdated -D # should support dev output
64-
warn: --prod/--dev not supported by npm
64+
warn: --prod/--dev not supported by npm
6565
Package Current Wanted Latest Location Depended by
6666
test-vite-plus-other-optional <semver> <semver> <semver> node_modules/test-vite-plus-other-optional command-outdated-npm10
6767
test-vite-plus-top-package <semver> <semver> <semver> node_modules/test-vite-plus-top-package command-outdated-npm10
6868
testnpm2 <semver> <semver> <semver> node_modules/testnpm2 command-outdated-npm10
6969

7070
[1]> vp outdated --no-optional # should support no-optional output
71-
warn: --no-optional not supported by npm
71+
warn: --no-optional not supported by npm
7272
Package Current Wanted Latest Location Depended by
7373
test-vite-plus-other-optional <semver> <semver> <semver> node_modules/test-vite-plus-other-optional command-outdated-npm10
7474
test-vite-plus-top-package <semver> <semver> <semver> node_modules/test-vite-plus-top-package command-outdated-npm10
7575
testnpm2 <semver> <semver> <semver> node_modules/testnpm2 command-outdated-npm10
7676

7777
[1]> vp outdated --compatible # should compatible output nothing
78-
warn: --compatible not supported by npm
78+
warn: --compatible not supported by npm
7979
Package Current Wanted Latest Location Depended by
8080
test-vite-plus-other-optional <semver> <semver> <semver> node_modules/test-vite-plus-other-optional command-outdated-npm10
8181
test-vite-plus-top-package <semver> <semver> <semver> node_modules/test-vite-plus-top-package command-outdated-npm10
8282
testnpm2 <semver> <semver> <semver> node_modules/testnpm2 command-outdated-npm10
8383

8484
[1]> json-edit package.json '_.optionalDependencies["test-vite-plus-other-optional"] = "^1.0.0"' && vp outdated --compatible # should support compatible output with optional dependencies
85-
warn: --compatible not supported by npm
85+
warn: --compatible not supported by npm
8686
Package Current Wanted Latest Location Depended by
8787
test-vite-plus-other-optional <semver> <semver> <semver> node_modules/test-vite-plus-other-optional command-outdated-npm10
8888
test-vite-plus-top-package <semver> <semver> <semver> node_modules/test-vite-plus-top-package command-outdated-npm10
8989
testnpm2 <semver> <semver> <semver> node_modules/testnpm2 command-outdated-npm10
9090

9191
[1]> vp outdated --sort-by name # should support sort-by output
92-
warn: --sort-by not supported by npm
92+
warn: --sort-by not supported by npm
9393
Package Current Wanted Latest Location Depended by
9494
test-vite-plus-other-optional <semver> <semver> <semver> node_modules/test-vite-plus-other-optional command-outdated-npm10
9595
test-vite-plus-top-package <semver> <semver> <semver> node_modules/test-vite-plus-top-package command-outdated-npm10

packages/cli/snap-tests-global/command-outdated-yarn4/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
> vp outdated -- -h # should show yarn upgrade-interactive help
2-
note: yarn@2+ uses 'yarn upgrade-interactive' for checking outdated packages
2+
note: yarn@2+ uses 'yarn upgrade-interactive' for checking outdated packages
33
Open the upgrade interface
44

55
Usage

packages/cli/snap-tests-global/command-prune-yarn4/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Options:
1212
-h, --help Print help
1313

1414
> vp pm prune # should show warning that yarn does not support prune command
15-
warn: yarn does not have 'prune' command. yarn install will prune extraneous packages automatically.
15+
warn: yarn does not have 'prune' command. yarn install will prune extraneous packages automatically.

packages/cli/snap-tests-global/command-update-npm10-with-workspace/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ added 5 packages in <variable>ms
1414
}
1515

1616
> vp update testnpm2 --latest --filter app -- --no-audit && cat packages/app/package.json # should update in specific package
17-
warn: npm doesn't support --latest flag. Updating within semver range only.
17+
warn: npm doesn't support --latest flag. Updating within semver range only.
1818

1919
up to date in <variable>ms
2020
{

packages/cli/snap-tests-global/command-update-npm10/snap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ added 3 packages in <variable>ms
1717
}
1818

1919
> vp up testnpm2 --latest -- --no-audit && cat package.json # should to absolute latest version
20-
warn: npm doesn't support --latest flag. Updating within semver range only.
20+
warn: npm doesn't support --latest flag. Updating within semver range only.
2121

2222
up to date in <variable>ms
2323
{
@@ -76,7 +76,7 @@ up to date in <variable>ms
7676
removed 1 package in <variable>ms
7777

7878
added 1 package in <variable>ms
79-
warn: npm doesn't support --latest flag. Updating within semver range only.
79+
warn: npm doesn't support --latest flag. Updating within semver range only.
8080
npm warn config optional Use `--omit=optional` to exclude optional dependencies, or
8181
npm warn config `--include=optional` to include them.
8282
npm warn config

0 commit comments

Comments
 (0)