devextreme-internal-tools 18.1.2 → 18.2.0
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/bin/DevExtreme.Declarations.Discoverer +0 -0
- package/bin/DevExtreme.Declarations.Discoverer.dll +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator.dll +0 -0
- package/bin/DevExtreme.Declarations.dll +0 -0
- package/bin/DevExtreme.Descriptions.Injector +0 -0
- package/bin/DevExtreme.Descriptions.Injector.dll +0 -0
- package/bin/DevExtreme.Infrastructure.dll +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator.dll +0 -0
- package/bin/DevExtreme.NgSmdGenerator +0 -0
- package/bin/DevExtreme.NgSmdGenerator.dll +0 -0
- package/bin/DevExtreme.SmdCommon.dll +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator.dll +0 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator +0 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator.dll +0 -0
- package/bin/DevExtreme.Topics.Generator +0 -0
- package/bin/DevExtreme.Topics.Generator.dll +0 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator +0 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator.dll +0 -0
- package/bin/DevExtreme.Topics.Validation +0 -0
- package/bin/DevExtreme.Topics.Validation.dll +0 -0
- package/bin/DevExtreme.Topics.dll +0 -0
- package/bin/DevExtreme.WebSite.CompactDocsCreator +0 -0
- package/bin/DevExtreme.WebSite.CompactDocsCreator.dll +0 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator +0 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator.dll +0 -0
- package/bin/DevExtreme.WebSite.ContentMaps.dll +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter.dll +0 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator +0 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator.dll +0 -0
- package/bin/JetBrains.Annotations.dll +0 -0
- package/bin/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.DependencyInjection.dll +0 -0
- package/bin/NLog.dll +0 -0
- package/bin/Newtonsoft.Json.dll +0 -0
- package/bin/System.IO.Abstractions.dll +0 -0
- package/bin/TestableIO.System.IO.Abstractions.Wrappers.dll +0 -0
- package/bin/TestableIO.System.IO.Abstractions.dll +0 -0
- package/bin/TypeGen.Core.dll +0 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +17 -15
- package/ts/angular-components-generator/common-reexports-generator.d.ts +2 -2
- package/ts/angular-components-generator/dot-generator.d.ts +2 -1
- package/ts/angular-components-generator/dot-generator.js +37 -13
- package/ts/angular-components-generator/dot-generator.js.map +1 -1
- package/ts/angular-components-generator/import-helper.d.ts +1 -1
- package/ts/angular-components-generator/import-helper.js.map +1 -1
- package/ts/angular-components-generator/metadata-generator.d.ts +3 -3
- package/ts/angular-components-generator/metadata-generator.js +23 -45
- package/ts/angular-components-generator/metadata-generator.js.map +1 -1
- package/ts/angular-components-generator/templates/component.tst +14 -27
- package/ts/angular-components-generator/templates/nested-component.tst +31 -37
- package/ts/components-generation/common-reexports-generator.d.ts +2 -2
- package/ts/components-generation/helpers.js +2 -1
- package/ts/components-generation/helpers.js.map +1 -1
- package/ts/components-generation/models/imd/array-descr.d.ts +4 -0
- package/ts/{angular-components-generator/metadata-model.js → components-generation/models/imd/array-descr.js} +1 -1
- package/ts/components-generation/models/imd/array-descr.js.map +1 -0
- package/ts/components-generation/models/imd/complex-prop.d.ts +14 -0
- package/{integration-data-model.js → ts/components-generation/models/imd/complex-prop.js} +1 -1
- package/ts/components-generation/models/imd/complex-prop.js.map +1 -0
- package/ts/components-generation/models/imd/component-ref.d.ts +5 -0
- package/ts/components-generation/models/imd/component-ref.js +3 -0
- package/ts/components-generation/models/imd/component-ref.js.map +1 -0
- package/ts/components-generation/models/imd/custom-type.d.ts +9 -0
- package/ts/components-generation/models/imd/custom-type.js +3 -0
- package/ts/components-generation/models/imd/custom-type.js.map +1 -0
- package/ts/components-generation/models/imd/field.d.ts +5 -0
- package/ts/components-generation/models/imd/field.js +3 -0
- package/ts/components-generation/models/imd/field.js.map +1 -0
- package/ts/components-generation/models/imd/function-descr.d.ts +6 -0
- package/ts/components-generation/models/imd/function-descr.js +3 -0
- package/ts/components-generation/models/imd/function-descr.js.map +1 -0
- package/ts/components-generation/models/imd/index.d.ts +13 -0
- package/ts/components-generation/models/imd/index.js +30 -0
- package/ts/components-generation/models/imd/index.js.map +1 -0
- package/ts/components-generation/models/imd/meta.d.ts +4 -0
- package/ts/components-generation/models/imd/meta.js +3 -0
- package/ts/components-generation/models/imd/meta.js.map +1 -0
- package/ts/components-generation/models/imd/model.d.ts +11 -0
- package/ts/components-generation/models/imd/model.js +3 -0
- package/ts/components-generation/models/imd/model.js.map +1 -0
- package/ts/components-generation/models/imd/object-descr.d.ts +5 -0
- package/ts/components-generation/models/imd/object-descr.js +3 -0
- package/ts/components-generation/models/imd/object-descr.js.map +1 -0
- package/ts/components-generation/models/imd/param.d.ts +5 -0
- package/ts/components-generation/models/imd/param.js +3 -0
- package/ts/components-generation/models/imd/param.js.map +1 -0
- package/ts/components-generation/models/imd/prop.d.ts +9 -0
- package/ts/components-generation/models/imd/prop.js +3 -0
- package/ts/components-generation/models/imd/prop.js.map +1 -0
- package/ts/components-generation/models/imd/type-descr.d.ts +9 -0
- package/ts/components-generation/models/imd/type-descr.js +3 -0
- package/ts/components-generation/models/imd/type-descr.js.map +1 -0
- package/ts/components-generation/models/imd/widget.d.ts +16 -0
- package/ts/components-generation/models/imd/widget.js +3 -0
- package/ts/components-generation/models/imd/widget.js.map +1 -0
- package/ts/components-generation/models/ng/import.d.ts +5 -0
- package/ts/components-generation/models/ng/import.js +3 -0
- package/ts/components-generation/models/ng/import.js.map +1 -0
- package/ts/components-generation/models/ng/index.d.ts +4 -0
- package/ts/components-generation/models/ng/index.js +21 -0
- package/ts/components-generation/models/ng/index.js.map +1 -0
- package/ts/components-generation/models/ng/model.d.ts +12 -0
- package/ts/components-generation/models/ng/model.js +3 -0
- package/ts/components-generation/models/ng/model.js.map +1 -0
- package/ts/components-generation/models/ng/option.d.ts +20 -0
- package/ts/components-generation/models/ng/option.js +3 -0
- package/ts/components-generation/models/ng/option.js.map +1 -0
- package/ts/components-generation/models/ng/options-owner.d.ts +15 -0
- package/ts/components-generation/models/ng/options-owner.js +3 -0
- package/ts/components-generation/models/ng/options-owner.js.map +1 -0
- package/ts/components-generation/models/smd/container.d.ts +12 -0
- package/ts/components-generation/models/smd/container.js +3 -0
- package/ts/components-generation/models/smd/container.js.map +1 -0
- package/ts/components-generation/models/smd/index.d.ts +7 -0
- package/ts/components-generation/models/smd/index.js +24 -0
- package/ts/components-generation/models/smd/index.js.map +1 -0
- package/ts/components-generation/models/smd/model.d.ts +13 -0
- package/ts/components-generation/models/smd/model.js +3 -0
- package/ts/components-generation/models/smd/model.js.map +1 -0
- package/ts/components-generation/models/smd/option-info.d.ts +13 -0
- package/ts/components-generation/models/smd/option-info.js +3 -0
- package/ts/components-generation/models/smd/option-info.js.map +1 -0
- package/ts/components-generation/models/smd/strong-enum-info.d.ts +7 -0
- package/ts/components-generation/models/smd/strong-enum-info.js +3 -0
- package/ts/components-generation/models/smd/strong-enum-info.js.map +1 -0
- package/ts/components-generation/models/smd/strong-enum-item-info.d.ts +5 -0
- package/ts/components-generation/models/smd/strong-enum-item-info.js +3 -0
- package/ts/components-generation/models/smd/strong-enum-item-info.js.map +1 -0
- package/ts/components-generation/models/smd/type-info.d.ts +8 -0
- package/ts/components-generation/models/smd/type-info.js +3 -0
- package/ts/components-generation/models/smd/type-info.js.map +1 -0
- package/ts/components-generation/models/smd/type-kind.d.ts +4 -0
- package/ts/components-generation/models/smd/type-kind.js +9 -0
- package/ts/components-generation/models/smd/type-kind.js.map +1 -0
- package/ts/components-generation/type-resolving.d.ts +7 -7
- package/ts/components-generation/type-resolving.js.map +1 -1
- package/ts/react-components-generator/generator.d.ts +12 -12
- package/ts/react-components-generator/generator.js.map +1 -1
- package/ts/vue-components-generator/converter.d.ts +3 -3
- package/ts/vue-components-generator/converter.js.map +1 -1
- package/ts/vue-components-generator/generator.d.ts +3 -3
- package/ts/vue-components-generator/generator.js.map +1 -1
- package/integration-data-model.d.ts +0 -78
- package/integration-data-model.js.map +0 -1
- package/ts/angular-components-generator/metadata-model.d.ts +0 -52
- package/ts/angular-components-generator/metadata-model.js.map +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/NLog.dll
CHANGED
|
Binary file
|
package/bin/Newtonsoft.Json.dll
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * as IntegrationMetadata from './
|
|
1
|
+
export * as IntegrationMetadata from './ts/components-generation/models/imd';
|
|
2
2
|
export { generate as generateReactComponents } from './ts/react-components-generator/generator';
|
|
3
3
|
export { generate as generateVueComponents } from './ts/vue-components-generator/generator';
|
|
4
4
|
export { ComponentMetadataGenerator as AngularMetadataGenerator } from './ts/angular-components-generator/metadata-generator';
|
package/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.AngularCommonReexportsGenerator = exports.AngularComponentNamesGenerator = exports.AngularModuleFacadeGenerator = exports.AngularFacadeGenerator = exports.AngularDotGenerator = exports.AngularMetadataGenerator = exports.generateVueComponents = exports.generateReactComponents = exports.IntegrationMetadata = void 0;
|
|
37
|
-
exports.IntegrationMetadata = __importStar(require("./
|
|
37
|
+
exports.IntegrationMetadata = __importStar(require("./ts/components-generation/models/imd"));
|
|
38
38
|
var generator_1 = require("./ts/react-components-generator/generator");
|
|
39
39
|
Object.defineProperty(exports, "generateReactComponents", { enumerable: true, get: function () { return generator_1.generate; } });
|
|
40
40
|
var generator_2 = require("./ts/vue-components-generator/generator");
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6FAA6E;AAE7E,uEAAgG;AAAvF,oHAAA,QAAQ,OAA2B;AAE5C,qEAA4F;AAAnF,kHAAA,QAAQ,OAAyB;AAE1C,2FAA8H;AAArH,8HAAA,0BAA0B,OAA4B;AAE/D,iFAAsG;AAA7F,oHAAA,YAAY,OAAuB;AAE5C,uFAA+G;AAAtG,0HAAA,eAAe,OAA0B;AAElD,qGAAkI;AAAzH,uIAAA,qBAAqB,OAAgC;AAE9D,yGAAwI;AAA/H,2IAAA,uBAAuB,OAAkC;AAElE,2GAA2I;AAAlI,6IAAA,wBAAwB,OAAmC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "devextreme-internal-tools",
|
|
3
3
|
"description": "DevExtreme internal tools",
|
|
4
4
|
"author": "Developer Express Inc.",
|
|
5
|
-
"version": "18.
|
|
5
|
+
"version": "18.2.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"bin": {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"directory": "dist"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@changesets/cli": "2.29.6",
|
|
19
18
|
"@prettier/sync": "^0.6.1",
|
|
20
19
|
"dot": "1.1.3",
|
|
21
20
|
"mkdirp": "3.0.1",
|
|
@@ -25,29 +24,32 @@
|
|
|
25
24
|
"winston": "~3.17.0"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@eslint/
|
|
30
|
-
"@
|
|
27
|
+
"@changesets/cli": "2.29.7",
|
|
28
|
+
"@eslint/compat": "1.4.0",
|
|
29
|
+
"@eslint/js": "9.35.0",
|
|
30
|
+
"@stylistic/eslint-plugin": "5.4.0",
|
|
31
31
|
"@types/dasherize": "2.0.3",
|
|
32
32
|
"@types/jest": "30.0.0",
|
|
33
|
-
"@types/node": "18.19.
|
|
33
|
+
"@types/node": "18.19.127",
|
|
34
34
|
"@types/shelljs": "0.8.17",
|
|
35
|
-
"eslint": "
|
|
36
|
-
"eslint
|
|
35
|
+
"@typescript-eslint/parser": "8.44.1",
|
|
36
|
+
"eslint": "9.35.0",
|
|
37
|
+
"eslint-config-airbnb-extended": "2.3.1",
|
|
37
38
|
"eslint-config-prettier": "10.1.8",
|
|
38
39
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
39
40
|
"eslint-plugin-import-x": "4.16.1",
|
|
40
|
-
"eslint-plugin-n": "17.
|
|
41
|
+
"eslint-plugin-n": "17.23.1",
|
|
41
42
|
"eslint-plugin-prettier": "5.5.4",
|
|
42
|
-
"jest": "30.1.
|
|
43
|
+
"jest": "30.1.3",
|
|
43
44
|
"nodemon": "3.1.10",
|
|
44
45
|
"path": "0.12.7",
|
|
45
46
|
"rimraf": "6.0.1",
|
|
46
|
-
"ts-jest": "29.4.
|
|
47
|
-
"
|
|
47
|
+
"ts-jest": "29.4.4",
|
|
48
|
+
"ts-node": "10.9.2",
|
|
49
|
+
"typescript-eslint": "8.44.1"
|
|
48
50
|
},
|
|
49
51
|
"scripts": {
|
|
50
|
-
"build": "npm run clean &&
|
|
52
|
+
"build": "npm run clean && ts-node ./build.ts && npm run build-ts",
|
|
51
53
|
"build-ts": "tsc",
|
|
52
54
|
"build-ts-watch": "tsc -w",
|
|
53
55
|
"changeset": "changeset",
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
"discover-watch": "nodemon --delay 500ms -e js,.ts,d.ts --watch dist --watch ../devextreme/packages/devextreme/js --exec pnpm run discover",
|
|
58
60
|
"generate-ts-bundle": "node dist/cli.js generate-ts-bundle --artifacts dist/bin --sources ../devextreme/packages/devextreme/js --output-path ../devextreme/packages/devextreme/ts/dx.all.d.ts --exclude \"js/(renovation|__internal|.eslintrc.js)\"",
|
|
59
61
|
"inject-descriptions": "node dist/cli.js inject-descriptions --collapse-tags --artifacts dist/bin --sources ../devextreme/packages/devextreme/js",
|
|
62
|
+
"install-dotnet-typegen": "dotnet tool install --local dotnet-typegen --version 5.0.1 || echo skip installation",
|
|
60
63
|
"lint": "pnpm run lint-ts && pnpm run lint-netcore",
|
|
61
64
|
"lint-ts": "eslint .",
|
|
62
65
|
"lint-netcore": "dotnet format whitespace netcore --verify-no-changes",
|
|
@@ -65,7 +68,6 @@
|
|
|
65
68
|
"release": "pnpm run build && pnpm changeset publish",
|
|
66
69
|
"test": "pnpm run test-ts && pnpm run test-netcore",
|
|
67
70
|
"test-ts": "jest",
|
|
68
|
-
"test-netcore": "dotnet build netcore && dotnet test ./netcore --verbosity quiet"
|
|
69
|
-
"regenerate": "dotnet build netcore/DevExtreme.IntegrationDataGenerator/DevExtreme.IntegrationDataGenerator.csproj && dotnet run --project netcore/DevExtreme.IntegrationDataModelGenerator/DevExtreme.IntegrationDataModelGenerator.csproj --artifacts=dist/bin --output-path=./integration-data-model.ts"
|
|
71
|
+
"test-netcore": "dotnet build netcore && dotnet test ./netcore --verbosity quiet"
|
|
70
72
|
}
|
|
71
73
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Model } from '../components-generation/models/imd';
|
|
2
2
|
import type { TemplatingOptions } from '../components-generation/template';
|
|
3
3
|
interface Config {
|
|
4
|
-
metadata:
|
|
4
|
+
metadata: Model;
|
|
5
5
|
outputPath: string;
|
|
6
6
|
widgetsPackage: string;
|
|
7
7
|
templatingOptions: TemplatingOptions;
|
|
@@ -2,8 +2,9 @@ export declare function createTemplateFromString(templateString: string): any;
|
|
|
2
2
|
export declare class DotGenerator {
|
|
3
3
|
private _encoding;
|
|
4
4
|
createTemplate(templateFilePath: string): any;
|
|
5
|
+
private getMetadataJSON;
|
|
5
6
|
generate(config: any): void;
|
|
6
|
-
private
|
|
7
|
+
private createTokenFile;
|
|
7
8
|
private generateComponent;
|
|
8
9
|
private generateLegacyComponents;
|
|
9
10
|
private createEntryPoint;
|
|
@@ -28,6 +28,13 @@ class DotGenerator {
|
|
|
28
28
|
const templateString = node_fs_1.default.readFileSync(templateFilePath, this._encoding);
|
|
29
29
|
return createTemplateFromString(templateString);
|
|
30
30
|
}
|
|
31
|
+
getMetadataJSON(metadataFilePath) {
|
|
32
|
+
(0, logging_1.log)(`Read data from ${metadataFilePath}`);
|
|
33
|
+
const data = node_fs_1.default.readFileSync(metadataFilePath, {
|
|
34
|
+
encoding: this._encoding,
|
|
35
|
+
});
|
|
36
|
+
return JSON.parse(data);
|
|
37
|
+
}
|
|
31
38
|
generate(config) {
|
|
32
39
|
const defaultEntryFileName = 'index.ts';
|
|
33
40
|
const { outputFolderPath, metadataFolderPath, nestedPathPart, entryFileNames, } = config;
|
|
@@ -37,6 +44,7 @@ class DotGenerator {
|
|
|
37
44
|
const nestedComponentTemplate = this.createTemplate(config.nestedTemplateFilePath ||
|
|
38
45
|
node_path_1.default.join(__dirname, './templates/nested-component.tst'));
|
|
39
46
|
(0, logging_1.log)(`List directory: ${metadataFolderPath}`);
|
|
47
|
+
const collectionPropNames = new Set();
|
|
40
48
|
node_fs_1.default.readdirSync(metadataFolderPath)
|
|
41
49
|
.filter((d) => d !== 'nested')
|
|
42
50
|
.forEach((dirname) => {
|
|
@@ -44,7 +52,8 @@ class DotGenerator {
|
|
|
44
52
|
const componentMetaPath = node_path_1.default.join(metadataFolderPath, componentName, `${componentName}.json`);
|
|
45
53
|
const entryFileName = entryFileNames[componentName] || defaultEntryFileName;
|
|
46
54
|
const componentOutputPath = node_path_1.default.join(outputFolderPath, componentName, entryFileName);
|
|
47
|
-
this.
|
|
55
|
+
const componentMetadataJSON = this.getMetadataJSON(componentMetaPath);
|
|
56
|
+
this.generateComponent(componentMetadataJSON, componentOutputPath, componentTemplate);
|
|
48
57
|
this.createEntryPoint(node_path_1.default.dirname(componentOutputPath));
|
|
49
58
|
const nestedComponentsFolder = node_path_1.default.join(metadataFolderPath, componentName, nestedPathPart);
|
|
50
59
|
if (node_fs_1.default.existsSync(nestedComponentsFolder)) {
|
|
@@ -55,29 +64,37 @@ class DotGenerator {
|
|
|
55
64
|
const nestedComponentName = node_path_1.default.parse(fileName).name;
|
|
56
65
|
const nestedComponentOutputPath = node_path_1.default.join(outputFolderPath, componentName, nestedPathPart, `${nestedComponentName}.ts`);
|
|
57
66
|
names.push(nestedComponentName);
|
|
58
|
-
this.
|
|
67
|
+
const nestedComponentMetadataJSON = this.getMetadataJSON(node_path_1.default.join(nestedComponentsFolder, fileName));
|
|
68
|
+
if (nestedComponentMetadataJSON.isCollectionItem) {
|
|
69
|
+
collectionPropNames.add(nestedComponentMetadataJSON.propertyName);
|
|
70
|
+
}
|
|
71
|
+
this.generateComponent(nestedComponentMetadataJSON, nestedComponentOutputPath, nestedComponentTemplate);
|
|
59
72
|
});
|
|
60
73
|
const indexFilePath = node_path_1.default.join(outputFolderPath, componentName, nestedPathPart, 'index.ts');
|
|
61
74
|
node_fs_1.default.writeFileSync(indexFilePath, `${names.map((name) => `export * from './${name}';\n`).join('')}\n`, { encoding: this._encoding });
|
|
62
75
|
this.createEntryPoint(node_path_1.default.dirname(indexFilePath));
|
|
63
76
|
}
|
|
64
77
|
});
|
|
65
|
-
this.generateLegacyComponents(config.nestedTemplateFilePath ||
|
|
78
|
+
const legacyCollectionComponentsMetadata = this.generateLegacyComponents(config.nestedTemplateFilePath ||
|
|
66
79
|
node_path_1.default.join(__dirname, './templates/nested-component.tst'), node_path_1.default.join(config.metadataFolderPath, config.nestedPathPart), node_path_1.default.join(config.outputFolderPath, config.nestedPathPart));
|
|
80
|
+
legacyCollectionComponentsMetadata.forEach(({ propertyName }) => collectionPropNames.add(propertyName));
|
|
67
81
|
this.generateLegacyComponents(config.baseNestedTemplateFilePath ||
|
|
68
82
|
node_path_1.default.join(__dirname, './templates/base-nested-component.tst'), node_path_1.default.join(config.metadataFolderPath, config.nestedPathPart, config.basePathPart), node_path_1.default.join(config.outputFolderPath, config.nestedPathPart, config.basePathPart));
|
|
83
|
+
this.createTokenFile(collectionPropNames, outputFolderPath);
|
|
69
84
|
this.createEntryPoint(node_path_1.default.join(config.outputFolderPath, 'nested'));
|
|
70
85
|
}
|
|
71
|
-
|
|
72
|
-
(
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
(
|
|
77
|
-
|
|
86
|
+
createTokenFile(collectionPropNames, outputFolderPath) {
|
|
87
|
+
const tokensFolderPath = node_path_1.default.join(outputFolderPath.replace('/ui', '/core'), 'tokens');
|
|
88
|
+
const tokensSrc = Array.from(collectionPropNames)
|
|
89
|
+
.map((name) => `export const PROPERTY_TOKEN_${name} = new InjectionToken<string>('property-token-${name}');`)
|
|
90
|
+
.join('\n');
|
|
91
|
+
node_fs_1.default.mkdirSync(tokensFolderPath, { recursive: true });
|
|
92
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(tokensFolderPath, 'index.ts'), `import { InjectionToken } from '@angular/core';\n\n${tokensSrc}\n`, { encoding: this._encoding });
|
|
93
|
+
this.createEntryPoint(tokensFolderPath);
|
|
78
94
|
}
|
|
79
|
-
generateComponent(
|
|
80
|
-
|
|
95
|
+
generateComponent(metadataJSON, outputPath, template) {
|
|
96
|
+
(0, logging_1.log)('Apply template');
|
|
97
|
+
const result = template(metadataJSON);
|
|
81
98
|
node_fs_1.default.mkdirSync(node_path_1.default.dirname(outputPath), { recursive: true });
|
|
82
99
|
node_fs_1.default.writeFileSync(outputPath, result, { encoding: this._encoding });
|
|
83
100
|
}
|
|
@@ -86,13 +103,19 @@ class DotGenerator {
|
|
|
86
103
|
(0, mkdirp_1.sync)(outputFolderPath);
|
|
87
104
|
(0, logging_1.log)(`List directory: ${metadataFolderPath}`);
|
|
88
105
|
const names = [];
|
|
106
|
+
const collectionComponentsMetadata = [];
|
|
89
107
|
node_fs_1.default.readdirSync(metadataFolderPath)
|
|
90
108
|
.filter((fileName) => node_fs_1.default.lstatSync(node_path_1.default.join(metadataFolderPath, fileName)).isFile())
|
|
91
109
|
.forEach((fileName) => {
|
|
92
110
|
const filePath = node_path_1.default.join(metadataFolderPath, fileName);
|
|
93
|
-
const
|
|
111
|
+
const legacyMetadataJSON = this.getMetadataJSON(filePath);
|
|
112
|
+
(0, logging_1.log)('Apply template');
|
|
113
|
+
const result = template(legacyMetadataJSON);
|
|
94
114
|
const widgetName = node_path_1.default.parse(filePath).name;
|
|
95
115
|
names.push(widgetName);
|
|
116
|
+
if (legacyMetadataJSON.baseClass === 'CollectionNestedOption') {
|
|
117
|
+
collectionComponentsMetadata.push(legacyMetadataJSON);
|
|
118
|
+
}
|
|
96
119
|
let resultFilePath;
|
|
97
120
|
if (isSecondaryEntryPoint) {
|
|
98
121
|
node_fs_1.default.mkdirSync(node_path_1.default.join(outputFolderPath, widgetName));
|
|
@@ -107,6 +130,7 @@ class DotGenerator {
|
|
|
107
130
|
if (!isSecondaryEntryPoint) {
|
|
108
131
|
node_fs_1.default.writeFileSync(`${outputFolderPath}/index.ts`, `${names.map((name) => `export * from './${name}';\n`).join('')}\n`, { encoding: this._encoding });
|
|
109
132
|
}
|
|
133
|
+
return collectionComponentsMetadata;
|
|
110
134
|
}
|
|
111
135
|
createEntryPoint(outputFolderPath) {
|
|
112
136
|
node_fs_1.default.writeFileSync(node_path_1.default.join(outputFolderPath, 'ng-package.json'), JSON.stringify({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dot-generator.js","sourceRoot":"","sources":["../../../ts/angular-components-generator/dot-generator.ts"],"names":[],"mappings":";;;;;;AAgBA,4DAEC;AAjBD,sDAAyB;AACzB,0DAA6B;AAE7B,8CAAsB;AACtB,mCAA2C;AAE3C,gEAA2E;AAC3E,wCAAiC;AAEjC,aAAG,CAAC,gBAAgB,GAAG;IACrB,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,KAAK;IACpB,GAAG,iCAAsB;CAC1B,CAAC;AAEF,SAAgB,wBAAwB,CAAC,cAAsB;IAC7D,OAAO,aAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACtC,CAAC;AAED,MAAa,YAAY;IAAzB;QACU,cAAS,GAAmB,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"dot-generator.js","sourceRoot":"","sources":["../../../ts/angular-components-generator/dot-generator.ts"],"names":[],"mappings":";;;;;;AAgBA,4DAEC;AAjBD,sDAAyB;AACzB,0DAA6B;AAE7B,8CAAsB;AACtB,mCAA2C;AAE3C,gEAA2E;AAC3E,wCAAiC;AAEjC,aAAG,CAAC,gBAAgB,GAAG;IACrB,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,KAAK;IACpB,GAAG,iCAAsB;CAC1B,CAAC;AAEF,SAAgB,wBAAwB,CAAC,cAAsB;IAC7D,OAAO,aAAG,CAAC,QAAQ,CA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AC;QAED,OAAO,4BAA4B,CAAC;IACtC,CAAC;IAEO,gBAAgB,CAAC,gBAAwB;QAC/C,iBAAE,CAAC,aAAa,CACd,mBAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAC9C,IAAI,CAAC,SAAS,CACZ;YACE,GAAG,EAAE;gBACH,SAAS,EAAE,UAAU;aACtB;SACF,EACD,IAAI,EACJ,IAAI,CACL,EACD,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,CAC7B,CAAC;IACJ,CAAC;CACF;AA1PD,oCA0PC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-helper.js","sourceRoot":"","sources":["../../../ts/angular-components-generator/import-helper.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"import-helper.js","sourceRoot":"","sources":["../../../ts/angular-components-generator/import-helper.ts"],"names":[],"mappings":";;AAYA,oCA2CC;AAvDD,uCAAqD;AAYrD,SAAgB,YAAY,CAC1B,OAAiB,EACjB,iBAAyB;IAEzB,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CACtD,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAElD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,EAAgD,CACjD,CAAC;IAEF,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;SAC9B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAC1D,IA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AAC;YACtC,CAAC,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,IAAA,mBAAS,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAqB;IAIjD,MAAM,MAAM,GAA4C;QACtD,aAAa,EAAE,SAAS;QACxB,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CACb,sCAAsC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,eAAe,CAAC,UAAsB;IAC7C,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Model as IMDModel } from '../components-generation/models/imd';
|
|
2
|
+
import type { Model as NGModel } from '../components-generation/models/ng';
|
|
3
3
|
import type { UnifiedExternalConfig } from '../config';
|
|
4
4
|
interface Config {
|
|
5
5
|
sourceMetadataFilePath: string;
|
|
@@ -13,7 +13,7 @@ interface Config {
|
|
|
13
13
|
unifiedConfig?: UnifiedExternalConfig;
|
|
14
14
|
}
|
|
15
15
|
export interface IObjectStore {
|
|
16
|
-
read: (name: string) =>
|
|
16
|
+
read: (name: string) => NGModel | IMDModel;
|
|
17
17
|
write: (name: string, data: unknown) => void;
|
|
18
18
|
}
|
|
19
19
|
export declare class FSObjectStore implements IObjectStore {
|
|
@@ -129,37 +129,30 @@ function mapProp(option, typeResolver) {
|
|
|
129
129
|
isSubscribable: option.isSubscribable,
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
function getComponentInfo(component, parentName) {
|
|
133
|
+
const prefix = component.isCollectionItem
|
|
134
|
+
? ITEM_COMPONENT_PREFIX
|
|
135
|
+
: OPTION_COMPONENT_PREFIX;
|
|
136
|
+
const name = 'name' in component ? component.name : component.componentName;
|
|
137
|
+
return {
|
|
138
|
+
selector: `${prefix.toLowerCase()}-${parentName}-${(0, helpers_2.toKebabCase)(name)}`,
|
|
139
|
+
className: `${prefix}${(0, helpers_2.toUpperCamelCase)(parentName)}${(0, helpers_2.uppercaseFirst)(name)}`,
|
|
140
|
+
filename: `${(0, helpers_2.toKebabCase)(name)}${component.isCollectionItem ? `-${prefix.toLowerCase()}` : ''}`,
|
|
141
|
+
};
|
|
138
142
|
}
|
|
139
143
|
function getCollectionNestedComponents(nesteds, parentName) {
|
|
140
144
|
if (nesteds && nesteds.length) {
|
|
141
145
|
return nesteds
|
|
142
146
|
.filter((n) => n.isCollectionItem)
|
|
143
|
-
.map((n) =>
|
|
144
|
-
className
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
function groupOverridingNestedComponents(components) {
|
|
153
|
-
if (components.length > 1) {
|
|
154
|
-
const groupsByPropName = (0, helpers_2.groupBy)(components, (c) => c.propertyName);
|
|
155
|
-
const propertyNames = Object.keys(groupsByPropName).filter((propertyName) => groupsByPropName[propertyName].length > 1);
|
|
156
|
-
if (propertyNames.length) {
|
|
157
|
-
return propertyNames.map((propertyName) => ({
|
|
158
|
-
propertyName,
|
|
159
|
-
methodName: (0, helpers_2.uppercaseFirst)(propertyName),
|
|
160
|
-
components: groupsByPropName[propertyName],
|
|
161
|
-
}));
|
|
162
|
-
}
|
|
147
|
+
.map((n) => {
|
|
148
|
+
const { className, filename } = getComponentInfo(n, parentName);
|
|
149
|
+
return {
|
|
150
|
+
className,
|
|
151
|
+
path: filename,
|
|
152
|
+
propertyName: n.optionName,
|
|
153
|
+
methodName: (0, helpers_2.pluralize)((0, helpers_2.lowercaseFirst)((0, helpers_2.camelize)((0, helpers_2.dasherize)(n.componentName)))),
|
|
154
|
+
};
|
|
155
|
+
});
|
|
163
156
|
}
|
|
164
157
|
return [];
|
|
165
158
|
}
|
|
@@ -642,11 +635,7 @@ class ComponentMetadataGenerator {
|
|
|
642
635
|
generateIMDComponentNestedOptions(nestedComponents, parentName, customTypeHash, metadataAugmentation) {
|
|
643
636
|
nestedComponents = nestedComponents.concat(getMissingCollectionItems(nestedComponents));
|
|
644
637
|
return nestedComponents.map((component) => {
|
|
645
|
-
const
|
|
646
|
-
? ITEM_COMPONENT_PREFIX
|
|
647
|
-
: OPTION_COMPONENT_PREFIX).toLocaleLowerCase();
|
|
648
|
-
const componentName = (0, helpers_2.dasherize)((0, helpers_2.underscore)(component.name));
|
|
649
|
-
const rawSelector = getRawSelector(component.name, parentName, prefix);
|
|
638
|
+
const { selector, className, filename } = getComponentInfo(component, parentName);
|
|
650
639
|
const aliases = {};
|
|
651
640
|
const resolveCustomTypeConflicts = (typeName) => {
|
|
652
641
|
if (TYPE_ALIASES[typeName]) {
|
|
@@ -662,22 +651,13 @@ class ComponentMetadataGenerator {
|
|
|
662
651
|
.map((p) => this.createEvent(p.name, p.type, null));
|
|
663
652
|
const nesteds = appendMissingRecursiveNestedComponents(component, nestedComponents);
|
|
664
653
|
const collectionNestedComponents = getCollectionNestedComponents(nesteds, parentName);
|
|
665
|
-
const overridingGroups = groupOverridingNestedComponents(collectionNestedComponents);
|
|
666
|
-
if (overridingGroups.length) {
|
|
667
|
-
const groupPropNames = overridingGroups.map((c) => c.propertyName);
|
|
668
|
-
collectionNestedComponents.forEach((c) => {
|
|
669
|
-
if (groupPropNames.includes(c.propertyName)) {
|
|
670
|
-
c.grouped = true;
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
}
|
|
674
654
|
return {
|
|
675
655
|
...component,
|
|
676
656
|
nesteds,
|
|
677
|
-
path:
|
|
657
|
+
path: filename,
|
|
658
|
+
selector,
|
|
659
|
+
className,
|
|
678
660
|
propertyName: component.optionName,
|
|
679
|
-
selector: (0, helpers_2.dasherize)(rawSelector),
|
|
680
|
-
className: (0, helpers_2.camelize)(rawSelector),
|
|
681
661
|
baseClass: component.isCollectionItem
|
|
682
662
|
? 'CollectionNestedOption'
|
|
683
663
|
: 'NestedOption',
|
|
@@ -688,8 +668,6 @@ class ComponentMetadataGenerator {
|
|
|
688
668
|
events: events.length ? events : undefined,
|
|
689
669
|
imports: createImports(customTypeModules, metadataAugmentation, aliases),
|
|
690
670
|
collectionNestedComponents,
|
|
691
|
-
hasSubscriptionGroups: overridingGroups.length,
|
|
692
|
-
subscriptionGroups: overridingGroups,
|
|
693
671
|
};
|
|
694
672
|
});
|
|
695
673
|
}
|