Registry / devops / terriajs-schema

terriajs-schema

JSON →
library0.4.3jsnpmunverified

JSON schema definitions for TerriaJS catalog files, version 0.4.3. Release cadence is irregular. Used to validate catalog files and populate the Data Source Editor. Differs from other schema libraries by being tightly coupled to TerriaJS; it is not a general-purpose schema validator.

npm install terriajs-schema
INSTALL
IMPORT
SIG · TERRIAJS-SCHEMA
T
terriajs-schema
devopsjavascriptv0.4.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CatalogSchema
import { CatalogSchema } from 'terriajs-schema'
const CatalogSchema = require('terriajs-schema').CatalogSchema
ESM-only since v0.4.0
DataSourceSchemata
import { DataSourceSchemata } from 'terriajs-schema'
import DataSourceSchemata from 'terriajs-schema'
Named export, not default.
default
import schema from 'terriajs-schema'
import { default } from 'terriajs-schema'
Default export exists but is rarely used.

Imports and logs the catalog JSON schema to verify the library works.

import { CatalogSchema } from 'terriajs-schema'; console.log(CatalogSchema);
Debug
Known issues
breakingRemoved support for CommonJS require() in v0.4.0
fix
Use ESM import instead.
affects: >=0.4.0
gotchaSchema definitions are for TerriaJS v7 only
fix
Check TerriaJS version compatibility.
affects: >=0.4.0
deprecatedDataSourceSchemata will be renamed to DataSourceSchemas in v0.5.0
fix
Use DataSourceSchemas after migration.
affects: >=0.4.0 <0.5.0
breakingSchema properties changed in v0.3.0 (e.g., 'type' became 'format')
fix
Update catalog files to new schema structure.
affects: >=0.3.0 <0.4.0
gotchaThis library does not validate JSON; it only provides schemas.
fix
Use a validator like Ajv with the schema.
affects: all
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() on an ESM-only package
fix
Use import or set type: module in package.json
TypeError: Cannot read properties of undefined (reading 'properties')
Importing a non-existent export or wrong version
fix
Check the export name and package version
Module not found: Can't resolve 'terriajs-schema'
Package not installed or typo in import path
fix
npm install terriajs-schema
Upgrade
Version history
0.4.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
terriajs-schema — npm install terriajs-schema · libregistry