Skip to content

fix(convention): map group-prefixed index files like (0)index to their directory - #36

Merged
ryansolid merged 1 commit into
mainfrom
claude/project-thread-fpqdr5
Oct 27, 2026
Merged

ryansolid merged 1 commit into
mainfrom
claude/project-thread-fpqdr5

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

Found while moving the Solid docs site (solid-docs v2-rebuild) onto the Solid 2 port of SolidBase (kobaltedev/solidbase#174), which routes with filesystem-routing 0.4.

SolidBase orders sidebar pages with group prefixes in the file name: (0)index.mdx, (2)concepts/(0)reactivity.mdx. #12 limited index stripping in routePathFromFile to whole segments (to keep reindex intact). A (0)index segment isn't exactly index, so it now maps to /(0)index, and after the adapters strip groups the page lands at /index instead of /. On the docs site that sent all 14 section index pages, including /, to the 404 route.

The fix strips a trailing index when only (…) group prefixes come before it in the segment. The prefix stays in place, and the emission adapters strip it as before. reindex and (0)reindex are unchanged.

Tests

  • routePathFromFile unit cases for (0)index, nested (2)concepts/(0)index, stacked (a)(b)index, and (0)reindex.
  • A PageFileSystemRouter scan of (0)index.tsx, (1)docs/(0)index.tsx and (1)docs/(1)intro.tsx gives /, /docs/ and /docs/intro once groups are stripped.
  • Both new tests fail without the fix. Full suite: 135 passed. Patch changeset included.

Generated by Claude Code

`(0)index.mdx` (SolidBase's ordering prefix) mapped to `/index` after
#12 limited index stripping to whole segments. Keep the group prefix for
the emission adapters to strip and drop the trailing `index`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWPLXmEUSKddsQSHkzN
@ryansolid ryansolid self-assigned this Oct 27, 2026
@ryansolid
ryansolid merged commit e895297 into main Oct 27, 2026
4 checks passed
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