tshtml Development Guide
January 21, 2026 · View on GitHub
Repo layout
tshtml/— core library (TypeScript APIs: tag/html builders, render helpers)tshtml-loader/— webpack loader and CLI exporterdocs/— user and development guides, generated typedoc indocs/typedocsamples/— example Angular setup
Prerequisites
- Node.js 18+
- npm 8+
Setup
npm install
Common scripts (root)
npm run build— build both packagesnpm run test— run all tests (tshtml + tshtml-loader)npm run coverage— coverage for both packagesnpm run docs— generate typedoc for tshtmlnpm run clean— remove build and coverage artifacts
Package-specific (workspaces)
npm run build -w tshtml
npm run test -w tshtml
npm run coverage -w tshtml
npm run build -w tshtml-loader
npm run test -w tshtml-loader
npm run coverage -w tshtml-loader
Testing
- Test runner: Jasmine via
tsx ./test/jasmine.js - Snapshot-free; assertions are plain expectations
- Coverage:
nyc(reports incoverage/under each package)
Debugging tests
# In the package folder you want to debug
set-item env:NODE_OPTIONS "--inspect"
npm run test -- --filter "spec name"
# Attach debugger to Node on port 9229
Releasing / publishing
- Build artifacts live in
dist/per package - Ensure tests and coverage pass before publishing
- See Workflows & Publishing for the CI/CD release flow (Changesets + npm trusted publishing)
Coding guidelines
- Prefer the builder APIs (
tag,html,cssClass,expr) - Use TemplateValue implementations for dynamic rendering
- Avoid non-ASCII in source unless required
- Keep JSDoc current; run typedoc after API changes