Skip to content

Commit

Permalink
πŸ”¨ feat: Migrate to pnpm (#9516)
Browse files Browse the repository at this point in the history
* πŸ”¨ feat: replacing yarn by pnpm

* πŸ”¨ chore: Update package.json

* πŸ› οΈ feat: Update GitHub Actions

* πŸ”¨ feat: Install pnpm for compressed-size workflow

* πŸ”¨ feat: Use setup-node for compress-size.yml

* fix: fix syntax

* πŸ”¨ feat: use pnpm link for start command

* πŸ§ͺ feat: use pnpm for automation workflow

* feat: no need to link react

(issues with 2 react(s) in the past)

* chore: add a build:watch script

* feat: do not need to link rhf to `app`

* remove the following script due to overlap

- coverage
- test:native
- test:server

Co-authored-by: Beier Luo <bluebill1049@hotmail.com>
  • Loading branch information
nvh95 and bluebill1049 committed Dec 5, 2022
1 parent fcd7985 commit c7210f1
Show file tree
Hide file tree
Showing 12 changed files with 8,539 additions and 8,049 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/api-extrator.yml
Expand Up @@ -5,16 +5,31 @@ on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Do we want to run with multiple versions of node?
node-version: [16]

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

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

- name: API Extractor
run: yarn api-extractor:ci
run: pnpm api-extractor:ci
8 changes: 7 additions & 1 deletion .github/workflows/automation.yml
Expand Up @@ -7,9 +7,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: npm run start
start: pnpm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
32 changes: 24 additions & 8 deletions .github/workflows/build-test.yml
Expand Up @@ -5,24 +5,40 @@ on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Do we want to run with multiple versions of node?
node-version: [16]

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Lint
run: |
yarn lint
yarn type
pnpm lint
pnpm type
# What is --ci?
- name: Test
run: |
yarn test --ci
yarn test:type
pnpm run test --ci
pnpm test:type
- name: Bundle watch
run: |
yarn bundlewatch
pnpm bundlewatch
9 changes: 9 additions & 0 deletions .github/workflows/compressed-size.yml
Expand Up @@ -8,6 +8,15 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
2 changes: 1 addition & 1 deletion .npmrc
@@ -1 +1 @@
package-lock=false
auto-install-peers=true
8 changes: 4 additions & 4 deletions app/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "react-hook-form",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"dev": "vite --force",
"build": "tsc && vite build",
"serve": "vite preview"
},
Expand All @@ -13,7 +13,7 @@
"joi": "^17.5.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-hook-form": "^7.25.0",
"react-hook-form": "file:..",
"react-router-dom": "^6.2.1",
"react-select": "^5.2.2",
"yup": "^0.32.8"
Expand All @@ -24,8 +24,8 @@
"@types/react-router-dom": "^5.3.3",
"@types/react-select": "^5.0.1",
"@types/yup": "^0.29.13",
"@vitejs/plugin-react": "^1.3.1",
"@vitejs/plugin-react": "^2.2.0",
"typescript": "^4.5.5",
"vite": "^2.9"
"vite": "^3.2.4"
}
}

0 comments on commit c7210f1

Please sign in to comment.