Skip to content

Commit fa4adf6

Browse files
authored
chore: yarn to pnpm (#334)
* install pnpm and simple replace * fix a few issues * fix github actions * drop Node 12 * adjust deps version * more pnpm * back Node 12 * drop Node 12 again
1 parent 5cfccf9 commit fa4adf6

File tree

12 files changed

+68
-49
lines changed

12 files changed

+68
-49
lines changed

.changeset/lazy-walls-reflect.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-eslint-parser": minor
3+
---
4+
5+
Drop Node 12 support

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// "forwardPorts": [],
2424

2525
// Use 'postCreateCommand' to run commands after the container is created.
26-
"postCreateCommand": "yarn install",
26+
"postCreateCommand": "pnpm install",
2727

2828
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2929
"remoteUser": "node"

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module.exports = {
6969
"@typescript-eslint/no-use-before-define": "off",
7070
"@typescript-eslint/no-explicit-any": "off",
7171
"no-implicit-globals": "off",
72+
"no-void": ["error", { allowAsStatement: true }],
7273
},
7374
},
7475
{

.github/workflows/GHPages.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v3
28+
- uses: pnpm/action-setup@v2
2829
- uses: actions/setup-node@v3
2930
- name: Install And Build
3031
run: |+
31-
yarn install
32-
yarn build
32+
pnpm install
33+
pnpm run build
3334
cd explorer-v2
34-
yarn install
35-
yarn pre-build
36-
yarn build
35+
pnpm install
36+
pnpm run pre-build
37+
pnpm run build
3738
- name: Setup Pages
3839
uses: actions/configure-pages@v3
3940
- name: Upload artifact

.github/workflows/NodeCI.yml

+22-16
Original file line numberDiff line numberDiff line change
@@ -11,77 +11,82 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14+
- uses: pnpm/action-setup@v2
1415
- uses: actions/setup-node@v3
1516
- name: Install Packages
16-
run: yarn install
17+
run: pnpm install
1718
- name: Lint
18-
run: yarn lint
19+
run: pnpm run lint
1920
- name: Build
20-
run: yarn build
21+
run: pnpm run build
2122
test:
2223
runs-on: ubuntu-latest
2324
strategy:
2425
matrix:
25-
node-version: [12.x, 14.x, 16.x, 17.x, 18.x, 19.x]
26+
node-version: [14.x, 16.x, 17.x, 18.x, 19.x]
2627
steps:
2728
- uses: actions/checkout@v3
29+
- uses: pnpm/action-setup@v2
2830
- name: Use Node.js ${{ matrix.node-version }}
2931
uses: actions/setup-node@v3
3032
with:
3133
node-version: ${{ matrix.node-version }}
3234
- name: Install Packages
33-
run: yarn install --ignore-engines
35+
run: pnpm install
3436
- name: Test
35-
run: yarn test
37+
run: pnpm run test
3638
test-for-ts-eslint-v4:
3739
runs-on: ubuntu-latest
3840
strategy:
3941
matrix:
4042
node-version: [14.x]
4143
steps:
4244
- uses: actions/checkout@v3
45+
- uses: pnpm/action-setup@v2
4346
- name: Use Node.js ${{ matrix.node-version }}
4447
uses: actions/setup-node@v3
4548
with:
4649
node-version: ${{ matrix.node-version }}
4750
- name: Install @typescript-eslint v4
4851
run: |+
49-
yarn add -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7 --ignore-engines
52+
pnpm install -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7
5053
rm -rf node_modules
5154
- name: Install Packages
52-
run: yarn install --ignore-engines
55+
run: pnpm install
5356
- name: Test
54-
run: yarn test
57+
run: pnpm run test
5558
test-for-eslint-v7:
5659
runs-on: ubuntu-latest
5760
strategy:
5861
matrix:
5962
node-version: [14.x]
6063
steps:
6164
- uses: actions/checkout@v3
65+
- uses: pnpm/action-setup@v2
6266
- name: Use Node.js ${{ matrix.node-version }}
6367
uses: actions/setup-node@v3
6468
with:
6569
node-version: ${{ matrix.node-version }}
6670
- name: Install eslint v7
6771
run: |+
68-
yarn add -D eslint@7 --ignore-engines
72+
pnpm install -D eslint@7
6973
rm -rf node_modules
7074
- name: Install Packages
71-
run: yarn install --ignore-engines
75+
run: pnpm install
7276
- name: Test
73-
run: yarn test
77+
run: pnpm run test
7478
update-fixtures:
7579
runs-on: ubuntu-latest
7680
steps:
7781
- uses: actions/checkout@v3
82+
- uses: pnpm/action-setup@v2
7883
- uses: actions/setup-node@v3
7984
with:
8085
node-version: 18
8186
- name: Install Packages
82-
run: yarn install --ignore-engines
87+
run: pnpm install
8388
- name: Update fixtures
84-
run: yarn update-fixtures
89+
run: pnpm run update-fixtures
8590
- name: Check changes
8691
run: |
8792
git add --all && \
@@ -90,11 +95,12 @@ jobs:
9095
runs-on: ubuntu-latest
9196
steps:
9297
- uses: actions/checkout@v3
98+
- uses: pnpm/action-setup@v2
9399
- uses: actions/setup-node@v3
94100
- name: Install Packages
95-
run: yarn install --ignore-engines
101+
run: pnpm install
96102
- name: Test
97-
run: yarn cover
103+
run: pnpm run cover
98104
- name: Coveralls GitHub Action
99105
uses: coverallsapp/[email protected]
100106
with:

.github/workflows/Release.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,25 @@ jobs:
2121
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2222
fetch-depth: 0
2323

24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v2
26+
2427
- name: Setup Node.js 16
2528
uses: actions/setup-node@v3
2629
with:
2730
node-version: 16
2831

2932
- name: Install Dependencies
30-
run: yarn
33+
run: pnpm install
3134

3235
- name: Create Release Pull Request or Publish to npm
3336
id: changesets
3437
uses: changesets/action@v1
3538
with:
3639
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
37-
version: yarn version:ci
40+
version: pnpm run version:ci
3841
# This expects you to have a script called release which does a build for your packages and calls changeset publish
39-
publish: yarn release
42+
publish: pnpm run release
4043
commit: "chore: release svelte-eslint-parser"
4144
title: "chore: release svelte-eslint-parser"
4245
env:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ dist
104104
.tern-port
105105

106106
# repo
107-
yarn.lock
107+
/pnpm-lock.yaml
108108
/lib
109109
/.nyc_output
110110
/coverage

.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
package-lock=false
1+
package-lock=false
2+
enable-pre-post-scripts=true

explorer-v2/.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"useTabs": true,
33
"singleQuote": true,
44
"trailingComma": "none",
5-
"printWidth": 100
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"]
67
}

package.json

+20-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"funding": "https://github.com/sponsors/ota-meshi",
1212
"license": "MIT",
13-
"packageManager": "[email protected]",
13+
"packageManager": "[email protected]",
1414
"engines": {
1515
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
1616
},
@@ -25,25 +25,24 @@
2525
"parser"
2626
],
2727
"scripts": {
28-
"benchmark": "yarn ts benchmark/index.ts",
29-
"build": "yarn build:meta && yarn build:tsc",
30-
"build:meta": "yarn ts ./tools/update-meta.ts",
28+
"benchmark": "pnpm run ts benchmark/index.ts",
29+
"build": "pnpm run build:meta && pnpm run build:tsc",
30+
"build:meta": "pnpm run ts ./tools/update-meta.ts",
3131
"build:tsc": "tsc --project ./tsconfig.build.json",
3232
"clean": "rimraf .nyc_output lib coverage",
33-
"cover": "nyc --reporter=lcov yarn test",
34-
"debug": "yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
35-
"eslint-fix": "yarn lint --fix",
36-
"eslint-playground": "eslint tests/fixtures --ext .svelte --config .eslintrc-for-playground.js --format codeframe",
33+
"cover": "nyc --reporter=lcov pnpm run test",
34+
"debug": "pnpm run mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
35+
"eslint-fix": "pnpm run lint --fix",
3736
"lint": "eslint . --ext .js,.ts,.json,.yaml,.yml,.svelte",
38-
"mocha": "yarn ts ./node_modules/mocha/bin/mocha.js",
39-
"prebuild": "yarn clean",
40-
"prerelease": "yarn clean && yarn build",
41-
"preversion": "yarn lint && yarn test",
37+
"mocha": "pnpm run ts ./node_modules/mocha/bin/mocha.js",
38+
"prebuild": "pnpm run clean",
39+
"prerelease": "pnpm run clean && pnpm run build",
40+
"preversion": "pnpm run lint && pnpm run test",
4241
"release": "changeset publish",
43-
"test": "yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
42+
"test": "pnpm run mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
4443
"ts": "node -r esbuild-register",
45-
"update-fixtures": "yarn ts ./tools/update-fixtures.ts",
46-
"version:ci": "env-cmd -e version-ci yarn build:meta && changeset version"
44+
"update-fixtures": "pnpm run ts ./tools/update-fixtures.ts",
45+
"version:ci": "env-cmd -e version-ci pnpm run build:meta && changeset version"
4746
},
4847
"peerDependencies": {
4948
"svelte": "^3.37.0"
@@ -61,12 +60,14 @@
6160
"devDependencies": {
6261
"@changesets/changelog-github": "^0.4.6",
6362
"@changesets/cli": "^2.24.2",
63+
"@changesets/get-release-plan": "^3.0.0",
6464
"@ota-meshi/eslint-plugin": "^0.13.0",
6565
"@types/benchmark": "^2.1.1",
6666
"@types/chai": "^4.3.0",
6767
"@types/eslint": "^8.0.0",
6868
"@types/eslint-scope": "^3.7.0",
6969
"@types/eslint-visitor-keys": "^1.0.0",
70+
"@types/estree": "^1.0.0",
7071
"@types/mocha": "^10.0.0",
7172
"@types/node": "^18.11.0",
7273
"@types/semver": "^7.3.9",
@@ -78,7 +79,7 @@
7879
"esbuild": "^0.17.0",
7980
"esbuild-register": "^3.3.3",
8081
"eslint": "^8.2.0",
81-
"eslint-config-prettier": "^8.3.0",
82+
"eslint-config-prettier": "^8.8.0",
8283
"eslint-plugin-eslint-comments": "^3.2.0",
8384
"eslint-plugin-json-schema-validator": "^4.0.0",
8485
"eslint-plugin-jsonc": "^2.0.0",
@@ -88,17 +89,17 @@
8889
"eslint-plugin-regexp": "^1.5.0",
8990
"eslint-plugin-svelte": "^2.0.0",
9091
"eslint-plugin-svelte3": "^4.0.0",
91-
"eslint-plugin-vue": "^9.0.0",
9292
"eslint-plugin-yml": "^1.0.0",
9393
"estree-walker": "^3.0.0",
9494
"locate-character": "^2.0.5",
9595
"magic-string": "^0.30.0",
9696
"mocha": "^10.0.0",
9797
"mocha-chai-jest-snapshot": "^1.1.3",
9898
"nyc": "^15.1.0",
99-
"prettier": "^2.0.5",
99+
"prettier": "^2.8.0",
100100
"prettier-plugin-pkg": "^0.17.0",
101-
"prettier-plugin-svelte": "^2.5.0",
101+
"prettier-plugin-svelte": "^2.10.0",
102+
"rimraf": "^5.0.0",
102103
"semver": "^7.3.5",
103104
"string-replace-loader": "^3.0.3",
104105
"svelte": "^3.57.0",

src/meta.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// IMPORTANT!
22
// This file has been automatically generated,
3-
// in order to update its content execute "yarn build:meta"
3+
// in order to update its content execute "pnpm run build:meta"
44
export const name = "svelte-eslint-parser" as const;
55
export const version = "0.28.0" as const;

tools/update-meta.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function main() {
1818
`/*
1919
* IMPORTANT!
2020
* This file has been automatically generated,
21-
* in order to update its content execute "yarn build:meta"
21+
* in order to update its content execute "pnpm run build:meta"
2222
*/
2323
export const name = ${JSON.stringify(name)} as const;
2424
export const version = ${JSON.stringify(await getVersion())} as const;

0 commit comments

Comments
 (0)