Skip to content

TypeScript npm package template with Biome, node:test and npm provenance

A package for npm in TypeScript on Node 24, with the tools that Node brings itself where they are enough.

Start one

uvx --from copier==9.19.1 copier copy --data project_type=node-package gh:Dennis-Otto/repo-blueprint my-package
cd my-package
python3 .github/blueprint.py create

With uv and the GitHub CLI, as the quick start shows. Copier asks for the name, the owner and the other answers, and create makes the repository on GitHub, applies the settings as code and prints the checklist.

What you get

  • The example: src/index.ts, built into dist/, the tests in test/, tsconfig.json and tsconfig.build.json, biome.jsonc, and package.json with its lock file. Replace it with the real code; its tests show how.
  • The steps of scripts/check.sh for this kind, the same on your machine and in the CI: the lock file, which must agree with package.json, Biome for the lint and the format, tsc for the types, node:test with every line, branch and function covered and its report in the PR coach, and npm pack; npm installs without the scripts of the packages. Biome leaves out the diagrams that scripts/diagrams.sh draws, because the next drawing writes them again.
  • Workflows of this kind: the newest Node on main (newest-node.yml), after every change and every week, while the CI checks the Node of .nvmrc.
  • The steps of every kind: the text files, the diagrams, the pages in one column, the files of the project, the fragments of the changelog, the accepted advisories, the lock files, the version, the Git hooks, ShellCheck for the shell scripts and the strict build of the website.
  • Everything that every repository gets: the PR coach and the fix bot, the release bot, Renovate, the settings as code, the issue assistant, the website in English and German, the security checks and the blueprint bot, as the guide lists them.

The checks that a pull request needs

The ruleset Protect main of .github/repository.toml lets a pull request merge once these checks pass:

  • check (node): scripts/check.sh with the tools of Node.
  • lint, diagrams, docs, conventional title, codeql, dependency-review and gitleaks, which every kind needs: every linter in one job, the pictures of the diagrams, the strict build of the website, the title of the pull request with its entry in the changelog, CodeQL, the review of new dependencies and the secret scan.

Delivery

Merging the release pull request publishes the package on npm with provenance, by trusted publishing from the environment npm, without a token, and attaches it to the release with its SBOM and the signed provenance of SLSA Build Level 3.

A package that nobody installs from npm, such as a private one or a browser extension that people load from a zip, answers publish_package with no, or later with uvx --from copier==9.19.1 copier update --defaults --vcs-ref=:current: --data publish_package=false. It runs that on the update pull request of the release that brought the question, because on an older release the command changes nothing, and with the default topics it adds --data "topics=typescript, nodejs". The release then delivers it nowhere and carries its SBOMs, its provenance and what scripts/release-assets.sh builds; package.json of a new repository is private, and SECURITY.md, GOVERNANCE.md and CONTRIBUTING.md no longer speak of npm or of a *.tgz.

Once by hand

python3 .github/blueprint.py checklist ticks off each step that it can see and names the rest, each with its link: the release app of the owner with its private key, as your own account shows, the token of the issue assistant unless its AI is off, OpenSSF Best Practices, the REUSE API and the social preview.

This kind adds these steps:

A real repository

No public repository of this kind follows the blueprint yet. The Variants workflow of the blueprint makes one from every change of its files and runs its checks with their real tools, and updates one from the latest release as its blueprint bot would.

How the blueprint compares with other templates: the comparison.