Skip to content

Commit 19a5322

Browse files
authored
chore: package upgrades and maintenance (#44)
1 parent 8de6fdb commit 19a5322

File tree

11 files changed

+3027
-2359
lines changed

11 files changed

+3027
-2359
lines changed

.github/workflows/ci.yaml

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,83 +6,76 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
env:
10+
NODE_VER: 22.5
11+
912
jobs:
1013
testCodebase:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: actions/checkout@v4
14-
- name: Use Node.js 20.6.1
15-
uses: actions/setup-node@v4
16-
with:
17-
node-version: 20.6.1
1817

19-
- uses: pnpm/action-setup@v3
18+
- uses: pnpm/action-setup@v4
2019
name: Install pnpm
21-
id: pnpm-install
2220
with:
23-
version: 8
21+
run_install: false
2422

25-
- name: Get pnpm store directory
26-
shell: bash
27-
run: |
28-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
29-
30-
- uses: actions/cache@v4
31-
name: Setup pnpm cache
23+
- name: Use Node.js ${{ env.NODE_VER }}
24+
uses: actions/setup-node@v4
3225
with:
33-
path: ${{ env.STORE_PATH }}
34-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35-
restore-keys: |
36-
${{ runner.os }}-pnpm-store-
26+
node-version: ${{ env.NODE_VER }}
27+
cache: 'pnpm'
28+
29+
- name: Install deps
30+
run: pnpm i
3731

38-
- run: pnpm install
32+
- name: Check linting
33+
run: pnpm lint
3934

40-
- run: pnpm run lint
41-
- run: pnpm run typecheck
35+
- name: Check typecheck
36+
run: pnpm typecheck
4237

4338
testCli:
4439
runs-on: ubuntu-latest
4540
steps:
4641
- uses: actions/checkout@v4
47-
- name: Use Node.js 20.6.1
48-
uses: actions/setup-node@v4
49-
with:
50-
node-version: 20.6.1
5142

52-
- uses: pnpm/action-setup@v3
43+
- uses: pnpm/action-setup@v4
5344
name: Install pnpm
54-
id: pnpm-install
5545
with:
56-
version: 8
57-
58-
- name: Get pnpm store directory
59-
shell: bash
60-
run: |
61-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
46+
run_install: false
6247

63-
- uses: actions/cache@v4
64-
name: Setup pnpm cache
48+
- name: Use Node.js ${{ env.NODE_VER }}
49+
uses: actions/setup-node@v4
6550
with:
66-
path: ${{ env.STORE_PATH }}
67-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
68-
restore-keys: |
69-
${{ runner.os }}-pnpm-store-
51+
node-version: ${{ env.NODE_VER }}
52+
cache: 'pnpm'
53+
54+
- name: Install deps
55+
run: pnpm i
7056

71-
- run: pnpm install
72-
- run: pnpm dev:ci
57+
- name: Run the CI with default options
58+
run: pnpm dev:ci
7359

74-
# This is what the user would do, minus actually starting the application
75-
- run: cd my-sidebase-app && npx prisma db push
60+
# setup the database inside the generated app
61+
- name: app:init the database
62+
run: cd my-sidebase-app && npx prisma db push
7663

7764
# code should be 100% correct at the start
78-
- run: cd my-sidebase-app && pnpm lint
79-
- run: cd my-sidebase-app && npm exec nuxi prepare && pnpm run typecheck
65+
- name: app:check linting
66+
run: cd my-sidebase-app && pnpm lint
67+
68+
- name: app:check typing
69+
run: cd my-sidebase-app && npm exec nuxi prepare && pnpm run typecheck
8070

8171
# start dev-app, all of the following adapted from https://stackoverflow.com/a/60996259
82-
- run: "cd my-sidebase-app && timeout 30 npm run dev || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
72+
- name: app:run in dev
73+
run: "cd my-sidebase-app && timeout 30 npm run dev || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
8374

8475
# start prod-app
85-
- run: "export AUTH_ORIGIN=http://localhost:3000 && export AUTH_SECRET=test123 && cd my-sidebase-app && npm run build && timeout 30 npm run preview || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
76+
- name: app:run in prod
77+
run: "export AUTH_ORIGIN=http://localhost:3000 && export AUTH_SECRET=test123 && cd my-sidebase-app && npm run build && timeout 30 npm run preview || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
8678

8779
# start dev-app and curl from it
88-
- run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 20 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
80+
- name: app:test in prod
81+
run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 20 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vite-node src/ -- --nocounting",
88
"dev:ci": "vite-node src/ -- --ci",
9-
"lint": "eslint \"./src/**/*.{ts,tsx}\" --max-warnings=0",
9+
"lint": "oxlint --deny-warnings -D correctness -D suspicious -D perf && eslint \"./src/**/*.{ts,tsx}\" --max-warnings=0",
10+
"lint:fix": "eslint \"./src/**/*.{ts,tsx}\" --max-warnings=0 --fix",
1011
"typecheck": "tsc --noEmit",
1112
"build": "rm -rf dist && tsup src/ --format esm",
1213
"start": "npx",
@@ -43,6 +44,7 @@
4344
"@types/node": "^18.11.16",
4445
"@types/prompts": "^2.4.2",
4546
"eslint": "^8.57.0",
47+
"oxlint": "^0.7.2",
4648
"tsup": "^6.2.3",
4749
"typescript": "^4.8.2",
4850
"vite-node": "^0.25.8"
@@ -59,5 +61,6 @@
5961
"ora": "^6.1.2",
6062
"pkg-types": "^1.0.1",
6163
"prompts": "^2.4.2"
62-
}
64+
},
65+
"packageManager": "[email protected]+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e"
6366
}

0 commit comments

Comments
 (0)