Catalog
Tested, ready-made tasks for common tools. Include one, pass a few inputs, and run it.
The catalog is a set of build files for common tools such as npm ci or
yarn install, kept in the hammerkit repository. Each entry is built the way this
documentation recommends, runs in a pinned container image, declares what it reads
and writes so it is cached, and is run by hammerkit's own test suite against a real
project on every change.
You use an entry by including it from git and calling its tasks:
includes:
npm:
git: https://github.com/no0dles/hammerkit.git
ref: v1.16.0
path: catalog/npm
with:
NODE_VERSION: 22
tasks:
build:
image: node:22-alpine
deps: [npm:install]
src: [src, tsconfig.json]
generates: [dist]
cmds:
- npm run buildhammerkit build installs the dependencies (or reuses them when package.json and
package-lock.json are unchanged) and then builds. The include runs in your directory,
so every package of a monorepo can include the same entry.
Entries
| Entry | What it does |
|---|---|
| npm | Install locked dependencies with npm ci. |
| yarn | Install locked dependencies with yarn install. |
| pnpm | Install locked dependencies with pnpm install. |
| pip | Install pinned requirements with pip install. |
| go | Build and test a Go module. |
| cargo | Build and test a Rust crate or workspace. |
| dotnet | Build and test a .NET project or solution. |
| docker | Build a Docker image and push it. |
| tsc | Compile a TypeScript project with tsc. |
| eslint | Lint a project with ESLint. |
| prettier | Check the formatting of a project with Prettier. |
| jest | Run the tests of a project with Jest. |
| helm | Lint and package a Helm chart. |
The Node tools (tsc, eslint, prettier, jest) run from node_modules, so they do not install
anything themselves: your task extends the entry's task and adds the install of your
package manager as a dependency. Each of their pages shows it.
Versions
ref is a release tag of hammerkit: the catalog at v1.16.0 is the one that release's
tests ran. A commit SHA pins exactly, and a branch such as master follows the latest
entries but can differ between machines (see
caching and offline use). A task or
input of an entry is not renamed or removed within a major version of hammerkit.
Inputs
An entry declares its inputs as top-level envs with defaults, and lists them on its
page. with replaces them for one include; a name the entry does not declare is an
error that lists the ones it does. See
inputs.
Adapting an entry
Tasks are building blocks, not templates you edit. To go beyond the inputs:
- Depend on it. Your own task lists the entry's task in
deps, as above. - Extend it.
extend: npm:installadds to an entry task: moresrcentries, morecmds, moreenvs. Addreset: [src]to drop what it brings for a property. See extending. - Another layout. An entry reads files relative to the directory that includes it, so a
project in
packages/webincludes it frompackages/web/.hammerkit.yaml. For a lockfile that lives elsewhere, extend the task and pointsrcat it.
What an include brings
Before you adopt an entry, read its page: it shows the whole build file. After including
it, hammerkit ls lists its tasks and
hammerkit explain --definition npm:install
shows what one runs, with the repository, ref and commit it came from and where each env
value was set. An entry contributes tasks and never runs anything until you run one of them.