fix: make npm run dev and check-format work on Windows - #35
Open
Chebaleomkar wants to merge 2 commits into
Open
Chebaleomkar wants to merge 2 commits into
Chebaleomkar wants to merge 2 commits into
Conversation
Windows clones with core.autocrlf=true get CRLF files, so npm run check-format fails on every file under Prettier's default endOfLine: lf.
cmd.exe cannot parse inline NODE_ENV=development, so npm run dev exits immediately on Windows. Use cross-env.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #34
Problem: on a fresh Windows clone,
npm run devexits with'NODE_ENV' is not recognized, andnpm run check-formatreports 121 files, because Git checks them out with CRLF line endings.Fix
.gitattributes(* text=auto eol=lf) so text files are checked out with LF. The files in the repository are already LF, so renormalizing changes no files.devscript's server command throughcross-env(new devDependency) soNODE_ENV=developmentworks incmd.exe. The lockfile only addscross-envand its one dependency.No setup docs change: the commands stay the same.
Testing (Windows 11, Node 24.14.0)
npm run check-formatpasses.npm run dev: the server logslistening on http://127.0.0.1:4310, Vite serves on 5173, and/apirequests proxy through.npm ci,lint,typecheck,test(156/156) andbuildall pass.