Comfy-Org / Comfy-Org/ComfyUI_frontend
Extract locale page composition from Astro frontmatter into covered modules
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 704
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 512
Description
## Summary
Extract locale-aware page-data composition from Astro frontmatter into adjacent instrumented TypeScript modules. Add unit tests for the extracted composition.
## Rationale
Astro files are excluded from V8 coverage. The current locale and canonical URL composition is therefore not covered. This work is intentionally deferred from PR #17244 because that PR changes locale plumbing only, while this issue should apply one consistent pattern across the affected templates.
## Scope
Move non-trivial composition that derives locale-aware page data into covered `.ts` modules beside the relevant Astro files. Preserve existing behavior for:
- `pageContext` calls using `Astro.originPathname`
- `canonicalUrl` and `canonicalLocale`
- localized route construction
- structured-data and JSON-LD inputs
- published locale routes and fallback-canonical routes
Apply the pattern consistently to these areas:
- `apps/website/src/components/customers/CustomerVideoWatchTemplate.astro`
- `apps/website/src/components/learning/LearningDirectoryPage.astro`
- `apps/website/src/components/learning/LearningTutorialPage.astro`
- `apps/website/src/pages/enterprise/managed-builds.astro`
- `apps/website/src/pages/cloud/supported-nodes.astro`
- dynamic supported-node and slug page templates that use the same composition
## Acceptance criteria
- The non-trivial page-data composition is in adjacent instrumented TypeScript modules.
- Astro frontmatter retains only wiring that requires Astro runtime values.
- Tests cover a published localized route.
- Tests cover a held-back locale route that canonicalizes to the English route.
- Tests verify canonical URL, canonical locale, localized routes, and structured-data inputs.
- Existing page output behavior remains unchanged.
## Backlinks
- Source PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/17244
- Source review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/17244#discussion_r3969042005
- Requested by: @mobeenabdullah
Contributor guide
Assessment
This issue has not been assessed yet.