Comfy-Org / Comfy-Org/ComfyUI_frontend

Extract locale-aware Astro frontmatter builders into tested TypeScript modules

Open
#17,258 0 comments 0 reactions 1 assignee Claimed by @mobeenabdullah View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

Extract non-trivial locale-aware data shaping and structured-data builders from Astro frontmatter into colocated, instrumented TypeScript modules.

This work is deferred from #17244 to keep the localization change focused. The affected logic pre-dates that pull request. The pull request changed locale plumbing from `Astro.url.pathname` to `Astro.originPathname`, and changed structured-data inputs from `locale` to `canonicalLocale` / `canonicalUrl`.

## Rationale

Astro frontmatter is excluded from V8 coverage. The builders cannot receive unit coverage while they remain in `.astro` files.

A single follow-up should apply the convention consistently across the affected locale-aware pages.

## Affected areas

At minimum, review and extract applicable builders from:

- `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`
- `apps/website/src/pages/cloud/supported-nodes/[pack].astro`
- `apps/website/src/pages/customers/[slug].astro`

## Required changes

- Move non-trivial frontmatter data shaping, branching, formatting, and JSON-LD construction into colocated `.ts` modules that the `website-unit` gate instruments.
- Keep Astro components focused on rendering and request-context wiring.
- Add unit tests for the extracted builders.
- Test canonical-locale fallback behavior. In particular, verify that held-back localized pages use the English canonical URL and canonical locale for structured-data and breadcrumb URLs.
- Preserve current rendered output and structured-data semantics.

## References

- Source pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/17244
- Source review thread: https://github.com/Comfy-Org/ComfyUI_frontend/pull/17244#discussion_r3970288851
- Requested by: @mobeenabdullah

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.