Skip to content

Add support for Next.js dynamic route directory naming (/path/[<paramName>]/) #23102

@peter-woyzbun

Description

@peter-woyzbun

Is your feature request related to a problem? Please describe.
Pants does not support using [ and ] in directory names. This is how Next.js defines "dynamic routes" (https://nextjs.org/docs/app/getting-started/project-structure#dynamic-routes) via directory naming convention. E.g.:

  • Path to React component: app/blog/[slug]/page.tsx
  • URL: /blog/my-first-post

As it stands, trying to use this convention will result in Pants erroring out.

Describe the solution you'd like
Allow the use of [ and ] in directory names.

Describe alternatives you've considered
n/a

Additional context
Happy to add this feature but would need some initial guidance on where to start/whether it's feasible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions