Skip to content

Commit

Permalink
build!: use pnpm (#820)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This project now uses pnpm instead of yarn
  • Loading branch information
viceice committed Feb 8, 2024
1 parent fd4ca43 commit 1639f1a
Show file tree
Hide file tree
Showing 10 changed files with 3,839 additions and 4,744 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/build.yml
Expand Up @@ -23,6 +23,9 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
show-progress: false
filter: blob:none # we don't need all blobs, only the full tree

- name: Lint commit messages
uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe # v5.4.5
continue-on-error: true
Expand All @@ -34,19 +37,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: false

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache: pnpm

- name: enable corepack
run: corepack enable

- name: Install project
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Lint
run: yarn lint
run: pnpm lint

e2e:
runs-on: ubuntu-latest
Expand All @@ -59,21 +68,26 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
show-progress: false

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache: pnpm

- name: enable corepack
run: corepack enable

- name: Install project
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

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

- name: Configure renovate token
run: |
Expand Down Expand Up @@ -115,13 +129,14 @@ jobs:
git config --global core.symlinks true
git config --global user.email 'bot@renovateapp.com'
git config --global user.name 'Renovate Bot'
yarn config set version-git-tag false
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
fetch-depth: 0 # required for semantic release
ref: 'release'
show-progress: false
filter: blob:none # we don't need all blobs, only the full tree

- name: fetch pr
if: ${{github.event_name == 'pull_request'}}
Expand All @@ -133,17 +148,20 @@ jobs:
git merge --no-ff -Xtheirs -m 'skip: merge (${{ github.sha }}) [skip release]' ${{ github.sha }}
commit=$(git rev-parse HEAD)
- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache: pnpm

- name: enable corepack
run: corepack enable

- name: Install project
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Push release branch
run: git push origin release:release
Expand All @@ -153,7 +171,7 @@ jobs:
run: |
# override for semantic-release
export GITHUB_REF=refs/heads/release GITHUB_SHA=${{ steps.merge.outputs.commit }}
yarn release
pnpm release
if: ${{ github.ref_name == github.event.repository.default_branch }}
env:
GITHUB_TOKEN: ${{ github.token }}
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -187,7 +187,7 @@ typings/
# nuxt.js build output
.nuxt

# react / gatsby
# react / gatsby
public/

# vuepress build output
Expand Down Expand Up @@ -300,3 +300,6 @@ dkms.conf
*.exe
*.out
*.app


/.pnpm-store
2 changes: 1 addition & 1 deletion .husky/commit-msg
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
pnpm commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
7 changes: 5 additions & 2 deletions .lintstagedrc.json
@@ -1,4 +1,7 @@
{
"*.{ts,tsx,js,jsx,json}": "eslint --fix",
"*": "prettier --ignore-unknown --write"
"*.{ts,tsx,js,jsx,json}": [
"eslint --cache --fix",
"prettier --cache --write"
],
"!*.{ts,tsx,js,jsx,json}": "prettier --cache --ignore-unknown --write"
}
5 changes: 5 additions & 0 deletions .npmrc
@@ -1 +1,6 @@
save-exact=true
save-prefix =

# pnpm run settings
# https://pnpm.io/cli/run
shell-emulator = true
3 changes: 3 additions & 0 deletions .prettierignore
Expand Up @@ -6,3 +6,6 @@ coverage/
LICENSE.md
modules/
node_modules/

/.pnpm-store
/pnpm-lock.yaml
17 changes: 14 additions & 3 deletions package.json
Expand Up @@ -15,8 +15,8 @@
},
"main": "src/index.ts",
"engines": {
"node": ">=20.11.0",
"yarn": "^1.22.0"
"node": ">=20.9.0",
"pnpm": "^8.0.0"
},
"scripts": {
"build": "run-s clean compile",
Expand Down Expand Up @@ -64,5 +64,16 @@
"ts-node": "10.9.2",
"typescript": "5.3.3"
},
"packageManager": "yarn@1.22.21"
"packageManager": "pnpm@8.15.1",
"pnpm": {
"supportedArchitectures": {
"os": [
"linux",
"win32"
],
"cpu": [
"x64"
]
}
}
}

0 comments on commit 1639f1a

Please sign in to comment.