Skip to content

Commit 7d66ecd

Browse files
authored
chore(package): switch to pnpm (#376)
* chore(package): manage with pnpm * ci: enable corepack * chore: fix linting * chore: correct formatting * chore(deps): add json-schema * chore(deps): update all minor
1 parent c9e8e16 commit 7d66ecd

File tree

11 files changed

+12711
-12702
lines changed

11 files changed

+12711
-12702
lines changed

.github/CONTRIBUTING.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
3232

33-
- Make sure `yarn test` passes. (see [development setup](#development-setup))
33+
- Make sure `pnpm test` passes. (see [development setup](#development-setup))
3434

3535
- If adding new feature:
3636

@@ -52,23 +52,23 @@
5252

5353
## Development Setup
5454

55-
You will need [Node.js](http://nodejs.org) and [Yarn](https://yarnpkg.com/en/)
55+
You will need [Node.js](http://nodejs.org) and [pnpm](https://pnpm.io/)
5656

5757
After cloning the repo, run:
5858

59-
$ yarn
59+
$ pnpm install
6060

61-
### Commonly used scirpt with Yarn
61+
### Commonly used scirpt with `pnpm`
6262

6363
# lint source codes and docs
64-
$ yarn lint
65-
$ yarn lint:docs
64+
$ pnpm lint
65+
$ pnpm lint:docs
6666

6767
# run the vuepress
68-
$ yarn docs
68+
$ pnpm docs
6969

7070
# run the test suite
71-
$ yarn test
71+
$ pnpm test
7272

7373
There are some other scripts available in the `scripts` section of the `package.json` file.
7474

.github/ISSUE_TEMPLATE/bug_report.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ about: Create a report to help us improve
66
<!--
77
Before posting the issue, please confirm that the problem you're getting
88
is not related with your code editor configuration.
9-
To make sure it's not, run: yarn eslint src/your-file.vue
9+
To make sure it's not, run: pnpm eslint src/your-file.vue
1010
-->
1111

1212
**Tell us about your environment**
@@ -46,5 +46,3 @@ about: Create a report to help us improve
4646
Please share a repository that can reproduce your issue.
4747
If you don't share it, we will most likely add a comment asking you to share the repository.
4848
-->
49-
50-

.github/workflows/test.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ jobs:
1818
uses: actions/setup-node@v3
1919
with:
2020
node-version: 16
21+
- name: Enable corepack
22+
run: corepack enable
2123
- name: Install
22-
run: yarn install
24+
run: pnpm install
2325
- name: Lint
24-
run: yarn lint
26+
run: pnpm lint
2527
- name: Lint docs
26-
run: yarn lint:docs
28+
run: pnpm lint:docs
2729
test:
2830
name: 'Test for ESLint 8 on Node.js ${{ matrix.node }} OS: ${{matrix.os}}'
2931
runs-on: ${{ matrix.os }}
@@ -38,14 +40,16 @@ jobs:
3840
uses: actions/setup-node@v3
3941
with:
4042
node-version: ${{ matrix.node }}
43+
- name: Enable corepack
44+
run: corepack enable
4145
- name: Install
42-
run: yarn install
46+
run: pnpm install
4347
- name: Test
44-
run: yarn test
48+
run: pnpm test
4549
- name: Integration Test
4650
run: |
47-
yarn build
48-
yarn test:integrations
51+
pnpm build
52+
pnpm test:integrations
4953
test-for-eslint:
5054
name: 'Test for ESLint ${{ matrix.eslint }} on ${{ matrix.node }} OS: ${{matrix.os}}'
5155
runs-on: ${{ matrix.os }}
@@ -61,10 +65,12 @@ jobs:
6165
uses: actions/setup-node@v3
6266
with:
6367
node-version: ${{ matrix.node }}
68+
- name: Enable corepack
69+
run: corepack enable
6470
- name: Install
65-
run: yarn add eslint@${{ matrix.eslint }}
71+
run: pnpm add eslint@${{ matrix.eslint }}
6672
- name: Install ts-eslint v5
67-
run: yarn add @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4
73+
run: pnpm add @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4
6874
if: matrix.eslint == 5
6975
- name: Test
70-
run: yarn test
76+
run: pnpm test

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"eslint.validate": ["javascript", "typescript", "vue", "markdown"],
33
"eslint.alwaysShowStatus": true,
4-
"eslint.packageManager": "yarn",
4+
"eslint.packageManager": "pnpm",
55
"eslint.run": "onSave",
6-
"npm.packageManager": "yarn",
6+
"npm.packageManager": "pnpm",
77
"editor.formatOnSave": true,
88
"editor.defaultFormatter": "esbenp.prettier-vscode"
99
}

lib/rules/key-format-style.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const allowedCaseOptions = [
1818
'snake_case',
1919
'SCREAMING_SNAKE_CASE'
2020
] as const
21-
type CaseOption = typeof allowedCaseOptions[number]
21+
type CaseOption = (typeof allowedCaseOptions)[number]
2222

2323
function create(context: RuleContext): RuleListener {
2424
const filename = context.getFilename()

lib/utils/casing.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const allowedCaseOptions = [
136136
* Return case checker
137137
*/
138138
export function getCasingChecker(
139-
name: typeof allowedCaseOptions[number]
139+
name: (typeof allowedCaseOptions)[number]
140140
): (str: string) => boolean {
141141
return checkersMap[name] || isPascalCase
142142
}

package.json

+48-43
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,61 @@
2424
}
2525
},
2626
"dependencies": {
27-
"@eslint/eslintrc": "^1.2.0",
28-
"@intlify/core-base": "^9.1.9",
29-
"@intlify/message-compiler": "^9.1.9",
30-
"debug": "^4.3.1",
31-
"glob": "^8.0.0",
32-
"ignore": "^5.0.5",
27+
"@eslint/eslintrc": "^1.4.1",
28+
"@intlify/core-base": "^9.2.2",
29+
"@intlify/message-compiler": "^9.2.2",
30+
"debug": "^4.3.4",
31+
"glob": "^8.1.0",
32+
"ignore": "^5.2.4",
3333
"is-language-code": "^3.1.0",
34-
"js-yaml": "^4.0.0",
35-
"json5": "^2.1.3",
36-
"jsonc-eslint-parser": "^2.0.0",
37-
"lodash": "^4.17.11",
38-
"parse5": "^7.0.0",
39-
"semver": "^7.3.4",
40-
"vue-eslint-parser": "^9.0.0",
41-
"yaml-eslint-parser": "^1.0.0"
34+
"js-yaml": "^4.1.0",
35+
"json5": "^2.2.3",
36+
"jsonc-eslint-parser": "^2.3.0",
37+
"lodash": "^4.17.21",
38+
"parse5": "^7.1.2",
39+
"semver": "^7.5.1",
40+
"vue-eslint-parser": "^9.3.0",
41+
"yaml-eslint-parser": "^1.2.2"
4242
},
4343
"devDependencies": {
44-
"@types/debug": "^4.1.5",
45-
"@types/eslint": "^8.0.0",
46-
"@types/eslint-scope": "^3.7.0",
44+
"@types/debug": "^4.1.7",
45+
"@types/eslint": "^8.37.0",
46+
"@types/eslint-scope": "^3.7.4",
4747
"@types/eslint-visitor-keys": "^1.0.0",
48-
"@types/js-yaml": "^4.0.0",
48+
"@types/glob": "^8.1.0",
49+
"@types/js-yaml": "^4.0.5",
50+
"@types/json-schema": "^7.0.11",
4951
"@types/json5": "^0.0.30",
50-
"@types/lodash": "^4.14.159",
51-
"@types/mocha": "^10.0.0",
52-
"@types/parse5": "^6.0.0",
53-
"@types/prettier": "^2.4.4",
54-
"@types/semver": "^7.3.4",
55-
"@typescript-eslint/eslint-plugin": "^5.2.0",
56-
"@typescript-eslint/parser": "^5.2.0",
57-
"entities": "^4.4.0",
58-
"eslint": "^8.1.0",
59-
"eslint-config-prettier": "^8.0.0",
52+
"@types/lodash": "^4.14.194",
53+
"@types/mocha": "^10.0.1",
54+
"@types/node": "^20.2.3",
55+
"@types/parse5": "^6.0.3",
56+
"@types/prettier": "^2.7.2",
57+
"@types/semver": "^7.5.0",
58+
"@typescript-eslint/eslint-plugin": "^5.59.6",
59+
"@typescript-eslint/parser": "^5.59.6",
60+
"entities": "^4.5.0",
61+
"eslint": "^8.41.0",
62+
"eslint-config-prettier": "^8.8.0",
6063
"eslint-plugin-markdown": "^3.0.0",
61-
"eslint-plugin-prettier": "^4.0.0",
62-
"eslint-plugin-vue": "^9.0.0",
63-
"eslint-plugin-vue-libs": "^3.0.0 || ^4.0.0",
64-
"eslint4b": "^7.16.0",
65-
"lerna-changelog": "^2.0.0",
66-
"mocha": "^10.0.0",
64+
"eslint-plugin-prettier": "^4.2.1",
65+
"eslint-plugin-vue": "^9.13.0",
66+
"eslint-plugin-vue-libs": "^4.0.0",
67+
"eslint4b": "^7.32.0",
68+
"json-schema": "^0.4.0",
69+
"lerna-changelog": "^2.2.0",
70+
"mocha": "^10.2.0",
6771
"monaco-editor": "^0.38.0",
68-
"nyc": "^15.0.0",
69-
"opener": "^1.5.1",
70-
"prettier": "^2.0.5",
71-
"rimraf": "^4.0.0",
72-
"shipjs": "^0.26.0",
73-
"ts-node": "^10.0.0",
74-
"typescript": "^5.0.0",
72+
"nyc": "^15.1.0",
73+
"opener": "^1.5.2",
74+
"prettier": "^2.8.8",
75+
"rimraf": "^4.4.1",
76+
"shipjs": "^0.26.3",
77+
"ts-node": "^10.9.1",
78+
"typescript": "^5.0.4",
7579
"vue-eslint-editor": "^1.1.0",
76-
"vue-github-button": "^1.2.0",
77-
"vuepress": "^1.8.2"
80+
"vue-github-button": "^1.3.0",
81+
"vuepress": "^1.9.9"
7882
},
7983
"engines": {
8084
"node": "^14.17.0 || >=16.0.0"
@@ -104,6 +108,7 @@
104108
"type": "git",
105109
"url": "git+https://github.com/intlify/eslint-plugin-vue-i18n.git"
106110
},
111+
"packageManager": "[email protected]",
107112
"scripts": {
108113
"build": "tsc --project ./tsconfig.build.json",
109114
"clean": "rimraf .nyc_output coverage dist docs/.vuepress/dist",

0 commit comments

Comments
 (0)