Skip to content

Migrate core module set from BillGrokker WebSPA #4

Closed

Description

@diegohb

Part of #1

Context

Spec: #1. Port the SEO engine's core modules from the BillGrokker SPA into this package, behavior-identical. Source snapshot: Expert-Vision-Software/billgrokker @ 3169c7a10003, SPA root BSUS.BillViewer.Presentation.WebSPA/. The API reference doc is normative (its "Files for package rebuild" and "Hard constraints" sections).

Source files (pinned links ΓÇö port these)

  • seo-page.ts ΓÇö pure-data types: ISeoPage, WebPageSpec, ArticleSpec, FaqPageSpec, TwitterSpec, AppendableList<T>, BreadcrumbItem.
  • seo-service.ts ΓÇö SeoService: atomic emit(), in-memory JSON-LD graph store (eager flush), prepareToNavigate() page-state reset with site-wide + manual-base-node persistence, setUrl(), resolveUrl(), getDefaults(), setSiteName(), siteWide builder, URL hygiene guard, SeoLogger interface + no-op default + logger config injection.
  • seo-page-builder.ts ΓÇö IPageBuilder, SeoPageBuilder (L1), ContentPageBuilder (L2) with parent delegation + end(), createBuilder().
  • seo-specs.ts ΓÇö DateOnly, SeoDateInput, normalizeSeoDate() (DateOnly ΓåÆ ISO with +00:00 offset).
  • seo-config.ts ΓÇö SeoConfig + HtmlSeoConfigParser (confirmed decision: travels into the package; operates on a host-provided document so it stays host-agnostic).

Not ported (app-level by design): breadcrumb constants (already extracted app-side), seo-service.di.ts (Aurelia DI token ΓÇö consumer-side), initialization AppTask, navigation handler.

Semantics that must survive the port exactly

  • emit() merge table: scalar fields replace; bare-array lists replace; { append: [...] } merges; graph nodes (webPage, article, faqPage) upsert by canonicalPath and set the active id; absent fields leave current page-state untouched.
  • prepareToNavigate() clears page state; site-wide nodes and manual base nodes (setLogo/setOrganization/setWebApplication/setBaseGraphNode) persist and are the exclusive base-node source (no DOM-parsed JSON-LD reads).
  • URL hygiene guard throws on absolute URLs matching rootUrl for setUrl/setCanonicalPath/setWebPage/setArticle/setFaqPage (setImage exempt) with the byte-identical error message.
  • L2 contentPage() seeds webPage + article, ogType: "article", root-value inheritance (title/description/url fan out unless explicitly set), setDates fan-out, setAbout/setSection/setQuestion.
  • JSON-LD output is byte-identical: @id ordering, key insertion order, @context/@graph shape.

Structure

  • Preserve file/identifier names; keep the relative import graph: seo-page ΓåÉ schema-dts only; seo-specs standalone; seo-page-builder ΓåÉ seo-page + seo-specs + schema-dts; seo-config ΓåÉ schema-dts; seo-service ΓåÉ the above + schema-dts.
  • src/index.ts re-exports the public surface: SeoService, createBuilder, all spec types, SeoConfig/HtmlSeoConfigParser, normalizeSeoDate, SeoLogger.

Constraints

  • Zero framework imports (Aurelia/React/Vue); runtime dependency = schema-dts only.
  • No code comments (house style; ported files are already comment-free).
  • Strict tsc clean.

Acceptance criteria

  • All five modules ported; import graph matches the target (verified: no non-schema-dts runtime imports).
  • npm run build emits dist/ + declarations; tsc --noEmit strict-clean.
  • Public surface exported from src/index.ts (list in PR body).
  • Placeholder equivalence: a trivial smoke test constructs SeoService against jsdom and emits a minimal spec successfully.

Dependencies

Downstream

Activity

  1. added a commit that references this issue on Nov 23, 2026
  2. diegohb commented on Nov 23, 2026

    @diegohb
    MemberAuthor

    Merged via #10 into integration branch issue-1-initial-rollout-spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions