Skip to content

Commit 2347435

Browse files
authored
chore: use pnpm instead of yarn (#36)
* chore: use pnpm instead of yarn * chore: add files to prettierignore * chore: use pnpm caching example from readme * chore: fix pnpm scripts
1 parent 0c89a76 commit 2347435

File tree

6 files changed

+6839
-7604
lines changed

6 files changed

+6839
-7604
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- main
77

8-
env:
9-
YARN_CACHE_FOLDER: ~/.yarn
10-
118
jobs:
129
release:
1310
name: Release
@@ -19,27 +16,28 @@ jobs:
1916
fetch-depth: 0
2017

2118
- name: Setup Node.js
22-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v2
2320
with:
24-
node-version: 14
21+
node-version: '14'
2522

26-
- name: Caching
23+
- name: Cache pnpm modules
2724
uses: actions/cache@v2
2825
with:
29-
path: ${{ env.YARN_CACHE_FOLDER }}
30-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
26+
path: ~/.pnpm-store
27+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3128
restore-keys: |
32-
${{ runner.OS }}-yarn-${{ env.cache-name }}
33-
${{ runner.OS }}-yarn-
29+
${{ runner.os }}-
3430
35-
- name: Installing dependencies
36-
run: yarn install --frozen-lockfile
31+
- uses: pnpm/[email protected]
32+
with:
33+
version: 6
34+
run_install: true
3735

3836
- name: Build
39-
run: yarn build
37+
run: pnpm run build
4038

4139
- name: Release
4240
env:
4341
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4442
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45-
run: yarn release
43+
run: pnpm run release

.github/workflows/tests.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Tests
2-
32
on:
43
pull_request:
54
branches:
@@ -8,9 +7,6 @@ on:
87
branches:
98
- main
109

11-
env:
12-
YARN_CACHE_FOLDER: ~/.yarn
13-
1410
jobs:
1511
unit-tests:
1612
name: Unit tests
@@ -22,24 +18,25 @@ jobs:
2218
fetch-depth: 0
2319

2420
- name: Setup Node.js
25-
uses: actions/setup-node@v1
21+
uses: actions/setup-node@v2
2622
with:
27-
node-version: 14
23+
node-version: '14'
2824

29-
- name: Caching
25+
- name: Cache pnpm modules
3026
uses: actions/cache@v2
3127
with:
32-
path: ${{ env.YARN_CACHE_FOLDER }}
33-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3430
restore-keys: |
35-
${{ runner.OS }}-yarn-${{ env.cache-name }}
36-
${{ runner.OS }}-yarn-
31+
${{ runner.os }}-
3732
38-
- name: Installing dependencies
39-
run: yarn install --frozen-lockfile
33+
- uses: pnpm/[email protected]
34+
with:
35+
version: 6
36+
run_install: true
4037

4138
- name: Unit test
42-
run: yarn test
39+
run: pnpm run test
4340

4441
- uses: artiomtr/[email protected]
4542
if: "github.event_name == 'pull_request'"
@@ -57,24 +54,25 @@ jobs:
5754
fetch-depth: 0
5855

5956
- name: Setup Node.js
60-
uses: actions/setup-node@v1
57+
uses: actions/setup-node@v2
6158
with:
62-
node-version: 14
59+
node-version: '14'
6360

64-
- name: Caching
61+
- name: Cache pnpm modules
6562
uses: actions/cache@v2
6663
with:
67-
path: ${{ env.YARN_CACHE_FOLDER }}
68-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
64+
path: ~/.pnpm-store
65+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
6966
restore-keys: |
70-
${{ runner.OS }}-yarn-${{ env.cache-name }}
71-
${{ runner.OS }}-yarn-
67+
${{ runner.os }}-
7268
73-
- name: Installing dependencies
74-
run: yarn install --frozen-lockfile
69+
- uses: pnpm/[email protected]
70+
with:
71+
version: 6
72+
run_install: true
7573

7674
- name: Typecheck
77-
run: yarn typecheck
75+
run: pnpm run typecheck
7876

7977
lint:
8078
name: Lint
@@ -86,24 +84,25 @@ jobs:
8684
fetch-depth: 0
8785

8886
- name: Setup Node.js
89-
uses: actions/setup-node@v1
87+
uses: actions/setup-node@v2
9088
with:
91-
node-version: 14
89+
node-version: '14'
9290

93-
- name: Caching
91+
- name: Cache pnpm modules
9492
uses: actions/cache@v2
9593
with:
96-
path: ${{ env.YARN_CACHE_FOLDER }}
97-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
94+
path: ~/.pnpm-store
95+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
9896
restore-keys: |
99-
${{ runner.OS }}-yarn-${{ env.cache-name }}
100-
${{ runner.OS }}-yarn-
97+
${{ runner.os }}-
10198
102-
- name: Installing dependencies
103-
run: yarn install --frozen-lockfile
99+
- uses: pnpm/[email protected]
100+
with:
101+
version: 6
102+
run_install: true
104103

105104
- name: Lint
106-
run: yarn lint
105+
run: pnpm run lint
107106

108107
check-format:
109108
name: Check format
@@ -115,21 +114,22 @@ jobs:
115114
fetch-depth: 0
116115

117116
- name: Setup Node.js
118-
uses: actions/setup-node@v1
117+
uses: actions/setup-node@v2
119118
with:
120-
node-version: 14
119+
node-version: '14'
121120

122-
- name: Caching
121+
- name: Cache pnpm modules
123122
uses: actions/cache@v2
124123
with:
125-
path: ${{ env.YARN_CACHE_FOLDER }}
126-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
124+
path: ~/.pnpm-store
125+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
127126
restore-keys: |
128-
${{ runner.OS }}-yarn-${{ env.cache-name }}
129-
${{ runner.OS }}-yarn-
127+
${{ runner.os }}-
130128
131-
- name: Installing dependencies
132-
run: yarn install --frozen-lockfile
129+
- uses: pnpm/[email protected]
130+
with:
131+
version: 6
132+
run_install: true
133133

134134
- name: Check format
135-
run: yarn lint:format
135+
run: pnpm run lint:format

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
dist/
22
coverage/
3+
pnpm-lock.yaml
4+
report.json

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"clean": "rm -rf dist/ node_modules/",
2323
"lint": "eslint --max-warnings 0 .",
2424
"lint:format": "prettier --check .",
25-
"start": "yarn build --watch",
25+
"start": "pnpm run build -- --watch",
2626
"test": "jest --forceExit --detectOpenHandles --testLocationInResults --json --outputFile=report.json",
27-
"test:watch": "yarn test --watch",
27+
"test:watch": "pnpm run test -- --watch",
2828
"typecheck": "tsc --noEmit",
2929
"release": "semantic-release"
3030
},
@@ -39,13 +39,14 @@
3939
"jest": "26.6.3",
4040
"mongodb": "3.6.10",
4141
"prettier": "2.3.1",
42-
"rollup": "2.52.2",
43-
"rollup-plugin-dts": "3.0.2",
44-
"rollup-plugin-typescript2": "0.30.0",
42+
"rollup": "2.60.2",
43+
"rollup-plugin-dts": "4.0.1",
44+
"rollup-plugin-typescript2": "0.31.1",
4545
"semantic-release": "18.0.0",
4646
"ts-jest": "26.5.6",
4747
"ts-node": "10.0.0",
48-
"typescript": "4.2.4"
48+
"tslib": "2.3.1",
49+
"typescript": "4.5.2"
4950
},
5051
"peerDependencies": {
5152
"mongodb": "^3.6.0"

0 commit comments

Comments
 (0)