Repository navigation
Closed
Labels
Description
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: atomicemit(), in-memory JSON-LD graph store (eager flush),prepareToNavigate()page-state reset with site-wide + manual-base-node persistence,setUrl(),resolveUrl(),getDefaults(),setSiteName(),siteWidebuilder, URL hygiene guard,SeoLoggerinterface + no-op default +loggerconfig 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:00offset). - 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 bycanonicalPathand 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
rootUrlforsetUrl/setCanonicalPath/setWebPage/setArticle/setFaqPage(setImageexempt) with the byte-identical error message. - L2
contentPage()seedswebPage+article,ogType: "article", root-value inheritance (title/description/url fan out unless explicitly set),setDatesfan-out,setAbout/setSection/setQuestion. - JSON-LD output is byte-identical:
@idordering, key insertion order,@context/@graphshape.
Structure
- Preserve file/identifier names; keep the relative import graph:
seo-page←schema-dtsonly;seo-specsstandalone;seo-page-builder←seo-page+seo-specs+schema-dts;seo-config←schema-dts;seo-service← the above +schema-dts. src/index.tsre-exports the public surface:SeoService,createBuilder, all spec types,SeoConfig/HtmlSeoConfigParser,normalizeSeoDate,SeoLogger.
Constraints
- Zero framework imports (Aurelia/React/Vue); runtime dependency =
schema-dtsonly. - No code comments (house style; ported files are already comment-free).
- Strict
tscclean.
Acceptance criteria
- All five modules ported;
importgraph matches the target (verified: no non-schema-dtsruntime imports). -
npm run buildemitsdist/+ declarations;tsc --noEmitstrict-clean. - Public surface exported from
src/index.ts(list in PR body). - Placeholder equivalence: a trivial smoke test constructs
SeoServiceagainst jsdom and emits a minimal spec successfully.
Dependencies
- Blocked by: package scaffold (Scaffold package manifest, toolchain, and license #2). Blocks: golden-master tests (Migrate golden-master unit tests into the package #5), synthesis tests (Baseline synthesis tests: package API reproduces production output #6), docs (Docs: README, API reference, framework integration guidance #7).
Downstream
- Consumer adoption spec: Expert-Vision-Software/billgrokker#36
Activity
Merge pull request #10 from Expert-Vision-Software/issue-4-core-migra…
diegohb commentedon Nov 23, 2026
Merged via #10 into integration branch issue-1-initial-rollout-spec.