Skip to content

Schema

@kjanat/dreamcli/schema is the package's published JSON Schema export. It resolves to dreamcli.schema.json, the same definition schema referenced by generateSchema() output.

Use it when you want local or offline validation of dreamcli definition metadata without depending on the CDN $schema URL.

Importing The Schema

ts
import  from '@kjanat/dreamcli/schema';

.;
..;

In TypeScript, this works with resolveJsonModule. At runtime, your loader needs to support JSON imports for the target environment.

Common Uses

  • Validate the output of generateSchema(myCli.schema) in tests or tooling.
  • Ship an offline $schema target in repos that do not want network lookups.
  • Feed the schema into JSON Schema tooling such as Ajv or IDE integrations.

Pairing With generateSchema()

ts
import  from '@kjanat/dreamcli/schema';
import {
  ,
  ,
  ,
} from '@kjanat/dreamcli';

const  = ('mycli').(('deploy'));
const  = (.);

.;
.;

definition.$schema points at the public schema URL, while the package export gives you the same definition locally from the installed package.

Released under the MIT License.