-
Notifications
You must be signed in to change notification settings - Fork 0
feat: pnpm migration #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: pnpm migration #520
Changes from 4 commits
061ec90
18e01f2
46f0786
0d92658
07b5f19
4f3e959
2975ab6
138347e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,18 +18,21 @@ jobs: | |
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: jdx/mise-action@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.5.2 | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Pull environment variables from Vercel | ||
| run: npx vercel env pull .env.local --token=${{ secrets.VERCEL_TOKEN }} --yes | ||
| run: pnpm dlx vercel env pull .env.local --token=${{ secrets.VERCEL_TOKEN }} --yes | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify all unpinned Vercel dlx usages in workflows
rg -nP 'pnpm dlx vercel(?!@)' .github/workflowsRepository: dejanvasic85/williamstownsc Length of output: 309 Pin Unpinned Suggested update- run: pnpm dlx vercel env pull .env.local --token=${{ secrets.VERCEL_TOKEN }} --yes
+ run: pnpm dlx vercel@<pinned-version> env pull .env.local --token=${{ secrets.VERCEL_TOKEN }} --yesAlso applies to: 53-53 🤖 Prompt for AI Agents |
||
| - name: Build | ||
| run: npm run build | ||
| run: pnpm run build | ||
| - name: Lint | ||
| run: npm run lint | ||
| run: pnpm run lint | ||
| - name: Type check | ||
| run: npm run type:check | ||
| run: pnpm run type:check | ||
| - name: Format | ||
| run: npm run format:check | ||
| run: pnpm run format:check | ||
|
|
||
| e2e: | ||
| name: E2E Tests | ||
|
|
@@ -39,12 +42,15 @@ jobs: | |
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: jdx/mise-action@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.5.2 | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Install Playwright browsers | ||
| run: npx playwright install --with-deps chromium | ||
| run: pnpm exec playwright install --with-deps chromium | ||
| - name: Pull environment variables from Vercel | ||
| run: npx vercel env pull .env.local --token=${{ secrets.VERCEL_TOKEN }} --yes | ||
| run: pnpm dlx vercel env pull .env.local --token=${{ secrets.VERCEL_TOKEN }} --yes | ||
| - name: Wait for Vercel preview deployment | ||
| uses: patrickedqvist/wait-for-vercel-preview@v1.3.3 | ||
| id: wait_for_vercel | ||
|
|
@@ -53,7 +59,7 @@ jobs: | |
| max_timeout: 300 | ||
| check_interval: 10 | ||
| - name: Run E2E tests | ||
| run: npm run test:e2e | ||
| run: pnpm run test:e2e | ||
| env: | ||
| PLAYWRIGHT_TEST_BASE_URL: ${{ steps.wait_for_vercel.outputs.url }} | ||
| - name: Upload test results | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,11 +21,15 @@ jobs: | |
|
|
||
| - uses: jdx/mise-action@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.5.2 | ||
|
||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Deploy to Sanity | ||
| run: npm run deploy:sanity -- --yes | ||
| run: pnpm run deploy:sanity -- --yes | ||
| env: | ||
| SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }} | ||
| NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ vars.SANITY_PROJECT_ID }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,27 +1,27 @@ | ||||||
| # Environment & Commands | ||||||
|
|
||||||
| - **IMPORTANT**: Dev server runs on port 3003 (not 3000): `npm run dev` | ||||||
| - **IMPORTANT**: Dev server runs on port 3003 (not 3000): `pnpm run dev` | ||||||
| - Node version: 24.12.0 (managed by Volta) | ||||||
|
||||||
| - Node version: 24.12.0 (managed by Volta) | |
| - Node version: 24.12.0 (managed by Mise) |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,14 +48,21 @@ To run the site locally, follow these steps: | |||||||||
| ### Prerequisites | ||||||||||
|
|
||||||||||
| - Node.js 24 installed | ||||||||||
| - pnpm 10.5.2 installed | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specify exact Node version to avoid setup drift. Line 50 still uses a broad version ( Suggested doc fix-- Node.js 24 installed
+- Node.js 24.12.0 installed (managed by Volta)Based on learnings: Node version must be 24.12.0, managed by Volta. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| - A Sanity account and project set up | ||||||||||
|
|
||||||||||
| ### CLI tools | ||||||||||
|
|
||||||||||
| The data CLI uses Playwright. Before running crawl commands, install the browser binaries: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| npx playwright install --with-deps chromium | ||||||||||
| pnpm exec playwright install --with-deps chromium | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Install dependencies | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| pnpm install | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Content Management | ||||||||||
|
|
@@ -74,7 +81,7 @@ Sanity URLs: | |||||||||
| After modifying Sanity schemas in `src/sanity/schema/`, run: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| npm run type:gen | ||||||||||
| pnpm run type:gen | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| This will update the TypeScript types to match your schema changes. | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Migrate repo to pnpm | ||
|
|
||
| **Created:** 2026-04-28 | ||
| **Status:** In Progress | ||
|
|
||
| ## Purpose | ||
|
|
||
| Standardize project package manager on pnpm. Keep local docs and GitHub workflows aligned to prevent drift and CI failures. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Use pnpm as canonical package manager for local and CI workflows | ||
| - Remove npm lockfile and commit pnpm lockfile | ||
| - Update script references in active docs and workflow docs | ||
| - Update GitHub Actions install and command steps to pnpm | ||
|
|
||
| ## Todo | ||
|
|
||
| - [x] Generate `pnpm-lock.yaml` from current dependency graph | ||
| - [x] Add `packageManager` in `package.json` | ||
| - [x] Update build script chaining in `package.json` to pnpm | ||
| - [x] Configure `pnpm.onlyBuiltDependencies` for known postinstall/build-script deps | ||
| - [x] Remove `package-lock.json` | ||
| - [x] Migrate `.github/workflows/ci.yml` to pnpm install/exec/run commands | ||
| - [x] Migrate `.github/workflows/crawl.yml` to pnpm install/exec/run commands and lockfile cache key | ||
| - [x] Migrate `.github/workflows/deploy-sanity.yml` to pnpm install/run commands | ||
| - [x] Update command docs in `README.md` | ||
| - [x] Update command docs in `AGENTS.md` | ||
| - [x] Run `pnpm run type:check` | ||
| - [x] Run `pnpm run lint` | ||
| - [x] Run `pnpm run format` | ||
| - [x] Run `pnpm run build` | ||
| - [ ] Run `pnpm run test:e2e` (1 failing test: `tests/search.spec.ts` navigation assertion) | ||
|
|
||
| ## Files | ||
|
|
||
| - `package.json`: set pnpm package manager, update build chaining, add pnpm build-script allowlist | ||
| - `pnpm-lock.yaml`: new lockfile generated via pnpm install | ||
| - `package-lock.json`: removed | ||
| - `.github/workflows/ci.yml`: npm/npx commands replaced with pnpm equivalents | ||
| - `.github/workflows/crawl.yml`: npm/npx commands replaced with pnpm equivalents, cache key now uses pnpm lockfile | ||
| - `.github/workflows/deploy-sanity.yml`: npm commands replaced with pnpm equivalents | ||
| - `README.md`: local setup and schema typegen commands updated to pnpm | ||
| - `AGENTS.md`: workflow command references updated to pnpm |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,44 @@ import nextTs from 'eslint-config-next/typescript'; | |
| import prettier from 'eslint-config-prettier/flat'; | ||
| import { defineConfig, globalIgnores } from 'eslint/config'; | ||
|
|
||
| const dependencyCheckConfigValue = { | ||
| files: ['**/*.{js,mjs,cjs,jsx,ts,tsx}'], | ||
| settings: { | ||
| 'import/internal-regex': '^(@/|@data/)', | ||
| 'import/resolver': { | ||
| typescript: { | ||
| project: './tsconfig.json' | ||
| } | ||
| } | ||
| }, | ||
| rules: { | ||
| 'import/no-extraneous-dependencies': [ | ||
| 'error', | ||
|
Comment on lines
+16
to
+18
|
||
| { | ||
| packageDir: ['.'], | ||
| devDependencies: [ | ||
| 'bin/**/*.{js,mjs,cjs,ts,tsx}', | ||
| '**/*.test.{js,jsx,ts,tsx}', | ||
| '**/*.spec.{js,jsx,ts,tsx}', | ||
| '**/tests/**/*.{js,jsx,ts,tsx}', | ||
| 'playwright.config.ts', | ||
| 'eslint.config.mjs', | ||
| 'next.config.ts', | ||
| 'sanity.config.ts', | ||
| 'sanity.cli.ts' | ||
| ], | ||
| optionalDependencies: false, | ||
| peerDependencies: false | ||
| } | ||
| ] | ||
| } | ||
| }; | ||
|
|
||
| const eslintConfig = defineConfig([ | ||
| ...nextVitals, | ||
| ...nextTs, | ||
| prettier, | ||
| dependencyCheckConfigValue, | ||
| // Override default ignores of eslint-config-next. | ||
| globalIgnores([ | ||
| // Default ignores of eslint-config-next: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/checkoutis pinned tov6here, while other workflows in the repo useactions/checkout@v4(e.g.crawl.yml). It’s safer to align on a single major version across workflows to avoid unexpected behavior differences and simplify maintenance.