Skip to content

React 19 - React Router Module - Phase 3: Manifest Generation & CLI Integration #3719

@odinr

Description

@odinr

Phase 3: Manifest Generation & CLI Integration

Parent Objective: #3716
Related User Story: #3715

Objective

Implement route metadata extraction and integrate it with existing app and portal manifest generation commands, ensuring routes are included in build manifests for static analysis and tooling.

Tasks

  1. Create Route Manifest Generator - Implement extractRouteMetadata() function to extract route metadata from RouteNode[]

    • Implement extractRouteMetadata() function
    • Extract route metadata from RouteNode[] recursively
    • Generate manifest structure: { path, description, params, search, children? }
    • Ensure no file paths or component references in manifest
    • Support routes defined in multiple files
    • Handle routes with dynamic segments, optional segments, and query parameters
  2. Integrate with App Manifest Generation - Update AppBuildManifest and createAppManifestFromPackage() to include optional routes field

    • Update AppBuildManifest type in packages/modules/app/src/types.ts to include optional routes field
    • Update createAppManifestFromPackage() to extract routes from app config
    • Integrate route extraction into ffc app manifest command
    • Ensure routes field is optional (backward compatible)
  3. Integrate with Portal Manifest Generation - Update PortalManifestBuildSchema to include optional routes field

    • Update PortalManifestBuildSchema in packages/cli/src/lib/portal/portal-manifest.schema.ts to include optional routes field
    • Integrate route extraction into ffc portal manifest command
    • Ensure routes field is optional (backward compatible)
  4. Add Route Validation - Implement validation and error reporting for route schemas

    • Implement route schema validation
    • Validate enum values, parameter types
    • Report errors with file locations and clear messages
    • Handle invalid route definitions gracefully

Deliverables

  • extractRouteMetadata() function that extracts route metadata from RouteNode[]
  • Updated AppBuildManifest type with optional routes field
  • Updated PortalManifestBuildSchema with optional routes field
  • Route extraction integrated into ffc app manifest and ffc portal manifest commands
  • Route validation and error reporting

Acceptance Criteria

  • Route metadata is extracted during existing ffc app manifest and ffc portal manifest commands
  • Routes are added to AppBuildManifest and PortalManifestBuildSchema as optional routes field
  • Route extraction runs during build process (before bundling) as part of manifest generation
  • Route extraction does not require app execution or DOM environment
  • CLI validates route schemas and reports errors with file locations during manifest generation
  • Routes in manifest can be consumed by documentation tools, SSG tools, and other build-time tools
  • Routes field is optional - apps without routes still generate valid manifests
  • The manifest contains only: path, description, params, searchno file paths, no component references
  • No runtime cost: manifest is generated before bundling (static analysis only)

Estimated Timeline

Phase 3: 2-3 days

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions