Commit activity
Last 12 weeks · 21 commits
Community health
4 of 6 standards met
Recent PRs & issues
The route declaration is written through Vite's plugin lifecycle, so a step that runs first can use a stale . now exports and . The function takes a route directory or a router plus the plugin's serialization options. It writes only when contents change and returns when it wrote, or when they already match. The plugin calls with the same router and options as before. The existing serializer is unchanged, and the client router still takes precedence in per-environment configurations. passes (145 tests), and passes. Closes #23
, and are runtime dependencies, and through them every app that uses this package installs 17 more: braces, fill-range, to-regex-range, is-number, glob-parent, is-glob, is-extglob, merge2, fastq, reusify, queue-microtask, run-parallel, the three packages, and picomatch 2. Nothing else in a Vite app needs them. Vite 8 already installs and picomatch 4, which can do the same job. What changed Only used the old libraries: The exported helper calls tinyglobby's with and . It also passes the filesystem root (, or the drive root on Windows) as . When the process cwd is not a path ancestor of the pattern, for example when the route directory is reached through a symlinked path such as on macOS, tinyglobby otherwise skips symlinked subdirectories. The route pattern is built with tinyglobby's . uses with . The source path is already POSIX-normalized, and picomatch 4's Windows mode would read the pattern's escapes as path separators. and replace the three old dependencies, and is a devDependency only. Behavior differences Fixed: when the route directory's path contains an apostrophe and more than one extension is configured, fast-glob returned no files, so the app silently had no routes. tinyglobby finds them. Regressed: inside a symlinked route directory, a nested directory symlink whose target starts with the outer target's path is skipped. Two shapes hit this: with , and with . fast-glob scans both. The cause is the loop check in fdir (the crawler tinyglobby uses), which compares path prefixes, and fdir 6.5.0, its latest release, still does this. Unrelated nested symlinks still scan. Avoiding this would mean replacing tinyglobby with a small walker of our own, which I left out to keep this change small. The changeset notes both. Verification passes with 300 tests, and and are clean. Two new tests in cover a route directory with in its path, and a symlinked route subdirectory reached through a symlinked directory. Both fail on . A throwaway script compared the old and new and on 2,304 cases, run once with real paths and once through the macOS symlink. The cases cover 18 directory names with glob characters, dotfiles, dot directories, , symlinked files and directories, and four extension sets. The only mismatches were the apostrophe fix above. Without the change, the run through had 72 mismatches. A packed tarball installed into copies of , and from solidjs/templates#344 removes 20 lockfile packages from each and adds none. Build, vitest, type check and oxlint pass. The build output matches the 0.5.0 build apart from hashes that depend on the install path. With the dev server running, , , and returned 200 and an unknown path returned 404. A route file added while the server was running was served on the next request. That check ran before the change, which affects only symlinked layouts. Windows was not tested locally. The CI matrix runs on . 🤖 Generated with Claude Code
Recent fixes
When route metadata is reexported from a page module, selecting only from the wrapper still loads the page's component dependency and CSS. Selecting directly from the page isolates them. I'd like to clarify the intended boundary before proposing a production change. My consumer loads route metadata in an isolated server runner to generate static artifacts. It currently rewrites named reexport sources to pass the selected names through. Removing that workaround would simplify the integration, but unconditional propagation has an identity problem. Reproduction Executable fixture and assertions, based on . The first test run characterizes the current behavior and passes all 14 cases. The second asks for transitive isolation and fails in three cases: dev SSR, client build and SSR build. The relevant pattern is: The selected wrapper retains . The source module is loaded without a pick. The fixture gives the component dependency an observable side effect and sets , so the build comparison does not depend on ordinary dead-code elimination. Why a source rewrite is insufficient A test-only rewrite to isolates the component dependency. When another consumer imports the full page, however, it creates a second instance: This happens in dev SSR and in the executed SSR bundle. It is related to the module-identity concern in #16 and #17. This fixture uses an observable initializer; it does not reproduce or the HTTP 405 path itself. Moving metadata into a separate module works with the current API: it avoids loading the component dependency and preserves the same metadata instance. That adds an explicit module boundary for consumers to maintain. Contract question Should picks remain module-local, with separate metadata modules as the supported pattern, or would a narrowly scoped selection mechanism for isolated loading graphs fit this package? Any transitive behavior would need to define module identity, aliases, multiple selected names, existing queries, explicit side effects and . The reproduction also confirms that stays unchanged; expanding its behavior is outside this proposal. Validated with Node 24.15.0, Vite 6.4.3 and Vitest 2.1.9. The full suite passes 127 tests; TypeScript, build and formatting checks pass. Vite 7/8, HMR and browser execution were not tested. The linked commit contains only the reproduction tests.
Would a helper fit the neutral manifest API? My Knip config uses to find page and HTTP handler modules. Extracting their source paths currently needs a type guard and a loop over the reserved keys because the manifest's index signature is . With a typed helper, that part becomes: The proposed result is an array of pairs. It keeps and keys, order, ref identity and separate refs for different picked exports of the same source. It skips null/undefined refs and only visits direct properties of a neutral entry. I have an implementation ready in the linked branch, reused by the Vite build-input and type-generation paths. Build and all 116 tests pass. In my app, it produces the same refs as the existing extraction for all three route directories (9, 1 and 26 modules). The immediate benefit is removing two small helpers from tooling. That is a modest gain, so I'd like your view on whether it warrants a public API before opening another PR. Implementation: https://github.com/everton-dgn/filesystem-routing/commit/cca30bd3a6b40467145db12c4cde876420f90bbe
_Requested by Ryan · project thread_ This fixes the three bugs #37 listed under "Left open". The old Babel pass had them too. It also moves the #37 changeset from to , so the next release is 0.5.0. Fixes Nothing left after picking. The pass used to return , so Vite served the original module with every unpicked export and its imports, server code included. It now returns an empty module. CSS module bindings. If was not picked, every import was removed, including , which left undefined in picked code. This happens for server-component pages, which pick only . Stylesheets imported only for their side effect are still removed. Imports with bindings now go through the normal sweep, so they stay while something reads them and are removed when nothing does. Dead cycles that run at evaluation.** In , was removed because only the dead / cycle reaches it, but 's initializer still calls when the module loads, which threw a . The reachability graph now counts a reference outside any function body as live. Cycles whose references are all inside function bodies are still removed, as before. Verification passes, and passes with 298 tests. The Babel comparison suite still matches, except for two cases: an empty pick now compares as an empty body, and CSS module imports that picked code reads are allowed to stay. Three new tests pin each fix and also assert what Babel emitted. The core Solid rules docs (RULES-FUNDAMENTALS/RULES-DERIVED) cover runtime semantics, so none of their rules apply to this build-time transform. _Generated by Claude Code_
Repository: solidjs/filesystem-routing. Description: Universal Filesystem routing plugin for Vite Stars: 20, Forks: 5. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Latest release: v0.5.0 (6d ago). Open PRs: 2, open issues: 2. Last activity: 4d ago. Community health: 87%. Top contributors: ryansolid, github-actions[bot], brenelz, everton-dgn, Mersho, sabercoy.