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

@@ -28,9 +28,11 @@ manually.
To generate the mapping files by hand, you need a local copy of the core-tools and the core, both need to be built first.
After that you can run
```
node lib/cli.js mapping path/to/core path/to/destination ignoredTag1,ignoredTag2,ignoredTag3
```
If you don't pass in any ignored tags, you will likely be prompted with errors, despite the core being absolutely correct.
This is because there are some tags that are not relevant to Elasticsearch, but the program has no direct way to tell
which ones simply lack an implementation and which ones can be ignored. Currently the ignored tags include
@@ -41,10 +43,15 @@ which ones simply lack an implementation and which ones can be ignored. Currentl
This is the more easy way, and it gives you direct access to the generated mapping as a (mostly typesafe) object. To
use it, call `generateTemplate`, However you will first need to generate a ProjectReflection of the core you are working
with. If you use the core as a dependency, you can for example use
```typescript
const map = generateTemplate(getProjectReflection(resolve('node_modules', '@openstapps', 'core', 'src')),
ignoredTags, false);
const map = generateTemplate(
getProjectReflection(resolve('node_modules', '@openstapps', 'core', 'src')),
ignoredTags,
false,
);
```
to generate the mappings. Note that the result object contains both a list of errors in `map.errors` and the actual mapping
in `map.template`. You can also specify whether you want the generator to show any errors while generating the mappings
in the console in the last parameter, `true` (default) being show errors and `false` to suppress them. That said it is very