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

@@ -38,8 +38,9 @@ import {premaps} from './config/premap.js';
import {settings} from './config/settings.js';
import {dynamicTypes, isTagType, MISSING_PREMAP, PARSE_ERROR, TYPE_CONFLICT, typemap} from './config/typemap.js';
import {AggregationSchema, ESNestedAggregation} from './types/aggregation.js';
import {ElasticsearchTemplateCollection, MappingGenTemplate} from './types/mapping.js';
import * as console from "console";
import {ElasticsearchTemplateCollection,
MappingGenTemplate} from './types/mapping.js';
import * as console from 'console';
let dynamicTemplates: Record<string, MappingDynamicTemplate>[] = [];
let errors: string[] = [];
@@ -259,7 +260,11 @@ function handleDeclarationReflection(
// check if we have an object referencing a generic
if (generics.has(decl.name)) {
// if the object name is the same as the generic name
return readFieldTags(generics.get(decl.name)!, path, topTypeName, decl.comment?.tags ?? []);
return readFieldTags(
generics.get(decl.name)!,
path,
topTypeName, decl.comment?.tags ?? [],
);
// use the value defined by the generic
}
@@ -682,7 +687,12 @@ function readFieldTags(
* @param topTypeName the name of the SCThingType
* @param tags tags attached to the value
*/
function readTypeTags(type: string, path: string, topTypeName: string, tags: CommentTag[]): MappingProperty {
function readTypeTags(
type: string,
path: string,
topTypeName: string,
tags: CommentTag[],
): MappingProperty {
let out: MappingProperty = {type: PARSE_ERROR};
if (typeof typemap[type] !== 'undefined') {