check
check validates a host that already has adonia.json. It reports errors (exit 1) and warnings (exit 0 unless --strict). Use it after add and in CI.
This page covers what is treated as an error versus a warning, and how --strict changes the exit code.
Run it
npx adonia check
npx adonia check --strictMissing adonia.json (and missing legacy modules.json) prints the init hint and exits 1.
Errors
Any error sets exit code 1, even without --strict.
check walks adonia.json installed and fails when:
- The folder
paths.modules/<name>is missing. - Local
module.jsonnamedoes not match the folder name. - A
registryDependenciesentry (and, forapi,types/constants/contracts) is not ininstalled. - A manifest
peerModelsalias has no file.#models/usermust exist atpaths.models/user.ts(defaultapp/models/user.ts).
Plain adonia add auth does not copy models, so check fails on #models/user and #models/password_reset until you add --with-models / --with-stubs or provide those files yourself.
Warnings
Warnings print as warn: …. Without --strict, check still exits 0 and prints check passed or check passed (N warnings).
check warns when:
- A
paths.*directory fromadonia.jsondoes not exist yet. - Local
module.jsoncannot be parsed. config/modules.tsis missing while the module declareseventsorconfigKeys.- An event name from the manifest is absent from
config/modules.ts. - A
configKeysleaf (the segment after the last., for exampleauthfrommodules.auth) has nokey:in that file. package.json"imports"is missing a required alias (#modules/*,#constants,#adapters/*, and the rest frominit --wire).adonisrc.tsdoes not mention#modules/api/provider.start/kernel.tsdoes not mention#modules/api/exception_handler.- An Adonis package is missing while a stub that needs it is present (
@adonisjs/limiterwithstart/limiter.ts,@adonisjs/drivewithapp/adapters/drive_avatar_storage.ts,@adonisjs/mailwithapp/adapters/adonis_mail_transport.ts). The text includesnode ace add @adonisjs/<pkg>. - The registry cannot load a listed module's manifest (the error message is printed as a warning).
hostTests and hostFacingExceptions in module.json are not checked yet.
Strict mode
--strict treats every warning as a failure: exit code 1, no check passed line. Errors still print as error:.
Use --strict in CI once the host is fully wired and stub peers exist. A freshly init --wire'd app with no feature modules still warns (for example missing path directories), so --strict fails there until those paths exist.
Flags
check accepts the shared flags plus:
| Flag | Effect |
|---|---|
--strict | Exit 1 when any warning was printed |
--overwrite and --dry-run do not change check: it never writes files.
Next steps
Fix what check reported, then move on:
- Run
init --wirefor missing aliases, provider, or exception handler. addwith--with-models(or--with-stubs) when peer models are missing.- Browse modules for the slice you just installed.