$ show roxiness/routify
Routify (@roxi/routify) is a file‑based routing framework for Svelte applications. It provides a build‑time plugin system that parses a directory structure (files, `_module`, `_reset`, `[param]`, `[...spread]`) into a route tree, and a runtime that renders routes with support for multiple routers, decorators, inline pages, and SSR/SSG. The library integrates with Vite via a dedicated plugin and with Express for server‑side rendering. It is not a standalone application but a library published on npm, with a CLI (`routify build`, `routify create`) and a rich set of example projects demonstrating usage with SvelteKit, Tailwind, TypeScript, mobile layouts, and more. The codebase is well‑structured, with clear separation between build‑time and runtime logic, a plugin architecture, and comprehensive tests. Despite its pre‑release version (`3.0.0‑next.22`), the library is actively maintained and production‑ready for many use cases.
The LLM identified 2 files worth highlighting for reuse:
A generic Svelte component that places an anchor (`<a>` element) at a configurable DOM location (wrapper, parent, firstChild, custom) and delegates click events. It is used by both the Router and RenderFragment to handle navigation clicks. The component is self‑contained, relying only on Svelte's `on:click` and slot mechanisms, making it extractable for any SPA routing system that needs to intercept link clicks.
A pure JavaScript function that transforms a list of file paths (with metadata) into a nested node tree representing the route hierarchy. It handles conventions like `_module`, `_reset`, `[param]`, `[...fallback]`, and `index`. The function is decoupled from the rest of the filemapper plugin and could be reused to generate a route tree from any file‑based structure, such as documentation or static site generators, with minimal adaptation.