Skip to main content
.wa/kit.json records which kit version a project comes from, which kit modules it has, with their manifests and file hashes, and which modules the project wrote itself. gato create, add, remove, update and eject write it; you edit only locales, projectModules and the reasons in ejected by hand. Commit it.
.wa/kit.json
The example is shortened. Unknown fields are ignored without an error, so a typo such as schemaRelation passes and the real field gets its default.

Top-level fields

string
required
Kit version the project’s kit files come from. add and list fetch the kit at tag v<kitVersion>; update uses it as the merge base. Changed only by gato update.
string
default:"https://github.com/webamigos/wa-kit.git"
Default kit source for add, list and update. gato create writes the repo of the kit it used, https://github.com/webamigos/gatojs.git for the public kit. The schema default applies only to old files without the field.
number
default:"1"
Format of the project’s kit files and state. Every command checks it first and stops on a format the CLI does not support, with a hint to run npx gato-cli@latest update <version> (Kit format). gato create writes the kit’s format; gato update sets the target version’s format. Files without the field are format 1.
{ name: string, slug: string }
default:"{ name: 'WA App', slug: 'wa-app' }"
Display name and slug. add and update use them to replace placeholders in kit files; generate uses them for {{projectName}} and {{projectSlug}} in module variable examples. The snake name is derived from the slug.
('pl' | 'en')[]
default:"['pl', 'en']"
App languages: at least one, must contain pl, no duplicates. generate writes them to src/i18n/locales.generated.ts and creates translation loaders only for them. Edit it by hand, then run gato generate.
Record<string, KitModule>
required
Installed kit modules, keyed by name. Always contains core.
Record<string, { manifest: ModuleManifest }>
default:"{}"
Features written in the project. See Project modules.
Record<string, { reason: string, ejectedAt: string }>
default:"{}"
GatoJS files the project changes on purpose, keyed by path. gato eject adds an entry with a non-blank reason and the UTC date; gato eject --undo removes it. Other commands keep the entries as they are. A blank reason fails validation.

File hashes

For every file create, add or update copies, modules.<name>.files holds a value computed from the content written to the project (after placeholder replacement): Kits released before seedFiles existed recorded README.md with a content hash. Since gato-cli 0.7.1, gato update treats every path in the target version’s seedFiles as a seed file, whatever hash the project recorded: it leaves the file unchanged and records it as seed. A seed file that is new in the target version is added only when the project doesn’t have it yet; an existing file at that path stays as it is, without a conflict. The hashes let gato remove refuse to delete files you changed, give gato update a base to tell kit changes from yours, and let gato doctor --files list the GatoJS files you changed. A path with a content hash is a GatoJS file; managed, seed and every path without an entry belong to the project (GatoJS files and project files). After an update, hashes are those of the kit’s content at the target version, so a merged file with local changes still counts as changed. Generated files are not copied and have no hash.

Project modules

A project module is a feature written in the project, registered next to kit modules. Its entry has only a manifest, without a version or file hashes:
Every command that reads .wa/kit.json validates these entries first and stops on the first problem:
  • name equals the key;
  • no kit module has the same name;
  • the name is not app, which is reserved for core-hosted slot configuration (modules.app in src/gato.config.ts);
  • every module in requires is installed (as a kit or project module);
  • files has a pattern starting with src/features/<name>/.
How the commands treat them:
Declare every npm dependency your project module uses in its manifest, in the same section (dependencies or devDependencies) a kit module might use. Otherwise gato remove of a kit module that declares the same package removes it from package.json.
Building a feature step by step: Build a feature.

Module manifest

The same schema describes kit modules (kit/modules/<name>.json in the kit repository, copied into modules.<name>.manifest) and project modules.
string
required
Module name. In the kit it equals the manifest’s file name; in projectModules it equals the key.
string
required
Module version. Kit modules bump it when their files change.
string
required
One line shown in the create prompt and in gato list. May be empty.
string[]
default:"[]"
Modules this one needs. create and add add them; remove refuses to remove a module that another one requires.
string[]
default:"[]"
Patterns of the files the module owns. Supported wildcards: **/ (zero or more directories), ** (anything, including /) and * (anything except /). Everything else is literal, including [locale] and (app); braces are not supported. generate uses only patterns under src/features/<name>/ to find features.
Record<string, string>
default:"{}"
npm dependencies added to package.json by create and add, and removed by remove when no other manifest declares them in the same section.
Record<string, string>
default:"{}"
Same for devDependencies.
{ name: string, example: string, selfhostExample?: string, required?: boolean, generate?: 'secret-32' | 'secret-64' | 'hex-32' }[]
default:"[]"
Variables written to the wa:modules region of .env.example as name=example, and to the same region of .env.selfhost.example as name=selfhostExample (or example when selfhostExample is not set). {{projectSlug}} and {{projectName}} in both values are replaced. Use selfhostExample when the self-hosted stack needs another value, such as a container path or an empty secret the operator must fill. generate marks a secret: gato create writes a random value into the new project’s .env instead of the example, with secret-32 or secret-64 random bytes in base64url, or hex-32 for 32 bytes as 64 hex characters. required is not read by the CLI; whether a variable is required is decided by the feature’s env.ts schema.
{ model: string, field: string }[]
default:"[]"
Back-relation lines written to wa:relations in the User model (auth.prisma) or the Organization model (organizations.prisma). Other models are ignored.
string | null
default:"null"
Path, relative to the project, of a file with Docker Compose service definitions (without the services: key). Written into the wa:services region. The file must belong to the module’s files.
string | null
default:"null"
Path, relative to the project, of a file with Docker Compose service definitions for the self-hosted stack (without the services: key). Written into the wa:services region of docker-compose.selfhost.yml. The file must belong to the module’s files. Put optional services behind a Compose profile, as uploads does with s3.
string | null
default:"null"
Path, relative to the project, of a file with GitHub Actions steps. Written into the wa:ci-integration regions of ci.yml and mutation.yml. The file must belong to the module’s files.
Record<string, string>
default:"{}"
npm scripts the module adds to the project’s package.json, as { "<name>": "<command>" }. gato generate (so also create, add and update) adds a script that package.json does not have, and leaves one with the same command alone. A script with the same name and another command in package.json, or in another module’s manifest, is an error, so when you change a command in a manifest, set the same command in package.json too. The name verify:modules is reserved: generation overwrites or removes it, so declare verify instead. gato remove deletes the module’s scripts unless another module declares the same name.
string | null
default:"null"
A shell command that checks the module, such as a test run of its own package. gato generate joins the verify commands of all modules, core first and in registry order, with && into the script verify:modules of package.json, and removes that script when no module has one. The project’s npm run verify runs verify:modules when it exists. The commands are joined as they are, without grouping, so a ; inside one command ends the && chain and hides the failure of an earlier check. Wrap a compound command in parentheses, such as (echo checking; true).
string[]
default:"[]"
Reserved. No command reads it.

In the kit repository

The kit repository has its own .wa/kit.json, rewritten from the manifests by gato kit sync. There every module has empty files, and project holds the placeholder names WA App and wa-app. Do not edit it by hand: see Kit repository.