Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

The package is stateless, so loading the ESM and CJS builds in one process is safe.

## Lit and render-template notes

Parts must return strings. The package depends on `@llazyemail/render-template` (see `package.json`). Lit `TemplateResult` objects cannot be returned from a part `render` function. Consumers that still author with Lit keep a local `renderEmailBody` / `stripLitMarkers` step that produces a string, then feed that string into the shell helpers or `renderTemplate`.

Do not vendor or reimplement the part/compose runtime; use the re-exports from this package or from `render-template` directly. Generation logic belongs in `@llazyemail/generate-template`.

## Commands

```bash
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Requires **Node.js 24+**. No runtime dependencies. No template registry. Strings
- Full API: [llms-full.txt](./llms-full.txt)
- Sample: [examples/compose.ts](./examples/compose.ts)

## Package ecosystem and Lit

This package builds on `@llazyemail/render-template` (currently pinned via GitHub ref in `package.json`). Parts must return **strings**. Lit `TemplateResult`s are not supported inside parts.

Consumers that still use Lit SSR (e.g. `_playing_with_lit`) keep a thin local adapter (`renderEmailBody` + `stripLitMarkers`) that turns a Lit result into a string, then pass that string into `document` / `renderTemplate` / `renderEmail`. Do not try to put Lit templates directly into a part `render` function — that is a known source of runtime errors.

Generation/catalog/write logic belongs in `@llazyemail/generate-template`, not here.

## Install

Published to GitHub Packages. Copy [`.npmrc.example`](./.npmrc.example) to `.npmrc` in the consuming project. `GITHUB_TOKEN` needs `read:packages`.
Expand Down
Loading