@naturalcycles/common-type
Common Type interface and generator
![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)
Allows to generate "Common Type" and JSON Schema from a set of
Typescript files with exported Interfaces (and Enums).
Status: experimental! Everything is subject to change!
Example
Install common-type
as your devDependency:
yarn add -D @naturacycles/common-type
Define a commonType.cfg.js
in the root of you project:
module.exports = {
paths: ['src/types/*.ts'],
outputDir: 'src/schemas',
}
Config says to scan all *.ts
files in src/types
, parse them, generate JSON schemas, write them
into src/schemas
folder.
Develop
Typescript AST debugging: https://ts-ast-viewer.com/
todo