Skip to content

feat: expose route type generation without Vite - #24

Open
everton-dgn wants to merge 1 commit into
solidjs:mainfrom
everton-dgn:feat/write-route-types
Open

everton-dgn wants to merge 1 commit into
solidjs:mainfrom
everton-dgn:feat/write-route-types

Conversation

@everton-dgn

Copy link
Copy Markdown

The route declaration is written through Vite's plugin lifecycle, so a tsc step that runs first can use a stale file-routes.d.ts.

filesystem-routing/vite now exports writeRouteTypes and WriteRouteTypesOptions. The function takes a route directory or a router plus the plugin's serialization options. It writes only when contents change and returns true when it wrote, or false when they already match.

The plugin calls writeRouteTypes with the same router and options as before. The existing serializer is unchanged, and the client router still takes precedence in per-environment configurations.

pnpm test passes (125 tests), and pnpm exec tsc --noEmit passes.

Closes #23

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

Successfully merging this pull request may close these issues.

Generate route declarations without starting Vite

1 participant