Skip to content

Commit 4de8a9f

Browse files
nurazon59fengmk2
andauthored
chore(tools): prevent false-positive <repeat> replacement on trailing plus (#1524)
Discovered while reviewing CI results after approving #1508. The regex `/\++\n/g` was overly aggressive and matched any line ending with a single `+`, including legitimate text like "Vite+" in the CLI help output. Changed to `/\+{2,}\n/g` to only match pnpm's actual repeated `+` progress indicators (e.g., `+++`). --------- Co-authored-by: nurazon59 <nurazon59@users.noreply.github.com> Co-authored-by: MK <fengmk2@gmail.com>
1 parent 7dc7d1e commit 4de8a9f

103 files changed

Lines changed: 150 additions & 128 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/cli/snap-tests-global/cli-helper-message/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Usage: vp [COMMAND]
44

55
Start:
66
create Create a new project from a template
7-
migrate Migrate an existing project to Vite+<repeat>
7+
migrate Migrate an existing project to Vite+
88
config Configure hooks and agent integration
99
staged Run linters on staged files
1010
install, i Install all dependencies, or add packages if package names are provided

packages/cli/snap-tests-global/command-add-pnpm10-with-workspace/snap.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ devDependencies:
55
+ testnpm2 ^1.0.1
66

77
Packages: +<variable>
8-
+<repeat>
8+
+
99
Done in <variable>ms using pnpm v<semver>
1010
{
1111
"name": "command-add-pnpm10-with-workspace",
@@ -38,7 +38,7 @@ Done in <variable>ms using pnpm v<semver>
3838

3939
> vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app
4040
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
41-
. | +1 +<repeat>
41+
. | +1 +
4242
Done in <variable>ms using pnpm v<semver>
4343
{
4444
"name": "command-add-pnpm10-with-workspace",
@@ -125,7 +125,7 @@ Done in <variable>ms using pnpm v<semver>
125125
}
126126

127127
> vp install test-vite-plus-package@1.0.0 --filter "*" --workspace-root --save-catalog && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command
128-
. | +1 +<repeat>
128+
. | +1 +
129129
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
130130
Done in <variable>ms using pnpm v<semver>
131131
{
@@ -167,7 +167,7 @@ catalog:
167167

168168
> vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 && cat packages/app/package.json pnpm-workspace.yaml # should add with save-catalog-name
169169
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
170-
. | +1 +<repeat>
170+
. | +1 +
171171
Done in <variable>ms using pnpm v<semver>
172172
{
173173
"name": "app",

packages/cli/snap-tests-global/command-add-pnpm10/snap.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For more information, try '--help'.
3636

3737
> vp add testnpm2 -D -- --loglevel=verbose --verbose && cat package.json # should add package as dev dependencies
3838
Packages: +<variable>
39-
+<repeat>
39+
+
4040
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
4141

4242
devDependencies:
@@ -54,7 +54,7 @@ Done in <variable>ms using pnpm v<semver>
5454

5555
> vp add testnpm2 test-vite-plus-install --allow-build=test-vite-plus-install && cat package.json # should add packages to dependencies
5656
Packages: +<variable>
57-
+<repeat>
57+
+
5858
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
5959

6060
dependencies:
@@ -75,7 +75,7 @@ Done in <variable>ms using pnpm v<semver>
7575

7676
> vp install test-vite-plus-package@1.0.0 --save-peer && cat package.json # should install package alias for add
7777
Packages: +<variable>
78-
+<repeat>
78+
+
7979
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
8080

8181
peerDependencies:
@@ -103,7 +103,7 @@ Done in <variable>ms using pnpm v<semver>
103103

104104
> vp add test-vite-plus-package-optional -O && cat package.json # should add package as optional dependencies
105105
Packages: +<variable>
106-
+<repeat>
106+
+
107107
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
108108

109109
optionalDependencies:

packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/snap.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ devDependencies:
55
+ testnpm2 ^1.0.1
66

77
Packages: +<variable>
8-
+<repeat>
8+
+
99
Done in <variable>ms using pnpm v<semver>
1010
{
1111
"name": "command-add-pnpm11-with-workspace",
@@ -38,7 +38,7 @@ Done in <variable>ms using pnpm v<semver>
3838

3939
> vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app
4040
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
41-
. | +1 +<repeat>
41+
. | +1 +
4242
Done in <variable>ms using pnpm v<semver>
4343
{
4444
"name": "command-add-pnpm11-with-workspace",
@@ -126,7 +126,7 @@ Done in <variable>ms using pnpm v<semver>
126126
}
127127

128128
> vp install test-vite-plus-package@1.0.0 --filter "*" --workspace-root --save-catalog && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command
129-
. | +1 +<repeat>
129+
. | +1 +
130130
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
131131
Done in <variable>ms using pnpm v<semver>
132132
{
@@ -168,7 +168,7 @@ catalog:
168168

169169
> vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 && cat packages/app/package.json pnpm-workspace.yaml # should add with save-catalog-name
170170
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
171-
. | +1 +<repeat>
171+
. | +1 +
172172
Done in <variable>ms using pnpm v<semver>
173173
{
174174
"name": "app",

packages/cli/snap-tests-global/command-add-pnpm11/snap.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For more information, try '--help'.
3636

3737
> vp add testnpm2 -D -- --loglevel=verbose --verbose && cat package.json # should add package as dev dependencies
3838
Packages: +<variable>
39-
+<repeat>
39+
+
4040
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
4141

4242
devDependencies:
@@ -54,7 +54,7 @@ Done in <variable>ms using pnpm v<semver>
5454

5555
> vp add testnpm2 test-vite-plus-install --allow-build=test-vite-plus-install && cat package.json # should add packages to dependencies
5656
Packages: +<variable>
57-
+<repeat>
57+
+
5858
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
5959

6060
dependencies:
@@ -75,7 +75,7 @@ Done in <variable>ms using pnpm v<semver>
7575

7676
> vp install test-vite-plus-package@1.0.0 --save-peer && cat package.json # should install package alias for add
7777
Packages: +<variable>
78-
+<repeat>
78+
+
7979
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
8080

8181
peerDependencies:
@@ -103,7 +103,7 @@ Done in <variable>ms using pnpm v<semver>
103103

104104
> vp add test-vite-plus-package-optional -O && cat package.json # should add package as optional dependencies
105105
Packages: +<variable>
106-
+<repeat>
106+
+
107107
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
108108

109109
optionalDependencies:

packages/cli/snap-tests-global/command-add-pnpm9-with-workspace/snap.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ devDependencies:
55
+ testnpm2 ^1.0.1
66

77
Packages: +<variable>
8-
+<repeat>
8+
+
99
Done in <variable>ms using pnpm v<semver>
1010
{
1111
"name": "command-add-pnpm9-with-workspace",
@@ -22,7 +22,7 @@ Done in <variable>ms using pnpm v<semver>
2222
> vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app
2323
. |  WARN  `node_modules` is present. Lockfile only installation will make it out-of-date
2424
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
25-
. | +1 +<repeat>
25+
. | +1 +
2626
Done in <variable>ms using pnpm v<semver>
2727
{
2828
"name": "command-add-pnpm9-with-workspace",
@@ -101,7 +101,7 @@ Done in <variable>ms using pnpm v<semver>
101101
}
102102

103103
> vp install test-vite-plus-package@1.0.0 --filter "*" --workspace-root && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command
104-
. | +1 +<repeat>
104+
. | +1 +
105105
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
106106
Done in <variable>ms using pnpm v<semver>
107107
{

packages/cli/snap-tests-global/command-add-pnpm9/snap.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Documentation: https://viteplus.dev/guide/install
2828

2929
> vp add testnpm2 -D && cat package.json # should add package as dev dependencies
3030
Packages: +<variable>
31-
+<repeat>
31+
+
3232
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
3333

3434
devDependencies:
@@ -46,7 +46,7 @@ Done in <variable>ms using pnpm v<semver>
4646

4747
> vp add testnpm2 test-vite-plus-install && cat package.json # should add packages to dependencies
4848
Packages: +<variable>
49-
+<repeat>
49+
+
5050
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
5151

5252
dependencies:
@@ -71,7 +71,7 @@ For help, run: pnpm help add
7171

7272
> vp install test-vite-plus-package@1.0.0 --save-peer && cat package.json # should install package alias for add
7373
Packages: +<variable>
74-
+<repeat>
74+
+
7575
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
7676

7777
peerDependencies:
@@ -99,7 +99,7 @@ Done in <variable>ms using pnpm v<semver>
9999

100100
> vp add test-vite-plus-package-optional -O && cat package.json # should add package as optional dependencies
101101
Packages: +<variable>
102-
+<repeat>
102+
+
103103
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
104104

105105
optionalDependencies:

packages/cli/snap-tests-global/command-install-auto-create-package-json/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ no package.json
88
}
99
> vp add testnpm2 -D && cat package.json # should add package to auto-created package.json
1010
Packages: +<variable>
11-
+<repeat>
11+
+
1212
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
1313

1414
devDependencies:

packages/cli/snap-tests-global/command-link-pnpm10/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Documentation: https://viteplus.dev/guide/install
1515

1616
> vp install # install initial dependencies
1717
Packages: +<variable>
18-
+<repeat>
18+
+
1919
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
2020

2121
dependencies:

packages/cli/snap-tests-global/command-link-pnpm11/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Documentation: https://viteplus.dev/guide/install
1515

1616
> vp install # install initial dependencies
1717
Packages: +<variable>
18-
+<repeat>
18+
+
1919
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
2020

2121
dependencies:

0 commit comments

Comments
 (0)