Skip to content

chore: make fsRoutes dir and adapter required, add next-adapter convenience module#125

Merged
uhyo merged 3 commits into
masterfrom
claude/fsroute-required-fields-55kede
Jun 27, 2026
Merged

chore: make fsRoutes dir and adapter required, add next-adapter convenience module#125
uhyo merged 3 commits into
masterfrom
claude/fsroute-required-fields-55kede

Conversation

@uhyo

@uhyo uhyo commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Tightens the experimental fsRoutes plugin option so users are explicit rather than relying on opinionated defaults, and adds a bundled convenience adapter so opting into the built-in convention stays a one-liner.

This is a breaking change to the (experimental) fsRoutes API — not yet covered by semantic versioning.

Changes

  • Make fsRoutes.dir and fsRoutes.adapter required. Both previously had opinionated defaults (dir"./src/pages", adapter → the built-in nextRoutes()); they must now be specified. root was already required.
  • Add the @funstack/static/fs-routes/next-adapter convenience module. A bundled module that export defaults nextRoutes(), so users can point adapter at it to use the built-in Next.js-like convention without writing their own re-export file.
  • Accept bare module specifiers for adapter. The option now resolves either a bare package import (like @funstack/static/fs-routes/next-adapter) or a path relative to the Vite root, instead of always path.resolve-ing against the root.
  • Updated the example, e2e fixture, and docs (API reference + File-System Routing guide) accordingly.

Usage after this change:

funstackStatic({
  ssr: true,
  fsRoutes: {
    dir: "./src/pages",
    root: "./src/root.tsx",
    adapter: "@funstack/static/fs-routes/next-adapter",
  },
});

Commits

  1. chore: make fsRoutes dir and adapter required
  2. feat: add @funstack/static/fs-routes/next convenience adapter module
  3. refactor: rename convenience module to @funstack/static/fs-routes/next-adapter

Test plan

  • pnpm build — emits dist/fs-routes/next-adapter.{mjs,d.mts}
  • pnpm typecheck clean
  • pnpm test:run — 51 unit tests pass
  • pnpm lint / pnpm format:check clean
  • Built the fs-routing e2e fixture directly — all 7 pages generate, confirming the bare-specifier adapter resolves end to end

Note: the Playwright e2e suite couldn't run to completion in the sandbox (the pre-installed Chromium is at a different path than the chrome-headless-shell the runner expected) — an environment issue, unrelated to these changes. The build phase those tests depend on succeeded.

🤖 Generated with Claude Code

https://claude.ai/code/session_019KZaV9B4HmtACBqoPdL8qK


Generated by Claude Code

claude added 3 commits June 26, 2026 23:40
The experimental `fsRoutes` plugin option previously defaulted `dir` to
`"./src/pages"` and `adapter` to the built-in `nextRoutes()` convention.
Require both fields so users are explicit about the routes directory and
the file-name convention rather than relying on opinionated defaults.

- Make `dir` and `adapter` required in `FsRoutesConfig`
- Drop the default resolution in the plugin and always wire the adapter
  import into the synthesized entries module
- Add explicit `adapter` modules to the example and e2e fixture
- Update API and File-System Routing docs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019KZaV9B4HmtACBqoPdL8qK
Now that `fsRoutes.adapter` is required, provide a bundled module that
`export default`s `nextRoutes()` so users can opt into the built-in
Next.js-like convention without writing their own re-export file:

    fsRoutes: { adapter: "@funstack/static/fs-routes/next", ... }

- Add the `src/fs-routes/next.ts` entry and `./fs-routes/next` package export
- Let `fsRoutes.adapter` accept a bare module specifier (a package import),
  not just a path resolved against the Vite root
- Use the convenience module in the example and e2e fixture
- Update API and File-System Routing docs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019KZaV9B4HmtACBqoPdL8qK
…t-adapter

Rename the bundled adapter module from `@funstack/static/fs-routes/next`
to `@funstack/static/fs-routes/next-adapter` for a clearer name.

- Rename src/fs-routes/next.ts -> next-adapter.ts and the package export
- Update the example, e2e fixture, and docs to the new specifier

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019KZaV9B4HmtACBqoPdL8qK
@uhyo uhyo merged commit 7488d69 into master Jun 27, 2026
2 checks passed
@uhyo uhyo deleted the claude/fsroute-required-fields-55kede branch June 27, 2026 13:58
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.

2 participants