Skip to content

Commit

Permalink
chore: use pnpm for workspace management
Browse files Browse the repository at this point in the history
  • Loading branch information
alvis committed Jun 10, 2023
1 parent 381c84f commit 358d0d7
Show file tree
Hide file tree
Showing 18 changed files with 9,303 additions and 34,288 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- name: install code climate reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /tmp/cc-test-reporter
chmod +x /tmp/cc-test-reporter
- name: cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: enable corepack
run: corepack enable
- name: install dependencies
run: npm ci
run: pnpm install
- name: run coverage
run: npm run coverage
run: pnpm run coverage
env:
CI: true
- name: upload coverage
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- name: enable corepack
run: corepack enable
- name: cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: install dependencies
run: npm ci
run: pnpm install
- name: publish the release note
run: npx github-release-from-changelog
env:
Expand All @@ -27,4 +33,4 @@ jobs:
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: publish the package
run: npm publish --provenance --workspaces --verbose
run: pnpm --recursive publish
11 changes: 9 additions & 2 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: enable corepack
run: corepack enable
- name: install dependencies
run: npm ci
run: pnpm install
- name: run code style check
run: npm run lint --if-present
run: pnpm run lint
env:
CI: true
12 changes: 6 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: install npm@7 for workspace
run: npm i -g npm@7
- name: cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ matrix.node }}-dependencies-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: enable corepack
run: corepack enable
- name: install dependencies
run: npm ci
run: pnpm install
- name: run test
run: npm run test --if-present
run: pnpm run test
env:
CI: true
- name: run build
run: npm run build --if-present
run: pnpm run build
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auto-install-peers=true # automatically install peer dependencies, default to true since pnpm v8
resolution-mode="highest" # since pnpm v8, packages are resolved by default in the lowest version possible, however it's not we want
node-linker=hoisted # makes all peer dependencies installed on the root's node_modules
Loading

0 comments on commit 358d0d7

Please sign in to comment.