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 and update write it; you edit only locales and projectModules 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.
{ 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.

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): The hashes let gato remove refuse to delete files you changed, and give gato update a base to tell kit changes from yours. 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;
  • 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, required?: boolean }[]
default:"[]"
Variables written to the wa:modules region of .env.example as name=example. {{projectSlug}} and {{projectName}} in example are replaced. 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 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.
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.