Repository navigation
fix(convention): map group-prefixed index files like (0)index to their directory - #36
Merged
Merged
Conversation
`(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
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withfilesystem-routing0.4.SolidBase orders sidebar pages with group prefixes in the file name:
(0)index.mdx,(2)concepts/(0)reactivity.mdx. #12 limitedindexstripping inroutePathFromFileto whole segments (to keepreindexintact). A(0)indexsegment isn't exactlyindex, so it now maps to/(0)index, and after the adapters strip groups the page lands at/indexinstead of/. On the docs site that sent all 14 section index pages, including/, to the 404 route.The fix strips a trailing
indexwhen only(…)group prefixes come before it in the segment. The prefix stays in place, and the emission adapters strip it as before.reindexand(0)reindexare unchanged.Tests
routePathFromFileunit cases for(0)index, nested(2)concepts/(0)index, stacked(a)(b)index, and(0)reindex.PageFileSystemRouterscan of(0)index.tsx,(1)docs/(0)index.tsxand(1)docs/(1)intro.tsxgives/,/docs/and/docs/introonce groups are stripped.Generated by Claude Code