Skip to content

Commit 69bc1ee

Browse files
committed
use pnpm exec, bun x and npx
1 parent 5a557f3 commit 69bc1ee

File tree

2 files changed

+49
-49
lines changed

2 files changed

+49
-49
lines changed

integrations/upgrade/index.test.ts

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test(
2828
},
2929
},
3030
async ({ fs, exec, expect }) => {
31-
let output = await exec('npx @tailwindcss/upgrade')
31+
let output = await exec('pnpm exec upgrade')
3232
expect(output).toContain('Cannot find any CSS files that reference Tailwind CSS.')
3333

3434
// Files should not be modified
@@ -100,7 +100,7 @@ test(
100100
},
101101
},
102102
async ({ exec, fs, expect }) => {
103-
await exec('npx @tailwindcss/upgrade')
103+
await exec('pnpm exec upgrade')
104104

105105
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot(`
106106
"
@@ -158,7 +158,7 @@ test(
158158
})
159159

160160
// Ensure the v4 project compiles correctly
161-
await exec('npx tailwindcss --input src/input.css --output dist/out.css')
161+
await exec('pnpm exec tailwindcss --input src/input.css --output dist/out.css')
162162

163163
await fs.expectFileToContain('dist/out.css', [
164164
candidate`flex!`,
@@ -204,7 +204,7 @@ test(
204204
},
205205
},
206206
async ({ exec, fs, expect }) => {
207-
await exec('npx @tailwindcss/upgrade')
207+
await exec('pnpm exec upgrade')
208208

209209
expect(await fs.dumpFiles('./**/*.{html,php,txt}')).toMatchInlineSnapshot(`
210210
"
@@ -262,7 +262,7 @@ test(
262262
},
263263
},
264264
async ({ exec, fs, expect }) => {
265-
await exec('npx @tailwindcss/upgrade')
265+
await exec('pnpm exec upgrade')
266266

267267
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot(`
268268
"
@@ -334,7 +334,7 @@ test(
334334
},
335335
},
336336
async ({ exec, fs, expect }) => {
337-
await exec('npx @tailwindcss/upgrade')
337+
await exec('pnpm exec upgrade')
338338

339339
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
340340
"
@@ -406,7 +406,7 @@ test(
406406
},
407407
},
408408
async ({ exec, fs, expect }) => {
409-
await exec('npx @tailwindcss/upgrade')
409+
await exec('pnpm exec upgrade')
410410

411411
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
412412
"
@@ -483,7 +483,7 @@ test(
483483
},
484484
},
485485
async ({ exec, fs, expect }) => {
486-
await exec('npx @tailwindcss/upgrade')
486+
await exec('pnpm exec upgrade')
487487

488488
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
489489
"
@@ -586,7 +586,7 @@ test(
586586
},
587587
},
588588
async ({ exec, fs, expect }) => {
589-
await exec('npx @tailwindcss/upgrade')
589+
await exec('pnpm exec upgrade')
590590

591591
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
592592
"
@@ -694,7 +694,7 @@ test(
694694
},
695695
},
696696
async ({ exec, fs, expect }) => {
697-
await exec('npx @tailwindcss/upgrade')
697+
await exec('pnpm exec upgrade')
698698

699699
await fs.expectFileToContain(
700700
'postcss.config.js',
@@ -765,7 +765,7 @@ test(
765765
},
766766
},
767767
async ({ exec, fs, expect }) => {
768-
await exec('npx @tailwindcss/upgrade')
768+
await exec('pnpm exec upgrade')
769769

770770
let packageJsonContent = await fs.read('package.json')
771771
let packageJson = JSON.parse(packageJsonContent)
@@ -812,7 +812,7 @@ test(
812812
},
813813
},
814814
async ({ exec, fs, expect }) => {
815-
await exec('npx @tailwindcss/upgrade')
815+
await exec('pnpm exec upgrade')
816816

817817
let packageJsonContent = await fs.read('package.json')
818818
let packageJson = JSON.parse(packageJsonContent)
@@ -864,7 +864,7 @@ test(
864864
},
865865
},
866866
async ({ exec, fs, expect }) => {
867-
await exec('npx @tailwindcss/upgrade')
867+
await exec('pnpm exec upgrade')
868868

869869
await fs.expectFileToContain('src/index.css', css`@import 'tailwindcss';`)
870870
await fs.expectFileToContain(
@@ -940,7 +940,7 @@ test(
940940
},
941941
},
942942
async ({ exec, fs, expect }) => {
943-
await exec('npx @tailwindcss/upgrade')
943+
await exec('pnpm exec upgrade')
944944

945945
await fs.expectFileToContain('src/index.css', css`@import 'tailwindcss';`)
946946
await fs.expectFileToContain(
@@ -1007,7 +1007,7 @@ test(
10071007
},
10081008
},
10091009
async ({ exec, fs, expect }) => {
1010-
await exec('npx @tailwindcss/upgrade')
1010+
await exec('pnpm exec upgrade')
10111011

10121012
expect(await fs.dumpFiles('./src/**/*.html')).toMatchInlineSnapshot(`
10131013
"
@@ -1054,7 +1054,7 @@ test(
10541054
},
10551055
},
10561056
async ({ exec, fs, expect }) => {
1057-
await exec('npx @tailwindcss/upgrade')
1057+
await exec('pnpm exec upgrade')
10581058

10591059
expect(await fs.dumpFiles('./src/**/*.html')).toMatchInlineSnapshot(`
10601060
"
@@ -1098,7 +1098,7 @@ test(
10981098
},
10991099
},
11001100
async ({ exec, fs, expect }) => {
1101-
await exec('npx @tailwindcss/upgrade --force')
1101+
await exec('pnpm exec upgrade --force')
11021102

11031103
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
11041104
"
@@ -1170,7 +1170,7 @@ test(
11701170
},
11711171
},
11721172
async ({ exec, fs, expect }) => {
1173-
await exec('npx @tailwindcss/upgrade --force')
1173+
await exec('pnpm exec upgrade --force')
11741174

11751175
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
11761176
"
@@ -1281,7 +1281,7 @@ test(
12811281
},
12821282
},
12831283
async ({ exec, fs, expect }) => {
1284-
await exec('npx @tailwindcss/upgrade --force')
1284+
await exec('pnpm exec upgrade --force')
12851285

12861286
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
12871287
"
@@ -1414,7 +1414,7 @@ test(
14141414
},
14151415
},
14161416
async ({ exec, fs, expect }) => {
1417-
let output = await exec('npx @tailwindcss/upgrade --force')
1417+
let output = await exec('pnpm exec upgrade --force')
14181418

14191419
expect(output).toMatch(
14201420
/You have one or more stylesheets that are imported into a utility layer and non-utility layer./,
@@ -1538,7 +1538,7 @@ test(
15381538
},
15391539
},
15401540
async ({ exec, fs, expect }) => {
1541-
await exec('npx @tailwindcss/upgrade --force')
1541+
await exec('pnpm exec upgrade --force')
15421542

15431543
expect(await fs.dumpFiles('./src/**/*.{html,css}')).toMatchInlineSnapshot(`
15441544
"
@@ -1763,8 +1763,8 @@ test(
17631763
},
17641764
},
17651765
async ({ exec, expect }) => {
1766-
let output = await exec('npx @tailwindcss/upgrade --force', {}, { ignoreStdErr: true }).catch(
1767-
(e) => e.toString(),
1766+
let output = await exec('pnpm exec upgrade --force', {}, { ignoreStdErr: true }).catch((e) =>
1767+
e.toString(),
17681768
)
17691769

17701770
expect(output).toMatch('Could not determine configuration file for:')
@@ -1835,7 +1835,7 @@ test(
18351835
},
18361836
},
18371837
async ({ exec, fs, expect }) => {
1838-
await exec('npx @tailwindcss/upgrade --force')
1838+
await exec('pnpm exec upgrade --force')
18391839

18401840
expect(await fs.dumpFiles('./src/**/*.{html,css}')).toMatchInlineSnapshot(`
18411841
"
@@ -1971,7 +1971,7 @@ test(
19711971
},
19721972
},
19731973
async ({ exec, fs, expect }) => {
1974-
await exec('npx @tailwindcss/upgrade --force')
1974+
await exec('pnpm exec upgrade --force')
19751975

19761976
expect(await fs.dumpFiles('./src/**/*.{html,css}')).toMatchInlineSnapshot(`
19771977
"
@@ -2091,7 +2091,7 @@ test(
20912091
},
20922092
},
20932093
async ({ exec, fs, expect }) => {
2094-
await exec('npx @tailwindcss/upgrade --force')
2094+
await exec('pnpm exec upgrade --force')
20952095

20962096
expect(await fs.dumpFiles('./src/**/*.{html,css}')).toMatchInlineSnapshot(`
20972097
"
@@ -2171,7 +2171,7 @@ test(
21712171
},
21722172
},
21732173
async ({ exec, fs, expect }) => {
2174-
await exec('npx @tailwindcss/upgrade --force')
2174+
await exec('pnpm exec upgrade --force')
21752175

21762176
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
21772177
"
@@ -2255,7 +2255,7 @@ test(
22552255
},
22562256
},
22572257
async ({ exec, fs, expect }) => {
2258-
await exec('npx @tailwindcss/upgrade --force')
2258+
await exec('pnpm exec upgrade --force')
22592259

22602260
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
22612261
"
@@ -2309,7 +2309,7 @@ test(
23092309
},
23102310
},
23112311
async ({ exec, fs, expect }) => {
2312-
await exec('npx @tailwindcss/upgrade --force')
2312+
await exec('pnpm exec upgrade --force')
23132313
23142314
let pkg = JSON.parse(await fs.read('package.json'))
23152315
@@ -2388,7 +2388,7 @@ test(
23882388
},
23892389
},
23902390
async ({ exec, fs, expect }) => {
2391-
await exec('npx @tailwindcss/upgrade --force')
2391+
await exec('pnpm exec upgrade --force')
23922392
23932393
// Files should not be modified
23942394
expect(await fs.dumpFiles('./*.{js,css,html}')).toMatchInlineSnapshot(`
@@ -2486,7 +2486,7 @@ test(
24862486
},
24872487
},
24882488
async ({ exec, fs, expect }) => {
2489-
await exec('npx @tailwindcss/upgrade --force')
2489+
await exec('pnpm exec upgrade --force')
24902490
24912491
// Files should not be modified
24922492
expect(await fs.dumpFiles('./*.{js,css,html,tsx}')).toMatchInlineSnapshot(`
@@ -2593,7 +2593,7 @@ test(
25932593
},
25942594
},
25952595
async ({ exec, fs, expect }) => {
2596-
await exec('npx @tailwindcss/upgrade ./src/index.css')
2596+
await exec('pnpm exec upgrade ./src/index.css')
25972597

25982598
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot(`
25992599
"
@@ -2719,7 +2719,7 @@ test(
27192719
},
27202720
},
27212721
async ({ exec, fs, expect }) => {
2722-
await exec('npx @tailwindcss/upgrade')
2722+
await exec('pnpm exec upgrade')
27232723
27242724
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot(`
27252725
"
@@ -2805,7 +2805,7 @@ test(
28052805
},
28062806
},
28072807
async ({ exec, fs, expect }) => {
2808-
await exec('npx @tailwindcss/upgrade')
2808+
await exec('pnpm exec upgrade')
28092809
28102810
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot(`
28112811
"
@@ -2873,7 +2873,7 @@ test(
28732873
},
28742874
},
28752875
async ({ exec, root, fs, expect }) => {
2876-
await exec('npx @tailwindcss/upgrade')
2876+
await exec('pnpm exec upgrade')
28772877
28782878
let before = await fs.dumpFiles('./src/**/*.{css,html}')
28792879
expect(before).toMatchInlineSnapshot(`
@@ -2915,7 +2915,7 @@ test(
29152915
}
29162916
29172917
// Run the upgrade again
2918-
let output = await exec('npx @tailwindcss/upgrade')
2918+
let output = await exec('pnpm exec upgrade')
29192919
expect(output).toContain('No changes were made to your repository')
29202920
29212921
let after = await fs.dumpFiles('./src/**/*.{css,html}')
@@ -2994,7 +2994,7 @@ test(
29942994
},
29952995
},
29962996
async ({ exec, fs, expect }) => {
2997-
await exec('npx @tailwindcss/upgrade')
2997+
await exec('pnpm exec upgrade')
29982998

29992999
expect(await fs.dumpFiles('./src/**/*.{css,html}')).toMatchInlineSnapshot(`
30003000
"
@@ -3043,7 +3043,7 @@ test(
30433043
},
30443044
},
30453045
async ({ exec, fs, expect }) => {
3046-
await exec('npx @tailwindcss/upgrade')
3046+
await exec('pnpm exec upgrade')
30473047

30483048
expect(await fs.dumpFiles('./src/**/{*,.env,.env.*}')).toMatchInlineSnapshot(`
30493049
"
@@ -3114,7 +3114,7 @@ test(
31143114
},
31153115
},
31163116
async ({ exec, fs, expect }) => {
3117-
await exec('npx @tailwindcss/upgrade')
3117+
await exec('pnpm exec upgrade')
31183118

31193119
expect(await fs.dumpFiles('./{src,templates}/**/*')).toMatchInlineSnapshot(`
31203120
"
@@ -3190,7 +3190,7 @@ test(
31903190
let originalKeepFile = await fs.read('src/keep.php')
31913191
let originalTemplate = await fs.read('src/templates/template-0.php')
31923192

3193-
let process = await spawn('npx @tailwindcss/upgrade --force', {
3193+
let process = await spawn('pnpm exec upgrade --force', {
31943194
env: {
31953195
NODE_OPTIONS: '--require=./hook.cjs',
31963196
},
@@ -3257,7 +3257,7 @@ test(
32573257
},
32583258
},
32593259
async ({ root, exec, fs, expect }) => {
3260-
let stdout = await exec('npx @tailwindcss/upgrade', {
3260+
let stdout = await exec('pnpm exec upgrade', {
32613261
cwd: path.join(root, 'project-a'),
32623262
})
32633263

@@ -3331,7 +3331,7 @@ test(
33313331
},
33323332
},
33333333
async ({ exec, fs, expect }) => {
3334-
let stdout = await exec('npx @tailwindcss/upgrade')
3334+
let stdout = await exec('pnpm exec upgrade')
33353335

33363336
expect(stdout).not.toContain(
33373337
'Running this command will add the dependency to the workspace root',
@@ -3407,7 +3407,7 @@ test(
34073407
},
34083408
},
34093409
async ({ exec, fs, expect }) => {
3410-
await exec('npx @tailwindcss/upgrade')
3410+
await exec('pnpm exec upgrade')
34113411

34123412
expect(await fs.dumpFiles('./src/**/*.{css,vue}')).toMatchInlineSnapshot(`
34133413
"

0 commit comments

Comments
 (0)