Skip to content

Commit bae610d

Browse files
build: migrate from npm to pnpm package manager (#286)
* build: migrate from npm to pnpm package manager * Update package.json Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * docs: update CLAUDE.md to reflect migration to pnpm package manager --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent bf41dca commit bae610d

File tree

12 files changed

+9768
-38814
lines changed

12 files changed

+9768
-38814
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,28 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616

17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 10.15.0
21+
1722
- name: Setup Node.js
1823
uses: actions/setup-node@v4
1924
with:
2025
node-version: 22.x
26+
cache: pnpm
2127

22-
- name: Install commitlint
23-
run: |
24-
npm install --save-dev @commitlint/config-conventional @commitlint/cli
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
2530

2631
- name: Validate PR title
2732
run: |
28-
echo "${{ github.event.pull_request.title }}" | npx commitlint
33+
echo "${{ github.event.pull_request.title }}" | pnpm exec commitlint
2934
3035
- name: Validate commits
3136
if: github.event.pull_request.commits > 1
3237
run: |
33-
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
38+
pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
3439
3540
lint:
3641
name: Lint

.github/workflows/example-angular.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13-
- uses: actions/cache@v4
13+
- uses: pnpm/action-setup@v4
1414
with:
15-
path: ~/.npm
16-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
17-
restore-keys: |
18-
${{ runner.os }}-node-
15+
version: 10.15.0
16+
17+
- name: Install Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: pnpm
22+
1923
- name: build
2024
run: |
2125
cd example/angular
22-
npm ci
23-
npx ng build --prod
26+
pnpm install --frozen-lockfile
27+
pnpm exec ng build --prod
2428
2529
- uses: ./
2630
id: vercel-action-staging

.github/workflows/example-nextjs.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,28 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
with:
18+
version: 10.15.0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: pnpm
25+
1426
- run: |
15-
npm ci
16-
npx vercel pull --yes --token=${VERCEL_TOKEN}
27+
pnpm install --frozen-lockfile
28+
pnpm exec vercel pull --yes --token=${VERCEL_TOKEN}
1729
working-directory: example/nextjs
1830
env:
1931
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_NEXTJS }}
2032
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
2133
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
2234
- run: |
23-
npx vercel build
35+
pnpm exec vercel build
2436
if: github.event_name == 'pull_request_target'
2537
working-directory: example/nextjs
2638
env:
@@ -51,7 +63,7 @@ jobs:
5163
env:
5264
REF: ${{ github.ref }}
5365
- run: |
54-
npx vercel build --prod
66+
pnpm exec vercel build --prod
5567
if: github.event_name == 'push'
5668
working-directory: example/nextjs
5769
env:

CLAUDE.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
## Project Overview
88

9-
This is a GitHub Action that deploys projects to Vercel. It's an npm package that integrates with GitHub workflows to automate deployments, providing more control than Vercel's native GitHub integration.
9+
This is a GitHub Action that deploys projects to Vercel. It's a pnpm-based package that integrates with GitHub workflows to automate deployments, providing more control than Vercel's native GitHub integration.
10+
11+
## Package Manager
12+
13+
This project uses **pnpm** as its package manager. The project is configured as a monorepo with workspaces for the example projects. Make sure to use pnpm commands instead of npm.
1014

1115
## Essential Commands
1216

1317
### Development
1418
```bash
15-
npm install # Install dependencies
16-
npm start # Run the action locally (node ./index.js)
17-
npm run lint # Run ESLint on index.js
18-
npm run format # Format code with Prettier
19-
npm run format-check # Check code formatting
20-
npm test # Run Jest tests
21-
npm run all # Run format, lint, package, and test in sequence
19+
pnpm install # Install dependencies
20+
pnpm start # Run the action locally (node ./index.js)
21+
pnpm run lint # Run ESLint
22+
pnpm run lint:fix # Run ESLint and fix issues
23+
pnpm test # Run Jest tests
24+
pnpm run all # Run lint, package, and test in sequence
2225
```
2326

2427
### Building for Distribution
2528
```bash
26-
npm run package # Build the action with ncc (outputs to dist/)
29+
pnpm run package # Build the action with ncc (outputs to dist/)
2730
```
2831

2932
**Important**: The `dist/` folder must be committed when creating releases. This contains the bundled action code that GitHub Actions will execute.

DEVELOP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Package
22

33
```bash
4-
npm run package
4+
pnpm run package
55
```
66

77
# Release

0 commit comments

Comments
 (0)