Skip to content

Commit 7edb25a

Browse files
committed
Clean up CI Workflow (Node Version Warnings + Type Check Fail)
- setup-node@v4 uses Node v24 by default, triggering warnings by declaring v22. Developer and CI tooling is now unified through .nvmrc, CI.yml, and package.json (Current Astro version requires a minimum of 22.12.0 which is documented in package.json; node 24 is the most recent LTS which, used in CI and local dev) - Type checking in Astro assumes that artifacts in .astro/ are available; references in source ts files are connected to these artifacts so tsc throws errors without them. So, `astro sync` must be run before typechecking in CI which creates the artifacts in `.astro/`. For convenience, `astro sync` is added to the `typecheck` npm script so it works in dev environments and CI.
1 parent 23b60b0 commit 7edb25a

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: pnpm/action-setup@v4
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 22
17+
node-version-file: .nvmrc
1818
cache: pnpm
1919
- run: pnpm install --frozen-lockfile
2020
- run: pnpm lint
@@ -28,10 +28,10 @@ jobs:
2828
- uses: pnpm/action-setup@v4
2929
- uses: actions/setup-node@v4
3030
with:
31-
node-version: 22
31+
node-version-file: .nvmrc
3232
cache: pnpm
3333
- run: pnpm install --frozen-lockfile
34-
- run: pnpm exec tsc --noEmit
34+
- run: pnpm typecheck
3535

3636
build:
3737
name: Build
@@ -41,7 +41,7 @@ jobs:
4141
- uses: pnpm/action-setup@v4
4242
- uses: actions/setup-node@v4
4343
with:
44-
node-version: 22
44+
node-version-file: .nvmrc
4545
cache: pnpm
4646
- run: pnpm install --frozen-lockfile
4747
- run: pnpm build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
"format": "prettier --write .",
1414
"format:check": "prettier --check .",
1515
"prepare": "husky",
16-
"typecheck": "tsc --noEmit"
16+
"typecheck": "astro sync && tsc --noEmit"
1717
},
1818
"lint-staged": {
1919
"*.{ts,astro,md,css,json,yml,yaml}": "prettier --write"
2020
},
21+
"engines": {
22+
"node": ">=22.12.0",
23+
"pnpm": ">=11.5.2"
24+
},
2125
"devDependencies": {
2226
"@astrojs/starlight": "^0.39.3",
2327
"@astrojs/starlight-tailwind": "^5.0.0",

0 commit comments

Comments
 (0)