Skip to content

Add EmailBuilder editor integration guide #55

Description

@patoperpetua

Parent: #7
Depends on: #5

Goal

Document how a consumer embeds @singleton-sd/post-kit-editor in a React admin application so an internal user can edit EmailBuilder.js template sources, preview them, and persist changes through a consumer-controlled persistence adapter that ultimately feeds the Git-backed publish pipeline. This covers the epic's "Admin template editing" scenario and its editor-integration work item.

Scope

Add docs/guides/editor-integration.md

  • What the editor package is and is not: an authoring surface for template.json sources; it does not send email, does not hold PostKit send credentials, and does not write to Azure Blob Storage.
  • Installation and peer requirements (React version, bundler expectations) as actually shipped by the package.
  • A minimal embedding example: mounting the editor component, loading an existing template.json, and receiving edited output.
  • The persistence adapter contract as implemented: the interface the consumer implements to load and save template sources, and worked notes for the two expected backings — committing to the consumer repo via a PR, and staging to a consumer-owned store before promotion.
  • Preview: how preview.json sample data drives the in-editor preview, and how preview relates to the server-side Handlebars render (call out any behaviour differences rather than implying they are identical).
  • How the editor output joins the documented lifecycle: editor -> content/email-templates/<key>/ -> PR -> CI -> post-kit-publish -> Blob. Link docs/guides/template-authoring.md and docs/guides/template-publishing.md instead of restating them.
  • Access control guidance: the editor is an internal admin surface; the admin app owns authentication and authorisation, and the PostKit send credential must not be present in the admin browser bundle.

Add examples/admin-editor/

  • README.md — what the example demonstrates and how to run it.
  • A minimal React embedding plus an in-memory persistence adapter implementation, kept as small as the package allows.
  • A node --test spec covering the adapter contract (load returns stored source; save round-trips; a save failure surfaces to the caller) without rendering a full browser environment if the package does not require it.
  • package.json — private, not published, with a test script.

Update docs/README.md

  • Add a row and structure entry for the guide.

Constraints

  • Blocked until Epic: Build the reusable EmailBuilder.js admin editor package #5 is closed. The editor package does not exist yet; do not start this issue, and do not stub or invent the package's API. Document the API that ships.
  • Do not build a full admin application — a minimal embedding plus an in-memory adapter is the target.
  • The example must not include or require a PostKit send credential.
  • Do not modify the editor package source from this issue; API gaps go back to Epic: Build the reusable EmailBuilder.js admin editor package #5 as comments.
  • Public repository: placeholder tenants and example.com addresses only.
  • If pnpm-workspace.yaml does not yet include an examples/* glob, add only that line.

Acceptance criteria

  • docs/guides/editor-integration.md documents installation, embedding, the persistence adapter contract, and preview behaviour as actually implemented in @singleton-sd/post-kit-editor.
  • The guide states clearly that the editor holds no PostKit send credential and that the admin app owns authentication/authorisation.
  • The editor's place in the edit -> PR -> CI -> Blob -> send lifecycle is documented with links to the authoring and publishing guides.
  • Any difference between in-editor preview and server-side render is stated explicitly.
  • examples/admin-editor/ contains a minimal embedding, an in-memory persistence adapter, a passing spec, and a README.
  • The example package is private and excluded from publication.
  • pnpm -r --if-present run test, pnpm lint, and pnpm format:check pass.
  • docs/README.md lists the new guide.

Agent implementation notes

Do not start until #5 is closed. When it is, read the shipped packages/post-kit-editor source, README, and specs first, and confirm the persistence adapter interface from the code before writing any of it down. Also read docs/guides/template-authoring.md and docs/guides/template-publishing.md (from the sibling documentation issues under #7) so the lifecycle description stays consistent. Branch: docs/55-editor-integration-guide.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedHas an unresolved Depends on: line (docs/github-source-of-truth.md, section 5) — do not claimdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions