@theopenweb/schema

1.3.2 • Public • Published

Description

A collection of schema. Currently, no specific grouping.

Example

Add any examples to the example directory.

Format

Schema are to the schema directory. The following schema are allowed:

Usage

Install:

npm install @theopenweb/schema

If using Node.js and want perform builds, any utility functions are provided in the main index.js file.

JSDoc

/**
 *  @type {import('schema/jsdoc').Size}
 */

JSONSchema

// First convert to typescript
// CLI
// https://github.com/bcherny/json-schema-to-typescript#cli
// json2ts ./node_modules/schema/json-schema/index.json > schema.d.ts

/**
 * @type {import('schema.d.ts').definitions.Work}
 */
{
  "$schema": "http://json-schema.org/draft-07/schema",
  "definitions": {
    "MyType": {
        "$ref": "language-scripts.json#definitions/scripts"
    }
  }
}

Typing

https://www.w3.org/TR/json-ld/#typed-values

Languages

https://www.w3.org/TR/json-ld/#string-internationalization

Conversions

JSDoc => TypeScript

tsc [SOURCE] --declaration --emitDeclarationOnly --allowJs

Generated Schema

  • Schema MAY be generated into ./schema/generated.
  • Schema MAY be generated either via an arbitrary build process, or via conversion.
  • For conversions, use the following file hierarchy: "./schema/generated/[DESTINATION_SCHEMA_TYPE]/from_[SOURCE_SCHEMA_TYPE]/[FILENAME]"
  • For arbitrary build, use the following file hierarchy: "./schema/generated/[DESTINATION_SCHEMA_TYPE]/[FILENAME]"

Extra Documentation

Readme

Keywords

none

Package Sidebar

Install

npm i @theopenweb/schema

Weekly Downloads

1

Version

1.3.2

License

MIT

Unpacked Size

176 kB

Total Files

51

Last publish

Collaborators

  • theopenweb_jp