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
-
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
-
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)
-
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)
-
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, search — no file paths, no component references
- No runtime cost: manifest is generated before bundling (static analysis only)
Estimated Timeline
Phase 3: 2-3 days
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
Create Route Manifest Generator - Implement
extractRouteMetadata()function to extract route metadata fromRouteNode[]extractRouteMetadata()functionRouteNode[]recursively{ path, description, params, search, children? }Integrate with App Manifest Generation - Update
AppBuildManifestandcreateAppManifestFromPackage()to include optionalroutesfieldAppBuildManifesttype inpackages/modules/app/src/types.tsto include optionalroutesfieldcreateAppManifestFromPackage()to extract routes from app configffc app manifestcommandIntegrate with Portal Manifest Generation - Update
PortalManifestBuildSchemato include optionalroutesfieldPortalManifestBuildSchemainpackages/cli/src/lib/portal/portal-manifest.schema.tsto include optionalroutesfieldffc portal manifestcommandAdd Route Validation - Implement validation and error reporting for route schemas
Deliverables
extractRouteMetadata()function that extracts route metadata fromRouteNode[]AppBuildManifesttype with optionalroutesfieldPortalManifestBuildSchemawith optionalroutesfieldffc app manifestandffc portal manifestcommandsAcceptance Criteria
ffc app manifestandffc portal manifestcommandsAppBuildManifestandPortalManifestBuildSchemaas optionalroutesfieldpath,description,params,search— no file paths, no component referencesEstimated Timeline
Phase 3: 2-3 days