Skip to content

feat: port core module set from BillGrokker WebSPA (#4) - #10

Merged
diegohb merged 5 commits into
issue-1-initial-rollout-specfrom
issue-4-core-migration
Nov 23, 2026
Merged

diegohb merged 5 commits into
issue-1-initial-rollout-specfrom
issue-4-core-migration

Conversation

@diegohb

@diegohb diegohb commented Nov 23, 2026

Copy link
Copy Markdown
Member

Closes #4

What

Ports the five core SEO modules from the BillGrokker WebSPA snapshot (3169c7a10003) behavior-identically, preserving file and identifier names and the import graph:

  • src/seo-page.ts — pure-data types: ISeoPage, WebPageSpec, ArticleSpec, FaqPageSpec, TwitterSpec, AppendableList<T>, BreadcrumbItem (imports schema-dts only)
  • src/seo-specs.ts — DateOnly, SeoDateInput, normalizeSeoDate() (standalone)
  • src/seo-page-builder.ts — ISeoBuilderTarget, IPageBuilder, SeoPageBuilder (L1), ContentPageBuilder (L2, parent delegation + end()), createBuilder()
  • src/models/seo-config.ts — SeoConfig, GraphDocument, JsonLdScript, HtmlSeoConfigParser (host-provided document)
  • src/seo-service.ts — SeoService (atomic emit() merge semantics, in-memory JSON-LD graph store with eager flush, prepareToNavigate() persistence, URL hygiene guard with the byte-identical error message, siteWide builder, SeoLogger)

Not ported (per ticket): seo-service.di.ts and all Aurelia integration.

Public surface exported from src/index.ts

Types: AppendableList, ArticleSpec, BreadcrumbItem, FaqPageSpec, ISeoPage, TwitterSpec, WebPageSpec, DateOnly, SeoDateInput, GraphDocument, JsonLdScript, SeoConfig, ContentPageBuilder, IPageBuilder, ISeoBuilderTarget, SeoPageBuilder, ISitewideBuilder, SeoLogger, SeoServiceConfig

Values: normalizeSeoDate, HtmlSeoConfigParser, createBuilder, SeoService

Validation

  • bun run typecheck (strict, exactOptionalPropertyTypes, noUncheckedIndexedAccess) — clean
  • bun run lint — clean
  • bun run build — dist/ + .d.ts emitted
  • bun run test — 3/3 jsdom smoke tests via public API (initialize → emit → head output, prepareToNavigate, builder equivalence)
  • Verified: no non-schema-dts runtime imports in dist/ (relative imports only; schema-dts is type-only)

Deviations (strict-mode type-only, no behavior change)

  • Added .js extensions to relative imports (NodeNext ESM requirement).
  • Optional spec fields in seo-page.ts declared as T | undefined for exactOptionalPropertyTypes; service-side ?? "" fallbacks make emitted JSON-LD byte-identical.
  • seo-config.ts: jsonLd = items[0] ?? null guard for noUncheckedIndexedAccess; SeoConfig.jsonLd typed | undefined. Behavior identical.

@diegohb
diegohb merged commit 635b237 into issue-1-initial-rollout-spec Nov 23, 2026
1 check failed
@diegohb
diegohb deleted the issue-4-core-migration branch November 23, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant