Skip to content

Migrate from yarn to pnpm #13968

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/algolia-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
- uses: actions/setup-node@v4
id: setup-node
with:
node-version-file: 'package.json'

- uses: pnpm/action-setup@v4

- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -25,22 +28,22 @@ jobs:
- 'develop-docs/**'
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.1.34'
bun-version: latest

- uses: actions/cache@v4
id: cache
with:
path: ${{ github.workspace }}/node_modules
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key: node-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- run: yarn install --frozen-lockfile
- run: pnpm install --frozen-lockfile
if: steps.cache.outputs.cache-hit != 'true'

# bun seems to be the most straightforward way to run a TypeScript script
# without introducing another dependency like ts-node or tsx for everyone else

- name: Build index for user docs
run: yarn build && bun ./scripts/algolia.ts
run: pnpm build && bun ./scripts/algolia.ts
if: steps.filter.outputs.docs == 'true'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand All @@ -52,7 +55,7 @@ jobs:
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0

- name: Build index for developer docs
run: yarn build:developer-docs && bun ./scripts/algolia.ts
run: pnpm build:developer-docs && bun ./scripts/algolia.ts
if: steps.filter.outputs.dev-docs == 'true'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/lint-404s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
- uses: actions/setup-node@v4
id: setup-node
with:
node-version-file: 'package.json'

- uses: pnpm/action-setup@v4

- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -33,25 +36,26 @@ jobs:
id: cache
with:
path: ${{ github.workspace }}/node_modules
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key: node-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- run: yarn install --frozen-lockfile
- run: pnpm install --frozen-lockfile
if: steps.cache.outputs.cache-hit != 'true'

- run: yarn build
- run: pnpm build
if: steps.filter.outputs.docs == 'true'
env:
SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0

- run: yarn build:developer-docs
- run: pnpm build:developer-docs
if: steps.filter.outputs.dev-docs == 'true'
env:
SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
NEXT_PUBLIC_DEVELOPER_DOCS: 1

- name: Start Http Server
run: yarn start &
run: pnpm start &
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.dev-docs == 'true'
env:
SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
id: setup-node
with:
node-version-file: 'package.json'

- name: Install github-label-sync
run: yarn global add github-label-sync@2.2.0
- uses: pnpm/action-setup@v4
- run: pnpm add -g github-label-sync@2.2.0

- name: Run github-label-sync
run: |
Expand All @@ -41,7 +41,7 @@ jobs:
2>&1 | tee sync-report.txt

- name: Read sync output into variable
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: github.event_name == 'pull_request'
id: github-label-sync
with:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4

- name: Internal github app token
id: token
Expand All @@ -21,7 +21,7 @@ jobs:
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}

- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
- uses: actions/setup-node@v4
id: setup-node
with:
node-version-file: 'package.json'
Expand All @@ -30,17 +30,19 @@ jobs:
id: cache
with:
path: ${{ github.workspace }}/node_modules
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
key: node-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
if: steps.cache.outputs.cache-hit != 'true'

# Additional checks
- run: yarn lint:ts
- run: yarn lint:docs
- run: pnpm lint:ts
- run: pnpm lint:docs

# Run automatic fixes (run prettier apart from eslint to also fix mdx files)
- run: yarn lint:prettier:fix
- run: yarn lint:eslint:fix
- run: pnpm lint:prettier:fix
- run: pnpm lint:eslint:fix

# Check (and error) for dirty working tree for forks
# Reason being we need a different token to auto commit changes and
Expand All @@ -61,7 +63,7 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
Expand All @@ -70,8 +72,9 @@ jobs:
id: cache
with:
path: ${{ github.workspace }}/node_modules
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
key: node-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
if: steps.cache.outputs.cache-hit != 'true'
- name: Run Tests
run: yarn test
run: pnpm test
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
Expand Down Expand Up @@ -63,7 +64,7 @@ typings/
# IDE settings
.idea/

# Yarn
# Package manager files
yarn-error.log
.pnp/
.pnp.js
Expand All @@ -72,6 +73,9 @@ yarn-error.log
# Yarn Integrity file
.yarn-integrity

# pnpm
.pnpm-store

# wizard files are auto generated
static/_platforms/

Expand Down
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
develop: setup-git
[ -f .env.development ] || cp .env.example .env.development
yarn
pnpm install

setup-git:
ifneq (, $(shell which pre-commit))
Expand All @@ -9,7 +9,7 @@ endif
git config branch.autosetuprebase always

test:
yarn test
pnpm test

preview-api-docs:
bin/preview-api-docs
6 changes: 0 additions & 6 deletions apps/changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-
First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Expand Down
6 changes: 1 addition & 5 deletions apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "prisma generate && next build",
"start": "next start",
"lint": "next lint",
"migrate:dev": "dotenv -e .env.development -- yarn prisma migrate reset"
"migrate:dev": "dotenv -e .env.development -- pnpm prisma migrate reset"
},
"prisma": {
"seed": "node prisma/seed/seed.mjs"
Expand Down Expand Up @@ -63,9 +63,5 @@
},
"volta": {
"extends": "../../package.json"
},
"resolutions": {
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1"
}
}
29 changes: 17 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
"url": "https://github.com/getsentry/sentry-docs/issues"
},
"private": true,
"workspaces": [
"./apps/*"
],
"packageManager": "pnpm@9.5.0",
"scripts": {
"dev": "yarn enforce-redirects && concurrently \"yarn sidecar\" \"node ./src/hotReloadWatcher.mjs\" \"next dev\"",
"dev:developer-docs": "yarn enforce-redirects && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn dev",
"build:developer-docs": "yarn enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn build",
"build": "yarn enforce-redirects && next build",
"vercel:build:developer-docs": "yarn enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn build",
"dev": "pnpm enforce-redirects && concurrently \"pnpm sidecar\" \"node ./src/hotReloadWatcher.mjs\" \"next dev\"",
"dev:developer-docs": "pnpm enforce-redirects && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm dev",
"build:developer-docs": "pnpm enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm build",
"build": "pnpm enforce-redirects && next build",
"vercel:build:developer-docs": "pnpm enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm build",
"start": "next start",
"lint": "next lint",
"lint:ts": "tsc --skipLibCheck",
Expand All @@ -28,8 +26,8 @@
"lint:eslint:fix": "eslint --fix \"{src,app,scripts}/**/*.{ts,tsx,js,jsx}\"",
"lint:prettier": "prettier --check \"./{src,app,scripts}/**/*.{md,mdx,ts,tsx,js,jsx,mjs}\"",
"lint:prettier:fix": "prettier --write \"./{src,app,scripts}/**/*.{md,mdx,ts,tsx,js,jsx,mjs}\"",
"lint:fix": "yarn run lint:prettier:fix && yarn run lint:eslint:fix",
"sidecar": "yarn spotlight-sidecar",
"lint:fix": "pnpm run lint:prettier:fix && pnpm run lint:eslint:fix",
"sidecar": "pnpm spotlight-sidecar",
"test": "vitest",
"test:ci": "vitest run",
"enforce-redirects": "node ./scripts/no-vercel-json-redirects.mjs"
Expand Down Expand Up @@ -133,8 +131,15 @@
"dompurify": "3.2.4",
"@types/dompurify": "3.0.5"
},
"pnpm": {
"overrides": {
"dompurify": "3.2.4",
"@types/dompurify": "3.0.5",
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1"
}
},
"volta": {
"node": "20.11.0",
"yarn": "1.22.22"
"node": "20.11.0"
}
}
Loading
Loading