mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-02-26 10:52:20 +00:00
feat: migrate to esm
This commit is contained in:
@@ -17,7 +17,7 @@ import {Logger} from '@openstapps/logger';
|
||||
import {expect} from 'chai';
|
||||
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {cwd} from 'process';
|
||||
import {getTsconfigPath} from '../src/common';
|
||||
import {getTsconfigPath} from '../src/common.js';
|
||||
|
||||
process.on('unhandledRejection', (reason: unknown): void => {
|
||||
if (reason instanceof Error) {
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
import {expect} from 'chai';
|
||||
import {existsSync, unlinkSync} from 'fs';
|
||||
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {createDiagram, createDiagramFromString} from '../src/uml/create-diagram';
|
||||
import {UMLConfig} from '../src/uml/uml-config';
|
||||
import {LightweightDefinition} from '../src/easy-ast/types/lightweight-definition';
|
||||
import {createDiagram, createDiagramFromString} from '../src/uml/create-diagram.js';
|
||||
import {UMLConfig} from '../src/uml/uml-config.js';
|
||||
import {LightweightDefinition} from '../src/easy-ast/types/lightweight-definition.js';
|
||||
import nock = require('nock');
|
||||
import {lightweightDefinitionsFromPath} from '../src/easy-ast/easy-ast';
|
||||
import {lightweightDefinitionsFromPath} from '../src/easy-ast/easy-ast.js';
|
||||
import path from 'path';
|
||||
|
||||
@suite(timeout(15_000), slow(5000))
|
||||
|
||||
@@ -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 {expandPathToFilesSync, toUnixPath} from '../src/util/io';
|
||||
import {EasyAstSpecType} from './easy-ast/easy-ast-spec-type';
|
||||
import {lightweightProjectFromPath} from '../src/easy-ast/easy-ast';
|
||||
import {expandPathToFilesSync, toUnixPath} from '../src/util/io.js';
|
||||
import {EasyAstSpecType} from './easy-ast/easy-ast-spec-type.js';
|
||||
import {lightweightProjectFromPath} from '../src/easy-ast/easy-ast.js';
|
||||
import {expect} from 'chai';
|
||||
import {omitBy} from 'lodash';
|
||||
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
type TestTypeAlias = number | string;
|
||||
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface Random {}
|
||||
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface TestInterface {
|
||||
foo: number;
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
/**
|
||||
* Class comment
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface Test1<T = number> {
|
||||
foo: T;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {LightweightFile} from '../../src/easy-ast/types/lightweight-project';
|
||||
import {LightweightFile} from '../../src/easy-ast/types/lightweight-project.js';
|
||||
|
||||
export interface EasyAstSpecType {
|
||||
testName: string;
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
enum TestAuto {
|
||||
Foo,
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface $Random {}
|
||||
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface $Random {}
|
||||
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface $BaseInterface<T> {
|
||||
foo: T;
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface NestedObject {
|
||||
nested: {
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface Test {
|
||||
number_type: number;
|
||||
|
||||
@@ -13,8 +13,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 {EasyAstSpecType} from './easy-ast-spec-type';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind';
|
||||
import {EasyAstSpecType} from './easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/easy-ast/types/lightweight-definition-kind.js';
|
||||
|
||||
interface Foo<T extends Bar<string>> {
|
||||
bar: T;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {TestFirstUnion} from './test-union';
|
||||
import {TestFirstUnion} from './test-union.js';
|
||||
|
||||
export class TestClass<T> {
|
||||
test2: T;
|
||||
|
||||
@@ -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 {TestClass, TestSecondClass} from './test-class';
|
||||
import {TestFirstEnum} from './test-enum';
|
||||
import {TestThirdUnion} from './test-union';
|
||||
import {TestClass, TestSecondClass} from './test-class.js';
|
||||
import {TestFirstEnum} from './test-enum.js';
|
||||
import {TestThirdUnion} from './test-union.js';
|
||||
|
||||
export interface TestInterface {
|
||||
articleBody: string[];
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {expect} from 'chai';
|
||||
import {toPosixPath} from '../src/util/posix-path';
|
||||
import {toPosixPath} from '../src/util/posix-path.js';
|
||||
import path from 'path';
|
||||
|
||||
describe('posix-path', function () {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {expect} from 'chai';
|
||||
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {Converter} from '../src/schema';
|
||||
import {Converter} from '../src/schema.js';
|
||||
import path from 'path';
|
||||
|
||||
process.on('unhandledRejection', (error: unknown) => {
|
||||
|
||||
@@ -19,9 +19,9 @@ import {existsSync, mkdirSync, writeFileSync} from 'fs';
|
||||
import {JSONSchema7 as Schema} from 'json-schema';
|
||||
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import rimraf from 'rimraf';
|
||||
import {Foo} from '../src/resources/foo';
|
||||
import {Converter} from '../src/schema';
|
||||
import {Validator} from '../src/validate';
|
||||
import {Foo} from '../src/resources/foo.js';
|
||||
import {Converter} from '../src/schema.js';
|
||||
import {Validator} from '../src/validate.js';
|
||||
import path from 'path';
|
||||
|
||||
process.on('unhandledRejection', (error: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user