Skip to content

Commit

Permalink
chore: use pnpm instead of yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
geekact committed Nov 28, 2022
1 parent 17a349b commit 85d0ca7
Show file tree
Hide file tree
Showing 11 changed files with 5,779 additions and 5,383 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
branches: [ "master" ]
branches: ['master']
schedule:
- cron: "29 3 * * 1"
- cron: '29 3 * * 1'

jobs:
analyze:
Expand All @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ javascript ]
language: [javascript]

steps:
- name: Checkout
Expand All @@ -38,4 +38,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
category: '/language:${{ matrix.language }}'
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn install
- run: pnpm install
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn install
- run: pnpm install
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
Expand Down
64 changes: 45 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ on:
branches:

jobs:
formatting:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.17.1
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
- run: pnpm install
- run: npx --no-install prettier --cache --verbose --check .

type-checking:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
strategy:
Expand All @@ -19,18 +33,22 @@ jobs:
react-version: ['16.14.0', 16.x, 17.x, 18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.17.1
- name: Use Node.js ${{ matrix.node-version }} & Typescript ${{ matrix.ts-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
yarn install
yarn add --dev \
pnpm install
pnpm add -D \
typescript@${{ matrix.ts-version }} \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }}
- run: yarn tsc
- run: npx --no-install tsc --noEmit

react-16-17:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
Expand All @@ -40,19 +58,23 @@ jobs:
react-version: ['16.14.0', 16.x, 17.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.17.1
- name: Use Node.js ${{ matrix.node-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
yarn install
yarn add --dev \
pnpm install
pnpm add -D \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }} \
react-test-renderer@${{ matrix.react-version }} \
@testing-library/react@12
- run: yarn test --coverage=false
- run: pnpm run test --coverage=false

react-18:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
Expand All @@ -62,20 +84,24 @@ jobs:
react-version: [18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.17.1
- name: Use Node.js ${{ matrix.node-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
yarn install
yarn add --dev \
pnpm install
pnpm add -D \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }} \
react-test-renderer@${{ matrix.react-version }}
- run: yarn test
- run: pnpm run test
- name: Upload Coverage
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/master'
with:
name: coverage
Expand All @@ -88,10 +114,10 @@ jobs:
needs: react-18
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download Coverage
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install prettier --cache --check .
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
_sidebar.md
dist/
build/
coverage/
pnpm-lock.yaml
_sidebar.md
2 changes: 1 addition & 1 deletion .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ arrowParens: always
proseWrap: preserve
jsxSingleQuote: false
# Put > on the last line instead of at a new line.
jsxBracketSameLine: false
bracketSameLine: false
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"volta": {
"node": "16.16.0",
"yarn": "1.22.19"
"pnpm": "7.17.1"
},
"peerDependencies": {
"react": "^16.14 || ^17 || ^18",
Expand All @@ -66,29 +66,29 @@
"topic": "^3.0.2"
},
"devDependencies": {
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@redux-devtools/extension": "^3.2.3",
"@swc/core": "^1.3.14",
"@swc/core": "^1.3.20",
"@testing-library/react": "^13.4.0",
"@types/jest": "^29.2.2",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.8",
"@types/react-dom": "^18.0.9",
"browserslist": "^4.21.4",
"docsify-cli": "^4.4.4",
"husky": "^8.0.2",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"prettier": "^2.7.1",
"prettier": "^2.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rxjs": "^7.5.7",
"sleep-promise": "^9.1.0",
"ts-expect": "^1.3.0",
"ts-jest": "^29.0.3",
"tsup": "^6.4.0",
"typescript": "^4.8.4"
"tsup": "^6.5.0",
"typescript": "^4.9.3"
}
}
Loading

0 comments on commit 85d0ca7

Please sign in to comment.