Skip to content

Commit 20bee31

Browse files
authored
chore: use pnpm (#16)
1 parent 6224ac7 commit 20bee31

9 files changed

+4078
-3765
lines changed

.github/workflows/main.yml

+20-10
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,40 @@ jobs:
1818
access_token: ${{ secrets.GITHUB_TOKEN }}
1919

2020
- name: Checkout repository
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222
with:
2323
fetch-depth: 0
2424
token: ${{ secrets.GH_RELEASE_TOKEN }}
2525

26-
- name: Setup Git
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 18
30+
always-auth: true
31+
registry-url: https://registry.npmjs.org
32+
33+
- name: Set up Git
2734
run: |
2835
git config --local user.name "GitHub Actions"
2936
git config --local user.email "[email protected]"
3037
31-
- name: Install dependencies
32-
uses: bahmutov/npm-install@v1
38+
- name: Set up pnpm
39+
uses: pnpm/action-setup@v4
3340
with:
34-
useLockFile: false
41+
version: 8.15
42+
43+
- name: Install dependencies
44+
run: pnpm install
3545

36-
- name: Test the library
37-
run: yarn test
46+
- name: Tests
47+
run: pnpm test
3848

39-
- name: Build the library
40-
run: yarn build
49+
- name: Build
50+
run: pnpm build
4151

4252
- name: Publish
4353
if: github.ref == 'refs/heads/main'
44-
run: yarn release
54+
run: pnpm release
4555
env:
4656
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
4757
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Dependencies
22
node_modules
3+
yarn.lock
4+
package-lock.json
35

46
# Build
57
lib

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ Using `invariant` reduces the visual nesting of the code and leads to cleaner er
5252

5353
```sh
5454
npm install outvariant
55-
# or
56-
yarn add outvariant
5755
```
5856

5957
> You may want to install this library as a dev dependency (`-D`) based on your usage.
@@ -89,7 +87,7 @@ invariant(
8987
'firstName',
9088
{
9189
id: 1,
92-
}
90+
},
9391
)
9492
```
9593

@@ -126,7 +124,7 @@ class NetworkError extends Error {
126124
invariant.as(
127125
(message) => new NetworkError(500, message),
128126
res.fulfilled,
129-
'Failed to handle response'
127+
'Failed to handle response',
130128
)
131129
```
132130

package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
"license": "MIT",
1717
"scripts": {
1818
"test": "jest",
19-
"clean": "rimraf ./lib",
20-
"build": "yarn clean && tsup",
21-
"prepublishOnly": "yarn test && yarn build",
19+
"build": "tsup",
20+
"prepublishOnly": "pnpm test && pnpm build",
2221
"release": "release publish"
2322
},
2423
"files": [
@@ -32,9 +31,9 @@
3231
],
3332
"devDependencies": {
3433
"@ossjs/release": "^0.8.0",
35-
"@types/jest": "^26.0.23",
34+
"@types/jest": "^27.5.2",
35+
"@types/node": "^18.0.0",
3636
"jest": "^27.0.6",
37-
"rimraf": "^3.0.2",
3837
"ts-jest": "^27.0.3",
3938
"ts-node": "^10.0.0",
4039
"tsup": "^6.2.3",
@@ -44,4 +43,4 @@
4443
"type": "git",
4544
"url": "https://github.com/open-draft/outvariant"
4645
}
47-
}
46+
}

0 commit comments

Comments
 (0)