mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
feat: migrate to esm
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"version": "0.4.0",
|
||||
"description": "Tool to convert TypeScript Interfaces to Elasticsearch Mappings",
|
||||
"version": "2.1.0",
|
||||
"type": "commonjs",
|
||||
"license": "GPL-3.0-only",
|
||||
"author": "Thea Schöbl <dev@theaninova.de>",
|
||||
"main": "./lib/index.js",
|
||||
@@ -30,7 +31,7 @@
|
||||
"commander": "10.0.0",
|
||||
"deepmerge": "4.3.0",
|
||||
"flatted": "3.2.7",
|
||||
"got": "12.6.0",
|
||||
"got": "11.8.6",
|
||||
"typedoc": "0.18.0",
|
||||
"typescript": "3.8.3"
|
||||
},
|
||||
@@ -40,7 +41,7 @@
|
||||
"@openstapps/eslint-config": "workspace:*",
|
||||
"@types/chai": "4.3.4",
|
||||
"@types/mocha": "10.0.1",
|
||||
"@types/node": "18.15.3",
|
||||
"@types/node": "14.18.38",
|
||||
"@types/rimraf": "3.0.2",
|
||||
"chai": "4.3.7",
|
||||
"conventional-changelog-cli": "2.2.2",
|
||||
|
||||
@@ -13,21 +13,20 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {Command} from 'commander';
|
||||
import {mkdirSync, readFileSync, writeFileSync} from 'fs';
|
||||
import got from 'got';
|
||||
import path from 'path';
|
||||
import {exit} from 'process';
|
||||
import {generateTemplate} from './mapping';
|
||||
import {getProjectReflection} from './project-reflection';
|
||||
import {ElasticsearchTemplateCollection} from './types/mapping';
|
||||
import {generateTemplate} from './mapping.js';
|
||||
import {getProjectReflection} from './project-reflection.js';
|
||||
import {ElasticsearchTemplateCollection} from './types/mapping.js';
|
||||
|
||||
// handle unhandled promise rejections
|
||||
process.on('unhandledRejection', async (reason: unknown) => {
|
||||
if (reason instanceof Error) {
|
||||
await Logger.error(reason.message);
|
||||
Logger.info(reason.stack);
|
||||
await console.error(reason.message);
|
||||
console.info(reason.stack);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -57,9 +56,9 @@ commander
|
||||
|
||||
const result = generateTemplate(projectReflection, ignoredTagsList, true);
|
||||
if (result.errors.length > 0) {
|
||||
await Logger.error('Mapping generated with errors!');
|
||||
await console.error('Mapping generated with errors!');
|
||||
} else {
|
||||
Logger.ok('Mapping generated without errors!');
|
||||
console.log('Mapping generated without errors!');
|
||||
}
|
||||
|
||||
// write documentation to file
|
||||
@@ -68,24 +67,24 @@ commander
|
||||
mkdirSync(path.dirname(aggPath), {recursive: true});
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
writeFileSync(aggPath, JSON.stringify(result.aggregations, null, 2));
|
||||
Logger.ok(`Elasticsearch aggregations written to ${aggPath}.`);
|
||||
console.log(`Elasticsearch aggregations written to ${aggPath}.`);
|
||||
}
|
||||
if (typeof options.mappingPath !== 'undefined') {
|
||||
const mappingPath = path.resolve(options.mappingPath);
|
||||
mkdirSync(path.dirname(mappingPath), {recursive: true});
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
writeFileSync(mappingPath, JSON.stringify(result.mappings, null, 2));
|
||||
Logger.ok(`Elasticsearch mappings written to ${mappingPath}.`);
|
||||
console.log(`Elasticsearch mappings written to ${mappingPath}.`);
|
||||
}
|
||||
if (typeof options.errorPath !== 'undefined') {
|
||||
const errorPath = path.resolve(options.errorPath);
|
||||
mkdirSync(path.dirname(errPath), {recursive: true});
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
writeFileSync(errorPath, JSON.stringify(result.errors, null, 2));
|
||||
Logger.ok(`Mapping errors written to ${errorPath}.`);
|
||||
console.log(`Mapping errors written to ${errorPath}.`);
|
||||
} else if (result.errors.length > 0) {
|
||||
for (const error of result.errors) {
|
||||
await Logger.error(error);
|
||||
await console.error(error);
|
||||
}
|
||||
|
||||
throw new Error('Mapping generation failed');
|
||||
@@ -113,14 +112,14 @@ commander
|
||||
|
||||
const HTTP_STATUS_OK = 200;
|
||||
if (response.statusCode !== HTTP_STATUS_OK) {
|
||||
await Logger.error(
|
||||
await console.error(
|
||||
`Template for "${template}" failed in Elasticsearch:\n${JSON.stringify(response.body)}`,
|
||||
);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
Logger.ok(`Templates accepted by Elasticsearch.`);
|
||||
console.log(`Templates accepted by Elasticsearch.`);
|
||||
});
|
||||
|
||||
commander.parse(process.argv);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {MappingProperty} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {ElasticsearchFieldmap, SimpleType} from '../types/mapping';
|
||||
import {ElasticsearchFieldmap, SimpleType} from '../types/mapping.js';
|
||||
|
||||
const ducetSort = {
|
||||
type: 'icu_collation_keyword',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {MappingFloatNumberProperty} from '@elastic/elasticsearch/lib/api/types';
|
||||
import {ElasticsearchTypemap} from '../types/mapping';
|
||||
import {ElasticsearchTypemap} from '../types/mapping.js';
|
||||
|
||||
export const PARSE_ERROR = 'PARSE_ERROR' as MappingFloatNumberProperty['type'];
|
||||
export const MISSING_PREMAP = 'MISSING_PREMAP' as MappingFloatNumberProperty['type'];
|
||||
|
||||
@@ -33,12 +33,13 @@ import {
|
||||
TypeParameterType,
|
||||
UnionType,
|
||||
} from 'typedoc/dist/lib/models';
|
||||
import {fieldmap, filterableMap, filterableTagName} from './config/fieldmap';
|
||||
import {premaps} from './config/premap';
|
||||
import {settings} from './config/settings';
|
||||
import {dynamicTypes, isTagType, MISSING_PREMAP, PARSE_ERROR, TYPE_CONFLICT, typemap} from './config/typemap';
|
||||
import {AggregationSchema, ESNestedAggregation} from './types/aggregation';
|
||||
import {ElasticsearchTemplateCollection, MappingGenTemplate} from './types/mapping';
|
||||
import {fieldmap, filterableMap, filterableTagName} from './config/fieldmap.js';
|
||||
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";
|
||||
|
||||
let dynamicTemplates: Record<string, MappingDynamicTemplate>[] = [];
|
||||
let errors: string[] = [];
|
||||
@@ -118,7 +119,7 @@ function composeErrorMessage(
|
||||
errors.push(error);
|
||||
if (showErrors) {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
void Logger.error(error);
|
||||
void console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +171,7 @@ function getReflectionGeneric(
|
||||
properties: {},
|
||||
});
|
||||
|
||||
Logger.warn(
|
||||
console.warn(
|
||||
`Type "${type.name}": Defaults of generics (Foo<T = any>) currently don't work due to a bug` +
|
||||
` in TypeDoc. It has been replaced by a dynamic type.`,
|
||||
);
|
||||
@@ -808,16 +809,16 @@ export function generateTemplate(
|
||||
typeName = typeObject.type.reflection.defaultValue.replace('"', '').replace('"', '');
|
||||
} else {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
void Logger.error(
|
||||
void console.error(
|
||||
'Your input files seem to be incorrect, or there is a major bug in the mapping generator.',
|
||||
);
|
||||
}
|
||||
} else if (typeObject.type instanceof StringLiteralType) {
|
||||
Logger.warn(`The interface ${_interface.name} uses a string literal as type, please use SCThingType.`);
|
||||
console.warn(`The interface ${_interface.name} uses a string literal as type, please use SCThingType.`);
|
||||
typeName = typeObject.type.value;
|
||||
} else {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
void Logger.error(
|
||||
void console.error(
|
||||
`The interface ${_interface.name} is required to use an SCThingType as a type, please do so.`,
|
||||
);
|
||||
}
|
||||
@@ -858,16 +859,16 @@ export function generateTemplate(
|
||||
typeName = typeObject.type.reflection.defaultValue.replace('"', '').replace('"', '');
|
||||
} else {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
void Logger.error(
|
||||
void console.error(
|
||||
'Your input files seem to be incorrect, or there is a major bug in the mapping generator.',
|
||||
);
|
||||
}
|
||||
} else if (typeObject.type instanceof StringLiteralType) {
|
||||
Logger.warn(`The interface ${_interface.name} uses a string literal as type, please use SCThingType.`);
|
||||
console.warn(`The interface ${_interface.name} uses a string literal as type, please use SCThingType.`);
|
||||
typeName = typeObject.type.value;
|
||||
} else {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
void Logger.error(
|
||||
void console.error(
|
||||
`The interface ${_interface.name} is required to use an SCThingType as a type, please do so.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,12 +12,10 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {existsSync, PathLike} from 'fs';
|
||||
import {platform} from 'os';
|
||||
import path from 'path';
|
||||
import {Application, ProjectReflection} from 'typedoc';
|
||||
import {ModuleKind, ScriptTarget} from 'typescript';
|
||||
|
||||
/**
|
||||
* Get a project reflection from a path
|
||||
@@ -26,7 +24,7 @@ import {ModuleKind, ScriptTarget} from 'typescript';
|
||||
* @param excludeExternals Exclude external dependencies
|
||||
*/
|
||||
export function getProjectReflection(sourcePath: PathLike, excludeExternals = true): ProjectReflection {
|
||||
Logger.info(`Generating project reflection for ${sourcePath.toString()}.`);
|
||||
console.info(`Generating project reflection for ${sourcePath.toString()}.`);
|
||||
|
||||
const tsconfigPath = getTsconfigPath(sourcePath.toString());
|
||||
|
||||
@@ -37,8 +35,6 @@ export function getProjectReflection(sourcePath: PathLike, excludeExternals = tr
|
||||
excludeExternals: excludeExternals,
|
||||
ignoreCompilerErrors: true,
|
||||
includeDeclarations: true,
|
||||
module: ModuleKind.CommonJS,
|
||||
target: ScriptTarget.Latest,
|
||||
tsconfig: path.join(tsconfigPath, 'tsconfig.json'),
|
||||
});
|
||||
|
||||
@@ -85,7 +81,7 @@ export function getTsconfigPath(startPath: string): string {
|
||||
tsconfigPath = tsconfigPathParts.join(path.sep);
|
||||
}
|
||||
|
||||
Logger.info(`Using 'tsconfig.json' from ${tsconfigPath}.`);
|
||||
console.info(`Using 'tsconfig.json' from ${tsconfigPath}.`);
|
||||
|
||||
return tsconfigPath;
|
||||
}
|
||||
|
||||
0
packages/es-mapping-generator/src/types/mapping.d.ts
vendored
Normal file
0
packages/es-mapping-generator/src/types/mapping.d.ts
vendored
Normal file
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable unicorn/consistent-function-scoping */
|
||||
/*
|
||||
* Copyright (C) 2020 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
@@ -16,8 +15,8 @@
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {readdirSync, statSync} from 'fs';
|
||||
import path from 'path';
|
||||
import {MapAggTest} from './mapping-model/map-agg-test';
|
||||
import {MapAggTestOptions} from './mapping-model/map-agg-test-options';
|
||||
import {MapAggTest} from './mapping-model/map-agg-test.js';
|
||||
import {MapAggTestOptions} from './mapping-model/map-agg-test-options.js';
|
||||
|
||||
describe('ES Aggregation Gen', async () => {
|
||||
const magAppInstance = new MapAggTest('aggregations');
|
||||
@@ -49,7 +48,7 @@ describe('ES Aggregation Gen', async () => {
|
||||
it(test.testName, function () {
|
||||
magAppInstance.testInterfaceAgainstPath(test);
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
await Logger.error('UNHANDLED REJECTION', error.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @date
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {PARSE_ERROR} from '../../../../lib/config/typemap';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {PARSE_ERROR} from '../../../../lib/config/typemap.js';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {TYPE_CONFLICT} from '../../../../lib/config/typemap';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {TYPE_CONFLICT} from '../../../../lib/config/typemap.js';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
export type FilterableEnumType = 'a' | 'b' | 'c';
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
import {ThingType} from './types.js';
|
||||
|
||||
/**
|
||||
* @date
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
import {ThingType} from './types.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable jsdoc/check-tag-names */
|
||||
/*
|
||||
* Copyright (C) 2020 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
@@ -13,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {MISSING_PREMAP} from '../../../../lib/config/typemap';
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {MISSING_PREMAP} from '../../../../lib/config/typemap.js';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
export interface SCISO8601DateRange {
|
||||
bar: string;
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ThingType} from './types';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options';
|
||||
import {ThingType} from './types.js';
|
||||
import {MapAggTestOptions} from '../../map-agg-test-options.js';
|
||||
|
||||
/**
|
||||
* @indexable
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {readdirSync, statSync} from 'fs';
|
||||
import path from 'path';
|
||||
import {MapAggTest} from './mapping-model/map-agg-test';
|
||||
import {MapAggTestOptions} from './mapping-model/map-agg-test-options';
|
||||
import {MapAggTest} from './mapping-model/map-agg-test.js';
|
||||
import {MapAggTestOptions} from './mapping-model/map-agg-test-options.js';
|
||||
|
||||
describe('ES Mapping Gen', async () => {
|
||||
const magAppInstance = new MapAggTest('mappings');
|
||||
@@ -49,7 +49,7 @@ describe('ES Mapping Gen', async () => {
|
||||
it(test.testName, function () {
|
||||
magAppInstance.testInterfaceAgainstPath(test);
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
await Logger.error('UNHANDLED REJECTION', error.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"inlineSourceMap": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "Node",
|
||||
"noErrorTruncation": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
@@ -19,7 +19,7 @@
|
||||
"outDir": "./lib/",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "es6"
|
||||
"target": "ES2020"
|
||||
},
|
||||
"exclude": [
|
||||
"./lib/",
|
||||
|
||||
Reference in New Issue
Block a user