feat: migrate to esm

This commit is contained in:
2023-03-16 01:58:13 +01:00
parent fd740b3091
commit 4df19e8c20
512 changed files with 3016 additions and 2222 deletions

View 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);
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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';

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}