refactor: build system

This commit is contained in:
2023-03-22 11:45:30 +01:00
parent 4df19e8c20
commit 8cb9285462
427 changed files with 3978 additions and 9810 deletions

View File

@@ -30,6 +30,7 @@ openstapps-core-tools schema <srcPath> <schemaPath>
```
where:
- `<srcPath>` is path to the project (where used `*.ts` files are, e.g. `src/core`,
- `<schemaPath>` is directory to save output files to, e.g. `lib/schema`.
@@ -45,14 +46,6 @@ Inside of a script in `package.json` or if the npm package is installed globally
openstapps-core-tools schema src/core lib/schema
```
## What is Easy AST?
Easy [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) is a "wrapper" around the TypeScript Compiler API. The TS Compiler API is built for many
much more complex things than just accessing type declarations, and thus comes with a ton of
bloat that makes it really difficult to work with.
This is why we built the Easy AST, which converts the TS representation to a really easy and
lightweight structure, that removes a lot of the stuff you wouldn't really need.
## How to use the validator?
@@ -65,7 +58,7 @@ import {ValidatorResult} from 'jsonschema';
import {join} from 'path';
const objectToValidate: SCDish = {
type: SCThingType.Dish,
type: SCThingType.Dish,
// more properties
};
@@ -95,6 +88,7 @@ Your basic JSON object:
```
JSON for validateFiles:
```json
{
"errorNames": [],
@@ -120,6 +114,7 @@ openstapps-core-tools validate <schemaPath> <testPath> [reportPath]
```
where:
- `<schemaPath>` is a directory where JSON schema files are, e.g. `lib/schema`,
- `<testPath>` is a directory where test files are, e.g. `src/test/resources`,
- `[reportPath]` is a file where the HTML report of the validation will be saved to, e.g. `report.html` (optional argument - if it's not provided no report will be written).
@@ -144,14 +139,6 @@ To generate a openapi JSON file that represents the routes according to openapi
openstapps-core-tools openapi PATH/TO/CORE/lib PATH/TO/PUT/FILES/TO
```
## Pack definitions and implementations
To pack all the different files into two distribution files - one for definitions/one for implementations - use the following command:
```shell
openstapps-core-tools pack
```
## How to use the UML generator
The UML Generator generates PlantUML from the project reflection of the source files. By default it will include externals, which will take considerably longer to execute, you can disable this behaviour via an option. It can help you to visually explore the data model or document a specific part.
@@ -202,7 +189,8 @@ The plantuml code is persisted inside the generated file at the very bottom. You
openstapps-core-tools plantuml-file /PATH/TO/Project.plantuml http://PLANTUMLSERVER OptionalCustomFileName
```
Example-File-Content of Project.plantuml
Example-File-Content of Project.plantuml
```
@startuml
interface MyClass{