Skip to content

Commit 30a982c

Browse files
committed
Migrate from Yarn to pnpm and update GitHub Actions workflows
1 parent 50b8528 commit 30a982c

File tree

14 files changed

+19574
-13314
lines changed

14 files changed

+19574
-13314
lines changed

.github/workflows/algolia-index.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,26 @@ jobs:
88
name: Update Algolia index
99
runs-on: ubuntu-latest
1010
steps:
11+
- name: Internal github app token
12+
id: token
13+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
14+
with:
15+
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
16+
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
17+
1118
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
13-
id: setup-node
1419
with:
15-
node-version-file: 'package.json'
20+
submodules: recursive
21+
token: ${{ steps.token.outputs.token }}
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'pnpm'
26+
cache-dependency-path: 'pnpm-lock.yaml'
27+
- uses: pnpm/action-setup@v4
28+
with:
29+
version: 8
30+
- run: pnpm install --frozen-lockfile
1631
- uses: dorny/paths-filter@v3
1732
id: filter
1833
with:
@@ -40,7 +55,7 @@ jobs:
4055
# without introducing another dependency like ts-node or tsx for everyone else
4156

4257
- name: Build index for user docs
43-
run: yarn build && bun ./scripts/algolia.ts
58+
run: pnpm build && bun ./scripts/algolia.ts
4459
if: steps.filter.outputs.docs == 'true'
4560
env:
4661
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
@@ -52,7 +67,7 @@ jobs:
5267
NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0
5368

5469
- name: Build index for developer docs
55-
run: yarn build:developer-docs && bun ./scripts/algolia.ts
70+
run: pnpm build:developer-docs && bun ./scripts/algolia.ts
5671
if: steps.filter.outputs.dev-docs == 'true'
5772
env:
5873
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
@@ -63,3 +78,15 @@ jobs:
6378
SENTRY_DSN: https://[email protected]/0
6479
NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0
6580
NEXT_PUBLIC_DEVELOPER_DOCS: 1
81+
82+
- name: Build & Update Sentry Docs Algolia Index
83+
env:
84+
ALGOLIA_WRITE_API_KEY: ${{ secrets.ALGOLIA_WRITE_API_KEY }}
85+
run: pnpm build && bun ./scripts/algolia.ts
86+
if: github.ref == 'refs/heads/master'
87+
- name: Build & Update Developer Docs Algolia Index
88+
env:
89+
ALGOLIA_WRITE_API_KEY: ${{ secrets.ALGOLIA_WRITE_API_KEY }}
90+
NEXT_PUBLIC_DEVELOPER_DOCS: '1'
91+
run: pnpm build:developer-docs && bun ./scripts/algolia.ts
92+
if: github.ref == 'refs/heads/master'

.github/workflows/lint-404s.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@ jobs:
1010
index:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Internal github app token
14+
id: token
15+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
16+
with:
17+
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
18+
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
19+
1320
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
15-
id: setup-node
1621
with:
17-
node-version-file: 'package.json'
22+
submodules: recursive
23+
token: ${{ steps.token.outputs.token }}
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
cache: 'pnpm'
28+
cache-dependency-path: 'pnpm-lock.yaml'
29+
- uses: pnpm/action-setup@v4
30+
with:
31+
version: 8
32+
- run: pnpm install --frozen-lockfile
33+
1834
- uses: dorny/paths-filter@v3
1935
id: filter
2036
with:
@@ -29,29 +45,23 @@ jobs:
2945
with:
3046
bun-version: latest
3147

32-
- uses: actions/cache@v4
33-
id: cache
34-
with:
35-
path: ${{ github.workspace }}/node_modules
36-
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
37-
38-
- run: yarn install --frozen-lockfile
39-
if: steps.cache.outputs.cache-hit != 'true'
40-
41-
- run: yarn build
48+
# Build the app
49+
- run: pnpm build
4250
if: steps.filter.outputs.docs == 'true'
4351
env:
4452
SENTRY_DSN: https://[email protected]/0
4553
NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0
4654

47-
- run: yarn build:developer-docs
55+
- run: pnpm build:developer-docs
4856
if: steps.filter.outputs.dev-docs == 'true'
4957
env:
5058
SENTRY_DSN: https://[email protected]/0
5159
NEXT_PUBLIC_SENTRY_DSN: https://[email protected]/0
60+
NEXT_PUBLIC_DEVELOPER_DOCS: 1
5261

62+
# Start the server in the background
5363
- name: Start Http Server
54-
run: yarn start &
64+
run: pnpm start &
5565
if: steps.filter.outputs.docs == 'true' || steps.filter.outputs.dev-docs == 'true'
5666
env:
5767
SENTRY_DSN: https://[email protected]/0

.github/workflows/sync-labels.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
with:
2929
node-version-file: 'package.json'
3030

31-
- name: Install github-label-sync
32-
run: yarn global add [email protected]
31+
- uses: pnpm/action-setup@v4
32+
with:
33+
version: 8
34+
- run: pnpm add -g [email protected]
3335

3436
- name: Run github-label-sync
3537
run: |

.github/workflows/test.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Lint
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4.1.1
14+
- uses: actions/checkout@v4
1515

1616
- name: Internal github app token
1717
id: token
@@ -21,26 +21,24 @@ jobs:
2121
app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
2222
private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
2323

24-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
25-
id: setup-node
24+
- uses: actions/setup-node@v4
2625
with:
27-
node-version-file: 'package.json'
28-
29-
- uses: actions/cache@v4
30-
id: cache
26+
node-version: '20'
27+
cache: 'pnpm'
28+
cache-dependency-path: 'pnpm-lock.yaml'
29+
- uses: pnpm/action-setup@v4
3130
with:
32-
path: ${{ github.workspace }}/node_modules
33-
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
34-
- run: yarn install --frozen-lockfile
31+
version: 8
32+
- run: pnpm install --frozen-lockfile
3533
if: steps.cache.outputs.cache-hit != 'true'
3634

37-
# Additional checks
38-
- run: yarn lint:ts
39-
- run: yarn lint:docs
35+
# Linting
36+
- run: pnpm lint:ts
37+
- run: pnpm lint:docs
4038

41-
# Run automatic fixes (run prettier apart from eslint to also fix mdx files)
42-
- run: yarn lint:prettier:fix
43-
- run: yarn lint:eslint:fix
39+
# Auto-fix formatting to reduce noise in diffs
40+
- run: pnpm lint:prettier:fix
41+
- run: pnpm lint:eslint:fix
4442

4543
# Check (and error) for dirty working tree for forks
4644
# Reason being we need a different token to auto commit changes and
@@ -61,17 +59,15 @@ jobs:
6159
name: Test
6260
runs-on: ubuntu-latest
6361
steps:
64-
- uses: actions/[email protected]
65-
- name: Set up Node
66-
uses: actions/setup-node@v4
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-node@v4
6764
with:
68-
node-version-file: 'package.json'
69-
- uses: actions/cache@v4
70-
id: cache
65+
node-version: '20'
66+
cache: 'pnpm'
67+
cache-dependency-path: 'pnpm-lock.yaml'
68+
- uses: pnpm/action-setup@v4
7169
with:
72-
path: ${{ github.workspace }}/node_modules
73-
key: node-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
74-
- run: yarn install --frozen-lockfile
75-
if: steps.cache.outputs.cache-hit != 'true'
70+
version: 8
71+
- run: pnpm install --frozen-lockfile
7672
- name: Run Tests
77-
run: yarn test
73+
run: pnpm test

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
npm-debug.log*
44
yarn-debug.log*
55
yarn-error.log*
6+
pnpm-debug.log*
67

78
# Runtime data
89
pids
@@ -63,7 +64,7 @@ typings/
6364
# IDE settings
6465
.idea/
6566

66-
# Yarn
67+
# Package manager files
6768
yarn-error.log
6869
.pnp/
6970
.pnp.js
@@ -72,6 +73,9 @@ yarn-error.log
7273
# Yarn Integrity file
7374
.yarn-integrity
7475

76+
# pnpm
77+
.pnpm-store
78+
7579
# wizard files are auto generated
7680
static/_platforms/
7781

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
develop: setup-git
22
[ -f .env.development ] || cp .env.example .env.development
3-
yarn
3+
pnpm install
44

55
setup-git:
66
ifneq (, $(shell which pre-commit))
@@ -9,7 +9,7 @@ endif
99
git config branch.autosetuprebase always
1010

1111
test:
12-
yarn test
12+
pnpm test
1313

1414
preview-api-docs:
1515
bin/preview-api-docs

apps/changelog/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-
55
First, run the development server:
66

77
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
128
pnpm dev
13-
# or
14-
bun dev
159
```
1610

1711
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

apps/changelog/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"build": "prisma generate && next build",
1313
"start": "next start",
1414
"lint": "next lint",
15-
"migrate:dev": "dotenv -e .env.development -- yarn prisma migrate reset"
15+
"migrate:dev": "dotenv -e .env.development -- pnpm prisma migrate reset"
1616
},
1717
"prisma": {
1818
"seed": "node prisma/seed/seed.mjs"
@@ -63,9 +63,5 @@
6363
},
6464
"volta": {
6565
"extends": "../../package.json"
66-
},
67-
"resolutions": {
68-
"@types/react": "npm:[email protected]",
69-
"@types/react-dom": "npm:[email protected]"
7066
}
7167
}

package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@
1111
"url": "https://github.com/getsentry/sentry-docs/issues"
1212
},
1313
"private": true,
14-
"workspaces": [
15-
"./apps/*"
16-
],
1714
"scripts": {
18-
"dev": "yarn enforce-redirects && concurrently \"yarn sidecar\" \"node ./src/hotReloadWatcher.mjs\" \"next dev\"",
19-
"dev:developer-docs": "yarn enforce-redirects && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn dev",
20-
"build:developer-docs": "yarn enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn build",
21-
"build": "yarn enforce-redirects && next build",
22-
"vercel:build:developer-docs": "yarn enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 yarn build",
15+
"dev": "pnpm enforce-redirects && concurrently \"pnpm sidecar\" \"node ./src/hotReloadWatcher.mjs\" \"next dev\"",
16+
"dev:developer-docs": "pnpm enforce-redirects && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm dev",
17+
"build:developer-docs": "pnpm enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm build",
18+
"build": "pnpm enforce-redirects && next build",
19+
"vercel:build:developer-docs": "pnpm enforce-redirects && git submodule init && git submodule update && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm build",
2320
"start": "next start",
2421
"lint": "next lint",
2522
"lint:ts": "tsc --skipLibCheck",
@@ -28,8 +25,8 @@
2825
"lint:eslint:fix": "eslint --fix \"{src,app,scripts}/**/*.{ts,tsx,js,jsx}\"",
2926
"lint:prettier": "prettier --check \"./{src,app,scripts}/**/*.{md,mdx,ts,tsx,js,jsx,mjs}\"",
3027
"lint:prettier:fix": "prettier --write \"./{src,app,scripts}/**/*.{md,mdx,ts,tsx,js,jsx,mjs}\"",
31-
"lint:fix": "yarn run lint:prettier:fix && yarn run lint:eslint:fix",
32-
"sidecar": "yarn spotlight-sidecar",
28+
"lint:fix": "pnpm run lint:prettier:fix && pnpm run lint:eslint:fix",
29+
"sidecar": "pnpm spotlight-sidecar",
3330
"test": "vitest",
3431
"test:ci": "vitest run",
3532
"enforce-redirects": "node ./scripts/no-vercel-json-redirects.mjs"
@@ -133,8 +130,15 @@
133130
"dompurify": "3.2.4",
134131
"@types/dompurify": "3.0.5"
135132
},
133+
"pnpm": {
134+
"overrides": {
135+
"dompurify": "3.2.4",
136+
"@types/dompurify": "3.0.5",
137+
"@types/react": "npm:[email protected]",
138+
"@types/react-dom": "npm:[email protected]"
139+
}
140+
},
136141
"volta": {
137-
"node": "20.11.0",
138-
"yarn": "1.22.22"
142+
"node": "20.11.0"
139143
}
140144
}

0 commit comments

Comments
 (0)