CLI tool that scans TerriaJS source code to generate JSON Schema files for catalog init files. It parses JSDoc-style tags (@type, @editortype, @editorformat, etc.) to produce schemas used by DataSourceEditor for automatic form generation and catalog validation. Current version 1.5.0, released on npm. Key differentiator: schema generation is driven directly from TypeScript source annotations, ensuring schema stays in sync with code. Alternative to manual schema authoring. Low release cadence.
npm install generate-terriajs-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage: generate a JSON Schema with editor-friendly extensions from a local TerriaJS installation and write to file.
Use import or dynamic import.
Use editor: true in programmatic API.
Ensure JSDoc tags are present in TerriaJS source properties.
Use --noversionsubdir or noversionsubdir: true.
Use Node 14+ or pin commander to v8.
Install: npm install generate-terriajs-schema and ensure package.json has 'type': 'module' or use .mjs extension.
Use import generateSchema from 'generate-terriajs-schema' (default) or import { generateSchema } from 'generate-terriajs-schema' (named).Point --source to a directory containing lib/ or src/ with TypeScript files.