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
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agent notes for template-runtime-display

`@llazyemail/template-runtime-display` is a stateless runtime that renders a whole HTML email from named parts, plus the fragment functions those parts call. No DOM, no I/O, no runtime dependencies. Custom code is just another part. When a part throws, the trace names it.
`@llazyemail/template-runtime-display` is a stateless runtime that renders a whole HTML email from named parts, plus the fragment functions those parts call. No DOM, no I/O. Its only runtime dependency is `@llazyemail/render-template`. Custom code is just another part. When a part throws, the trace names it.

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

Expand Down Expand Up @@ -150,7 +150,7 @@ The Light / Dark preview pins `color-scheme` on the root of each previewed docum
- `head` always emits charset `utf-8`, the viewport meta, a `<title>`, and the hidden preview `<div>`.
- Props and slots are interpolated raw. This package has no escape step. Keep it that way unless the task asks for escaping.
- `bodyText`, `content`, and slot strings are allowed to contain HTML.
- Zero runtime dependencies. Dev tooling stays in `devDependencies`.
- One runtime dependency: `@llazyemail/render-template`. Do not add others. Dev tooling (including `markup-generator`, used only by tests and `scripts/generate.mjs`) stays in `devDependencies`.
- Public types ship from `src/index.ts` through tsup `dts`. Keep `tsconfig` `types` empty so `@types/node` cannot leak into `.d.ts`.

## Add a fragment
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ npx template-runtime-display inspect ./letter.mjs --fail-on error # also exit 1
[![CI](https://github.com/LLazyEmail/template-runtime-display/actions/workflows/ci.yml/badge.svg)](https://github.com/LLazyEmail/template-runtime-display/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Requires **Node.js 24+**. No runtime dependencies. No template registry. Strings you pass are interpolated as HTML.
Requires **Node.js 24+**. One runtime dependency, [`@llazyemail/render-template`](https://github.com/LLazyEmail/render-template), which supplies the part/compose runtime and `RenderError` (see [Dependencies](#dependencies)). No template registry. Strings you pass are interpolated as HTML.

- Agent guide: [AGENTS.md](./AGENTS.md)
- Short index: [llms.txt](./llms.txt)
Expand Down Expand Up @@ -91,7 +91,14 @@ console.log(formatDiff(diffRenders(before, after)));

## Package ecosystem and Lit

This package builds on `@llazyemail/render-template` (currently pinned via GitHub ref `github:LLazyEmail/render-template#0.3.0` in `package.json`). Prefer a published version from GitHub Packages when one is available and compatible, to reduce install fragility.
### Dependencies

| Package | Where | Why |
| ----------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `@llazyemail/render-template` | `dependencies` | The part/compose runtime. `RenderError`, `RenderOptions`, `RenderJob` and `renderMany` come from it and are re-exported. Installed for every consumer. |
| `markup-generator` | `devDependencies` | Only used by `test/write.test.ts` and `npm run generate` (`scripts/generate.mjs`) to write rendered HTML to disk. Not installed for consumers. |

`@llazyemail/render-template` is currently pinned via the GitHub ref `github:LLazyEmail/render-template#0.3.0` in `package.json`. Prefer a published version from GitHub Packages when one is available and compatible, to reduce install fragility.

Parts must return **strings**. Lit `TemplateResult`s are not supported inside parts.

Expand Down
2 changes: 1 addition & 1 deletion docs/email-quality-toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Gmail clips messages over ~102 KB of HTML, and the "View entire message" link hi

### Constraints (from AGENTS.md)

- Zero runtime dependencies: HTML is scanned with small tokenizers and regexes over the markup we generate, not a DOM library. Document that this is a linter for emails (mostly table markup and inline styles), not a general HTML parser, and keep a list of known blind spots in the README.
- No new runtime dependencies (the package already depends only on `@llazyemail/render-template`): HTML is scanned with small tokenizers and regexes over the markup we generate, not a DOM library. Document that this is a linter for emails (mostly table markup and inline styles), not a general HTML parser, and keep a list of known blind spots in the README.
- No template registry. Rules are an array of functions passed in.
- `escapeHtml` is still not applied to props. The linter should _report_ unescaped `<` and `&` in text positions rather than fixing them.
- 100% coverage on new executable files.
Expand Down
2 changes: 1 addition & 1 deletion llms-full.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @llazyemail/template-runtime-display API

Package: `@llazyemail/template-runtime-display`.
Node 24+. Named exports only. No default export. No runtime dependencies. No template registry.
Node 24+. Named exports only. No default export. One runtime dependency (`@llazyemail/render-template`). No template registry.
Import the package root. Builds: ESM `dist/index.js`, CJS `dist/index.cjs`, browser IIFE `dist/index.global.js` (global `TemplateRuntimeDisplay`), types `dist/index.d.ts`.

The runtime is synchronous and stateless. Callers own templates. The same template, props, and slots return the same HTML, including whitespace. Trace `ms` may differ. Omitted optional strings become `''`. Rendered HTML does not contain the word `undefined`. Prop values and slot strings are concatenated as HTML with no escape step.
Expand Down
2 changes: 1 addition & 1 deletion llms.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @llazyemail/template-runtime-display

> Stateless runtime that renders a whole HTML email from named parts and reports the part that broke. Ships an HTML inspector and a `template-runtime-display` CLI (`dev`, `inspect`). No runtime dependencies. Node 24+. Named exports only. No template registry.
> Stateless runtime that renders a whole HTML email from named parts and reports the part that broke. Ships an HTML inspector and a `template-runtime-display` CLI (`dev`, `inspect`). One runtime dependency (`@llazyemail/render-template`). Node 24+. Named exports only. No template registry.

- Repo: https://github.com/LLazyEmail/template-runtime-display
- Registry: https://npm.pkg.github.com (scope `@llazyemail`)
Expand Down
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
"live-reload"
],
"dependencies": {
"@llazyemail/render-template": "github:LLazyEmail/render-template#0.3.0",
"markup-generator": "^4.1.0"
"@llazyemail/render-template": "github:LLazyEmail/render-template#0.3.0"
}
}
Loading