-
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 7 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 |
|---|---|---|
|
|
@@ -16,35 +16,41 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/checkout@v4 | ||
| - 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 | ||
| - 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 | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| needs: test | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/checkout@v4 | ||
| - 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/[email protected] | ||
| 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 |
|---|---|---|
|
|
@@ -17,15 +17,19 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - 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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # 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 | ||
|
|
||
| ## Unresolved questions | ||
|
|
||
| - None |
| 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.
🧩 Analysis chain
🏁 Script executed:
Repository: dejanvasic85/williamstownsc
Length of output: 309
Pin
vercelinpnpm dlxfor deterministic CI runs.Unpinned
dlxcommands download the latest available version at execution time, which can vary across runs and compromise CI reproducibility. Usepnpm dlx vercel@<pinned-version>instead.Suggested update
Also applies to: 53-53
🤖 Prompt for AI Agents