Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running kit-routes' codegen step as a one-shot command #783

Open
ewen-lbh opened this issue Nov 26, 2024 · 3 comments
Open

Running kit-routes' codegen step as a one-shot command #783

ewen-lbh opened this issue Nov 26, 2024 · 3 comments

Comments

@ewen-lbh
Copy link
Contributor

Is your feature request related to a problem? Please describe.

We're considering gitignoring lib/ROUTES.ts in our repo. But unfortunately it seems like the file is not generated by vite upon running vite build (fortunately our CI caught the mistake before we could deploy to prod!)

Gitignoring the file allows us to not have to run prettier after every update of the file (which ok, granted, is not that often, but still); reduces merge conflicts and "noise" in PR diffs. Leaving the file checked in allows for a nice summary of the routes that changed, but (to me at least) the fact that the +page.svelte were moved around + the fact that deadlinks are statically impossible anyway makes gitignoring it a better choice

Describe the solution you'd like

Either:

  • Running kit-routes on vite build (arguably the better solution?)
  • Providing us with a generate binary that we can add to our package.json "generate" script (which already has things like svelte-kit sync and houdini generate)

Describe alternatives you've considered

Leaving the file checked into source control

Additional context

net7toulouse pushed a commit to inp-net/churros that referenced this issue Nov 26, 2024
@jycouet
Copy link
Owner

jycouet commented Nov 26, 2024

Hummm, I'm reading reading, but didn't fully get it. (maybe too tired ^^)

A few questions in random order

  • On vite build, ROUTES.ts should be generated today. It's not the case on your side ?
  • Do you run npm run check in your CI? (after build?)
  • I usually prettier ignore this file on my side. Would it be a solution for you?

Thanks for your input.

@ewen-lbh
Copy link
Contributor Author

Okay so yeah i looked at it again, and yeah it's indeed because we run svelte-check before vite build

We should just invert the order i guess

@jycouet
Copy link
Owner

jycouet commented Dec 6, 2024

Did you have time to look ? What should we do here ? (No hurry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants