Skip to content

fix(create-pages): clean path mapping of pathless groups #1593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tylersayshi
Copy link
Member

@tylersayshi tylersayshi commented Aug 3, 2025

this generates the correct mapping for paths using pathless groups

fixes #1574

Copy link

vercel bot commented Aug 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Aug 4, 2025 0:19am

Copy link

codesandbox-ci bot commented Aug 3, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

pkg-pr-new bot commented Aug 3, 2025

Open in StackBlitz

npm i https://pkg.pr.new/wakujs/waku@1593

commit: 3c05dbd

this generates the correct mapping for paths using pathless groups

fixes #1574
@tylersayshi tylersayshi force-pushed the fix-pathless-group-mapping branch from e945118 to 3c05dbd Compare August 4, 2025 00:18
@tylersayshi tylersayshi changed the title start fix for pathless group mapping for #1574 fix(create-pages): clean path mapping of pathless groups Aug 4, 2025
@tylersayshi tylersayshi marked this pull request as ready for review August 4, 2025 00:19
const hasWildcard = pathSpec.some((spec) => spec.type === 'wildcard');
// remove pathless groups
const cleanPathSpec = pathSpec.filter(
(spec) => !(spec.type === 'literal' && spec.name.startsWith('(')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't prefer this. Can you separate utils for define-router and create-pages? I hope to have separate files for each. Or only utils.ts should be for the define-router notion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would you feel about moving the functions that are only used for create-pages just into the create-pages.ts file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that will be good.

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.

Segment Routes not working as expected in Grouped Routes
2 participants