Skip to content

Route scanner: map file paths to URL patterns #7

@qantrepreneur

Description

@qantrepreneur

What to build

Implement the route scanner that reads the file system (or a provided file map) and converts file paths under /src/routes/ into URL patterns.

Conventions:

  • routes/index.tsx/
  • routes/about.tsx/about
  • routes/blog/index.tsx/blog
  • routes/blog/[slug].tsx/blog/:slug
  • routes/products/[category]/[id].tsx/products/:category/:id

Returns an array of route entries with the URL pattern, param names, and reference to the source file path.

Acceptance criteria

  • Converts file paths to URL patterns correctly
  • Extracts [param] segments into named parameters
  • Handles index.tsx as the directory root
  • Ignores non-route files (files not ending in .tsx)
  • Returns sorted route entries (static routes before dynamic ones for matching priority)
  • Unit tests for all path conventions including nested dynamic segments

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions