Skip to content

Commit

Permalink
chore: use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Sep 10, 2024
1 parent 986c33b commit 90a40b5
Show file tree
Hide file tree
Showing 10 changed files with 9,849 additions and 8,006 deletions.
64 changes: 36 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: CI

on:
Expand All @@ -17,44 +16,50 @@ jobs:
if: "!startsWith(github.head_ref, 'renovate/')"

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Unit tests
run: yarn test --ci --coverage
- name: Unit tests
run: pnpm test -- --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

lint:
name: Lint
runs-on: ubuntu-latest
if: "!startsWith(github.head_ref, 'renovate/')"

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: yarn lint
- name: Lint
run: pnpm lint

release:
needs: [tests, lint]
Expand All @@ -73,17 +78,20 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
run: pnpm install --frozen-lockfile

- name: Release
run: npx semantic-release --branches main
run: pnpm dlx semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 23 additions & 20 deletions .github/workflows/pkg-size-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Package size report

on:
pull_request:
branches: [ main, next ]
branches: [main, next]

permissions:
pull-requests: write
Expand All @@ -13,22 +13,25 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive

- name: Package size report
uses: pkg-size/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
hide-files: '*.{js,css}.map'
display-size: uncompressed, gzip
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Package size report
uses: pkg-size/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
hide-files: '*.{js,css}.map'
display-size: uncompressed, gzip
35 changes: 20 additions & 15 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Website

on:
Expand All @@ -17,20 +16,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build website
run: yarn website
- name: Build website
run: pnpm website

deploy:
name: Deploy
Expand All @@ -42,17 +44,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
run: pnpm install --frozen-lockfile

- name: Build
run: yarn website
run: pnpm website

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ node_modules/
npm-debug.log
lib/
esm/
yarn-error.log
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

tasks:
- init: yarn install && yarn run build
- init: pnpm install && pnpm run build

vscode:
extensions:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
"format": "eslint src --fix --report-unused-disable-directives",
"lint": "eslint src --report-unused-disable-directives",
"prebump": "run-s lint test",
"prepublishOnly": "yarn run build",
"prepublishOnly": "pnpm run build",
"test": "cross-env BABEL_OUTPUT=commonjs jest",
"start": "webpack serve",
"website": "run-s website:clean website:build website:redirect",
"website:clean": "rimraf examples/dist",
"website:build": "cross-env BABEL_TARGET=examples NODE_ENV=production webpack",
"website:redirect": "cp -R examples/src/example examples/dist"
},
"packageManager": "[email protected]",
"repository": {
"type": "git",
"url": "https://github.com/reactjs/react-tabs.git"
Expand Down
Loading

0 comments on commit 90a40b5

Please sign in to comment.