The toolchain

One source file is the input; the Custom Elements Manifest is the hub everything else is derived from.

One source, many artifacts

You write a vanilla custom element. banira reads it once into a Custom Elements Manifest (custom-elements.json) — the ecosystem-standard descriptor — and every other artifact is derived from that single source of truth, so they never drift apart.

The generate pipeline

A typical project regenerates everything from source in one pass:

generate everything
$ banira manifest src/*.ts        -o custom-elements.json
$ banira types    src/*.ts        -o dist/elements.d.ts
$ banira doc      src/my-button.ts -o docs/my-button.html

The same thing, as a library

Everything the CLI does is available as typed exports, so you can wire banira into your own scripts and build steps.

library
import { ManifestGenerator, toTypeDefinitions, DocGen } from 'banira';

const manifest = new ManifestGenerator(['src/my-button.ts']).generate();
const dts = toTypeDefinitions(manifest);
const page = await new DocGen('my-button').generate('src/my-button.ts');
The full set of exports — Compiler, ResultAnalyzer, TestHelper, manifestToMarkdown, validateManifest, diffManifests and more — is documented in the API reference.

Develop and ship

While authoring, banira dev gives you compile-on-save with live reload. For release, banira diff compares two manifests and suggests a semver bump — see CI & release.