Skip to content

Commit

Permalink
chore: migrate from yarn to pnpm package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
cchanxzy committed Nov 9, 2024
1 parent 1b9c978 commit 0279041
Show file tree
Hide file tree
Showing 11 changed files with 9,991 additions and 9,751 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: yarn
run: pnpm install
- name: Build examples
run: yarn gh-predeploy
run: pnpm gh-predeploy
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.6.2
with:
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: npm install -g yarn && yarn
run: pnpm install
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
run: pnpm playwright install --with-deps
- name: Run Playwright tests
run: yarn playwright test
run: pnpm playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@ jobs:
install-build-and-test:
name: Install, build and test PR
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: yarn
run: pnpm install
- name: Build package
run: yarn build
run: pnpm build
- name: Run linting
run: yarn lint
run: pnpm lint
- name: Run tests
run: yarn test-ci
run: pnpm test-ci
- name: Run typecheck
run: yarn typecheck
run: pnpm typecheck
- name: Code coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: yarn codecov
run: pnpm codecov
- name: Prepare new release
run: yarn semantic-release --dry-run
run: pnpm semantic-release --dry-run
27 changes: 14 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: yarn
run: pnpm install
- name: Build package
run: yarn build
run: pnpm build
- name: Run tests
run: yarn test-ci
run: pnpm test-ci
- name: Code coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: yarn codecov
run: pnpm codecov
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
run: pnpm semantic-release
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn typecheck
yarn lint
pnpm typecheck
pnpm lint
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22.11.0
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thanks for being willing to contribute!
## Project setup

1. Fork and clone the repo
2. Run `yarn` to install dependencies
2. Run `pnpm` to install dependencies
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`

> Tip: Keep your `main` branch pointing at the original repository and make pull
Expand All @@ -25,7 +25,7 @@ Thanks for being willing to contribute!
## Start
To start the examples page locally, run `yarn start`.
To start the examples page locally, run `pnpm start`.
This will open the page in `http://localhost:1234/`.
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"typecheck": "tsc && tsc --project tsconfig.test.json",
"lint": "eslint ./ --max-warnings=0",
"gh-predeploy": "parcel build src/examples/index.html --dist-dir demo/examples --public-url ./",
"gh-deploy": "yarn gh-predeploy && gh-pages -d demo/examples",
"ci": "yarn && yarn build",
"gh-deploy": "pnpm gh-predeploy && gh-pages -d demo/examples",
"ci": "pnpm && pnpm build",
"codecov": "codecov",
"semantic-release": "semantic-release"
},
Expand Down Expand Up @@ -96,5 +96,6 @@
"main": false,
"module": false,
"types": false
}
},
"packageManager": "pnpm@10.0.0-alpha.0+sha512.856941ef22665d2f3e41c04e8d86ed757ef057fb2bc35011698bfa988ef5817cc1cdd28bb883e7f23f0568c75de5544d4750211d4276b9ba6d55369eb207a549"
}
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineConfig({

/* Run your local dev server before starting the tests */
webServer: {
command: 'yarn start',
command: 'pnpm start',
url: 'http://localhost:1234/',
reuseExistingServer: !process.env.CI,
},
Expand Down
Loading

0 comments on commit 0279041

Please sign in to comment.