Skip to content

nextvm validate

Static checks on the current NextVM project. Catches the common mistakes before they hit production.

Synopsis

bash
nextvm validate

Checks performed

CheckSeverityWhat it catches
nextvm.config.ts existserrorThe CLI needs the project config to do anything
Each module has src/index.tserrorModule is malformed
Each module has en.ts localewarning— i18n required
Modules importing @nextvm/tebex ship MONETIZATION.mderror— PLA compliance
Each module uses the layered src/server/ structurewarningMODULE_ARCHITECTURE.md convention
Declared dependencies have a matching adapters/<dep>-adapter.tswarning— adapter pattern
RPC mutations have .input(z.object(...))error— Zod validation

The PLA-compliance check looks for real import statements, not stray mentions in JSDoc comments — so a module that documents the policy without consuming @nextvm/tebex does NOT trigger the warning.

Exit codes

CodeMeaning
0All checks passed (warnings are non-fatal)
1At least one check failed

Example output

ℹ Validating NextVM project
✓ nextvm.config.ts found
✓ Found 6 module(s)
⚠ Module 'banking' is not using the layered structure (src/server/service.ts + router.ts). See https://docs.nextvm.dev/guide/module-authoring.
⚠ Module 'jobs' declares dependency 'banking' but has no adapters/banking-adapter.ts
✓ Validation passed (2 warnings)

CI integration

Add it to your CI pipeline alongside pnpm test:

yaml
- run: pnpm install
- run: pnpm run build
- run: pnpm test
- run: pnpm exec nextvm validate

The non-zero exit on errors makes it fail the build cleanly.

See also

Released under the LGPL-3.0 License.