Skip to content

Use canonical Next.js layout #363

@jpmckinney

Description

@jpmckinney

This makes the repo more predictable for developers.

We should defer this work at least until development reaches a quiet period. Just logging as something I noticed.

  • Keep the route groups clear of non-routable files where possible (other than components).
  • Co-locate components used by only one route group.
    • Move (and rename as kebab-case) from top-level components/ into app/[locale]/[state]/analytics/components:
      • FactorIcons.tsx
      • InfoCircle.tsx (only used by output-window)
      • MobileFilterBox.tsx (only used by filter-component)
      • MapChart/ (only used by map-component)
  • Consistently use kebab-case for filenames (sometimes PascalCase is used)
    • Rename files:
      • app/[locale]/datasets/components/{DatasetCards,BreadCrumbs,GraphqlPagination,Filter}.tsx
      • app/[locale]/[state]/analytics/components/RadioButton.*
      • tests/RadioButton.test.tsx
      • lib/serverUtils.ts
    • Rename directory:
      • langSelect/
    • Avoid nested index.tsx:
      • Details/index.tsx to details.tsx
      • Metadata/index.tsx to metadata.tsx
      • PrimaryData/index.tsx to primary-data.tsx
      • Resources/index.tsx to resources.tsx
  • Ideally, rename components/ directories under app/ with an underscore as _components/ https://nextjs.org/docs/app/getting-started/project-structure#route-groups-and-private-folders

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