Skip to content

Contribute code

Use this guide for changes to textmode.js and its official add-ons.

Choose the repository

ProjectUse it forDocumentation
textmode.jsCore APIs, rendering, layers, fonts, media, input, and pluginsGuides · API
textmode.export.jsImage, document, and animation exportGuide · API
textmode.synth.jsSynth sources, transforms, and shader compositionGuide · API
textmode.figlet.jsFIGfont parsing, layout, and renderingGuide · API
textmode.filters.jsGPU filter shaders and filter optionsGuide · API

Report an add-on problem in its add-on repository. Use the core repository only when the problem is in textmode.js itself or can be reproduced without the add-on.

Before starting

Read the target repository's Code of Conduct and security policy. Report suspected vulnerabilities through the private process in SECURITY.md, never through an issue, pull request, Discussion, or Discord.

Small, clear fixes can go directly to a pull request. Open an issue or Discussion before investing in:

  • New features or public API changes
  • Architecture, rendering pipeline, packaging, release, or browser-support changes
  • Visual output changes with broad compatibility impact
  • New, removed, or replaced bundled assets

Search existing issues first and agree on scope with a maintainer when the direction is not already established.

Set up a library repository

Use Node.js 24 LTS as configured by the target repository's .nvmrc file. Fork the repository, create a focused branch from dev, and install the locked dependency tree:

bash
git clone https://github.com/YOUR-USERNAME/PROJECT.git
cd PROJECT
git checkout -b TYPE/describe-your-change origin/dev
nvm install
npm ci

The official libraries share these commands:

CommandPurpose
npm run devStart the package example gallery
npm run buildBuild the production bundle and type declarations
npm run testRun the package test suite
npm run check:docsValidate public API documentation and examples
npm run checkRun the full CI-equivalent verification

Use narrower test scripts from the target package.json while developing. Run npm run check before requesting review.

Make a reviewable change

  • Keep the pull request focused and separate unrelated cleanup.
  • Add regression tests for fixes and behavior tests for features.
  • Update public API docstrings, types, guides, and examples when behavior changes.
  • Keep API examples focused and ensure included example paths remain valid.
  • Test rendering changes in a WebGL2-capable browser and include before/after screenshots or recordings.
  • Document every new asset's source, author, license, redistribution permission, and required attribution.
  • Do not hand-edit generated API Markdown or commit generated exports unless the repository explicitly requires them.

Library commits use Conventional Commits. All libraries share the same commit rules through @textmode/commitlint-config and an automatically installed commit-msg hook, so no per-repository commit configuration is needed.

Open the pull request

Target dev; maintainers promote accepted changes through dev → beta → main. In the pull request:

  • Link the related issue or Discussion.
  • Explain the problem, solution, and user-visible impact.
  • List automated and manual validation performed.
  • Call out public API, breaking, packaging, asset-license, and browser-support implications.
  • Include screenshots or recordings for visual changes.

Maintainers review contributions on a best-effort basis and may request tests, documentation, a smaller scope, or prior design discussion.