devextreme-internal-tools 19.2.15 → 20.0.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/Readme.md +9 -5
- package/bin/DevExtreme.BaseGenerator.deps.json +1135 -0
- package/bin/DevExtreme.BaseGenerator.dll +0 -0
- package/bin/DevExtreme.Declarations.Analyzers.deps.json +188 -0
- package/bin/DevExtreme.Declarations.Analyzers.dll +0 -0
- package/bin/DevExtreme.Declarations.Discoverer +0 -0
- package/bin/DevExtreme.Declarations.Discoverer.deps.json +1152 -295
- package/bin/DevExtreme.Declarations.Discoverer.dll +0 -0
- package/bin/DevExtreme.Declarations.Discoverer.runtimeconfig.json +12 -8
- package/bin/DevExtreme.Declarations.IntegrityValidator +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator.deps.json +1169 -280
- package/bin/DevExtreme.Declarations.IntegrityValidator.dll +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator.runtimeconfig.json +12 -8
- package/bin/DevExtreme.Declarations.deps.json +469 -139
- package/bin/DevExtreme.Declarations.dll +0 -0
- package/bin/DevExtreme.Descriptions.Injector +0 -0
- package/bin/DevExtreme.Descriptions.Injector.deps.json +293 -0
- package/bin/DevExtreme.Descriptions.Injector.dll +0 -0
- package/bin/DevExtreme.Descriptions.Injector.runtimeconfig.json +13 -0
- package/bin/DevExtreme.Infrastructure.deps.json +275 -110
- package/bin/DevExtreme.Infrastructure.dll +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator.deps.json +1173 -0
- package/bin/DevExtreme.IntegrationDataGenerator.dll +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.NgSmdGenerator +0 -0
- package/bin/DevExtreme.NgSmdGenerator.deps.json +1192 -0
- package/bin/DevExtreme.NgSmdGenerator.dll +0 -0
- package/bin/DevExtreme.NgSmdGenerator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.SmdCommon.deps.json +1153 -0
- package/bin/DevExtreme.SmdCommon.dll +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator.deps.json +1173 -0
- package/bin/DevExtreme.StrongMetaDataGenerator.dll +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator +0 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator.deps.json +1278 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator.dll +0 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.Topics.Generator +0 -0
- package/bin/DevExtreme.Topics.Generator.deps.json +1170 -0
- package/bin/DevExtreme.Topics.Generator.dll +0 -0
- package/bin/DevExtreme.Topics.Generator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator +0 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator.deps.json +293 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator.dll +0 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.Topics.Validation +0 -0
- package/bin/DevExtreme.Topics.Validation.deps.json +1188 -0
- package/bin/DevExtreme.Topics.Validation.dll +0 -0
- package/bin/DevExtreme.Topics.Validation.runtimeconfig.json +13 -0
- package/bin/DevExtreme.Topics.deps.json +292 -0
- package/bin/DevExtreme.Topics.dll +0 -0
- package/bin/DevExtreme.WebSite.CompactDocsCreator +0 -0
- package/bin/DevExtreme.WebSite.CompactDocsCreator.deps.json +1258 -0
- package/bin/DevExtreme.WebSite.CompactDocsCreator.dll +0 -0
- package/bin/DevExtreme.WebSite.CompactDocsCreator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator +0 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator.deps.json +1240 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator.dll +0 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator.runtimeconfig.json +13 -0
- package/bin/DevExtreme.WebSite.ContentMaps.deps.json +1224 -0
- package/bin/DevExtreme.WebSite.ContentMaps.dll +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter.deps.json +308 -259
- package/bin/DevExtreme.WebSite.LinksConverter.dll +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter.runtimeconfig.json +12 -8
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator +0 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator.deps.json +1191 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator.dll +0 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator.runtimeconfig.json +13 -0
- package/bin/JetBrains.Annotations.dll +0 -0
- package/bin/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/bin/Microsoft.CodeAnalysis.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.Binder.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.CommandLine.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.EnvironmentVariables.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.FileExtensions.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.Json.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.UserSecrets.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.dll +0 -0
- package/bin/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.DependencyInjection.dll +0 -0
- package/bin/Microsoft.Extensions.Diagnostics.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.Diagnostics.dll +0 -0
- package/bin/Microsoft.Extensions.FileProviders.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.FileProviders.Physical.dll +0 -0
- package/bin/Microsoft.Extensions.FileSystemGlobbing.dll +0 -0
- package/bin/Microsoft.Extensions.Hosting.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.Hosting.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.Configuration.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.Console.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.Debug.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.EventLog.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.EventSource.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.dll +0 -0
- package/bin/Microsoft.Extensions.Options.ConfigurationExtensions.dll +0 -0
- package/bin/Microsoft.Extensions.Options.DataAnnotations.dll +0 -0
- package/bin/Microsoft.Extensions.Options.dll +0 -0
- package/bin/Microsoft.Extensions.Primitives.dll +0 -0
- package/bin/NLog.Extensions.Logging.dll +0 -0
- package/bin/NLog.dll +0 -0
- package/bin/Newtonsoft.Json.dll +0 -0
- package/bin/Spectre.Console.Cli.dll +0 -0
- package/bin/Spectre.Console.dll +0 -0
- package/bin/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/bin/System.Diagnostics.EventLog.dll +0 -0
- package/bin/System.IO.Abstractions.dll +0 -0
- package/bin/System.IO.Pipelines.dll +0 -0
- package/bin/System.Text.Encodings.Web.dll +0 -0
- package/bin/System.Text.Json.dll +0 -0
- package/bin/TestableIO.System.IO.Abstractions.Wrappers.dll +0 -0
- package/bin/TestableIO.System.IO.Abstractions.dll +0 -0
- package/bin/Testably.Abstractions.FileSystem.Interface.dll +0 -0
- package/bin/TypeGen.Core.dll +0 -0
- package/bin/cs/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/cs/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/de/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/de/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/de/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/es/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/es/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/es/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/fr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/fr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/fr/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/it/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/it/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/it/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/ja/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/ja/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/ja/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/ko/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/ko/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/ko/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/pl/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/pl/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/pt/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/pt-BR/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/ru/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/ru/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/ru/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll +0 -0
- package/bin/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- package/bin/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/bin/sv/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/tr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/tr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/zh-Hans/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/bin/zh-Hans/Spectre.Console.Cli.resources.dll +0 -0
- package/bin/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/bin/zh-Hant/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/cli.d.ts +2 -0
- package/cli.js +49 -0
- package/cli.js.map +1 -0
- package/index.d.ts +9 -0
- package/index.js +54 -30
- package/index.js.map +1 -0
- package/metadata.d.ts +5 -0
- package/metadata.js +45 -0
- package/metadata.js.map +1 -0
- package/package.json +63 -3
- package/ts/angular-components-generator/common-reexports-generator.d.ts +12 -0
- package/ts/angular-components-generator/common-reexports-generator.js +39 -0
- package/ts/angular-components-generator/common-reexports-generator.js.map +1 -0
- package/ts/angular-components-generator/component-names-generator.d.ts +8 -0
- package/ts/angular-components-generator/component-names-generator.js +35 -0
- package/ts/angular-components-generator/component-names-generator.js.map +1 -0
- package/ts/angular-components-generator/dot-generator.d.ts +11 -0
- package/ts/angular-components-generator/dot-generator.js +144 -0
- package/ts/angular-components-generator/dot-generator.js.map +1 -0
- package/ts/angular-components-generator/facade-generator.d.ts +11 -0
- package/ts/angular-components-generator/facade-generator.js +60 -0
- package/ts/angular-components-generator/facade-generator.js.map +1 -0
- package/ts/angular-components-generator/helpers.d.ts +2 -0
- package/ts/angular-components-generator/helpers.js +11 -0
- package/ts/angular-components-generator/helpers.js.map +1 -0
- package/ts/angular-components-generator/import-helper.d.ts +6 -0
- package/ts/angular-components-generator/import-helper.js +68 -0
- package/ts/angular-components-generator/import-helper.js.map +1 -0
- package/ts/angular-components-generator/metadata-generator.d.ts +45 -0
- package/ts/angular-components-generator/metadata-generator.js +753 -0
- package/ts/angular-components-generator/metadata-generator.js.map +1 -0
- package/ts/angular-components-generator/module-facade-generator.d.ts +5 -0
- package/ts/angular-components-generator/module-facade-generator.js +62 -0
- package/ts/angular-components-generator/module-facade-generator.js.map +1 -0
- package/ts/angular-components-generator/templates/base-nested-component.tst +21 -0
- package/ts/angular-components-generator/templates/component.tst +255 -0
- package/ts/angular-components-generator/templates/nested-component.tst +153 -0
- package/ts/bundler/bundler.d.ts +6 -0
- package/ts/bundler/bundler.js +286 -0
- package/ts/bundler/bundler.js.map +1 -0
- package/ts/collapser/collapser.d.ts +4 -0
- package/ts/collapser/collapser.js +259 -0
- package/ts/collapser/collapser.js.map +1 -0
- package/ts/common/common-resolving.d.ts +11 -0
- package/ts/common/common-resolving.js +62 -0
- package/ts/common/common-resolving.js.map +1 -0
- package/ts/common/id.d.ts +13 -0
- package/ts/common/id.js +153 -0
- package/ts/common/id.js.map +1 -0
- package/ts/common/tags/comparing.d.ts +3 -0
- package/ts/common/tags/comparing.js +16 -0
- package/ts/common/tags/comparing.js.map +1 -0
- package/ts/common/tags/generating.d.ts +4 -0
- package/ts/common/tags/generating.js +99 -0
- package/ts/common/tags/generating.js.map +1 -0
- package/ts/common/tags/merging.d.ts +12 -0
- package/ts/common/tags/merging.js +98 -0
- package/ts/common/tags/merging.js.map +1 -0
- package/ts/common/tags/parameter-field-tag.d.ts +7 -0
- package/ts/common/tags/parameter-field-tag.js +12 -0
- package/ts/common/tags/parameter-field-tag.js.map +1 -0
- package/ts/common/tags.d.ts +12 -0
- package/ts/common/tags.js +129 -0
- package/ts/common/tags.js.map +1 -0
- package/ts/common/ts-type-resolving.d.ts +16 -0
- package/ts/common/ts-type-resolving.js +472 -0
- package/ts/common/ts-type-resolving.js.map +1 -0
- package/ts/common/ts-utils.d.ts +40 -0
- package/ts/common/ts-utils.js +297 -0
- package/ts/common/ts-utils.js.map +1 -0
- package/ts/common/type-resolving.d.ts +42 -0
- package/ts/common/type-resolving.js +307 -0
- package/ts/common/type-resolving.js.map +1 -0
- package/ts/common/utils/array-utils.d.ts +6 -0
- package/ts/common/utils/array-utils.js +51 -0
- package/ts/common/utils/array-utils.js.map +1 -0
- package/ts/common/utils/basic-utils.d.ts +4 -0
- package/ts/common/utils/basic-utils.js +16 -0
- package/ts/common/utils/basic-utils.js.map +1 -0
- package/ts/common/utils/console-utils.d.ts +1 -0
- package/ts/common/utils/console-utils.js +32 -0
- package/ts/common/utils/console-utils.js.map +1 -0
- package/ts/common/utils/fs-utils.d.ts +4 -0
- package/ts/common/utils/fs-utils.js +44 -0
- package/ts/common/utils/fs-utils.js.map +1 -0
- package/ts/common/utils/index.d.ts +6 -0
- package/ts/common/utils/index.js +23 -0
- package/ts/common/utils/index.js.map +1 -0
- package/ts/common/utils/narrowing-utils.d.ts +6 -0
- package/ts/common/utils/narrowing-utils.js +14 -0
- package/ts/common/utils/narrowing-utils.js.map +1 -0
- package/ts/common/utils/path-utils.d.ts +6 -0
- package/ts/common/utils/path-utils.js +28 -0
- package/ts/common/utils/path-utils.js.map +1 -0
- package/ts/component-exports-generator/generator.d.ts +3 -0
- package/ts/component-exports-generator/generator.js +63 -0
- package/ts/component-exports-generator/generator.js.map +1 -0
- package/ts/components-generation/aggregated-reexports-generator.d.ts +9 -0
- package/ts/components-generation/aggregated-reexports-generator.js +40 -0
- package/ts/components-generation/aggregated-reexports-generator.js.map +1 -0
- package/ts/components-generation/common-reexports-generator.d.ts +12 -0
- package/ts/components-generation/common-reexports-generator.js +89 -0
- package/ts/components-generation/common-reexports-generator.js.map +1 -0
- package/ts/components-generation/file-helpers.d.ts +9 -0
- package/ts/components-generation/file-helpers.js +26 -0
- package/ts/components-generation/file-helpers.js.map +1 -0
- package/ts/components-generation/helpers.d.ts +15 -0
- package/ts/components-generation/helpers.js +99 -0
- package/ts/components-generation/helpers.js.map +1 -0
- package/ts/components-generation/index-generator.d.ts +4 -0
- package/ts/components-generation/index-generator.js +12 -0
- package/ts/components-generation/index-generator.js.map +1 -0
- package/ts/components-generation/metadata-augmentation.d.ts +10 -0
- package/ts/components-generation/metadata-augmentation.js +27 -0
- package/ts/components-generation/metadata-augmentation.js.map +1 -0
- package/ts/components-generation/models/declarations/index.d.ts +1 -0
- package/ts/components-generation/models/declarations/index.js +3 -0
- package/ts/components-generation/models/declarations/index.js.map +1 -0
- package/ts/components-generation/models/discoverer/app-config.d.ts +4 -0
- package/ts/components-generation/models/discoverer/app-config.js +3 -0
- package/ts/components-generation/models/discoverer/app-config.js.map +1 -0
- package/ts/components-generation/models/discoverer/index.d.ts +2 -0
- package/ts/components-generation/models/discoverer/index.js +19 -0
- package/ts/components-generation/models/discoverer/index.js.map +1 -0
- package/ts/components-generation/models/discoverer/variables.d.ts +5 -0
- package/ts/components-generation/models/discoverer/variables.js +3 -0
- package/ts/components-generation/models/discoverer/variables.js.map +1 -0
- package/ts/components-generation/models/imd/app-config.d.ts +4 -0
- package/ts/components-generation/models/imd/app-config.js +3 -0
- package/ts/components-generation/models/imd/app-config.js.map +1 -0
- package/ts/components-generation/models/imd/array-descr.d.ts +4 -0
- package/ts/components-generation/models/imd/array-descr.js +3 -0
- 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/ts/components-generation/models/imd/complex-prop.js +3 -0
- 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/i-member-metadata.d.ts +2 -0
- package/ts/components-generation/models/imd/i-member-metadata.js +3 -0
- package/ts/components-generation/models/imd/i-member-metadata.js.map +1 -0
- package/ts/components-generation/models/imd/index.d.ts +18 -0
- package/ts/components-generation/models/imd/index.js +35 -0
- package/ts/components-generation/models/imd/index.js.map +1 -0
- package/ts/components-generation/models/imd/location.d.ts +4 -0
- package/ts/components-generation/models/imd/location.js +3 -0
- package/ts/components-generation/models/imd/location.js.map +1 -0
- package/ts/components-generation/models/imd/member-metadata.d.ts +7 -0
- package/ts/components-generation/models/imd/member-metadata.js +3 -0
- package/ts/components-generation/models/imd/member-metadata.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/mutation.d.ts +6 -0
- package/ts/components-generation/models/imd/mutation.js +3 -0
- package/ts/components-generation/models/imd/mutation.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/app-config.d.ts +6 -0
- package/ts/components-generation/models/ng/app-config.js +3 -0
- package/ts/components-generation/models/ng/app-config.js.map +1 -0
- package/ts/components-generation/models/ng/base-smd-variables.d.ts +3 -0
- package/ts/components-generation/models/ng/base-smd-variables.js +3 -0
- package/ts/components-generation/models/ng/base-smd-variables.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 +9 -0
- package/ts/components-generation/models/ng/index.js +26 -0
- package/ts/components-generation/models/ng/index.js.map +1 -0
- package/ts/components-generation/models/ng/location.d.ts +4 -0
- package/ts/components-generation/models/ng/location.js +3 -0
- package/ts/components-generation/models/ng/location.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/mutation.d.ts +6 -0
- package/ts/components-generation/models/ng/mutation.js +3 -0
- package/ts/components-generation/models/ng/mutation.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/ng/variables.d.ts +3 -0
- package/ts/components-generation/models/ng/variables.js +3 -0
- package/ts/components-generation/models/ng/variables.js.map +1 -0
- package/ts/components-generation/models/smd/app-config.d.ts +6 -0
- package/ts/components-generation/models/smd/app-config.js +3 -0
- package/ts/components-generation/models/smd/app-config.js.map +1 -0
- package/ts/components-generation/models/smd/base-smd-variables.d.ts +3 -0
- package/ts/components-generation/models/smd/base-smd-variables.js +3 -0
- package/ts/components-generation/models/smd/base-smd-variables.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/enums-rule.d.ts +7 -0
- package/ts/components-generation/models/smd/enums-rule.js +3 -0
- package/ts/components-generation/models/smd/enums-rule.js.map +1 -0
- package/ts/components-generation/models/smd/forwarded-enum.d.ts +4 -0
- package/ts/components-generation/models/smd/forwarded-enum.js +3 -0
- package/ts/components-generation/models/smd/forwarded-enum.js.map +1 -0
- package/ts/components-generation/models/smd/index.d.ts +14 -0
- package/ts/components-generation/models/smd/index.js +31 -0
- package/ts/components-generation/models/smd/index.js.map +1 -0
- package/ts/components-generation/models/smd/location.d.ts +4 -0
- package/ts/components-generation/models/smd/location.js +3 -0
- package/ts/components-generation/models/smd/location.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/mutation.d.ts +6 -0
- package/ts/components-generation/models/smd/mutation.js +3 -0
- package/ts/components-generation/models/smd/mutation.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/models/smd/variables.d.ts +15 -0
- package/ts/components-generation/models/smd/variables.js +3 -0
- package/ts/components-generation/models/smd/variables.js.map +1 -0
- package/ts/components-generation/reexports-generator.d.ts +12 -0
- package/ts/components-generation/reexports-generator.js +19 -0
- package/ts/components-generation/reexports-generator.js.map +1 -0
- package/ts/components-generation/template.d.ts +28 -0
- package/ts/components-generation/template.js +53 -0
- package/ts/components-generation/template.js.map +1 -0
- package/ts/components-generation/type-resolving.d.ts +33 -0
- package/ts/components-generation/type-resolving.js +191 -0
- package/ts/components-generation/type-resolving.js.map +1 -0
- package/ts/config/args.d.ts +48 -0
- package/ts/config/args.js +132 -0
- package/ts/config/args.js.map +1 -0
- package/ts/config/index.d.ts +28 -0
- package/ts/config/index.js +109 -0
- package/ts/config/index.js.map +1 -0
- package/ts/config/metadata/data-types.d.ts +145 -0
- package/ts/config/metadata/data-types.js +3 -0
- package/ts/config/metadata/data-types.js.map +1 -0
- package/ts/config/metadata/data-types.slice.d.ts +1 -0
- package/ts/config/metadata/data-types.slice.js +3 -0
- package/ts/config/metadata/data-types.slice.js.map +1 -0
- package/ts/config/metadata/index.d.ts +3 -0
- package/ts/config/metadata/index.js +42 -0
- package/ts/config/metadata/index.js.map +1 -0
- package/ts/config/metadata/mutations.d.ts +46 -0
- package/ts/config/metadata/mutations.js +147 -0
- package/ts/config/metadata/mutations.js.map +1 -0
- package/ts/config/paths.d.ts +6 -0
- package/ts/config/paths.js +18 -0
- package/ts/config/paths.js.map +1 -0
- package/ts/discoverer/data-model.d.ts +105 -0
- package/ts/discoverer/data-model.js +13 -0
- package/ts/discoverer/data-model.js.map +1 -0
- package/ts/discoverer/discovering-error.d.ts +4 -0
- package/ts/discoverer/discovering-error.js +16 -0
- package/ts/discoverer/discovering-error.js.map +1 -0
- package/ts/discoverer/discovering.d.ts +4 -0
- package/ts/discoverer/discovering.js +73 -0
- package/ts/discoverer/discovering.js.map +1 -0
- package/ts/discoverer/parsing/enum-collecting.d.ts +6 -0
- package/ts/discoverer/parsing/enum-collecting.js +74 -0
- package/ts/discoverer/parsing/enum-collecting.js.map +1 -0
- package/ts/discoverer/parsing/file-reader.d.ts +2 -0
- package/ts/discoverer/parsing/file-reader.js +33 -0
- package/ts/discoverer/parsing/file-reader.js.map +1 -0
- package/ts/discoverer/parsing/widget-parsing.d.ts +11 -0
- package/ts/discoverer/parsing/widget-parsing.js +75 -0
- package/ts/discoverer/parsing/widget-parsing.js.map +1 -0
- package/ts/discoverer/parsing.d.ts +26 -0
- package/ts/discoverer/parsing.js +338 -0
- package/ts/discoverer/parsing.js.map +1 -0
- package/ts/discoverer/types.d.ts +20 -0
- package/ts/discoverer/types.js +3 -0
- package/ts/discoverer/types.js.map +1 -0
- package/ts/logging.d.ts +16 -0
- package/ts/logging.js +112 -0
- package/ts/logging.js.map +1 -0
- package/ts/modules-meta-generator/modules-meta-generator.d.ts +3 -0
- package/ts/modules-meta-generator/modules-meta-generator.js +63 -0
- package/ts/modules-meta-generator/modules-meta-generator.js.map +1 -0
- package/ts/program.d.ts +3 -0
- package/ts/program.js +15 -0
- package/ts/program.js.map +1 -0
- package/ts/react-components-generator/component-generator.d.ts +55 -0
- package/ts/react-components-generator/component-generator.js +421 -0
- package/ts/react-components-generator/component-generator.js.map +1 -0
- package/ts/react-components-generator/generator.d.ts +43 -0
- package/ts/react-components-generator/generator.js +245 -0
- package/ts/react-components-generator/generator.js.map +1 -0
- package/ts/tools/common.d.ts +8 -0
- package/ts/tools/common.js +51 -0
- package/ts/tools/common.js.map +1 -0
- package/ts/tools/discover-declarations.d.ts +15 -0
- package/ts/tools/discover-declarations.js +60 -0
- package/ts/tools/discover-declarations.js.map +1 -0
- package/ts/tools/index.d.ts +13 -0
- package/ts/tools/index.js +90 -0
- package/ts/tools/index.js.map +1 -0
- package/ts/tools/make-angular-metadata.d.ts +8 -0
- package/ts/tools/make-angular-metadata.js +16 -0
- package/ts/tools/make-angular-metadata.js.map +1 -0
- package/ts/tools/make-aspnet-metadata.d.ts +20 -0
- package/ts/tools/make-aspnet-metadata.js +16 -0
- package/ts/tools/make-aspnet-metadata.js.map +1 -0
- package/ts/tools/make-integration-metadata.d.ts +8 -0
- package/ts/tools/make-integration-metadata.js +16 -0
- package/ts/tools/make-integration-metadata.js.map +1 -0
- package/ts/vue-components-generator/component-generator.d.ts +47 -0
- package/ts/vue-components-generator/component-generator.js +229 -0
- package/ts/vue-components-generator/component-generator.js.map +1 -0
- package/ts/vue-components-generator/converter.d.ts +22 -0
- package/ts/vue-components-generator/converter.js +98 -0
- package/ts/vue-components-generator/converter.js.map +1 -0
- package/ts/vue-components-generator/generator.d.ts +14 -0
- package/ts/vue-components-generator/generator.js +156 -0
- package/ts/vue-components-generator/generator.js.map +1 -0
- package/bin/DevExtreme.Declarations.Discoverer.pdb +0 -0
- package/bin/DevExtreme.Declarations.Discoverer.runtimeconfig.dev.json +0 -10
- package/bin/DevExtreme.Declarations.IntegrityValidator.pdb +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator.runtimeconfig.dev.json +0 -10
- package/bin/DevExtreme.Declarations.pdb +0 -0
- package/bin/DevExtreme.HelpFilesGenerator.DeclarationsProvider.deps.json +0 -273
- package/bin/DevExtreme.HelpFilesGenerator.DeclarationsProvider.dll +0 -0
- package/bin/DevExtreme.HelpFilesGenerator.DeclarationsProvider.pdb +0 -0
- package/bin/DevExtreme.HelpFilesGenerator.deps.json +0 -266
- package/bin/DevExtreme.HelpFilesGenerator.dll +0 -0
- package/bin/DevExtreme.HelpFilesGenerator.pdb +0 -0
- package/bin/DevExtreme.HelpFilesGenerator.runtimeconfig.dev.json +0 -10
- package/bin/DevExtreme.HelpFilesGenerator.runtimeconfig.json +0 -9
- package/bin/DevExtreme.Infrastructure.pdb +0 -0
- package/bin/DevExtreme.Topics.pdb +0 -0
- package/bin/DevExtreme.TypeScriptGenerator.deps.json +0 -305
- package/bin/DevExtreme.TypeScriptGenerator.dll +0 -0
- package/bin/DevExtreme.TypeScriptGenerator.pdb +0 -0
- package/bin/DevExtreme.TypeScriptGenerator.runtimeconfig.dev.json +0 -10
- package/bin/DevExtreme.TypeScriptGenerator.runtimeconfig.json +0 -9
- package/bin/DevExtreme.WebSite.LinksConverter.pdb +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter.runtimeconfig.dev.json +0 -10
- package/bin/PublishToCorp.bat +0 -10
- package/bin/System.IO.FileSystem.AccessControl.dll +0 -0
- package/bin/System.Security.AccessControl.dll +0 -0
- package/bin/System.Security.Principal.Windows.dll +0 -0
- package/bin/runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll +0 -0
- package/bin/runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll +0 -0
- package/bin/runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll +0 -0
- package/bin/runtimes/win/lib/netstandard2.0/System.IO.FileSystem.AccessControl.dll +0 -0
- package/scripts/declaration-validator.js +0 -31
- package/scripts/link-updater.js +0 -88
- package/scripts/ts-generator.js +0 -47
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ComponentMetadataGenerator = exports.FSObjectStore = void 0;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const mkdirp_1 = require("mkdirp");
|
|
10
|
+
const helpers_1 = require("./helpers");
|
|
11
|
+
const import_helper_1 = require("./import-helper");
|
|
12
|
+
const utils_1 = require("../common/utils");
|
|
13
|
+
const helpers_2 = require("../components-generation/helpers");
|
|
14
|
+
const metadata_augmentation_1 = require("../components-generation/metadata-augmentation");
|
|
15
|
+
const type_resolving_1 = require("../components-generation/type-resolving");
|
|
16
|
+
const logging_1 = require("../logging");
|
|
17
|
+
const OPTION_COMPONENT_PREFIX = 'Dxo';
|
|
18
|
+
const ITEM_COMPONENT_PREFIX = 'Dxi';
|
|
19
|
+
const TYPES_SEPARATOR = ' | ';
|
|
20
|
+
const NON_EXPORTED_NESTED_COMPONENTS = [
|
|
21
|
+
'DxiToolbarItem',
|
|
22
|
+
];
|
|
23
|
+
function trimDx(value) {
|
|
24
|
+
return trimPrefix('dx-', value);
|
|
25
|
+
}
|
|
26
|
+
function trimPrefix(prefix, value) {
|
|
27
|
+
if (value.startsWith(prefix)) {
|
|
28
|
+
return value.substr(prefix.length);
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function trimComponentPrefix(className) {
|
|
33
|
+
const pattern = new RegExp(`^(${OPTION_COMPONENT_PREFIX}|${ITEM_COMPONENT_PREFIX})`);
|
|
34
|
+
return className.replace(pattern, '');
|
|
35
|
+
}
|
|
36
|
+
class FSObjectStore {
|
|
37
|
+
constructor() {
|
|
38
|
+
this.encoding = 'utf8';
|
|
39
|
+
}
|
|
40
|
+
read(filePath) {
|
|
41
|
+
(0, logging_1.log)(`Read from file: ${filePath}`);
|
|
42
|
+
const dataString = node_fs_1.default.readFileSync(filePath, { encoding: this.encoding });
|
|
43
|
+
(0, logging_1.log)('Parse data');
|
|
44
|
+
return JSON.parse(dataString);
|
|
45
|
+
}
|
|
46
|
+
write(filePath, data) {
|
|
47
|
+
(0, logging_1.log)(`Write data to file ${filePath}`);
|
|
48
|
+
const dataString = JSON.stringify(data, null, 4);
|
|
49
|
+
node_fs_1.default.mkdirSync(node_path_1.default.dirname(filePath), { recursive: true });
|
|
50
|
+
node_fs_1.default.writeFileSync(filePath, dataString, { encoding: this.encoding });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.FSObjectStore = FSObjectStore;
|
|
54
|
+
const TYPE_ALIASES = {
|
|
55
|
+
Component: 'CoreComponent',
|
|
56
|
+
};
|
|
57
|
+
function createImports(customTypeModules, metadataAugmentation, aliases) {
|
|
58
|
+
const customTypeImports = {};
|
|
59
|
+
const defaultTypeImports = {};
|
|
60
|
+
const wildcardTypeImports = {};
|
|
61
|
+
Object.keys(customTypeModules).forEach((t) => {
|
|
62
|
+
if (metadataAugmentation.defaultImports[t]) {
|
|
63
|
+
defaultTypeImports[metadataAugmentation.defaultImports[t]] = t;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const modules = customTypeModules[t].map((m) => { var _a; return (_a = metadataAugmentation.importOverrides[t]) !== null && _a !== void 0 ? _a : m; });
|
|
67
|
+
if (modules.length) {
|
|
68
|
+
modules.forEach((module) => {
|
|
69
|
+
const importNamespace = metadataAugmentation.nameConflictsResolutionNamespaces[t];
|
|
70
|
+
if (importNamespace) {
|
|
71
|
+
wildcardTypeImports[module] = `* as ${importNamespace}`;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const moduleImports = new Set(customTypeImports[module]);
|
|
75
|
+
const hasAlias = aliases && aliases[t];
|
|
76
|
+
moduleImports.add(hasAlias ? aliases[t] : t);
|
|
77
|
+
customTypeImports[module] = Array.from(moduleImports);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return [].concat(Object.keys(defaultTypeImports).map((key) => ({
|
|
83
|
+
path: key,
|
|
84
|
+
importString: defaultTypeImports[key],
|
|
85
|
+
})), Object.keys(wildcardTypeImports).map((key) => ({
|
|
86
|
+
path: key,
|
|
87
|
+
importString: wildcardTypeImports[key],
|
|
88
|
+
})), Object.keys(customTypeImports).map((key) => ({
|
|
89
|
+
path: key,
|
|
90
|
+
importString: `{ ${customTypeImports[key].join(', ')} }`,
|
|
91
|
+
})));
|
|
92
|
+
}
|
|
93
|
+
function replaceEmptyFunction(optionType) {
|
|
94
|
+
const emptyFunction = /\(\(\) => (void|any)\)/;
|
|
95
|
+
const typeFunction = 'Function';
|
|
96
|
+
if (emptyFunction.exec(optionType)) {
|
|
97
|
+
return optionType
|
|
98
|
+
.split(TYPES_SEPARATOR)
|
|
99
|
+
.map((typeName) => typeName.replace(emptyFunction, typeFunction))
|
|
100
|
+
.join(TYPES_SEPARATOR);
|
|
101
|
+
}
|
|
102
|
+
return optionType;
|
|
103
|
+
}
|
|
104
|
+
function mapProp(option, typeResolver) {
|
|
105
|
+
if (option.name.toLowerCase().includes('template')) {
|
|
106
|
+
return {
|
|
107
|
+
name: option.name,
|
|
108
|
+
type: type_resolving_1.BaseTypes.Any,
|
|
109
|
+
isSubscribable: option.isSubscribable,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
let optionType = (0, type_resolving_1.getComplexOptionType)(option.types, typeResolver, {
|
|
113
|
+
trimTypeParams: true,
|
|
114
|
+
});
|
|
115
|
+
if (option.props && option.props.length) {
|
|
116
|
+
const nested = option.props.map((o) => mapProp(o, typeResolver));
|
|
117
|
+
const nestedTypes = nested.map((n) => `${n.name}?: ${n.type}`);
|
|
118
|
+
optionType = optionType
|
|
119
|
+
.split(TYPES_SEPARATOR)
|
|
120
|
+
.filter((typeName) => typeName !== type_resolving_1.BaseTypes.Object &&
|
|
121
|
+
typeName !== `Array<${type_resolving_1.BaseTypes.Object}>`)
|
|
122
|
+
.concat(`{ ${nestedTypes.join(', ')} }${(0, type_resolving_1.isNestedOptionArray)(option) ? '[]' : ''}`)
|
|
123
|
+
.join(TYPES_SEPARATOR);
|
|
124
|
+
}
|
|
125
|
+
optionType = replaceEmptyFunction(optionType);
|
|
126
|
+
return {
|
|
127
|
+
name: option.name,
|
|
128
|
+
type: optionType,
|
|
129
|
+
isSubscribable: option.isSubscribable,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
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
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function getCollectionNestedComponents(nesteds, parentName) {
|
|
144
|
+
if (nesteds && nesteds.length) {
|
|
145
|
+
return nesteds
|
|
146
|
+
.filter((n) => n.isCollectionItem)
|
|
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
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
function getMissingCollectionItems(nestedComponents) {
|
|
160
|
+
const nestedComponentsHash = {};
|
|
161
|
+
let nestedCollectionOptions = [];
|
|
162
|
+
nestedComponents.forEach((c) => {
|
|
163
|
+
var _a;
|
|
164
|
+
nestedComponentsHash[c.optionName] = c;
|
|
165
|
+
const collectionNesteds = (_a = c.nesteds) === null || _a === void 0 ? void 0 : _a.filter((n) => n.isCollectionItem).reduce((acc, nestedOption) => {
|
|
166
|
+
acc[nestedOption.optionName] = nestedOption.componentName;
|
|
167
|
+
return acc;
|
|
168
|
+
}, {});
|
|
169
|
+
if (collectionNesteds) {
|
|
170
|
+
nestedCollectionOptions = nestedCollectionOptions.concat(c.props
|
|
171
|
+
.filter((prop) => collectionNesteds[prop.name])
|
|
172
|
+
.map((prop) => ({
|
|
173
|
+
...prop,
|
|
174
|
+
name: collectionNesteds[prop.name],
|
|
175
|
+
optionName: prop.name,
|
|
176
|
+
isCollectionItem: true,
|
|
177
|
+
nesteds: [],
|
|
178
|
+
owners: [],
|
|
179
|
+
predefinedProps: null,
|
|
180
|
+
templates: null,
|
|
181
|
+
})));
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
const result = [];
|
|
185
|
+
nestedCollectionOptions.forEach((option) => {
|
|
186
|
+
if (!nestedComponentsHash[option.optionName]) {
|
|
187
|
+
result.push(option);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
function appendMissingRecursiveNestedComponents(component, siblings) {
|
|
193
|
+
const collectionItems = siblings.filter((c) => c.isCollectionItem);
|
|
194
|
+
const siblingsByOptionName = (0, helpers_2.groupBy)(collectionItems, (c) => c.optionName);
|
|
195
|
+
const missingNesteds = [];
|
|
196
|
+
component.props.forEach((prop) => {
|
|
197
|
+
var _a;
|
|
198
|
+
const recursiveNesteds = siblingsByOptionName[prop.name];
|
|
199
|
+
if ((0, type_resolving_1.isNestedOptionArray)(prop) && recursiveNesteds) {
|
|
200
|
+
const isMergedNested = component.owners.length > 1 && prop.name === component.optionName;
|
|
201
|
+
if (isMergedNested) {
|
|
202
|
+
missingNesteds.push({
|
|
203
|
+
componentName: component.name,
|
|
204
|
+
optionName: prop.name,
|
|
205
|
+
isCollectionItem: true,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
recursiveNesteds.forEach((r) => {
|
|
210
|
+
const haveCommonOwner = r.owners.some((o) => component.owners.includes(o));
|
|
211
|
+
if (haveCommonOwner) {
|
|
212
|
+
missingNesteds.push({
|
|
213
|
+
componentName: r.name,
|
|
214
|
+
optionName: r.optionName,
|
|
215
|
+
isCollectionItem: true,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
if (!((_a = component.nesteds) === null || _a === void 0 ? void 0 : _a.some((n) => n.optionName === prop.name))) {
|
|
220
|
+
const nestedsAreOwners = recursiveNesteds
|
|
221
|
+
.filter((r) => component.owners.includes(r.name))
|
|
222
|
+
.map((r) => r.owners)
|
|
223
|
+
.flat();
|
|
224
|
+
recursiveNesteds
|
|
225
|
+
.filter((r) => r.owners.some((o) => nestedsAreOwners.includes(o)))
|
|
226
|
+
.forEach((r) => {
|
|
227
|
+
missingNesteds.push({
|
|
228
|
+
componentName: r.name,
|
|
229
|
+
optionName: r.optionName,
|
|
230
|
+
isCollectionItem: true,
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
const allNesteds = component.nesteds
|
|
238
|
+
? component.nesteds.concat(missingNesteds)
|
|
239
|
+
: missingNesteds;
|
|
240
|
+
return (0, utils_1.distinctByProperty)(allNesteds, 'componentName');
|
|
241
|
+
}
|
|
242
|
+
class ComponentMetadataGenerator {
|
|
243
|
+
constructor(store) {
|
|
244
|
+
this.store = store;
|
|
245
|
+
if (!this.store) {
|
|
246
|
+
this.store = new FSObjectStore();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
generate(config) {
|
|
250
|
+
var _a, _b, _c;
|
|
251
|
+
const ngMetadata = this.store.read(config.sourceMetadataFilePath);
|
|
252
|
+
const imdMetadata = this.store.read(config.imdMetadataFilePath);
|
|
253
|
+
const customTypeHash = (0, type_resolving_1.createCustomTypeHash)(imdMetadata.customTypes);
|
|
254
|
+
const widgetsMetadata = ngMetadata.Widgets;
|
|
255
|
+
let allNestedComponents = [];
|
|
256
|
+
(0, mkdirp_1.sync)(config.outputFolderPath);
|
|
257
|
+
(0, mkdirp_1.sync)(node_path_1.default.join(config.outputFolderPath, config.nestedPathPart));
|
|
258
|
+
(0, mkdirp_1.sync)(node_path_1.default.join(config.outputFolderPath, config.nestedPathPart, config.basePathPart));
|
|
259
|
+
for (const widget of imdMetadata.widgets) {
|
|
260
|
+
const widgetName = (0, helpers_2.lowercaseFirst)(widget.name);
|
|
261
|
+
const legacyWidget = widgetsMetadata[widgetName];
|
|
262
|
+
if (!widget.exportPath) {
|
|
263
|
+
(0, logging_1.log)(`Skipping metadata for ${widgetName}`);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
(0, logging_1.log)(`Generate metadata for ${widgetName}`);
|
|
267
|
+
const isTranscludedContent = widget.hasTranscludedContent;
|
|
268
|
+
const isViz = widget.exportPath.startsWith('viz');
|
|
269
|
+
const isExtension = widget.isExtension || false;
|
|
270
|
+
const dasherizedWidgetName = (0, helpers_2.dasherize)((0, helpers_2.underscore)(widgetName));
|
|
271
|
+
const outputFilePath = node_path_1.default.join(config.outputFolderPath, trimDx(dasherizedWidgetName), `${trimDx(dasherizedWidgetName)}.json`);
|
|
272
|
+
const events = [];
|
|
273
|
+
const changeEvents = [];
|
|
274
|
+
const properties = [];
|
|
275
|
+
const metadataAugmentation = (0, metadata_augmentation_1.readFromConfig)(config.unifiedConfig);
|
|
276
|
+
const [typeResolver, customTypeModules] = (0, type_resolving_1.createCustomTypeResolver)(customTypeHash, metadataAugmentation);
|
|
277
|
+
for (const option of widget.options) {
|
|
278
|
+
const legacyOption = legacyWidget === null || legacyWidget === void 0 ? void 0 : legacyWidget.Options[option.name];
|
|
279
|
+
const isEvent = option.types.filter((type) => type.type === 'Function').length ===
|
|
280
|
+
1 &&
|
|
281
|
+
(!option.firedEvents || option.firedEvents.length === 0) &&
|
|
282
|
+
option.name.startsWith('on');
|
|
283
|
+
if (isEvent) {
|
|
284
|
+
const eventName = (0, helpers_2.lowercaseFirst)((0, helpers_2.camelize)(option.name.slice('on'.length)));
|
|
285
|
+
const eventTypeDescr = option.types[0]
|
|
286
|
+
.params[0].types[0];
|
|
287
|
+
let eventType = eventTypeDescr.type;
|
|
288
|
+
const { importPath } = eventTypeDescr;
|
|
289
|
+
if (importPath) {
|
|
290
|
+
customTypeModules[eventType] = [
|
|
291
|
+
`${config.widgetPackageName}/${importPath}`,
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
else if (customTypeHash[eventType]) {
|
|
295
|
+
customTypeModules[eventType] = [
|
|
296
|
+
`${config.widgetPackageName}/${customTypeHash[eventType].module}`,
|
|
297
|
+
];
|
|
298
|
+
}
|
|
299
|
+
if (metadataAugmentation.genericTypes[eventType]) {
|
|
300
|
+
eventType += `<${type_resolving_1.BaseTypes.Any}>`;
|
|
301
|
+
}
|
|
302
|
+
events.push({
|
|
303
|
+
docID: legacyOption === null || legacyOption === void 0 ? void 0 : legacyOption.DocID,
|
|
304
|
+
isDeprecated: option.isDeprecated,
|
|
305
|
+
emit: option.name,
|
|
306
|
+
subscribe: eventName,
|
|
307
|
+
type: `EventEmitter<${eventType}>`,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
const { type: finalizedType } = mapProp(option, typeResolver);
|
|
312
|
+
const property = {
|
|
313
|
+
docID: legacyOption === null || legacyOption === void 0 ? void 0 : legacyOption.DocID,
|
|
314
|
+
isDeprecated: option.isDeprecated,
|
|
315
|
+
name: option.name,
|
|
316
|
+
type: finalizedType,
|
|
317
|
+
};
|
|
318
|
+
const isDataSource = option.name.toLowerCase() === 'datasource';
|
|
319
|
+
const isCollection = option.types.length && option.types[0].type === 'Array';
|
|
320
|
+
if (isCollection || isDataSource) {
|
|
321
|
+
property.isCollection = true;
|
|
322
|
+
}
|
|
323
|
+
properties.push(property);
|
|
324
|
+
changeEvents.push(this.createEvent(option.name, finalizedType));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
const allEvents = events.concat(changeEvents);
|
|
328
|
+
const isEditor = widget.options.some((o) => o.name === 'onValueChanged');
|
|
329
|
+
if (isEditor) {
|
|
330
|
+
allEvents.push({ emit: 'onBlur', type: 'EventEmitter<any>' });
|
|
331
|
+
}
|
|
332
|
+
const parentName = trimDx(dasherizedWidgetName);
|
|
333
|
+
const componentNestedOptions = this.generateIMDComponentNestedOptions((_a = widget.complexOptions) !== null && _a !== void 0 ? _a : [], trimDx(dasherizedWidgetName), customTypeHash, metadataAugmentation);
|
|
334
|
+
const widgetNestedComponents = this.filterWidgetNestedComponents(componentNestedOptions, properties);
|
|
335
|
+
let nestedComponents = [];
|
|
336
|
+
if (legacyWidget) {
|
|
337
|
+
for (const optionName of Object.keys(legacyWidget.Options)) {
|
|
338
|
+
const option = legacyWidget.Options[optionName];
|
|
339
|
+
if (!option.IsEvent) {
|
|
340
|
+
const components = (_b = this.generateComplexOptionByType(ngMetadata, option, optionName, [], config)) !== null && _b !== void 0 ? _b : [];
|
|
341
|
+
nestedComponents = nestedComponents.concat(...components);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const widgetLegacyNestedComponents = this.filterWidgetNestedComponents(nestedComponents, properties).filter((component) => !NON_EXPORTED_NESTED_COMPONENTS.includes(component.className));
|
|
346
|
+
const containsReexports = (_c = widget.reexports) === null || _c === void 0 ? void 0 : _c.some((r) => r !== 'default');
|
|
347
|
+
const widgetMetadata = {
|
|
348
|
+
docID: legacyWidget === null || legacyWidget === void 0 ? void 0 : legacyWidget.DocID,
|
|
349
|
+
className: widget.name,
|
|
350
|
+
widgetName,
|
|
351
|
+
isTranscludedContent,
|
|
352
|
+
isViz,
|
|
353
|
+
isExtension,
|
|
354
|
+
selector: dasherizedWidgetName,
|
|
355
|
+
path: trimDx(dasherizedWidgetName),
|
|
356
|
+
events: allEvents,
|
|
357
|
+
properties,
|
|
358
|
+
isEditor,
|
|
359
|
+
module: `${config.widgetPackageName}/${widget.exportPath}`,
|
|
360
|
+
packageName: config.wrapperPackageName,
|
|
361
|
+
imports: createImports(customTypeModules, metadataAugmentation),
|
|
362
|
+
collectionNestedComponents: getCollectionNestedComponents(widget.nesteds, parentName),
|
|
363
|
+
nestedComponents: widgetNestedComponents,
|
|
364
|
+
legacyNestedComponents: widgetLegacyNestedComponents,
|
|
365
|
+
optionsTypeParams: widget.optionsTypeParams,
|
|
366
|
+
renderReexports: config.generateReexports && containsReexports,
|
|
367
|
+
};
|
|
368
|
+
(0, logging_1.log)(`Write metadata to file ${outputFilePath}`);
|
|
369
|
+
this.store.write(outputFilePath, normalizeMeta(widgetMetadata));
|
|
370
|
+
this.writeNestedOptionsMetadata(componentNestedOptions, node_path_1.default.join(config.outputFolderPath, parentName, config.nestedPathPart));
|
|
371
|
+
allNestedComponents = allNestedComponents.concat(...nestedComponents);
|
|
372
|
+
}
|
|
373
|
+
const commonNestedOptions = this.prepareCommonNestedOptionsMetadata(config, allNestedComponents);
|
|
374
|
+
this.writeNestedOptionsMetadata(commonNestedOptions, node_path_1.default.join(config.outputFolderPath, config.nestedPathPart));
|
|
375
|
+
}
|
|
376
|
+
createEvent(name, type, option) {
|
|
377
|
+
return {
|
|
378
|
+
isInternal: true,
|
|
379
|
+
emit: `${name}Change`,
|
|
380
|
+
type: `EventEmitter<${type}>`,
|
|
381
|
+
option,
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
filterWidgetNestedComponents(nestedComponents, widgetProperties) {
|
|
385
|
+
return (0, utils_1.distinctByProperty)(nestedComponents, 'className').map((component) => ({
|
|
386
|
+
path: component.path,
|
|
387
|
+
propertyName: component.propertyName,
|
|
388
|
+
className: component.className,
|
|
389
|
+
events: component.events,
|
|
390
|
+
isCollection: component.isCollection,
|
|
391
|
+
hasTemplate: component.hasTemplate,
|
|
392
|
+
root: widgetProperties.filter((p) => p.name === component.propertyName)
|
|
393
|
+
.length === 1
|
|
394
|
+
? true
|
|
395
|
+
: undefined,
|
|
396
|
+
}));
|
|
397
|
+
}
|
|
398
|
+
getTypesDescription(optionMetadata) {
|
|
399
|
+
const typeParts = this.getTypeParts(optionMetadata);
|
|
400
|
+
return {
|
|
401
|
+
primitiveTypes: typeParts.primitiveTypes,
|
|
402
|
+
arrayTypes: typeParts.arrayTypes,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
getTypeParts(optionMetadata) {
|
|
406
|
+
const primitiveTypes = optionMetadata.PrimitiveTypes
|
|
407
|
+
? optionMetadata.PrimitiveTypes.slice(0)
|
|
408
|
+
: [];
|
|
409
|
+
let arrayTypes = [];
|
|
410
|
+
if (optionMetadata.ItemPrimitiveTypes) {
|
|
411
|
+
if (optionMetadata.IsPromise) {
|
|
412
|
+
const promiseType = optionMetadata.ItemPrimitiveTypes.join(TYPES_SEPARATOR);
|
|
413
|
+
primitiveTypes.push(`Promise<${promiseType}> & JQueryPromise<${promiseType}>`);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
arrayTypes = arrayTypes.concat(optionMetadata.ItemPrimitiveTypes);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (optionMetadata.Options) {
|
|
420
|
+
const optionType = this.getObjectType(optionMetadata.Options);
|
|
421
|
+
if (optionType.length) {
|
|
422
|
+
(optionMetadata.IsCollection ? arrayTypes : primitiveTypes).push(optionType);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return { primitiveTypes, arrayTypes };
|
|
426
|
+
}
|
|
427
|
+
getObjectType(optionMetadata) {
|
|
428
|
+
const objectType = [];
|
|
429
|
+
for (const option of Object.keys(optionMetadata)) {
|
|
430
|
+
const typeParts = this.getTypeParts(optionMetadata[option]);
|
|
431
|
+
const type = this.getType(typeParts);
|
|
432
|
+
objectType.push(`${option}?: ${type}`);
|
|
433
|
+
}
|
|
434
|
+
if (objectType.length) {
|
|
435
|
+
return `{ ${objectType.join(', ')} }`;
|
|
436
|
+
}
|
|
437
|
+
return '';
|
|
438
|
+
}
|
|
439
|
+
getEventType(typesDescription, option) {
|
|
440
|
+
var _a;
|
|
441
|
+
if (!((option === null || option === void 0 ? void 0 : option.IsEvent) && ((_a = option.TypeImports) === null || _a === void 0 ? void 0 : _a.length))) {
|
|
442
|
+
return this.getType(typesDescription);
|
|
443
|
+
}
|
|
444
|
+
return `((e: ${option.TypeImports[0].Name}) => void)`;
|
|
445
|
+
}
|
|
446
|
+
getType(typesDescription) {
|
|
447
|
+
const primitiveTypes = typesDescription.primitiveTypes.slice(0);
|
|
448
|
+
let result = 'any';
|
|
449
|
+
if (typesDescription.arrayTypes.length) {
|
|
450
|
+
primitiveTypes.push(`Array<${typesDescription.arrayTypes.join(TYPES_SEPARATOR)}>`);
|
|
451
|
+
}
|
|
452
|
+
if (primitiveTypes.length) {
|
|
453
|
+
result = primitiveTypes.join(TYPES_SEPARATOR);
|
|
454
|
+
}
|
|
455
|
+
return result;
|
|
456
|
+
}
|
|
457
|
+
mergeArrayTypes(array1, array2) {
|
|
458
|
+
const newTypes = array2.filter((type) => !array1.includes(type));
|
|
459
|
+
return [].concat(array1, newTypes);
|
|
460
|
+
}
|
|
461
|
+
getExternalObjectInfo(metadata, typeName) {
|
|
462
|
+
let externalObject = metadata.ExtraObjects[typeName];
|
|
463
|
+
if (!externalObject) {
|
|
464
|
+
const postfix = 'Options';
|
|
465
|
+
if (typeName.endsWith(postfix)) {
|
|
466
|
+
const widgetName = typeName.substr(0, typeName.length - postfix.length);
|
|
467
|
+
externalObject = metadata.Widgets[widgetName];
|
|
468
|
+
typeName = trimPrefix('dx', typeName);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (!externalObject) {
|
|
472
|
+
console.warn(`WARN: missed complex type: ${typeName}`);
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
return {
|
|
476
|
+
Options: externalObject.Options,
|
|
477
|
+
typeName,
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
return undefined;
|
|
481
|
+
}
|
|
482
|
+
generateComplexOptionByType(metadata, option, optionName, complexTypes, config) {
|
|
483
|
+
const optionComplexTypes = option[option.IsCollection ? 'ItemComplexTypes' : 'ComplexTypes'];
|
|
484
|
+
if (option.Options) {
|
|
485
|
+
return this.generateComplexOption(metadata, option.Options, optionName, complexTypes, option, config);
|
|
486
|
+
}
|
|
487
|
+
if (optionComplexTypes && optionComplexTypes.length > 0) {
|
|
488
|
+
if (complexTypes.indexOf(complexTypes[complexTypes.length - 1]) !==
|
|
489
|
+
complexTypes.length - 1) {
|
|
490
|
+
return [];
|
|
491
|
+
}
|
|
492
|
+
const result = [];
|
|
493
|
+
optionComplexTypes.forEach((complexType) => {
|
|
494
|
+
const externalObjectInfo = this.getExternalObjectInfo(metadata, complexType);
|
|
495
|
+
if (externalObjectInfo) {
|
|
496
|
+
const nestedOptions = externalObjectInfo.Options;
|
|
497
|
+
const nestedComplexTypes = complexTypes.concat(externalObjectInfo.typeName);
|
|
498
|
+
result.push(...this.generateComplexOption(metadata, nestedOptions, optionName, nestedComplexTypes, option, config));
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
if (optionComplexTypes.length === 1) {
|
|
502
|
+
const externalObjectInfo = this.getExternalObjectInfo(metadata, optionComplexTypes[0]);
|
|
503
|
+
if (externalObjectInfo) {
|
|
504
|
+
if (result.length === 0) {
|
|
505
|
+
console.warn(`External object has empty complex options DocID: ${option.DocID}, typeName: ${externalObjectInfo.typeName}`);
|
|
506
|
+
return [];
|
|
507
|
+
}
|
|
508
|
+
result[0].baseClass =
|
|
509
|
+
(option.IsCollection
|
|
510
|
+
? ITEM_COMPONENT_PREFIX
|
|
511
|
+
: OPTION_COMPONENT_PREFIX) + externalObjectInfo.typeName;
|
|
512
|
+
result[0].basePath = (0, helpers_2.dasherize)((0, helpers_2.underscore)(externalObjectInfo.typeName));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return result;
|
|
516
|
+
}
|
|
517
|
+
return [];
|
|
518
|
+
}
|
|
519
|
+
generateComplexOption(metadata, nestedOptions, optionName, complexTypes, option, config) {
|
|
520
|
+
var _a;
|
|
521
|
+
if (!nestedOptions || !Object.keys(nestedOptions).length) {
|
|
522
|
+
return [];
|
|
523
|
+
}
|
|
524
|
+
let pluralName = optionName;
|
|
525
|
+
if (option.IsCollection) {
|
|
526
|
+
pluralName = `${option.SingularName}Dxi`;
|
|
527
|
+
}
|
|
528
|
+
const singularName = option.SingularName || pluralName;
|
|
529
|
+
const underscoreSingular = (0, helpers_2.underscore)(singularName).split('.').join('_');
|
|
530
|
+
const underscorePlural = (0, helpers_2.underscore)(pluralName).split('.').join('_');
|
|
531
|
+
const prefix = `${(option.IsCollection ? ITEM_COMPONENT_PREFIX : OPTION_COMPONENT_PREFIX).toLocaleLowerCase()}_`;
|
|
532
|
+
const underscoreSelector = prefix + (option.IsCollection ? underscoreSingular : underscorePlural);
|
|
533
|
+
const selector = (0, helpers_2.dasherize)(underscoreSelector);
|
|
534
|
+
const complexOptionMetadata = {
|
|
535
|
+
docID: option.DocID,
|
|
536
|
+
isDeprecated: option.IsDeprecated,
|
|
537
|
+
className: (0, helpers_2.camelize)(underscoreSelector),
|
|
538
|
+
selector,
|
|
539
|
+
optionName,
|
|
540
|
+
properties: [],
|
|
541
|
+
events: [],
|
|
542
|
+
path: (0, helpers_2.dasherize)(underscorePlural),
|
|
543
|
+
propertyName: optionName,
|
|
544
|
+
isCollection: option.IsCollection,
|
|
545
|
+
hasTemplate: option.Options &&
|
|
546
|
+
option.Options.template &&
|
|
547
|
+
option.Options.template.IsTemplate,
|
|
548
|
+
collectionNestedComponents: [],
|
|
549
|
+
imports: [],
|
|
550
|
+
};
|
|
551
|
+
let nestedComponents = [complexOptionMetadata];
|
|
552
|
+
for (const optName of Object.keys(nestedOptions)) {
|
|
553
|
+
const nestedOption = nestedOptions[optName];
|
|
554
|
+
const typesDescription = this.getTypesDescription(nestedOption);
|
|
555
|
+
let propertyType = this.getType(typesDescription);
|
|
556
|
+
if (nestedOption.IsEvent && ((_a = nestedOption.TypeImports) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
557
|
+
propertyType = `((e: ${nestedOption.TypeImports[0].Name}) => void)`;
|
|
558
|
+
}
|
|
559
|
+
const property = {
|
|
560
|
+
docID: nestedOption.DocID,
|
|
561
|
+
isDeprecated: nestedOption.IsDeprecated,
|
|
562
|
+
name: optName,
|
|
563
|
+
type: propertyType,
|
|
564
|
+
typesDescription,
|
|
565
|
+
option: nestedOption,
|
|
566
|
+
};
|
|
567
|
+
if (nestedOption.IsCollection) {
|
|
568
|
+
property.isCollection = true;
|
|
569
|
+
}
|
|
570
|
+
complexOptionMetadata.properties.push(property);
|
|
571
|
+
if (nestedOption.IsChangeable || nestedOption.IsReadonly) {
|
|
572
|
+
complexOptionMetadata.events.push(this.createEvent(optName, propertyType, nestedOption));
|
|
573
|
+
}
|
|
574
|
+
const components = this.generateComplexOptionByType(metadata, nestedOptions[optName], optName, complexTypes, config);
|
|
575
|
+
nestedComponents = nestedComponents.concat(...components);
|
|
576
|
+
const ownCollectionNestedComponents = components
|
|
577
|
+
.filter((c) => complexOptionMetadata.properties.filter((p) => p.name === c.propertyName && p.isCollection).length === 1)
|
|
578
|
+
.map((c) => ({
|
|
579
|
+
className: c.className,
|
|
580
|
+
path: c.path,
|
|
581
|
+
propertyName: c.propertyName,
|
|
582
|
+
}));
|
|
583
|
+
complexOptionMetadata.collectionNestedComponents.push(...ownCollectionNestedComponents);
|
|
584
|
+
}
|
|
585
|
+
complexOptionMetadata.imports = (0, import_helper_1.buildImports)((0, helpers_1.getValues)(nestedOptions), config.widgetPackageName);
|
|
586
|
+
return nestedComponents;
|
|
587
|
+
}
|
|
588
|
+
getBaseComponentPath(component) {
|
|
589
|
+
return component.basePath + (component.isCollection ? '-dxi' : '');
|
|
590
|
+
}
|
|
591
|
+
mergeNestedComponents(components) {
|
|
592
|
+
const mergedNestedComponents = {};
|
|
593
|
+
components.forEach((component) => {
|
|
594
|
+
if (!mergedNestedComponents[component.className]) {
|
|
595
|
+
mergedNestedComponents[component.className] = {
|
|
596
|
+
...component,
|
|
597
|
+
options: component.properties.map((p) => p.option),
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
const mergedComponent = mergedNestedComponents[component.className];
|
|
602
|
+
mergedComponent.properties = mergedComponent.properties
|
|
603
|
+
.concat(...component.properties)
|
|
604
|
+
.reduce((properties, property) => {
|
|
605
|
+
var _a;
|
|
606
|
+
if (!properties.some(({ name }) => name === property.name)) {
|
|
607
|
+
properties.push(property);
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
const existingProperty = properties.find(({ name }) => name === property.name);
|
|
611
|
+
const { typesDescription } = existingProperty;
|
|
612
|
+
typesDescription.primitiveTypes = this.mergeArrayTypes(typesDescription.primitiveTypes, property.typesDescription.primitiveTypes);
|
|
613
|
+
typesDescription.arrayTypes = this.mergeArrayTypes(typesDescription.arrayTypes, property.typesDescription.arrayTypes);
|
|
614
|
+
existingProperty.type = ((_a = existingProperty.option) === null || _a === void 0 ? void 0 : _a.IsEvent)
|
|
615
|
+
? this.getEventType(typesDescription, existingProperty.option)
|
|
616
|
+
: this.getType(typesDescription);
|
|
617
|
+
}
|
|
618
|
+
return properties;
|
|
619
|
+
}, []);
|
|
620
|
+
if (mergedComponent.events != null) {
|
|
621
|
+
mergedComponent.events = (0, utils_1.distinctByProperty)(mergedComponent.events.concat(...component.events), 'emit');
|
|
622
|
+
}
|
|
623
|
+
mergedComponent.baseClass =
|
|
624
|
+
mergedComponent.baseClass || component.baseClass;
|
|
625
|
+
mergedComponent.basePath =
|
|
626
|
+
mergedComponent.basePath || component.basePath;
|
|
627
|
+
mergedComponent.hasTemplate =
|
|
628
|
+
mergedComponent.hasTemplate || component.hasTemplate;
|
|
629
|
+
mergedComponent.collectionNestedComponents.push(...component.collectionNestedComponents);
|
|
630
|
+
mergedComponent.options.push(...component.properties.map((p) => p.option));
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
return Object.values(mergedNestedComponents);
|
|
634
|
+
}
|
|
635
|
+
generateIMDComponentNestedOptions(nestedComponents, parentName, customTypeHash, metadataAugmentation) {
|
|
636
|
+
nestedComponents = nestedComponents.concat(getMissingCollectionItems(nestedComponents));
|
|
637
|
+
return nestedComponents.map((component) => {
|
|
638
|
+
const { selector, className, filename } = getComponentInfo(component, parentName);
|
|
639
|
+
const aliases = {};
|
|
640
|
+
const resolveCustomTypeConflicts = (typeName) => {
|
|
641
|
+
if (TYPE_ALIASES[typeName]) {
|
|
642
|
+
aliases[typeName] = `${typeName} as ${TYPE_ALIASES[typeName]}`;
|
|
643
|
+
return TYPE_ALIASES[typeName];
|
|
644
|
+
}
|
|
645
|
+
return typeName;
|
|
646
|
+
};
|
|
647
|
+
const [typeResolver, customTypeModules] = (0, type_resolving_1.createCustomTypeResolver)(customTypeHash, metadataAugmentation, resolveCustomTypeConflicts);
|
|
648
|
+
const properties = component.props.map((prop) => mapProp(prop, typeResolver));
|
|
649
|
+
const events = properties
|
|
650
|
+
.filter((p) => p.isSubscribable)
|
|
651
|
+
.map((p) => this.createEvent(p.name, p.type, null));
|
|
652
|
+
const nesteds = appendMissingRecursiveNestedComponents(component, nestedComponents);
|
|
653
|
+
const collectionNestedComponents = getCollectionNestedComponents(nesteds, parentName);
|
|
654
|
+
return {
|
|
655
|
+
...component,
|
|
656
|
+
nesteds,
|
|
657
|
+
path: filename,
|
|
658
|
+
selector,
|
|
659
|
+
className,
|
|
660
|
+
propertyName: component.optionName,
|
|
661
|
+
baseClass: component.isCollectionItem
|
|
662
|
+
? 'CollectionNestedOption'
|
|
663
|
+
: 'NestedOption',
|
|
664
|
+
basePath: 'devextreme-angular/core',
|
|
665
|
+
isCollection: component.isCollectionItem,
|
|
666
|
+
hasTemplate: component.templates && component.templates.includes('template'),
|
|
667
|
+
properties,
|
|
668
|
+
events: events.length ? events : undefined,
|
|
669
|
+
imports: createImports(customTypeModules, metadataAugmentation, aliases),
|
|
670
|
+
collectionNestedComponents,
|
|
671
|
+
};
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
prepareCommonNestedOptionsMetadata(config, metadata) {
|
|
675
|
+
const commonNestedOptions = this.mergeNestedComponents(metadata);
|
|
676
|
+
commonNestedOptions.forEach((component) => {
|
|
677
|
+
component.collectionNestedComponents = (0, utils_1.distinctByProperty)(component.collectionNestedComponents, 'className');
|
|
678
|
+
});
|
|
679
|
+
const baseComponents = commonNestedOptions.reduce((result, component) => {
|
|
680
|
+
const existingComponent = result.find((c) => c.className === component.baseClass);
|
|
681
|
+
if (!existingComponent && component.baseClass) {
|
|
682
|
+
const nestedComponent = {
|
|
683
|
+
properties: component.properties,
|
|
684
|
+
events: component.events,
|
|
685
|
+
className: component.baseClass,
|
|
686
|
+
path: this.getBaseComponentPath(component),
|
|
687
|
+
baseClass: component.isCollection
|
|
688
|
+
? 'CollectionNestedOption'
|
|
689
|
+
: 'NestedOption',
|
|
690
|
+
basePath: 'devextreme-angular/core',
|
|
691
|
+
imports: (0, import_helper_1.buildImports)(component.options, config.widgetPackageName),
|
|
692
|
+
};
|
|
693
|
+
result.push(nestedComponent);
|
|
694
|
+
}
|
|
695
|
+
return result;
|
|
696
|
+
}, []);
|
|
697
|
+
Object.values((0, helpers_2.groupBy)(baseComponents, (c) => trimComponentPrefix(c.className)))
|
|
698
|
+
.filter((g) => g.length > 1)
|
|
699
|
+
.forEach((g) => g.forEach((c) => {
|
|
700
|
+
if (c.className.startsWith(ITEM_COMPONENT_PREFIX)) {
|
|
701
|
+
c.selector = `base-${(0, helpers_2.toKebabCase)(c.className)}`;
|
|
702
|
+
}
|
|
703
|
+
}));
|
|
704
|
+
baseComponents.forEach((component) => {
|
|
705
|
+
const outputFilePath = node_path_1.default.join(config.outputFolderPath, config.nestedPathPart, config.basePathPart, `${component.path}.json`);
|
|
706
|
+
this.store.write(outputFilePath, normalizeMeta(component));
|
|
707
|
+
});
|
|
708
|
+
return commonNestedOptions.map((component) => {
|
|
709
|
+
if (component.events && !component.events.length) {
|
|
710
|
+
delete component.events;
|
|
711
|
+
}
|
|
712
|
+
if (component.baseClass) {
|
|
713
|
+
component.inputs = component.properties;
|
|
714
|
+
delete component.properties;
|
|
715
|
+
component.basePath = `./base/${this.getBaseComponentPath(component)}`;
|
|
716
|
+
component.imports = component.events
|
|
717
|
+
? (component.imports = (0, import_helper_1.buildImports)(component.events.map((e) => e.option), config.widgetPackageName))
|
|
718
|
+
: undefined;
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
component.baseClass = component.isCollection
|
|
722
|
+
? 'CollectionNestedOption'
|
|
723
|
+
: 'NestedOption';
|
|
724
|
+
component.basePath = 'devextreme-angular/core';
|
|
725
|
+
component.hasSimpleBaseClass = true;
|
|
726
|
+
component.imports = (0, import_helper_1.buildImports)(component.options, config.widgetPackageName);
|
|
727
|
+
}
|
|
728
|
+
return component;
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
writeNestedOptionsMetadata(components, outputDir) {
|
|
732
|
+
components.forEach((component) => {
|
|
733
|
+
const outputFilePath = node_path_1.default.join(outputDir, `${component.path}.json`);
|
|
734
|
+
this.store.write(outputFilePath, normalizeMeta(component));
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
exports.ComponentMetadataGenerator = ComponentMetadataGenerator;
|
|
739
|
+
function normalizeMeta(meta) {
|
|
740
|
+
const result = {
|
|
741
|
+
...meta,
|
|
742
|
+
properties: meta.properties &&
|
|
743
|
+
meta.properties.map(({ option, ...rest }) => ({ ...rest })),
|
|
744
|
+
events: meta.events && meta.events.map(({ option, ...rest }) => ({ ...rest })),
|
|
745
|
+
};
|
|
746
|
+
if (!result.imports || !result.imports.length) {
|
|
747
|
+
result.imports = undefined;
|
|
748
|
+
delete result.imports;
|
|
749
|
+
}
|
|
750
|
+
(0, logging_1.log)(result);
|
|
751
|
+
return result;
|
|
752
|
+
}
|
|
753
|
+
//# sourceMappingURL=metadata-generator.js.map
|