definition-generator-framework 1.12.5 → 1.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/framework/definition-component.d.ts +11 -9
- package/dist/framework/definition-component.js +18 -18
- package/dist/framework/definition-generator.d.ts +6 -5
- package/dist/framework/definition-generator.js +16 -18
- package/dist/framework/file-content-generator/file-content-generator.js +1 -1
- package/dist/framework/file-content-generator/file-content-generator.test.js +49 -49
- package/dist/framework/framework.d.ts +14 -13
- package/dist/framework/framework.data.d.ts +3 -3
- package/dist/framework/framework.data.js +13 -7
- package/dist/framework/framework.js +36 -33
- package/dist/framework/framework.model.d.ts +15 -15
- package/dist/framework/framework.model.js +3 -3
- package/dist/helpers/common-functions/common-functions.js +1 -1
- package/dist/helpers/common-functions/common-functions.spec.js +48 -48
- package/dist/helpers/duplicate-helper/duplicate-helper.spec.js +52 -52
- package/dist/helpers/output-helper/output-helper.d.ts +26 -26
- package/dist/helpers/output-helper/output-helper.js +127 -107
- package/dist/helpers/output-helper/output-helper.spec.d.ts +22 -22
- package/dist/helpers/output-helper/output-helper.spec.js +223 -211
- package/dist/helpers/output-helper/output-helper.test.d.ts +22 -22
- package/dist/helpers/output-helper/output-helper.test.js +224 -212
- package/dist/helpers/raw-definition-helper/raw-definition.helper.spec.js +133 -125
- package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.spec.d.ts +1 -1
- package/dist/helpers/validator/custom-validator-helper/custom-validator.helper.spec.js +174 -156
- package/dist/helpers/validator/custom-validators/image.custom-validator.d.ts +6 -6
- package/dist/helpers/validator/custom-validators/image.custom-validator.js +40 -39
- package/dist/helpers/validator/custom-validators/unique-name-group.custom-validator.d.ts +4 -4
- package/dist/helpers/validator/custom-validators/unique-name-group.custom-validator.js +29 -29
- package/dist/helpers/validator/joi-custom-validators.spec.js +284 -240
- package/dist/helpers/validator/validator.spec.js +313 -303
- package/dist/pipeline/1-select-definitions-helper.d.ts +13 -13
- package/dist/pipeline/1-select-definitions-helper.js +68 -72
- package/dist/pipeline/1-select-definitions.helper.test.js +40 -40
- package/dist/pipeline/1-select-definitions.spec.js +131 -131
- package/dist/pipeline/2-structure-parser.helper.spec.js +266 -266
- package/dist/pipeline/parsers/array-parser.spec.js +116 -113
- package/dist/pipeline/parsers/object-parser.spec.js +159 -153
- package/dist/pipeline/parsers/primitive-parser.spec.js +67 -67
- package/dist/pre-made-components/assets/3-font.js +4 -4
- package/dist/pre-made-components/events/1-event.d.ts +1 -1
- package/dist/pre-made-components/events/1-event.js +157 -125
- package/dist/pre-made-components/events/2-event-test.d.ts +8 -8
- package/dist/pre-made-components/events/2-event-test.js +156 -119
- package/dist/pre-made-components/events/2-script-test.js +0 -1
- package/dist/pre-made-components/events/event-setup.d.ts +10 -5
- package/dist/pre-made-components/events/event-setup.js +15 -15
- package/dist/pre-made-components/events/script-setup.d.ts +5 -3
- package/dist/pre-made-components/events/script-setup.js +11 -11
- package/package.json +5 -10
|
@@ -2,17 +2,19 @@ import Joi from 'joi';
|
|
|
2
2
|
import { Output } from './framework.model';
|
|
3
3
|
export type DefinitionComponentClassType<T> = new (...args: any[]) => DefinitionComponent<T> | SingleDefinitionComponent<T>;
|
|
4
4
|
export interface DefinitionComponentMeta {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
componentName: string;
|
|
6
|
+
keyName?: string;
|
|
7
|
+
singleton?: boolean;
|
|
8
|
+
validationSchema: Joi.Schema;
|
|
9
9
|
}
|
|
10
|
-
export declare function DefinitionComponentDecorator(
|
|
10
|
+
export declare function DefinitionComponentDecorator(
|
|
11
|
+
meta: DefinitionComponentMeta
|
|
12
|
+
): (ComponentClass: DefinitionComponentClassType<any>) => any;
|
|
11
13
|
export declare abstract class DefinitionComponent<T> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
static getSchema(): Joi.Schema;
|
|
15
|
+
abstract process(definitions: T[], context: Output): Promise<void>;
|
|
14
16
|
}
|
|
15
17
|
export declare abstract class SingleDefinitionComponent<T> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
static getSchema(): Joi.Schema;
|
|
19
|
+
abstract process(definitions: T, context: Output): Promise<void>;
|
|
18
20
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.SingleDefinitionComponent = exports.DefinitionComponent = exports.DefinitionComponentDecorator = void 0;
|
|
4
|
-
const definition_store_1 = require(
|
|
4
|
+
const definition_store_1 = require('./definition-store');
|
|
5
5
|
function DefinitionComponentDecorator(meta) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
6
|
+
return function (ComponentClass) {
|
|
7
|
+
definition_store_1.FrameworkData.definitionComponentNames.add(meta.componentName);
|
|
8
|
+
ComponentClass.$meta = {
|
|
9
|
+
componentName: meta.componentName,
|
|
10
|
+
keyName: meta.keyName,
|
|
11
|
+
singleton: meta.singleton,
|
|
12
|
+
validationSchema: meta.validationSchema
|
|
14
13
|
};
|
|
14
|
+
};
|
|
15
15
|
}
|
|
16
16
|
exports.DefinitionComponentDecorator = DefinitionComponentDecorator;
|
|
17
17
|
class DefinitionComponent {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
static getSchema() {
|
|
19
|
+
return this.$meta.validationSchema;
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
22
|
exports.DefinitionComponent = DefinitionComponent;
|
|
23
23
|
class SingleDefinitionComponent {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
static getSchema() {
|
|
25
|
+
return this.$meta.validationSchema;
|
|
26
|
+
}
|
|
27
27
|
}
|
|
28
28
|
exports.SingleDefinitionComponent = SingleDefinitionComponent;
|
|
29
|
-
//# sourceMappingURL=definition-component.js.map
|
|
29
|
+
//# sourceMappingURL=definition-component.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DefinitionComponentClassType } from './definition-component';
|
|
2
2
|
interface DefinitionGeneratorMeta {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
modules: DefinitionComponentClassType<any>[];
|
|
4
|
+
interfaces: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function DefinitionGeneratorDecorator(
|
|
6
|
+
export declare function DefinitionGeneratorDecorator(
|
|
7
|
+
meta: DefinitionGeneratorMeta
|
|
8
|
+
): (ModuleClass: DefinitionGeneratorClassType) => any;
|
|
7
9
|
export type DefinitionGeneratorClassType = new (...args: any[]) => DefinitionGenerator;
|
|
8
|
-
export declare abstract class DefinitionGenerator {
|
|
9
|
-
}
|
|
10
|
+
export declare abstract class DefinitionGenerator {}
|
|
10
11
|
export {};
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.DefinitionGenerator = exports.DefinitionGeneratorDecorator = void 0;
|
|
4
|
-
const definition_store_1 = require(
|
|
5
|
-
const kernel_1 = require(
|
|
4
|
+
const definition_store_1 = require('./definition-store');
|
|
5
|
+
const kernel_1 = require('./kernel');
|
|
6
6
|
let ModuleIsRegistered = false;
|
|
7
7
|
function DefinitionGeneratorDecorator(meta) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
8
|
+
return function (ModuleClass) {
|
|
9
|
+
if (ModuleIsRegistered) {
|
|
10
|
+
console.error('There can be only one definition module!');
|
|
11
|
+
} else {
|
|
12
|
+
ModuleIsRegistered = true;
|
|
13
|
+
definition_store_1.FrameworkData.modules.push(...meta.modules);
|
|
14
|
+
definition_store_1.FrameworkData.interfaces = meta.interfaces;
|
|
15
|
+
kernel_1.Kernel.process();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
19
18
|
}
|
|
20
19
|
exports.DefinitionGeneratorDecorator = DefinitionGeneratorDecorator;
|
|
21
|
-
class DefinitionGenerator {
|
|
22
|
-
}
|
|
20
|
+
class DefinitionGenerator {}
|
|
23
21
|
exports.DefinitionGenerator = DefinitionGenerator;
|
|
24
|
-
//# sourceMappingURL=definition-generator.js.map
|
|
22
|
+
//# sourceMappingURL=definition-generator.js.map
|
|
@@ -109,7 +109,7 @@ class FileContentGenerator {
|
|
|
109
109
|
return { assetImports, replaceMap };
|
|
110
110
|
}
|
|
111
111
|
static stringify(obj) {
|
|
112
|
-
//
|
|
112
|
+
// biome-ignore lint:all
|
|
113
113
|
return JSON.stringify(obj, (k, v) => (v === undefined ? null : v)).replace(/null/gm, 'undefined');
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -57,57 +57,57 @@ exports.Const = {
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
let noTypeExpected = `export const ConstSample = { type: 'item' };
|
|
60
|
+
let noTypeExpected = `export const ConstSample = { type: 'item' };
|
|
61
61
|
`;
|
|
62
|
-
let basicConstExpected = `export const ConstSample: string = 'basic';
|
|
62
|
+
let basicConstExpected = `export const ConstSample: string = 'basic';
|
|
63
63
|
`;
|
|
64
|
-
let complexConstExpected = `export const ConstSample: any = {
|
|
65
|
-
type: 'bow',
|
|
66
|
-
material: 'WoodenItemMaterial',
|
|
67
|
-
maxQuantity: 10,
|
|
68
|
-
mainHand: undefined,
|
|
69
|
-
offHand: undefined,
|
|
70
|
-
bothHands: {
|
|
71
|
-
imageOnCharacter: 'BodyPartImageNames',
|
|
72
|
-
parryDice: undefined,
|
|
73
|
-
attacks: [
|
|
74
|
-
{
|
|
75
|
-
actionIcon: 'AssetNames.characterActionBowAttack',
|
|
76
|
-
attackDices: ['DiceType.d6', 'DiceType.d6'],
|
|
77
|
-
range: 'WeaponRange.ranged',
|
|
78
|
-
requiresSetup: false,
|
|
79
|
-
unparryable: true,
|
|
80
|
-
lowersQuantity: true,
|
|
81
|
-
projectileType: 'ProjectileType.arrow',
|
|
82
|
-
sounds: { hit: 'AssetGroups.battleSoundArrowHit', pre: 'AssetGroups.battleSoundArrowShot' }
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
};
|
|
64
|
+
let complexConstExpected = `export const ConstSample: any = {
|
|
65
|
+
type: 'bow',
|
|
66
|
+
material: 'WoodenItemMaterial',
|
|
67
|
+
maxQuantity: 10,
|
|
68
|
+
mainHand: undefined,
|
|
69
|
+
offHand: undefined,
|
|
70
|
+
bothHands: {
|
|
71
|
+
imageOnCharacter: 'BodyPartImageNames',
|
|
72
|
+
parryDice: undefined,
|
|
73
|
+
attacks: [
|
|
74
|
+
{
|
|
75
|
+
actionIcon: 'AssetNames.characterActionBowAttack',
|
|
76
|
+
attackDices: ['DiceType.d6', 'DiceType.d6'],
|
|
77
|
+
range: 'WeaponRange.ranged',
|
|
78
|
+
requiresSetup: false,
|
|
79
|
+
unparryable: true,
|
|
80
|
+
lowersQuantity: true,
|
|
81
|
+
projectileType: 'ProjectileType.arrow',
|
|
82
|
+
sounds: { hit: 'AssetGroups.battleSoundArrowHit', pre: 'AssetGroups.battleSoundArrowShot' }
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
87
|
`;
|
|
88
|
-
let complexConstReplaceExpected = `export const ConstSample: any = {
|
|
89
|
-
type: 'bow',
|
|
90
|
-
material: 'WoodenItemMaterial',
|
|
91
|
-
maxQuantity: 10,
|
|
92
|
-
mainHand: undefined,
|
|
93
|
-
offHand: undefined,
|
|
94
|
-
bothHands: {
|
|
95
|
-
imageOnCharacter: 'BodyPartImageNames',
|
|
96
|
-
parryDice: undefined,
|
|
97
|
-
attacks: [
|
|
98
|
-
{
|
|
99
|
-
actionIcon: 'AssetNames.characterActionBowAttack',
|
|
100
|
-
attackDices: ['DiceType.d6', 'DiceType.d6'],
|
|
101
|
-
range: WeaponRange,
|
|
102
|
-
requiresSetup: false,
|
|
103
|
-
unparryable: true,
|
|
104
|
-
lowersQuantity: true,
|
|
105
|
-
projectileType: 'ProjectileType.arrow',
|
|
106
|
-
sounds: { hit: 'AssetGroups.battleSoundArrowHit', pre: 'AssetGroups.battleSoundArrowShot' }
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
};
|
|
88
|
+
let complexConstReplaceExpected = `export const ConstSample: any = {
|
|
89
|
+
type: 'bow',
|
|
90
|
+
material: 'WoodenItemMaterial',
|
|
91
|
+
maxQuantity: 10,
|
|
92
|
+
mainHand: undefined,
|
|
93
|
+
offHand: undefined,
|
|
94
|
+
bothHands: {
|
|
95
|
+
imageOnCharacter: 'BodyPartImageNames',
|
|
96
|
+
parryDice: undefined,
|
|
97
|
+
attacks: [
|
|
98
|
+
{
|
|
99
|
+
actionIcon: 'AssetNames.characterActionBowAttack',
|
|
100
|
+
attackDices: ['DiceType.d6', 'DiceType.d6'],
|
|
101
|
+
range: WeaponRange,
|
|
102
|
+
requiresSetup: false,
|
|
103
|
+
unparryable: true,
|
|
104
|
+
lowersQuantity: true,
|
|
105
|
+
projectileType: 'ProjectileType.arrow',
|
|
106
|
+
sounds: { hit: 'AssetGroups.battleSoundArrowHit', pre: 'AssetGroups.battleSoundArrowShot' }
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
111
|
`;
|
|
112
112
|
(0, vitest_1.describe)('File Content Generator: Const Output', () => {
|
|
113
113
|
(0, vitest_1.test)('should handle no type', async () => {
|
|
@@ -140,7 +140,7 @@ let complexConstReplaceExpected = `export const ConstSample: any = {
|
|
|
140
140
|
(0, vitest_1.test)('should not lose properties with undefined or null value', async () => {
|
|
141
141
|
let output = await file_content_generator_1.FileContentGenerator['stringify']({
|
|
142
142
|
a: undefined,
|
|
143
|
-
//
|
|
143
|
+
// biome-ignore lint:all
|
|
144
144
|
b: null
|
|
145
145
|
});
|
|
146
146
|
(0, vitest_1.expect)(output).toStrictEqual('{"a":undefined,"b":undefined}');
|
|
@@ -2,26 +2,27 @@ import Joi from 'joi';
|
|
|
2
2
|
import { Output } from './framework.model';
|
|
3
3
|
export type DefinitionComponentClassType<T> = new (...args: any[]) => DefinitionComponent<T> | SingleDefinitionComponent<T>;
|
|
4
4
|
export interface DefinitionComponentMeta {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
definitionName: string;
|
|
6
|
+
keyName?: string;
|
|
7
|
+
singleton?: boolean;
|
|
8
|
+
validationSchema: Joi.Schema;
|
|
9
9
|
}
|
|
10
|
-
export declare function DefinitionComponentDecorator(
|
|
10
|
+
export declare function DefinitionComponentDecorator(
|
|
11
|
+
meta: DefinitionComponentMeta
|
|
12
|
+
): (ComponentClass: DefinitionComponentClassType<any>) => any;
|
|
11
13
|
export declare abstract class DefinitionComponent<T> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
static getSchema(): Joi.Schema;
|
|
15
|
+
abstract process(definitions: T[], context: Output): Promise<void>;
|
|
14
16
|
}
|
|
15
17
|
export declare abstract class SingleDefinitionComponent<T> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
static getSchema(): Joi.Schema;
|
|
19
|
+
abstract process(definitions: T, context: Output): Promise<void>;
|
|
18
20
|
}
|
|
19
21
|
interface DefinitionModuleMeta {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
modules: DefinitionComponentClassType<any>[];
|
|
23
|
+
interfaces: string;
|
|
22
24
|
}
|
|
23
25
|
export declare function DefinitionModuleDecorator(meta: DefinitionModuleMeta): (ModuleClass: DefinitionModuleClassType) => any;
|
|
24
26
|
export type DefinitionModuleClassType = new (...args: any[]) => DefinitionModule;
|
|
25
|
-
export declare abstract class DefinitionModule {
|
|
26
|
-
}
|
|
27
|
+
export declare abstract class DefinitionModule {}
|
|
27
28
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefinitionComponentClassType } from './framework';
|
|
2
2
|
export declare class FrameworkData {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
static readonly definitionNames: Set<string>;
|
|
4
|
+
static readonly modules: DefinitionComponentClassType<any>[];
|
|
5
|
+
static interfaces: string;
|
|
6
6
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.FrameworkData = void 0;
|
|
4
|
-
const _3_config_1 = require(
|
|
4
|
+
const _3_config_1 = require('../pipeline/3-config');
|
|
5
5
|
class FrameworkData {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
static {
|
|
7
|
+
this.definitionNames = new Set([_3_config_1.ConfigDefinitionName]);
|
|
8
|
+
}
|
|
9
|
+
static {
|
|
10
|
+
this.modules = [];
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.interfaces = '';
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
16
|
exports.FrameworkData = FrameworkData;
|
|
11
|
-
//# sourceMappingURL=framework.data.js.map
|
|
17
|
+
//# sourceMappingURL=framework.data.js.map
|
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.DefinitionModule =
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.DefinitionModule =
|
|
4
|
+
exports.DefinitionModuleDecorator =
|
|
5
|
+
exports.SingleDefinitionComponent =
|
|
6
|
+
exports.DefinitionComponent =
|
|
7
|
+
exports.DefinitionComponentDecorator =
|
|
8
|
+
void 0;
|
|
9
|
+
const kernel_1 = require('./kernel');
|
|
10
|
+
const definition_store_1 = require('./definition-store');
|
|
6
11
|
function DefinitionComponentDecorator(meta) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
12
|
+
return function (ComponentClass) {
|
|
13
|
+
definition_store_1.FrameworkData.definitionNames.add(meta.definitionName);
|
|
14
|
+
ComponentClass.$meta = {
|
|
15
|
+
definitionName: meta.definitionName,
|
|
16
|
+
keyName: meta.keyName,
|
|
17
|
+
singleton: meta.singleton,
|
|
18
|
+
validationSchema: meta.validationSchema
|
|
15
19
|
};
|
|
20
|
+
};
|
|
16
21
|
}
|
|
17
22
|
exports.DefinitionComponentDecorator = DefinitionComponentDecorator;
|
|
18
23
|
class DefinitionComponent {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
static getSchema() {
|
|
25
|
+
return this.$meta.validationSchema;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
exports.DefinitionComponent = DefinitionComponent;
|
|
24
29
|
class SingleDefinitionComponent {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
static getSchema() {
|
|
31
|
+
return this.$meta.validationSchema;
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
exports.SingleDefinitionComponent = SingleDefinitionComponent;
|
|
30
35
|
let ModuleIsRegistered = false;
|
|
31
36
|
function DefinitionModuleDecorator(meta) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
37
|
+
return function (ModuleClass) {
|
|
38
|
+
if (ModuleIsRegistered) {
|
|
39
|
+
console.error('There can be only one definition module!');
|
|
40
|
+
} else {
|
|
41
|
+
ModuleIsRegistered = true;
|
|
42
|
+
definition_store_1.FrameworkData.modules.push(...meta.modules);
|
|
43
|
+
definition_store_1.FrameworkData.interfaces = meta.interfaces;
|
|
44
|
+
kernel_1.Kernel.process();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
43
47
|
}
|
|
44
48
|
exports.DefinitionModuleDecorator = DefinitionModuleDecorator;
|
|
45
|
-
class DefinitionModule {
|
|
46
|
-
}
|
|
49
|
+
class DefinitionModule {}
|
|
47
50
|
exports.DefinitionModule = DefinitionModule;
|
|
48
|
-
//# sourceMappingURL=framework.js.map
|
|
51
|
+
//# sourceMappingURL=framework.js.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
export interface FileSystem {
|
|
2
|
-
|
|
2
|
+
existsSync: (path: string) => boolean;
|
|
3
3
|
}
|
|
4
4
|
export interface FileInfo {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
path: string;
|
|
6
|
+
content: string;
|
|
7
7
|
}
|
|
8
8
|
export interface LocationInFile {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly line: number;
|
|
11
11
|
}
|
|
12
12
|
export interface ErrorLog {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly location: LocationInFile;
|
|
15
15
|
}
|
|
16
16
|
export interface Config {
|
|
17
|
-
|
|
17
|
+
projectRoot: string;
|
|
18
18
|
}
|
|
19
19
|
export type RawData = undefined | string | ParsedStructure[] | Record<string, ParsedStructure>;
|
|
20
20
|
export interface ParsedStructure {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
readonly rawData: RawData;
|
|
22
|
+
readonly line: number;
|
|
23
23
|
}
|
|
24
24
|
export interface RawDefinition {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
readonly componentName: string;
|
|
26
|
+
readonly parsedStructure: ParsedStructure;
|
|
27
|
+
readonly location: LocationInFile;
|
|
28
28
|
}
|
|
29
29
|
export interface Output {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
addFile: (fileInfo: FileInfo) => void;
|
|
31
|
+
addError: (errorLog: ErrorLog) => void;
|
|
32
32
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=framework.model.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
//# sourceMappingURL=framework.model.js.map
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const common_functions_1 = require(
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
const common_functions_1 = require('./common-functions');
|
|
4
4
|
describe('COMMON FUNCTIONS', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
5
|
+
test('kabab case to camel case', () => {
|
|
6
|
+
expect(common_functions_1.CommonFunctions.kebabCaseToCamelCase('')).toEqual('');
|
|
7
|
+
expect(common_functions_1.CommonFunctions.kebabCaseToCamelCase('text')).toEqual('text');
|
|
8
|
+
expect(common_functions_1.CommonFunctions.kebabCaseToCamelCase('TEXT')).toEqual('text');
|
|
9
|
+
expect(common_functions_1.CommonFunctions.kebabCaseToCamelCase('text-asdf')).toEqual('textAsdf');
|
|
10
|
+
expect(common_functions_1.CommonFunctions.kebabCaseToCamelCase('TEXT-ASDF')).toEqual('textAsdf');
|
|
11
|
+
});
|
|
12
|
+
test('lower case first letter', () => {
|
|
13
|
+
expect(common_functions_1.CommonFunctions.lowerCaseFirstLetter('')).toEqual('');
|
|
14
|
+
expect(common_functions_1.CommonFunctions.lowerCaseFirstLetter('text')).toEqual('text');
|
|
15
|
+
expect(common_functions_1.CommonFunctions.lowerCaseFirstLetter(' ')).toEqual(' ');
|
|
16
|
+
expect(common_functions_1.CommonFunctions.lowerCaseFirstLetter('Text')).toEqual('text');
|
|
17
|
+
expect(common_functions_1.CommonFunctions.lowerCaseFirstLetter(' Text')).toEqual(' Text');
|
|
18
|
+
});
|
|
19
|
+
test('upper case first letter', () => {
|
|
20
|
+
expect(common_functions_1.CommonFunctions.upperCaseFirstLetter('')).toEqual('');
|
|
21
|
+
expect(common_functions_1.CommonFunctions.upperCaseFirstLetter('Text')).toEqual('Text');
|
|
22
|
+
expect(common_functions_1.CommonFunctions.upperCaseFirstLetter(' ')).toEqual(' ');
|
|
23
|
+
expect(common_functions_1.CommonFunctions.upperCaseFirstLetter('text')).toEqual('Text');
|
|
24
|
+
expect(common_functions_1.CommonFunctions.upperCaseFirstLetter(' text')).toEqual(' text');
|
|
25
|
+
});
|
|
26
|
+
test('remove whitespace', () => {
|
|
27
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('')).toEqual('');
|
|
28
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text')).toEqual('text');
|
|
29
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace(' text')).toEqual('text');
|
|
30
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text ')).toEqual('text');
|
|
31
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text\n')).toEqual('text');
|
|
32
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text\r')).toEqual('text');
|
|
33
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text\r\n')).toEqual('text');
|
|
34
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text//')).toEqual('text');
|
|
35
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text //')).toEqual('text');
|
|
36
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text // asdf')).toEqual('text');
|
|
37
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text text')).toEqual('text text');
|
|
38
|
+
expect(common_functions_1.CommonFunctions.removeWhiteSpace('text text')).toEqual('text text');
|
|
39
|
+
});
|
|
40
|
+
test('remove comments', () => {
|
|
41
|
+
expect(common_functions_1.CommonFunctions.removeComments('')).toEqual('');
|
|
42
|
+
expect(common_functions_1.CommonFunctions.removeComments('text')).toEqual('text');
|
|
43
|
+
expect(common_functions_1.CommonFunctions.removeComments(' text ')).toEqual(' text');
|
|
44
|
+
expect(common_functions_1.CommonFunctions.removeComments(' text//')).toEqual(' text');
|
|
45
|
+
expect(common_functions_1.CommonFunctions.removeComments(' text //')).toEqual(' text');
|
|
46
|
+
expect(common_functions_1.CommonFunctions.removeComments(' text // asdf')).toEqual(' text');
|
|
47
|
+
expect(common_functions_1.CommonFunctions.removeComments('- Symbol: □ // Dirt\n')).toEqual('- Symbol: □');
|
|
48
|
+
});
|
|
49
49
|
});
|
|
50
|
-
//# sourceMappingURL=common-functions.spec.js.map
|
|
50
|
+
//# sourceMappingURL=common-functions.spec.js.map
|