Skip to content

Commit 6cbc2a2

Browse files
authored
chore: use pnpm as package manager (#966)
2 parents 828b152 + efeceec commit 6cbc2a2

16 files changed

+7771
-30450
lines changed

.github/workflows/release.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,31 @@ permissions:
2323

2424
jobs:
2525
publish:
26-
name: Publish NPM package
26+
name: Publish package
2727
runs-on: ubuntu-latest
2828
# Avoid publishing in forks
2929
if: github.repository == 'testing-library/eslint-plugin-testing-library'
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v4
3333

34+
- name: Install pnpm
35+
uses: pnpm/action-setup@v4
36+
3437
- name: Set up Node
3538
uses: actions/setup-node@v4
3639
with:
37-
cache: npm
40+
cache: 'pnpm'
3841
node-version-file: '.nvmrc'
3942

4043
- name: Install dependencies
41-
run: npm install
44+
run: pnpm install
4245

4346
- name: Build package
44-
run: npm run build
47+
run: pnpm run build
4548

4649
- name: Release new version
47-
run: npx semantic-release
50+
run: pnpm exec semantic-release
4851
env:
4952
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5053
NPM_CONFIG_PROVENANCE: true

.github/workflows/smoke-test.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616

17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v4
19+
1720
- name: Use Node
1821
uses: actions/setup-node@v4
1922
with:
23+
cache: 'pnpm'
2024
node-version-file: '.nvmrc'
2125

2226
- run: |
23-
npm install
24-
npm run build
27+
pnpm install
28+
pnpm run build
2529
26-
- run: npm link
30+
- run: pnpm link
2731
working-directory: ./dist
2832

29-
- run: npm link eslint-plugin-testing-library
33+
- run: pnpm link eslint-plugin-testing-library
3034

3135
- uses: AriPerkkio/eslint-remote-tester-run-action@v4
3236
with:

.github/workflows/verifications.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v4
1818

19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
1922
- name: Set up Node
2023
uses: actions/setup-node@v4
2124
with:
22-
cache: npm
25+
cache: 'pnpm'
2326
node-version-file: '.nvmrc'
2427

2528
- name: Install dependencies
26-
run: npm install
29+
run: pnpm install
2730

2831
- name: Run script
29-
run: npm run ${{ matrix.validation-script }}
32+
run: pnpm run ${{ matrix.validation-script }}
3033

3134
tests:
3235
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }})
@@ -41,24 +44,23 @@ jobs:
4144
- name: Checkout
4245
uses: actions/checkout@v4
4346

47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v4
49+
4450
- name: Set up Node
4551
uses: actions/setup-node@v4
4652
with:
47-
cache: npm
53+
cache: 'pnpm'
4854
node-version: ${{ matrix.node }}
4955

5056
- name: Install dependencies
51-
run: npm install
52-
53-
# see https://github.com/npm/cli/issues/7349
54-
- if: ${{ matrix.eslint == 9 }}
55-
run: npm un @typescript-eslint/eslint-plugin eslint-plugin-jest eslint-doc-generator
57+
run: pnpm install
5658

5759
- name: Install ESLint v${{ matrix.eslint }}
58-
run: npm install --no-save --force eslint@${{ matrix.eslint }}
60+
run: pnpm add eslint@${{ matrix.eslint }}
5961

6062
- name: Run tests
61-
run: npm run test:ci
63+
run: pnpm run test:ci
6264

6365
- name: Upload coverage reports to Codecov
6466
uses: codecov/codecov-action@v5

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ yarn-error.log
6767
# Yarn Integrity file
6868
.yarn-integrity
6969

70-
# Ignore locks other than npm
71-
pnpm-lock.yaml
70+
# Ignore locks other than pnpm
71+
package-lock.json
7272
yarn.lock

.gitpod.yml

-2
This file was deleted.

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ dist
22
node_modules
33
coverage
44
.all-contributorsrc
5+
pnpm-lock.yaml

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Tweaking ESLint rules is mostly about traversing through the AST. [AST Explorer]
1111

1212
1. Fork this repository
1313
2. Clone your forked repository
14-
3. Run `npm install` to install corresponding dependencies
14+
3. Run `pnpm install` to install corresponding dependencies
1515
4. Create a branch for your PR named like `pr/your-branch-name` (you can do this through git CLI with `git checkout -b pr/your-branch-name`)
1616

1717
> Tip: Keep your `main` branch pointing at the original repository and make
@@ -63,7 +63,7 @@ each rule has three files named with its identifier (e.g. `no-debugging-utils`):
6363
6464
Additionally, you need to do a couple of extra things:
6565
66-
- Run `npm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
66+
- Run `pnpm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
6767
6868
### Custom rule creator
6969
@@ -99,7 +99,7 @@ If you need some check related to Testing Library which is not available in any
9999
- pass it through `helpers`
100100
- write some generic test within `fake-rule.ts`, which is a dumb rule to be able to test all enhanced behavior from our custom Rule Creator.
101101
102-
Take also into account that we're using our own `recommendedConfig` meta instead of the default `recommended` one. This is done so that our tools can automatically generate (`npm run generate:configs`) our configs.
102+
Take also into account that we're using our own `recommendedConfig` meta instead of the default `recommended` one. This is done so that our tools can automatically generate (`pnpm run generate:configs`) our configs.
103103
104104
## Updating existing rules
105105

lib/configs/angular.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THIS CODE WAS AUTOMATICALLY GENERATED
22
// DO NOT EDIT THIS CODE BY HAND
3-
// YOU CAN REGENERATE IT USING npm run generate:configs
3+
// YOU CAN REGENERATE IT USING pnpm run generate:configs
44

55
export = {
66
plugins: ['testing-library'],

lib/configs/dom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THIS CODE WAS AUTOMATICALLY GENERATED
22
// DO NOT EDIT THIS CODE BY HAND
3-
// YOU CAN REGENERATE IT USING npm run generate:configs
3+
// YOU CAN REGENERATE IT USING pnpm run generate:configs
44

55
export = {
66
plugins: ['testing-library'],

lib/configs/marko.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THIS CODE WAS AUTOMATICALLY GENERATED
22
// DO NOT EDIT THIS CODE BY HAND
3-
// YOU CAN REGENERATE IT USING npm run generate:configs
3+
// YOU CAN REGENERATE IT USING pnpm run generate:configs
44

55
export = {
66
plugins: ['testing-library'],

lib/configs/react.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THIS CODE WAS AUTOMATICALLY GENERATED
22
// DO NOT EDIT THIS CODE BY HAND
3-
// YOU CAN REGENERATE IT USING npm run generate:configs
3+
// YOU CAN REGENERATE IT USING pnpm run generate:configs
44

55
export = {
66
plugins: ['testing-library'],

lib/configs/vue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THIS CODE WAS AUTOMATICALLY GENERATED
22
// DO NOT EDIT THIS CODE BY HAND
3-
// YOU CAN REGENERATE IT USING npm run generate:configs
3+
// YOU CAN REGENERATE IT USING pnpm run generate:configs
44

55
export = {
66
plugins: ['testing-library'],

0 commit comments

Comments
 (0)