Skip to content

Commit

Permalink
chore: use pnpm (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito authored Jul 5, 2024
1 parent 6224ac7 commit 20bee31
Show file tree
Hide file tree
Showing 9 changed files with 4,078 additions and 3,765 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,40 @@ jobs:
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_RELEASE_TOKEN }}

- name: Setup Git
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
always-auth: true
registry-url: https://registry.npmjs.org

- name: Set up Git
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
useLockFile: false
version: 8.15

- name: Install dependencies
run: pnpm install

- name: Test the library
run: yarn test
- name: Tests
run: pnpm test

- name: Build the library
run: yarn build
- name: Build
run: pnpm build

- name: Publish
if: github.ref == 'refs/heads/main'
run: yarn release
run: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Dependencies
node_modules
yarn.lock
package-lock.json

# Build
lib
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ Using `invariant` reduces the visual nesting of the code and leads to cleaner er

```sh
npm install outvariant
# or
yarn add outvariant
```

> You may want to install this library as a dev dependency (`-D`) based on your usage.
Expand Down Expand Up @@ -89,7 +87,7 @@ invariant(
'firstName',
{
id: 1,
}
},
)
```

Expand Down Expand Up @@ -126,7 +124,7 @@ class NetworkError extends Error {
invariant.as(
(message) => new NetworkError(500, message),
res.fulfilled,
'Failed to handle response'
'Failed to handle response',
)
```

Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"license": "MIT",
"scripts": {
"test": "jest",
"clean": "rimraf ./lib",
"build": "yarn clean && tsup",
"prepublishOnly": "yarn test && yarn build",
"build": "tsup",
"prepublishOnly": "pnpm test && pnpm build",
"release": "release publish"
},
"files": [
Expand All @@ -32,9 +31,9 @@
],
"devDependencies": {
"@ossjs/release": "^0.8.0",
"@types/jest": "^26.0.23",
"@types/jest": "^27.5.2",
"@types/node": "^18.0.0",
"jest": "^27.0.6",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.3",
"ts-node": "^10.0.0",
"tsup": "^6.2.3",
Expand All @@ -44,4 +43,4 @@
"type": "git",
"url": "https://github.com/open-draft/outvariant"
}
}
}
Loading

0 comments on commit 20bee31

Please sign in to comment.