npm i tsmeta
tsmeta can create schemas for either documentation of your RestAPI as well as the needed schemas for your GraphqlAPI of your typescript node application. Using simply typescript classes and a few annotations.
- tsmeta: can only be used for typescript projects
- tsmeta: create schema and data files for these applications:
to run tsmeta a tsmeta.config.json file is required in the root of your project.
the basic tsmeta.config.json has to include the base-package reference (package.json)
{
"basePackage": "package.json",
"scanAdditionalPackages": {},
"showScannedFiles": false,
"showWrittenFiles": true,
"metaConfig": {},
"sigmaConfig": {},
"oasConfig": {},
"graphQLConfig": {}
}your package.json has to include the source property like:
{
"main": "dist/index.js",
"source": "src/index.ts",
}the tsmetaConfig object is required in your tsmeta.config.json, however creation of the tsmeta.output.json file is not required to generate the other schemas
{
"create": true,
"outputPath": "schema",
"outputFilename": "tsmeta.output.json",
"compilerOptions": "tsconfig.json"
}