Skip to content

feat(example): add file-system routing example#85

Merged
uhyo merged 1 commit intomasterfrom
feat/example-fs-routing
Mar 22, 2026
Merged

feat(example): add file-system routing example#85
uhyo merged 1 commit intomasterfrom
feat/example-fs-routing

Conversation

@uhyo
Copy link
Owner

@uhyo uhyo commented Mar 22, 2026

Summary

  • Add a new example package (packages/example-fs-routing/) demonstrating userland file-system routing
  • Uses import.meta.glob to automatically discover page components in src/pages/ and map them to URL routes via @funstack/router
  • Includes three example pages: Home (/), About (/about), Blog (/blog)

How it works

  1. src/routes.tsx uses import.meta.glob("./pages/**/*.tsx", { eager: true }) to discover pages at compile time
  2. File paths are converted to URL paths (e.g., pages/blog/index.tsx/blog)
  3. Routes are passed to @funstack/router for client-side navigation
  4. src/entries.tsx derives EntryDefinition[] from the routes for static HTML generation

Test plan

  • pnpm install succeeds
  • pnpm --filter funstack-static-example-fs-routing build generates index.html, about.html, blog.html
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm format:check passes

🤖 Generated with Claude Code

Add a new example package demonstrating userland file-system routing
with import.meta.glob and @funstack/router. Pages in src/pages/ are
automatically discovered and mapped to URL routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@uhyo uhyo merged commit 19e6a8e into master Mar 22, 2026
2 checks passed
@uhyo uhyo deleted the feat/example-fs-routing branch March 22, 2026 02:09
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.

1 participant