mirror of
https://github.com/Donkie/Spoolman.git
synced 2026-10-21 17:42:16 -05:00
Compile paraglide before type-checking client_v2
The type check assumed $lib/paraglide existed, but it's gitignored
output of the paraglide vite plugin, so it only appears once something
runs vite. svelte-check doesn't, which left the job resolving ~40
imports of $lib/paraglide/{messages,runtime} against nothing on any
fresh checkout -- CI every time, and a new clone locally. It went
unnoticed because the job had been dying at exit 127 before it could
get far enough to report, and because a working tree that has ever run
dev or build has the directory sitting there.
The compiler ships a CLI, so this costs a compile rather than a full
vite build. Its flags live in a package.json script that `check` and
the hook both call, leaving one copy to keep in sync with the plugin
options in vite.config.ts.
Claude-Session: https://claude.ai/code/session_01UB5KocsTBm9GL5x3Uuup5F
This commit is contained in:
1 parent
9bdf4d1a5e
commit
aad337234e
2 files changed
+11
-6
No files matched your search
@@ -12,8 +12,9 @@
|
||||
"preview": "vite preview",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"paraglide": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide --strategy localStorage preferredLanguage baseLocale",
|
||||
"check": "npm run paraglide && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "npm run paraglide && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
"lint": "prettier --check . && eslint .",
|
||||
"lint:eslint": "eslint .",
|
||||
|
||||
+8
-4
@@ -36,8 +36,12 @@ pre-commit:
|
||||
stage_fixed: true
|
||||
- name: Run type check on client_v2 files
|
||||
root: "client_v2/"
|
||||
# svelte-kit sync generates .svelte-kit/tsconfig.json, which svelte-check needs.
|
||||
run: ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
|
||||
# Both prerequisites are gitignored generated code, absent on a fresh
|
||||
# clone: paraglide compiles $lib/paraglide (normally done by the vite
|
||||
# plugin, so a non-build check never triggers it), and svelte-kit sync
|
||||
# generates .svelte-kit/tsconfig.json. npm run keeps the paraglide
|
||||
# flags in package.json only, so they can't drift from vite.config.ts.
|
||||
run: npm run paraglide && ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
|
||||
|
||||
# Same as pre-commit but no fixes
|
||||
ci:
|
||||
@@ -72,6 +76,6 @@ ci:
|
||||
run: ./node_modules/.bin/prettier --check .
|
||||
- name: Run type check on client_v2 files
|
||||
root: "client_v2/"
|
||||
# svelte-kit sync generates .svelte-kit/tsconfig.json, which svelte-check needs.
|
||||
run: ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
|
||||
# See the ci hook's copy of this job for why paraglide runs first.
|
||||
run: npm run paraglide && ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
|
||||
|
||||
Reference in new issue
Block a user