Plain JS typography template for MTE plugin.
More information: https://github.com/LLazyEmail/documentation/blob/main/docs/templates/hn/details.md
npm install| Command | Description |
|---|---|
npm test |
Run tests with Vitest |
npm run test:watch |
Vitest watch mode |
npm run typecheck |
Typecheck with tsc --noEmit |
npm run lint |
Lint src/ with ESLint |
npm run lint:fix |
Auto-fix ESLint issues |
npm run format |
Format source files with Prettier |
npm run format:check |
Check formatting without writing |
npm run build |
Build CJS, ESM, and IIFE bundles with tsup |
npm run dev |
Watch mode build |
src/
components/ # Individual typography component functions
components.js # Aggregates all components into a single export
config.js # Shared configuration values
index.js # Package entry point
tests/
*.test.js # Vitest unit tests
*.test.ts # Typed Vitest examples
Each component is a plain function that accepts props and returns an HTML string:
headingComponent–<h3>section headingtitleComponent–<h1>main titlesubtitleComponent– styled<p>subtitleparagraphComponent– body text wrapper<div>strongComponent–<strong>bold textitalicComponent–<i>italic textlinkComponent–<a>anchor taglistComponent–<ul>unordered listlistItemComponent–<li>list item with inner<p>imageComponent–<img>inside a centered<p>separatorComponent– horizontal***separatorbuttonComponent– styled<a>button link
Bundled with tsup. npm run build writes:
dist/index.cjs.js— CommonJS (main)dist/index.es.js— ESM (module)dist/index.iife.js— browser IIFE (browser, globalnewsletterLayoutsTypographyPlainJS)
Tests run with Vitest. There is no Jest or Babel in the toolchain.