Skip to content

Commit

Permalink
refactor: migrate yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
kawamataryo committed Oct 5, 2024
1 parent 40b73cb commit 95f8420
Show file tree
Hide file tree
Showing 7 changed files with 5,708 additions and 5,699 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,43 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: yarn
node-version: 20.x
cache: pnpm
- name: Install
run: yarn install
run: pnpm i
- name: Lint
run: yarn run lint
run: pnpm run lint

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [18.x, 20.x]
os: [ubuntu-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
cache: yarn
cache: pnpm
- name: Install
run: yarn install
run: pnpm i
- name: Unit Test
run: yarn run test:ci
run: pnpm run test:ci
22 changes: 14 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
node-version: 20
cache: pnpm

- name: Install dependencies
run: yarn --frozen-lockfile
run: pnpm i

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

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
run: pnpm semantic-release
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
pnpm commitlint --edit $1
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ First, clone the forked repository locally.
$ git clone [email protected]:foo/suppress-ts-errors.git
```

Install dependent modules with [yarn](https://yarnpkg.com/).
If you do not have yarn, please install it beforehand.
Install dependent modules with pnpm
If you do not have pnpm, please install it beforehand.

```bash
$ yarn i
$ pnpm i
```

Run unit test with watch mode.

```bash
$ yarn test
$ pnpm test
```

That's it. Happy coding 👍
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.3.2",
"description": "cli tool to add comments to suppress typescript type errors",
"main": "index.js",
"preinstall": "npx only-allow pnpm",
"bin": {
"suppress-ts-errors": "dist/cli.js"
},
Expand Down
Loading

0 comments on commit 95f8420

Please sign in to comment.