Skip to content

Commit f27ddd0

Browse files
mcmxcdevdominikgbluwy
authored
chore: upgrade to pnpm 7 (#325)
* chore: upgrade to pnpm 7 - change pnpm engines version to v7 - remove outdated pnpm overrides - update GitHub Actions to run with pnpm v7 - update pre-commit hook to use locally installed lint-staged rather than pnpx one - change occurrences of "pnpm run" to shorter "pnpm" - install missing svelte peer dependency for ts-type-import package * fix .editorconfig configuration to include nested package.json * fix: heal lockfile with changes to package.json after rebase; update svelte version to match others * fix: update editorconfig to always use space ident in all READMEs * fix: remove extra -- from test server start scripts * fix: remove preferLocal, it somehow selected pnpm6 for me locally * fix: remove use of pnpx --no Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: dominikg <[email protected]> Co-authored-by: Bjorn Lu <[email protected]>
1 parent 6c1c55d commit f27ddd0

File tree

10 files changed

+175
-347
lines changed

10 files changed

+175
-347
lines changed

.editorconfig

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ indent_size = 2
88
charset = utf-8
99
trim_trailing_whitespace = true
1010

11-
[{package.json, README.md, docs/**/*.md}]
11+
[{**/package.json, **/README.md, docs/**/*.md}]
1212
indent_style = space
13-

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/setup-node@v3
2828
with:
2929
node-version: ${{ matrix.node }}
30-
- run: npm i -g pnpm@6
30+
- run: npm i -g pnpm@7
3131
- uses: actions/setup-node@v3
3232
with:
3333
node-version: ${{ matrix.node }}
@@ -37,10 +37,10 @@ jobs:
3737
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
3838
- name: build
3939
id: build
40-
run: pnpm run build
40+
run: pnpm build
4141
- name: lint
4242
if: (${{ success() }} || ${{ failure() }})
43-
run: pnpm run lint
43+
run: pnpm lint
4444
- name: audit
4545
if: (${{ success() }} || ${{ failure() }})
4646
run: pnpm audit
@@ -65,7 +65,7 @@ jobs:
6565
- uses: actions/setup-node@v3
6666
with:
6767
node-version: ${{ matrix.node }}
68-
- run: npm i -g pnpm@6
68+
- run: npm i -g pnpm@7
6969
- uses: actions/setup-node@v3
7070
with:
7171
node-version: ${{ matrix.node }}
@@ -74,7 +74,7 @@ jobs:
7474
- name: install
7575
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
7676
- name: build
77-
run: pnpm run build:ci
77+
run: pnpm build:ci
7878
- name: run tests
7979
run: pnpm test:ci
8080
- name: archive tests temp directory

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/setup-node@v3
2626
with:
2727
node-version: ${{ matrix.node }}
28-
- run: npm i -g pnpm@6
28+
- run: npm i -g pnpm@7
2929
- uses: actions/setup-node@v3
3030
with:
3131
node-version: ${{ matrix.node }}

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
pnpx --no-install lint-staged --concurrent false
4+
pnpm lint-staged --concurrent false

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ Please make sure the following is done when submitting a pull request:
7777

7878
1. Fork [the repository](https://github.com/sveltejs/vite-plugin-svelte) and create your branch from `main`.
7979
1. Describe your **test plan** in your pull request description. Make sure to test your changes.
80-
1. Make sure your code lints (`pnpm run lint`).
81-
1. Make sure your tests pass (`pnpm run test`).
80+
1. Make sure your code lints (`pnpm lint`).
81+
1. Make sure your tests pass (`pnpm test`).
8282

8383
All pull requests should be opened against the `main` branch.
8484

@@ -109,7 +109,7 @@ The core Svelte team will be monitoring for pull requests. Do help us by making
109109

110110
## Style guide
111111

112-
[Eslint](https://eslint.org) will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `pnpm run lint`.
112+
[Eslint](https://eslint.org) will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `pnpm lint`.
113113

114114
## License
115115

package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"test:ci:serve": "cross-env VITE_PRESERVE_BUILD_ARTIFACTS=1 jest --verbose --no-cache --runInBand --force-exit --ci --json --outputFile=\"temp/serve/jest-results.json\"",
1515
"test:ci:build": "cross-env VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 jest --verbose --no-cache --runInBand --force-exit --ci --json --outputFile=\"temp/build/jest-results.json\"",
1616
"lint": "eslint --ignore-path .gitignore '**/*.{js,ts,svelte,html,svx,md}'",
17-
"lint:fix": "pnpm run lint -- --fix",
17+
"lint:fix": "pnpm lint --fix",
1818
"format": "prettier --ignore-path .gitignore '**/*.{css,scss,svelte,html,js,ts,svx,md}' --check",
19-
"format:fix": "pnpm run format -- --write",
19+
"format:fix": "pnpm format --write",
2020
"fixup": "run-s lint:fix format:fix",
21-
"release": "pnpm run build && pnpx --no changeset publish",
21+
"release": "pnpm build && pnpm changeset publish",
2222
"prepare": "husky install"
2323
},
2424
"devDependencies": {
@@ -65,16 +65,14 @@
6565
]
6666
},
6767
"engines": {
68-
"pnpm": "^6.32.0",
68+
"pnpm": "^7.0.0",
6969
"yarn": "forbidden, use pnpm",
7070
"npm": "forbidden, use pnpm",
7171
"node": "^14.13.1 || >= 16"
7272
},
7373
"pnpm": {
7474
"overrides": {
75-
"@sveltejs/vite-plugin-svelte": "workspace:*",
76-
"ansi-regex@>2.1.1 <5.0.1": "^5.0.1",
77-
"node-fetch@2": "^2.6.7"
75+
"@sveltejs/vite-plugin-svelte": "workspace:*"
7876
}
7977
}
8078
}

packages/e2e-tests/e2e-server.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ exports.serve = async function serve(root, isBuild, port) {
8080

8181
try {
8282
const buildProcess = execa('pnpm', ['build'], {
83-
preferLocal: true,
8483
cwd: root,
8584
stdio: 'pipe'
8685
});
@@ -103,8 +102,7 @@ exports.serve = async function serve(root, isBuild, port) {
103102
}
104103
}
105104

106-
const serverProcess = execa('pnpm', [isBuild ? 'preview' : 'dev', '--', '--port', port], {
107-
preferLocal: true,
105+
const serverProcess = execa('pnpm', [isBuild ? 'preview' : 'dev', '--port', port], {
108106
cwd: root,
109107
stdio: 'pipe'
110108
});

packages/e2e-tests/ts-type-import/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@sveltejs/vite-plugin-svelte": "workspace:*",
1212
"@tsconfig/svelte": "^3.0.0",
1313
"@types/node": "^17.0.21",
14+
"svelte": "^3.48.0",
1415
"svelte-preprocess": "^4.10.6",
1516
"vite": "^2.9.8"
1617
}

packages/vite-plugin-svelte/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"./src/ui/*": "./src/ui/*"
2424
},
2525
"scripts": {
26-
"dev": "pnpm run build:ci -- --sourcemap --watch src",
26+
"dev": "pnpm build:ci --sourcemap --watch src",
2727
"build:ci": "rimraf dist && tsup-node src/index.ts --format esm,cjs --no-splitting --target node14",
28-
"build": "pnpm run build:ci -- --dts --sourcemap"
28+
"build": "pnpm build:ci --dts --sourcemap"
2929
},
3030
"engines": {
3131
"node": "^14.13.1 || >= 16"

0 commit comments

Comments
 (0)