Introducing a new way to review your PRs.

Read the announcement

bas3line / ascii

Animated ascii art for web pages, in TypeScript: React, Next.js, Astro, or one HTML tag

View on GitHub

21 documents · Updated Oct 26, 2026

docs / quality-and-release-automation

Quality and release automation

The repository uses local checks and GitHub workflows to keep package changes safe and publishable. The checks validate the piece contract, the kit, generated indexes and skills, documentation examples, and the built package before a version reaches npm. See package build and publishing for the package output and publishing model.

Quality gates

The quality gates cover both source correctness and user-facing behavior. TypeScript must typecheck, generated files must match their source inputs, and pieces and kit examples must keep the frame contract that users rely on.

Piece contract

npm run check loads each selected piece and checks its shape, metadata, frames, colors, repeatability, and frame speed. With no piece name, it checks every file in src/pieces; this makes the command the main guard against a piece that imports the wrong runtime resources, returns malformed frames, or changes output between runs. scripts/check.ts• L1-13, scripts/check.ts• L55-73, scripts/check.ts• L117-163

The check also covers the difference between text pieces and colored scenes. It samples frames at fixed times and verifies that the first frame is useful, animated pieces move, and colored output stays inside its palette. scripts/check.ts• L84-97, scripts/check.ts• L132-156

References: scripts/check.ts• L1-13 scripts/check.ts• L55-73 scripts/check.ts• L117-163

Kit validation

The kit has two layers of validation. npm test checks the kit modules and recipes, while npm run kit:examples runs every kit example in dark, paper, and one-ink modes. Together they show that the kit remains usable as a source of pieces across its supported display forms. package.json• L63-73, scripts/…/examples.ts• L19-42

Documentation examples are checked as user code, not only as text. npm run kit:docs builds temporary projects that resolve ascii.rest/kit through the package exports, typechecks the extracted blocks against dist, runs piece blocks, and compares documented frames with the frames the code produces. scripts/…/docs.ts• L1-13, scripts/…/docs.ts• L22-33, scripts/…/docs.ts• L98-153

References: package.json• L63-73 scripts/…/examples.ts• L19-42 scripts/…/docs.ts• L1-13 scripts/…/docs.ts• L98-153

Generated indexes

npm run gen derives the public piece index, the name-based loader, and the agent skill from the files in src/pieces and the documentation. CI runs the generator and then requires no diff in src/…/index.ts, src/library.ts, or skills/, so a new or renamed piece or a documentation edit cannot pass while its generated public data is stale. scripts/gen.ts• L1-5, scripts/gen.ts• L8-16, .github/…/ci.yml• L24-25

References: scripts/gen.ts• L1-5 scripts/gen.ts• L18-45 .github/…/ci.yml• L24-25

Continuous integration

Continuous integration is the shared gate for pull requests and pushes to main. It uses Node 24 with the npm cache, installs from the lockfile, and builds during npm ci through the prepare script. It then checks types, generated indexes and skills, kit tests, examples, and documentation before the change is accepted. .github/…/ci.yml• L3-29

The CI flow moves from low-level source checks to broader user-facing checks. This order makes type and generation errors fail early while still checking the package as a consumer would use it. The workflow has read-only repository permissions, so its job can validate changes without write access. .github/…/ci.yml• L8-10

This diagram shows how a repository change moves through the CI gates.

flowchart TD
    A[Pull request or push to main] --> B[Clean npm install]
    B --> C[Typecheck]
    C --> D[Regenerate indexes and agent skill and require no diff]
    D --> E[Run kit tests]
    E --> F[Run kit examples]
    F --> G[Check kit documentation code]
    G --> H[Change passes CI]

References: .github/…/ci.yml• L3-29 package.json• L63-74

Release publication

Release publication starts only when a tag that begins with v reaches GitHub. The release workflow confirms that the tag version equals package.json, installs from a clean state without a package cache, runs the repository checks and build, then publishes the package to npm. .github/…/release.yml• L1-11, .github/…/release.yml• L20-38

The workflow uses npm trusted publishing instead of a stored npm token. GitHub receives permission to request an identity token, and npm adds provenance to the published package. A version mismatch stops the job before installation and publication. .github/…/release.yml• L3-7, .github/…/release.yml• L12-14, .github/…/release.yml• L27-38

This diagram shows the release path from a version tag to the npm package.

flowchart LR
    A[Push vX.Y.Z tag] --> B[Compare tag with package.json]
    B --> C[Clean npm install]
    C --> D[Run check]
    D --> E[Build package]
    E --> F[Publish to npm with provenance]

References: .github/…/release.yml• L1-11 .github/…/release.yml• L12-14 .github/…/release.yml• L20-38 CONTRIBUTING.md• L134-148

Change checklist

When these files or sections are changed, remember to consider these:

  • When adding or renaming a piece, or changing the docs that feed the agent skill, run npm run gen and include the generated src/…/index.ts, src/library.ts, and skills/ changes.
  • When changing the piece contract or frame rules, review scripts/check.ts and the contributor guidance together so local and CI checks describe the same contract.
  • When changing the kit API, run the kit tests, examples, and documentation checks because each validates a different user path.
  • When changing a documented kit frame, update the shown frame and the code that produces it together.
  • When changing the package version, keep the version in package.json, package-lock.json, and the release tag aligned.
  • When changing release permissions or trusted publishing settings, keep the workflow identity settings aligned with the npm publisher configuration.

Important failure modes

TriggerConsequenceGuard
A piece is added or renamed, or source documentation changes, without regenerating indexes or the agent skillNamed imports, name-based loading, or agent guidance can use stale generated dataCI runs npm run gen and rejects a diff in src/…/index.ts, src/library.ts, or skills/
A piece returns the wrong frame size or unsupported characterThe piece breaks its display contract for pages and terminalsnpm run check samples frames and validates dimensions and characters
A kit example fails in paper or mono modeA supported display mode can break while the default example still worksnpm run kit:examples runs all three modes
A docs code block no longer matches its shown framePublished docs show output that the current package does not producenpm run kit:docs runs the block and compares the frame
A release tag does not match package.jsonThe wrong version could be publishedThe release job exits before build and publish
The release job cannot use trusted publishingnpm rejects publication or provenance is missingThe workflow grants id-token permission and uses the npm registry setup

Key files

FileWhy to read it
.github/…/ci.ymlDefines the checks required for pull requests and pushes to main.
.github/…/release.ymlDefines version checks, release validation, and npm publication.
package.jsonMaps the local commands to typechecking, tests, generation, builds, and preparation.
scripts/check.tsDefines the runtime contract that every library piece must satisfy.
scripts/gen.tsDefines how piece files and documentation become public exports, name-based loading data, and agent guidance.
scripts/…/examples.tsValidates kit examples across display modes.
scripts/…/docs.tsValidates documentation code and its displayed frames against the built package.
CONTRIBUTING.mdExplains the contributor-facing check and release sequence.