Skip to content

Commit e1125da

Browse files
committed
claude workflow fix for pnpm
1 parent 1cdc8a9 commit e1125da

2 files changed

Lines changed: 32 additions & 8 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ jobs:
3434
- name: Detect package manager
3535
id: detect-package-manager
3636
run: |
37-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
37+
if [ -f "${{ github.workspace }}/pnpm-lock.yaml" ]; then
38+
echo "manager=pnpm" >> $GITHUB_OUTPUT
39+
echo "command=install" >> $GITHUB_OUTPUT
40+
echo "runner=pnpm" >> $GITHUB_OUTPUT
41+
exit 0
42+
elif [ -f "${{ github.workspace }}/yarn.lock" ]; then
3843
echo "manager=yarn" >> $GITHUB_OUTPUT
3944
echo "command=install" >> $GITHUB_OUTPUT
4045
echo "runner=yarn" >> $GITHUB_OUTPUT
@@ -48,6 +53,11 @@ jobs:
4853
echo "Unable to determine package manager"
4954
exit 1
5055
fi
56+
- name: Setup pnpm
57+
if: steps.detect-package-manager.outputs.manager == 'pnpm'
58+
uses: pnpm/action-setup@v3
59+
with:
60+
version: 9
5161
- name: Setup Node
5262
uses: actions/setup-node@v4
5363
with:
@@ -67,10 +77,10 @@ jobs:
6777
path: |
6878
.next/cache
6979
# Generate a new cache whenever packages or source files change.
70-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
80+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
7181
# If source files changed but packages didn't, rebuild from a prior cache.
7282
restore-keys: |
73-
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
83+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}-
7484
- name: Install dependencies
7585
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
7686
- name: Build with Next.js

tsconfig.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"compilerOptions": {
3-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
48
"allowJs": true,
59
"target": "ES6",
610
"skipLibCheck": true,
@@ -11,17 +15,27 @@
1115
"moduleResolution": "bundler",
1216
"resolveJsonModule": true,
1317
"isolatedModules": true,
14-
"jsx": "preserve",
18+
"jsx": "react-jsx",
1519
"incremental": true,
1620
"plugins": [
1721
{
1822
"name": "next"
1923
}
2024
],
2125
"paths": {
22-
"@/*": ["./*"]
26+
"@/*": [
27+
"./*"
28+
]
2329
}
2430
},
25-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26-
"exclude": ["node_modules"]
31+
"include": [
32+
"next-env.d.ts",
33+
"**/*.ts",
34+
"**/*.tsx",
35+
".next/types/**/*.ts",
36+
".next/dev/types/**/*.ts"
37+
],
38+
"exclude": [
39+
"node_modules"
40+
]
2741
}

0 commit comments

Comments
 (0)