fix(ci): generate route tree before typecheck + enforce LF line endings
Two CI gaps surfaced on first push: 1. typecheck failed because tsc -b ran before vite build, but src/routeTree.gen.ts is only generated by the Vite plugin during build. tsc has nothing to typecheck against. Fix: install @tanstack/router-cli and chain `tsr generate` before tsc in the typecheck and build scripts. Now any environment that runs typecheck cold (CI, fresh clone) generates the route tree first. Also added a top-level `route-tree` script so the same command is reusable elsewhere if needed. 2. format:check would fail on Windows working trees because git autocrlf (default on Windows) checks files out with CRLF, but .prettierrc pins endOfLine: "lf". Locally the format:check intermittently passed/failed depending on whether files had been recently auto-formatted. Fix: .gitattributes with `* text=auto eol=lf` enforces LF in every working tree. Plus explicit overrides for binary blobs (images) and the route tree file. `git add --renormalize .` brought the index in line with the new policy; no actual file content changed. CI on the next push should now see the same green gates the local working tree shows.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Enforce LF line endings on every platform.
|
||||
# Without this, Windows + git autocrlf (default) checks files out with
|
||||
# CRLF, which conflicts with Prettier's `endOfLine: "lf"` and breaks
|
||||
# format:check on Windows working trees.
|
||||
* text=auto eol=lf
|
||||
|
||||
# Generated route tree (gitignored anyway, but if it ever sneaks in)
|
||||
src/routeTree.gen.ts text eol=lf
|
||||
|
||||
# Lock files: keep LF
|
||||
pnpm-lock.yaml text eol=lf
|
||||
|
||||
# Binary blobs
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.svg text eol=lf
|
||||
Reference in New Issue
Block a user