mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
refactor: build system
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable unicorn/no-null */
|
||||
/*
|
||||
* Copyright (C) 2018-2021 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
6
packages/es-mapping-generator/src/index.ts
Normal file
6
packages/es-mapping-generator/src/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './mapping'
|
||||
export * from './project-reflection'
|
||||
export * from './config/premap'
|
||||
export * from './config/fieldmap'
|
||||
export * from './config/settings'
|
||||
export * from './config/typemap'
|
||||
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user