Skip to content

Commit

Permalink
build: use pnpm instead of npm
Browse files Browse the repository at this point in the history
- Bump node version in .nvmrc
- Set package.json#engines
- Remove package-lock.json
- Generate pnpm-lock.yaml
- Add pnpm-workspace.yaml
- Update workflows/continuous-deployment.yml to use pnpm/action-setup
- Update all uses of npm to pnpm instead
- Run: pnpm run update-patch
- Run: pnpm run update-minor
  • Loading branch information
matijs committed Jan 16, 2024
1 parent 08f4984 commit 85f74ac
Show file tree
Hide file tree
Showing 9 changed files with 8,051 additions and 29,499 deletions.
50 changes: 31 additions & 19 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,65 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1

- name: Install pnpm
uses: pnpm/action-setup@v2.4.0
with:
version: 8.14

- name: Set up Node.js version
uses: actions/setup-node@v3.1.0
uses: actions/setup-node@v4.0.1
with:
node-version: "18"
node-version-file: .nvmrc
cache: pnpm

- name: Install
- name: Install dependencies
run: |
npm ci
npm ls
pnpm install
pnpm ls --recursive
- name: "Continuous Integration: lint"
run: |
npm run lint --if-present
pnpm run --if-present lint
- name: "Continuous Integration: build"
run: |
npm run build --if-present
pnpm run --if-present build
- name: "Continuous Integration: test"
run: |
npm run test --if-present
pnpm run --if-present test
publish-npm:
runs-on: ubuntu-latest
needs: continuous-integration
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.GH_REPO_TOKEN }}

- name: Install pnpm
uses: pnpm/action-setup@v2.4.0
with:
version: 8.14

- name: Set up Node.js version
uses: actions/setup-node@v3.1.0
uses: actions/setup-node@v4.0.1
with:
node-version: "18"
node-version-file: .nvmrc
cache: pnpm

- name: "Continuous Deployment: install"
run: |
npm ci
npm ls
pnpm install
pnpm ls --recursive
- name: "Continuous Deployment: build"
run: |
npm run build --if-present
pnpm run --if-present build
- name: "Continuous Deployment: publish to GitHub repository"
env:
Expand All @@ -68,12 +80,12 @@ jobs:
GIT_COMMITTER_NAME: "NL Design System"
run: |
git push --set-upstream origin HEAD
npm run release -- --yes
pnpm run release -- --yes
- name: "Continuous Deployment: publish to npm"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
npm run publish -- --no-verify-access --yes
npm config delete "//registry.npmjs.org/:_authToken"
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm run publish -- --no-verify-access --yes
pnpm config delete "//registry.npmjs.org/:_authToken"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# Ignore 3rd party files
node_modules/
vendor/

# prevent accidentally committing files generated by a package manager other than pnpm
package-lock.json
yarn.lock
.yarn/
.npm/

# Ignore generated files
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
20
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "npm",
"npmClient": "pnpm",
"version": "independent",
"useWorkspaces": true,
"command": {
Expand Down
Loading

0 comments on commit 85f74ac

Please sign in to comment.