-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Migrate to pnpm #11358
Migrate to pnpm #11358
Changes from all commits
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/fixtures/ | ||
node_modules/ | ||
pnpm-lock.yaml | ||
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. This is needed so that |
||
/docs/api | ||
examples/**/dist/ | ||
packages/**/dist/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: ⚙️ Deduplicate yarn.lock | ||
name: ⚙️ Deduplicate lock file | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- ./yarn.lock | ||
- ./pnpm-lock.yaml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -20,14 +20,17 @@ jobs: | |
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 📦 Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "yarn" | ||
cache: "pnpm" | ||
|
||
- name: ⚙️ Dedupe yarn.lock | ||
run: npx yarn-deduplicate && rm -rf ./node_modules && yarn | ||
- name: ⚙️ Dedupe lock file | ||
run: pnpm dedupe && rm -rf ./node_modules && pnpm install | ||
|
||
- name: 💪 Commit | ||
run: | | ||
|
@@ -38,6 +41,6 @@ jobs: | |
echo "💿 no deduplication needed" | ||
exit 0 | ||
fi | ||
git commit -m "chore: deduplicate `yarn.lock`" | ||
git commit -m "chore: deduplicate `pnpm-lock.yaml`" | ||
git push | ||
echo "💿 https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,20 +21,23 @@ jobs: | |
with: | ||
token: ${{ secrets.FORMAT_PAT }} | ||
|
||
- name: 📦 Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: yarn | ||
cache: pnpm | ||
node-version-file: ".nvmrc" | ||
|
||
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: 🔃 Sort contributors.yml | ||
run: sort --ignore-case --output contributors.yml contributors.yml | ||
|
||
- name: 👔 Format | ||
run: yarn format | ||
run: pnpm format | ||
|
||
- name: 💪 Commit | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,22 +22,25 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: 📦 Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: yarn | ||
cache: pnpm | ||
node-version-file: ".nvmrc" | ||
|
||
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: 🏗 Build | ||
run: yarn build | ||
run: pnpm build | ||
|
||
- name: 🔐 Setup npm auth | ||
run: | | ||
echo "registry=https://registry.npmjs.org" >> ~/.npmrc | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | ||
|
||
- name: 🚀 Publish | ||
run: npm run publish | ||
run: pnpm run publish |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,14 +27,17 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: 📦 Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "yarn" | ||
cache: "pnpm" | ||
|
||
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: 🔐 Setup npm auth | ||
run: | | ||
|
@@ -50,10 +53,10 @@ jobs: | |
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: yarn run version | ||
version: pnpm run version | ||
commit: "chore: Update version for release" | ||
title: "chore: Update version for release" | ||
publish: yarn run release | ||
publish: pnpm run release | ||
createGithubReleases: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -70,11 +73,14 @@ jobs: | |
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 📦 Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
cache: "npm" | ||
cache: "pnpm" | ||
|
||
- id: find_package_version | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,13 @@ jobs: | |
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 📦 Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: yarn | ||
cache: pnpm | ||
check-latest: true | ||
node-version: ${{ matrix.node }} | ||
|
||
|
@@ -49,16 +52,16 @@ jobs: | |
echo "::remove-matcher owner=eslint-stylish::" | ||
|
||
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: 🏗 Build | ||
run: yarn build | ||
run: pnpm build | ||
|
||
- name: 🔬 Lint | ||
run: yarn lint | ||
run: pnpm lint | ||
|
||
- name: 🧪 Run tests | ||
run: yarn test | ||
run: pnpm test | ||
|
||
- name: Check bundle size | ||
run: yarn size | ||
run: pnpm size |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignore-workspace-cycles=true | ||
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. This is suppressing dependency warnings that only affect dev dependencies due to test code. Everything still works. |
||
enable-pre-post-scripts=true | ||
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. This is optional, but I've opted to keep automatic |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
{ | ||
"name": "@remix-run/react-router", | ||
"private": true, | ||
"workspaces": { | ||
"packages": [ | ||
"packages/react-router", | ||
"packages/react-router-dom", | ||
"packages/react-router-dom-v5-compat", | ||
"packages/react-router-native", | ||
"packages/router" | ||
] | ||
}, | ||
Comment on lines
-4
to
-12
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. This is now configured in |
||
"scripts": { | ||
"build": "rollup -c", | ||
"clean": "git clean -fdX .", | ||
"format": "prettier --ignore-path .eslintignore --write .", | ||
"format:check": "prettier --ignore-path .eslintignore --check .", | ||
"postinstall": "patch-package", | ||
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. This feature is built into pnpm: https://pnpm.io/cli/patch |
||
"lint": "eslint --cache .", | ||
"prerelease": "yarn build", | ||
"prerelease": "pnpm build", | ||
"release": "changeset publish", | ||
"size": "filesize", | ||
"test": "jest", | ||
"test:inspect": "node --inspect-brk ./node_modules/.bin/jest", | ||
"changeset": "changeset", | ||
"version": "changeset version && node ./scripts/remove-prerelease-changelogs.mjs", | ||
"publish": "node scripts/publish.js", | ||
"postversion": "node scripts/postversion.mjs", | ||
"version:experimental": "node ./scripts/version experimental", | ||
"watch": "rollup -c -w" | ||
}, | ||
|
@@ -37,6 +26,7 @@ | |
"default" | ||
] | ||
}, | ||
"packageManager": "[email protected]", | ||
"resolutions": { | ||
"@types/react": "^18.2.18", | ||
"@types/react-dom": "^18.2.7", | ||
|
@@ -91,7 +81,6 @@ | |
"jest": "^29.6.2", | ||
"jest-environment-jsdom": "^29.6.2", | ||
"jsonfile": "^6.1.0", | ||
"patch-package": "^6.5.1", | ||
"prettier": "^2.8.8", | ||
"prompt-confirm": "^2.0.4", | ||
"react": "^18.2.0", | ||
|
@@ -130,5 +119,10 @@ | |
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": { | ||
"none": "23.5 kB" | ||
} | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"@changesets/[email protected]": "patches/@[email protected]" | ||
} | ||
} | ||
} |
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.
This setting is now enabled so that Changesets doesn't attempt to bump the
react-router-dom
dependency inreact-router-dom-v5-compat
since it's set to"4 || 5"
. This is a simpler method of achieving what thepostversion.mjs
script was doing since we can now useworkspace
dependencies.