Skip to content

Commit 0c60fe4

Browse files
balzssclaude
andcommitted
feat(many): migrate from npm to pnpm
Implement pnpm migration with workspace protocol and core tooling updates: Configuration: - Add pnpm-workspace.yaml defining workspace packages - Add .npmrc with pnpm configuration (hoisted node linker, strict peer deps) - Update lerna.json to use pnpm as npm client - Update root package.json with pnpm engines, overrides, and devDependencies - Update .gitignore for pnpm artifacts - Delete package-lock.json (replaced by pnpm-lock.yaml) Workspace Dependencies: - Convert all internal @instructure/* dependencies from exact versions to workspace:* - Update 94 package.json files across all packages - Create scripts/convert-to-workspace-protocol.js for automated conversion Build Tooling: - Update scripts/bootstrap.js to use pnpm and run builds sequentially - Update packages/ui-scripts/lib/commands/bump.js to use pnpm install - Update packages/ui-scripts/lib/utils/npm.js to use pnpm whoami - Fix babel-plugin-transform-imports for pnpm workspace module resolution - Fix generate-all-tokens for pnpm workspace package resolution - Optimize clean script performance - Restore markdown hot reload in dev server Regression Test App (npm): - Keep regression-test using npm to simulate external package consumption - Change @instructure/ui dependency to file: protocol (from link:) - Remove pnpm-lock.yaml and pnpm-workspace.yaml - Generate package-lock.json with npm install - Update .github/workflows/visual-regression.yml to use npm commands - Update README.md with npm commands and explanation - Add .npmrc explaining npm-only approach Documentation: - Update all internal npm references to pnpm across the codebase 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ed78d21 commit 0c60fe4

File tree

192 files changed

+30366
-33337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+30366
-33337
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
- uses: pnpm/action-setup@v4
1617
- name: Install Node 22
1718
uses: actions/setup-node@v4
1819
with:
1920
node-version: '22'
20-
- run: npm ci && npm run bootstrap
21+
cache: 'pnpm'
22+
- run: pnpm install --frozen-lockfile && pnpm run bootstrap
2123
- name: Set build directory and deployment path based on branch
2224
id: set-build-dir
2325
run: |
@@ -37,7 +39,7 @@ jobs:
3739
;;
3840
esac
3941
- name: Build docs-app
40-
run: npm run build:docs
42+
run: pnpm run build:docs
4143
- name: Deploy to GitHub Pages
4244
uses: JamesIves/github-pages-deploy-action@v4
4345
with:
@@ -57,13 +59,15 @@ jobs:
5759
if: github.ref == 'refs/heads/master'
5860
steps:
5961
- uses: actions/checkout@v4
62+
- uses: pnpm/action-setup@v4
6063
- name: Install Node 22
6164
uses: actions/setup-node@v4
6265
with:
6366
node-version: '22'
64-
- run: npm ci && npm run bootstrap
67+
cache: 'pnpm'
68+
- run: pnpm install --frozen-lockfile && pnpm run bootstrap
6569
- name: Build docs-app
66-
run: npm run build:docs
70+
run: pnpm run build:docs
6771
- name: Deploy to GitHub Pages
6872
uses: JamesIves/github-pages-deploy-action@v4
6973
with:

.github/workflows/manual-release-from-pr.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ jobs:
88
- uses: actions/checkout@v4
99
with:
1010
fetch-depth: 0
11+
- uses: pnpm/action-setup@v4
1112
- uses: actions/setup-node@v4
1213
with:
1314
node-version: '22'
14-
cache: 'npm'
15+
cache: 'pnpm'
1516
- name: Install packages
16-
run: npm ci
17+
run: pnpm install --frozen-lockfile
1718
- name: Set up project
18-
run: npm run bootstrap
19+
run: pnpm run bootstrap
1920
- name: Release to NPM
2021
env:
2122
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
2223
NPM_EMAIL: ${{secrets.NPM_EMAIL}}
2324
NPM_USERNAME: ${{secrets.NPM_USERNAME}}
24-
run: npm run release -- --prRelease
25+
run: pnpm run release -- --prRelease
2526
- name: Get commit message
2627
run: | # puts the first line of the last commit message to the commmit_message env var
2728
echo "commmit_message=$(git log --format=%B -n 1 ${{ github.event.after }} | head -n 1)" >> $GITHUB_ENV

.github/workflows/manual-release-to-npm.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ jobs:
88
- uses: actions/checkout@v4
99
with:
1010
fetch-depth: 0
11+
- uses: pnpm/action-setup@v4
1112
- name: Install Node 22
1213
uses: actions/setup-node@v4
1314
with:
1415
node-version: '22'
16+
cache: 'pnpm'
1517
- name: Install packages
16-
run: npm ci
18+
run: pnpm install --frozen-lockfile
1719
- name: Set up project
18-
run: npm run bootstrap
20+
run: pnpm run bootstrap
1921
- name: Release to NPM
2022
env:
2123
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
2224
NPM_EMAIL: ${{secrets.NPM_EMAIL}}
2325
NPM_USERNAME: ${{secrets.NPM_USERNAME}}
24-
run: npm run release
26+
run: pnpm run release
2527
- name: Get commit message
2628
run: | # puts the first line of the last commit message to the commmit_message env var
2729
echo "commmit_message=$(git log --format=%B -n 1 ${{ github.event.after }} | head -n 1)" >> $GITHUB_ENV

.github/workflows/pr-validation.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,51 @@ jobs:
88
- uses: actions/checkout@v4
99
with:
1010
fetch-depth: 0
11+
- uses: pnpm/action-setup@v4
1112
- uses: actions/setup-node@v4
1213
with:
1314
node-version: '22'
14-
cache: 'npm'
15+
cache: 'pnpm'
1516
- name: Install dependencies
16-
run: npm ci
17+
run: pnpm install --frozen-lockfile
1718
- name: Bootstrap project
18-
run: npm run bootstrap
19+
run: pnpm run bootstrap
1920
- name: Lint commits
20-
run: npm run lint:commits
21+
run: pnpm run lint:commits
2122
- name: Lint code
22-
run: npm run lint:changes
23+
run: pnpm run lint:changes
2324
vitest-tests:
2425
name: Vitest unit tests
2526
runs-on: ubuntu-latest
2627
steps:
2728
- uses: actions/checkout@v4
29+
- uses: pnpm/action-setup@v4
2830
- uses: actions/setup-node@v4
2931
with:
3032
node-version: '22'
31-
cache: 'npm'
33+
cache: 'pnpm'
3234
- name: Install dependencies
33-
run: npm ci
35+
run: pnpm install --frozen-lockfile
3436
- name: Bootstrap project
35-
run: npm run bootstrap
37+
run: pnpm run bootstrap
3638
- name: Run vitest unit tests
37-
run: npm run test:vitest
39+
run: pnpm run test:vitest
3840
cypress:
3941
name: Cypress component tests
4042
runs-on: ubuntu-latest
4143
steps:
4244
- uses: actions/checkout@v4
45+
- uses: pnpm/action-setup@v4
4346
- uses: actions/setup-node@v4
4447
with:
4548
node-version: '22'
46-
cache: 'npm'
49+
cache: 'pnpm'
4750
- name: Install dependencies
48-
run: npm ci
51+
run: pnpm install --frozen-lockfile
52+
- name: Install Cypress binary
53+
run: npx cypress install
4954
- name: Bootstrap project
50-
run: npm run bootstrap
55+
run: pnpm run bootstrap
5156
- name: Run Cypress components tests
52-
run: npm run cy:component
57+
run: pnpm run cy:component
5358

.github/workflows/preview.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v4
1718
- name: Install Node 22
1819
uses: actions/setup-node@v4
1920
with:
2021
node-version: '22'
21-
- name: Npm install and bootstrap
22-
run: npm ci && npm run bootstrap
22+
cache: 'pnpm'
23+
- name: Install and bootstrap
24+
run: pnpm install --frozen-lockfile && pnpm run bootstrap
2325
if: github.event.action != 'closed' # don't run install and bootstrap unnecessarily when pr is closed
2426
- name: Build docs-app
25-
run: npm run build:docs
27+
run: pnpm run build:docs
2628
if: github.event.action != 'closed'
2729
- uses: rossjrw/pr-preview-action@v1
2830
with:

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,23 @@ jobs:
1111
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
14+
- uses: pnpm/action-setup@v4
1415
- uses: actions/setup-node@v4
1516
with:
1617
node-version: '22'
17-
cache: 'npm'
18+
cache: 'pnpm'
1819
- name: Install packages.
19-
run: npm ci
20+
run: pnpm install --frozen-lockfile
2021
- name: Set up project.
21-
run: npm run bootstrap
22+
run: pnpm run bootstrap
2223
- name: Run tests.
23-
run: USE_REACT_STRICT_MODE=0 npm run test:vitest
24+
run: USE_REACT_STRICT_MODE=0 pnpm run test:vitest
2425
- name: Release to NPM
2526
env:
2627
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
2728
NPM_EMAIL: ${{secrets.NPM_EMAIL}}
2829
NPM_USERNAME: ${{secrets.NPM_USERNAME}}
29-
run: npm run release
30+
run: pnpm run release
3031
tag:
3132
needs: release
3233
if: "startsWith(github.event.head_commit.message, 'chore(release)')"

.github/workflows/visual-regression.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,30 @@ jobs:
1313
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
16+
- uses: pnpm/action-setup@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'pnpm'
21+
- name: Cache Cypress binary
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/Cypress
25+
key: ${{ runner.os }}-cypress-${{ hashFiles('regression-test/package-lock.json') }}
1626
- name: Build InstUI
17-
run: npm ci && npm run bootstrap
18-
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile && pnpm run bootstrap
28+
- name: Install regression-test dependencies
1929
run: npm ci
2030
working-directory: regression-test
31+
- name: Install Cypress binary
32+
run: npx cypress install
33+
working-directory: regression-test
2134
- name: Run Cypress tests
2235
uses: cypress-io/github-action@v6
2336
env:
2437
ELECTRON_EXTRA_LAUNCH_ARGS: "--remote-debugging-port=9222"
2538
with:
39+
install: false
2640
build: npm run build
2741
start: npm start
2842
working-directory: regression-test
@@ -42,10 +56,14 @@ jobs:
4256
uses: actions/checkout@v4
4357
with:
4458
fetch-depth: 0
59+
- uses: pnpm/action-setup@v4
4560
- uses: actions/setup-node@v4
4661
with:
4762
node-version: 22
48-
- name: Install dependencies
63+
cache: 'pnpm'
64+
- name: Build InstUI
65+
run: pnpm install --frozen-lockfile && pnpm run bootstrap
66+
- name: Install regression-test dependencies
4967
run: npm ci
5068
working-directory: regression-test
5169
- name: Download Cypress test results

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules/
22
npm-debug.log
3+
pnpm-debug.log
34
lerna-debug.log
45
./build-storybook.log
56
coverage/
@@ -9,10 +10,10 @@ __build__
910
.idea
1011
.DS_Store
1112
.viminfo
12-
.npmrc
1313
.env
1414
.env.test
1515
.tmp/
16+
.pnpm-store/
1617

1718
tsconfig.build.tsbuildinfo
1819

@@ -31,3 +32,6 @@ tsconfig.build.tsbuildinfo
3132
.claude/commands/*
3233
!.claude/commands/commit.md
3334
!.claude/commands/pr.md
35+
36+
# Playwright MCP
37+
.playwright-mcp

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run husky:pre-commit
1+
pnpm run husky:pre-commit

.npmrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Strict peer dependencies (recommended)
2+
auto-install-peers=false
3+
strict-peer-dependencies=true
4+
5+
# Workspace protocol
6+
link-workspace-packages=true
7+
8+
# Use hoisted node linker initially for compatibility
9+
node-linker=hoisted
10+
11+
# Can enable later for stricter isolation:
12+
# node-linker=isolated
13+
# shamefully-hoist=false

0 commit comments

Comments
 (0)