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,26 @@
|
|
|
1
|
+
import { ID } from '../common/id';
|
|
2
|
+
import type { CompilerOptions } from 'typescript';
|
|
3
|
+
import type { EnumLikeType, GenericParamDeclaration, TypeDeclaration } from './data-model';
|
|
4
|
+
import type { GeneralType } from './types';
|
|
5
|
+
import type { DocTag } from '../common/tags/types';
|
|
6
|
+
export type { CompilerOptions } from 'typescript';
|
|
7
|
+
export type Descriptor = OptionDescriptor | WidgetDescriptor;
|
|
8
|
+
interface OptionDescriptor extends DescriptorBase {
|
|
9
|
+
kind: 'option';
|
|
10
|
+
optional: boolean;
|
|
11
|
+
type?: GeneralType;
|
|
12
|
+
}
|
|
13
|
+
export interface WidgetDescriptor extends DescriptorBase {
|
|
14
|
+
kind: 'widget';
|
|
15
|
+
optionsType: string;
|
|
16
|
+
}
|
|
17
|
+
interface DescriptorBase {
|
|
18
|
+
[ID]: string;
|
|
19
|
+
exported: boolean;
|
|
20
|
+
tags: DocTag[];
|
|
21
|
+
location?: {
|
|
22
|
+
file: string;
|
|
23
|
+
};
|
|
24
|
+
typeParameters?: Record<string, GenericParamDeclaration>;
|
|
25
|
+
}
|
|
26
|
+
export declare function parseFiles(files: string[], baseDir: string, compilerOptions: CompilerOptions | undefined): [Descriptor[], Record<string, TypeDeclaration | EnumLikeType>];
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseFiles = parseFiles;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const typescript_1 = require("typescript");
|
|
6
|
+
const discovering_error_1 = require("./discovering-error");
|
|
7
|
+
const common_resolving_1 = require("../common/common-resolving");
|
|
8
|
+
const id_1 = require("../common/id");
|
|
9
|
+
const tags_1 = require("../common/tags");
|
|
10
|
+
const enum_collecting_1 = require("./parsing/enum-collecting");
|
|
11
|
+
const file_reader_1 = require("./parsing/file-reader");
|
|
12
|
+
const widget_parsing_1 = require("./parsing/widget-parsing");
|
|
13
|
+
const merging_1 = require("../common/tags/merging");
|
|
14
|
+
const ts_type_resolving_1 = require("../common/ts-type-resolving");
|
|
15
|
+
const ts_utils_1 = require("../common/ts-utils");
|
|
16
|
+
const utils_1 = require("../common/utils");
|
|
17
|
+
const logging_1 = require("../logging");
|
|
18
|
+
function parseFiles(files, baseDir, compilerOptions) {
|
|
19
|
+
const program = (0, typescript_1.createProgram)(files, compilerOptions !== null && compilerOptions !== void 0 ? compilerOptions : {});
|
|
20
|
+
const descriptors = [];
|
|
21
|
+
const tsTypes = {};
|
|
22
|
+
const checker = program.getTypeChecker();
|
|
23
|
+
const processTypes = (0, ts_type_resolving_1.createTypeProcessor)(checker, baseDir);
|
|
24
|
+
const { addEnum, toRecord } = (0, enum_collecting_1.createEnumsCollector)(baseDir);
|
|
25
|
+
files.forEach((filePath) => {
|
|
26
|
+
processFile(filePath);
|
|
27
|
+
});
|
|
28
|
+
function addDescriptor(descriptor, file) {
|
|
29
|
+
if (descriptor === undefined)
|
|
30
|
+
return;
|
|
31
|
+
descriptors.push({
|
|
32
|
+
...descriptor,
|
|
33
|
+
location: descriptor.location || { file },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function processFile(filePath) {
|
|
37
|
+
const sourceFile = program.getSourceFile(filePath);
|
|
38
|
+
if (sourceFile.text.length === 0)
|
|
39
|
+
throw new Error(`Empty file: ${filePath}`);
|
|
40
|
+
const file = (0, utils_1.toInvariantPath)((0, node_path_1.relative)(baseDir, filePath));
|
|
41
|
+
const addFileDescriptor = (d) => addDescriptor(d, file);
|
|
42
|
+
for (const member of (0, file_reader_1.getDiscoverableSymbols)(sourceFile, checker)) {
|
|
43
|
+
proccessMemberDescriptors(member, sourceFile.fileName, checker, baseDir, addFileDescriptor);
|
|
44
|
+
if (!file.includes('renovation')) {
|
|
45
|
+
addEnum(member);
|
|
46
|
+
}
|
|
47
|
+
if ((0, common_resolving_1.hasTag)(member, 'docid') || (0, ts_type_resolving_1.isPublicType)(member)) {
|
|
48
|
+
processTypes(member, tsTypes);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return [descriptors, { ...tsTypes, ...toRecord() }];
|
|
53
|
+
}
|
|
54
|
+
function proccessMemberDescriptors(member, fileName, checker, baseDir, addDescriptor) {
|
|
55
|
+
const [moduleName, exportName] = getModuleAndExport(member, baseDir);
|
|
56
|
+
const moduleAndExportTags = [
|
|
57
|
+
{ name: 'module', value: moduleName },
|
|
58
|
+
{ name: 'export', value: exportName },
|
|
59
|
+
];
|
|
60
|
+
const reportDuplicateTag = (message, lvl = 'warn') => {
|
|
61
|
+
(0, logging_1.log)(message, { lvl, node: member.declarations[0] });
|
|
62
|
+
};
|
|
63
|
+
const exportedDescriptors = getExportedDescriptors(member, fileName, checker, baseDir).filter((d) => !!(d === null || d === void 0 ? void 0 : d.tags.length));
|
|
64
|
+
exportedDescriptors.forEach((d) => {
|
|
65
|
+
const descriptor = { ...d };
|
|
66
|
+
if (descriptor.exported) {
|
|
67
|
+
descriptor.tags = (0, merging_1.mergeTags)(descriptor.tags, moduleAndExportTags, reportDuplicateTag);
|
|
68
|
+
}
|
|
69
|
+
addDescriptor(descriptor);
|
|
70
|
+
});
|
|
71
|
+
if (hasMultipleDeclarations(member))
|
|
72
|
+
return;
|
|
73
|
+
const descriptor = getDescriptorFromSymbol(member, checker, baseDir);
|
|
74
|
+
if (descriptor === null || descriptor === void 0 ? void 0 : descriptor.tags.length) {
|
|
75
|
+
descriptor.tags = (0, merging_1.mergeTags)(descriptor.tags, moduleAndExportTags, reportDuplicateTag);
|
|
76
|
+
addDescriptor(descriptor);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function getExportedDescriptors(member, fileName, checker, baseDir) {
|
|
80
|
+
const declarations = member.declarations.filter((d) => d.getSourceFile().fileName === fileName);
|
|
81
|
+
if (declarations.length > 1) {
|
|
82
|
+
return declarations
|
|
83
|
+
.map((d) => (0, typescript_1.isFunctionDeclaration)(d)
|
|
84
|
+
? getMemberFromFunctionDeclaration(d, checker, baseDir)
|
|
85
|
+
: undefined)
|
|
86
|
+
.filter((d) => d);
|
|
87
|
+
}
|
|
88
|
+
const declaration = member.declarations[0];
|
|
89
|
+
if ((0, typescript_1.isExportSpecifier)(declaration))
|
|
90
|
+
return [getMemberFromExportSpecifier(declaration, baseDir)];
|
|
91
|
+
if ((0, typescript_1.isExportAssignment)(declaration)) {
|
|
92
|
+
return getMembersFromExportAssignment(checker, declaration, baseDir);
|
|
93
|
+
}
|
|
94
|
+
if ((0, typescript_1.isTypeAliasDeclaration)(declaration)) {
|
|
95
|
+
return getMembersFromTypeAliasDeclaration(declaration, checker, baseDir);
|
|
96
|
+
}
|
|
97
|
+
return getMembersFromDeclaration(declaration, checker, baseDir);
|
|
98
|
+
}
|
|
99
|
+
function getDescriptorFromSymbol(symbol, checker, baseDir) {
|
|
100
|
+
if (hasMultipleDeclarations(symbol))
|
|
101
|
+
return undefined;
|
|
102
|
+
const declaration = symbol.declarations[0];
|
|
103
|
+
const tags = (0, tags_1.getSymbolTags)(checker, symbol, baseDir);
|
|
104
|
+
if (!(tags === null || tags === void 0 ? void 0 : tags.length))
|
|
105
|
+
return undefined;
|
|
106
|
+
const id = (0, id_1.getIdFromSymbol)(symbol, baseDir);
|
|
107
|
+
const { isWidget, optionsType, tags: widgetTags, } = (0, widget_parsing_1.parseWidgetExtras)(declaration, tags, checker, baseDir);
|
|
108
|
+
if (!id) {
|
|
109
|
+
throw new Error(`Unable to build ID for ${JSON.stringify(tags)}`);
|
|
110
|
+
}
|
|
111
|
+
const typeParameters = getTypeParameters(checker, symbol, baseDir);
|
|
112
|
+
if (isWidget) {
|
|
113
|
+
return {
|
|
114
|
+
[id_1.ID]: id,
|
|
115
|
+
kind: 'widget',
|
|
116
|
+
exported: true,
|
|
117
|
+
tags: widgetTags,
|
|
118
|
+
typeParameters,
|
|
119
|
+
optionsType,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
[id_1.ID]: id,
|
|
124
|
+
kind: 'option',
|
|
125
|
+
exported: true,
|
|
126
|
+
tags,
|
|
127
|
+
typeParameters,
|
|
128
|
+
optional: false,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function getMembersFromDeclaration(declaration, checker, baseDir) {
|
|
132
|
+
if ((0, typescript_1.isFunctionDeclaration)(declaration)) {
|
|
133
|
+
return [getMemberFromFunctionDeclaration(declaration, checker, baseDir)];
|
|
134
|
+
}
|
|
135
|
+
if ((0, typescript_1.isVariableDeclaration)(declaration) ||
|
|
136
|
+
(0, typescript_1.isTypeLiteralNode)(declaration) ||
|
|
137
|
+
(0, typescript_1.isClassDeclaration)(declaration) ||
|
|
138
|
+
(0, typescript_1.isInterfaceDeclaration)(declaration)) {
|
|
139
|
+
return (0, ts_utils_1.getNestedSymbols)(checker.getTypeAtLocation(declaration))
|
|
140
|
+
.map((s) => {
|
|
141
|
+
const members = getMembersFromSymbol(s, checker, baseDir);
|
|
142
|
+
return members.map((m) => ({ ...m, exported: false }));
|
|
143
|
+
})
|
|
144
|
+
.flat();
|
|
145
|
+
}
|
|
146
|
+
return [];
|
|
147
|
+
}
|
|
148
|
+
function getMemberFromFunctionDeclaration(declaration, checker, baseDir) {
|
|
149
|
+
return {
|
|
150
|
+
[id_1.ID]: (0, id_1.getIdFromNode)(declaration, baseDir),
|
|
151
|
+
kind: 'option',
|
|
152
|
+
exported: true,
|
|
153
|
+
tags: (0, tags_1.getSignatureDeclarationTags)(checker, declaration, baseDir),
|
|
154
|
+
optional: false,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function getMembersFromTypeAliasDeclaration(declaration, checker, targetDir) {
|
|
158
|
+
return getMembersFromPropType(checker.getTypeAtLocation(declaration.type), checker, declaration.getSourceFile().fileName, targetDir);
|
|
159
|
+
}
|
|
160
|
+
function getMembersFromSymbol(symbol, checker, baseDir) {
|
|
161
|
+
if (!symbol.declarations) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
const propDeclarations = [];
|
|
165
|
+
const result = [];
|
|
166
|
+
const id = (0, id_1.getIdFromSymbol)(symbol, baseDir);
|
|
167
|
+
for (const declaration of symbol.declarations) {
|
|
168
|
+
if (!registerDeclaration(declaration)) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if ((0, typescript_1.isMethodDeclaration)(declaration) || (0, typescript_1.isMethodSignature)(declaration)) {
|
|
172
|
+
result.push({
|
|
173
|
+
[id_1.ID]: (0, id_1.getIdFromNode)(declaration, baseDir),
|
|
174
|
+
kind: 'option',
|
|
175
|
+
exported: true,
|
|
176
|
+
tags: (0, tags_1.getSignatureDeclarationTags)(checker, declaration, baseDir),
|
|
177
|
+
optional: (0, ts_utils_1.isOptional)(symbol),
|
|
178
|
+
location: {
|
|
179
|
+
file: (0, utils_1.toInvariantPath)((0, node_path_1.relative)(baseDir, declaration.getSourceFile().fileName)),
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const propType = checker.getTypeAtLocation(declaration);
|
|
185
|
+
if ((0, ts_utils_1.isStructuredType)(propType)) {
|
|
186
|
+
result.push(...getMembersFromPropType(propType, checker, declaration.getSourceFile().fileName, baseDir));
|
|
187
|
+
}
|
|
188
|
+
propDeclarations.push(declaration);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (id && propDeclarations.length !== 0) {
|
|
192
|
+
result.push({
|
|
193
|
+
[id_1.ID]: id,
|
|
194
|
+
kind: 'option',
|
|
195
|
+
exported: true,
|
|
196
|
+
tags: (0, tags_1.getSymbolTags)(checker, symbol, baseDir),
|
|
197
|
+
type: extractType(propDeclarations, checker, baseDir),
|
|
198
|
+
optional: (0, ts_utils_1.isOptional)(symbol),
|
|
199
|
+
location: {
|
|
200
|
+
file: (0, utils_1.toInvariantPath)((0, node_path_1.relative)(baseDir, symbol.declarations[0].getSourceFile().fileName)),
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
206
|
+
function getMembersFromPropType(type, checker, targetFileName, targetDir) {
|
|
207
|
+
const symbols = (0, ts_utils_1.getTypeSymbols)(type);
|
|
208
|
+
const declarations = symbols
|
|
209
|
+
.map((symbol) => symbol.getDeclarations())
|
|
210
|
+
.filter(Boolean)
|
|
211
|
+
.flat()
|
|
212
|
+
.filter((declaration) => targetFileName === declaration.getSourceFile().fileName);
|
|
213
|
+
return declarations.flatMap((declaration) => getMembersFromDeclaration(declaration, checker, targetDir));
|
|
214
|
+
}
|
|
215
|
+
function getMemberFromExportSpecifier(exportSpecifier, baseDir) {
|
|
216
|
+
const adjacentExportSpecifiers = getAdjacentExportSpecifiers(exportSpecifier);
|
|
217
|
+
const isSingleExport = adjacentExportSpecifiers && adjacentExportSpecifiers.length === 1;
|
|
218
|
+
if (!isSingleExport)
|
|
219
|
+
return undefined;
|
|
220
|
+
const declaration = exportSpecifier.parent.parent;
|
|
221
|
+
const tags = (0, typescript_1.getJSDocTags)(declaration);
|
|
222
|
+
if (!(tags === null || tags === void 0 ? void 0 : tags.length))
|
|
223
|
+
return undefined;
|
|
224
|
+
return {
|
|
225
|
+
[id_1.ID]: (0, id_1.getIdFromNode)(exportSpecifier, baseDir),
|
|
226
|
+
kind: 'option',
|
|
227
|
+
exported: true,
|
|
228
|
+
tags: tags.map(tags_1.normalizeTag),
|
|
229
|
+
optional: false,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function getAdjacentExportSpecifiers(node) {
|
|
233
|
+
if (!node.parent)
|
|
234
|
+
return undefined;
|
|
235
|
+
const exportsListNodes = node.parent
|
|
236
|
+
.getChildren()
|
|
237
|
+
.filter((n) => n.kind === typescript_1.SyntaxKind.SyntaxList);
|
|
238
|
+
if (exportsListNodes.length !== 1)
|
|
239
|
+
return undefined;
|
|
240
|
+
return exportsListNodes[0]
|
|
241
|
+
.getChildren()
|
|
242
|
+
.filter((n) => n.kind === typescript_1.SyntaxKind.ExportSpecifier);
|
|
243
|
+
}
|
|
244
|
+
function getMembersFromExportAssignment(checker, declaration, baseDir) {
|
|
245
|
+
const result = [];
|
|
246
|
+
if (declaration.expression.kind !== typescript_1.SyntaxKind.Identifier)
|
|
247
|
+
return result;
|
|
248
|
+
const declarationSymbol = checker.getSymbolAtLocation(declaration.expression);
|
|
249
|
+
const declarationId = (0, id_1.getIdFromSymbol)(declarationSymbol, baseDir);
|
|
250
|
+
if (declarationId &&
|
|
251
|
+
declarationSymbol &&
|
|
252
|
+
!hasMultipleDeclarations(declarationSymbol)) {
|
|
253
|
+
result.push({
|
|
254
|
+
[id_1.ID]: declarationId,
|
|
255
|
+
kind: 'option',
|
|
256
|
+
exported: true,
|
|
257
|
+
tags: (0, tags_1.getSymbolTags)(checker, declarationSymbol, baseDir),
|
|
258
|
+
optional: false,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
const type = checker.getTypeAtLocation(declaration.expression);
|
|
262
|
+
result.push(...getMembersFromPropType(type, checker, declaration.getSourceFile().fileName, baseDir));
|
|
263
|
+
return result;
|
|
264
|
+
}
|
|
265
|
+
function hasMultipleDeclarations(symbol) {
|
|
266
|
+
var _a;
|
|
267
|
+
return ((_a = symbol.getDeclarations()) === null || _a === void 0 ? void 0 : _a.length) > 1;
|
|
268
|
+
}
|
|
269
|
+
const visitedDeclarations = new Set();
|
|
270
|
+
function registerDeclaration(d) {
|
|
271
|
+
const name = `${d.getSourceFile().fileName}|${d.getStart().toString()}`;
|
|
272
|
+
if ((0, ts_type_resolving_1.isExternalDeclaration)(d) || visitedDeclarations.has(name)) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
visitedDeclarations.add(name);
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
function getModuleAndExport(symbol, baseDir) {
|
|
279
|
+
const moduleName = (0, ts_utils_1.getModule)(symbol.declarations[0], baseDir);
|
|
280
|
+
const exportName = symbol.escapedName.toString();
|
|
281
|
+
return [moduleName, exportName];
|
|
282
|
+
}
|
|
283
|
+
function getTypeParameters(checker, member, baseDir) {
|
|
284
|
+
const typeParams = getGenericParameters(member);
|
|
285
|
+
if (!typeParams.length)
|
|
286
|
+
return undefined;
|
|
287
|
+
return Object.fromEntries(typeParams.map((p) => [
|
|
288
|
+
p.name.escapedText.toString(),
|
|
289
|
+
getGenericParamDeclaration(p, checker, baseDir),
|
|
290
|
+
]));
|
|
291
|
+
}
|
|
292
|
+
function extractType(declarations, checker, targetDir) {
|
|
293
|
+
const symbol = extractTypeSymbol(declarations, checker, targetDir);
|
|
294
|
+
const targetFlags = typescript_1.SymbolFlags.Interface |
|
|
295
|
+
typescript_1.SymbolFlags.TypeAlias |
|
|
296
|
+
typescript_1.SymbolFlags.Class |
|
|
297
|
+
typescript_1.SymbolFlags.Enum;
|
|
298
|
+
if ((symbol === null || symbol === void 0 ? void 0 : symbol.flags) & targetFlags) {
|
|
299
|
+
const file = (0, utils_1.toInvariantPath)((0, node_path_1.relative)(targetDir, symbol.declarations[0].getSourceFile().fileName));
|
|
300
|
+
return {
|
|
301
|
+
cat: 'custom',
|
|
302
|
+
name: symbol.name,
|
|
303
|
+
file,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
function extractTypeSymbol(nodes, checker, targetDir) {
|
|
309
|
+
const symbol = (0, ts_utils_1.getTypeSymbol)(checker.getTypeAtLocation(nodes[0]));
|
|
310
|
+
if (!symbol)
|
|
311
|
+
return undefined;
|
|
312
|
+
if (symbol.flags & typescript_1.SymbolFlags.TypeLiteral)
|
|
313
|
+
return undefined;
|
|
314
|
+
if (!symbol.declarations)
|
|
315
|
+
throw new discovering_error_1.DiscoveringError('Unable to find type declaration', nodes);
|
|
316
|
+
const file = (0, node_path_1.relative)(targetDir, symbol.declarations[0].getSourceFile().fileName);
|
|
317
|
+
if (/node_modules\\typescript\\.*\\lib\..*\.d\.ts/.test(file) ||
|
|
318
|
+
/node_modules\/typescript\/.*\/lib\..*\.d\.ts/.test(file))
|
|
319
|
+
return undefined;
|
|
320
|
+
return symbol;
|
|
321
|
+
}
|
|
322
|
+
function getGenericParamDeclaration(genericParam, checker, baseDir) {
|
|
323
|
+
return {
|
|
324
|
+
defaultValue: genericParam.default
|
|
325
|
+
? (0, ts_type_resolving_1.resolveType)(genericParam.default, checker, baseDir)
|
|
326
|
+
: undefined,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function getGenericParameters(member) {
|
|
330
|
+
const declaration = member.declarations[0];
|
|
331
|
+
if (((0, typescript_1.isTypeAliasDeclaration)(declaration) ||
|
|
332
|
+
(0, typescript_1.isInterfaceDeclaration)(declaration)) &&
|
|
333
|
+
declaration.typeParameters) {
|
|
334
|
+
return [...declaration.typeParameters];
|
|
335
|
+
}
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
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C,CAAC,CAAC,CAAC;IAC3C,IACE,CAAC,IAAA,mCAAsB,EAAC,WAAW,CAAC;QAClC,IAAA,mCAAsB,EAAC,WAAW,CAAC,CAAC;QACtC,WAAW,CAAC,cAAc,EAC1B,CAAC;QACD,OAAO,CAAC,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface Standard {
|
|
2
|
+
name: 'string' | 'number' | 'any' | 'Array' | 'Record';
|
|
3
|
+
}
|
|
4
|
+
interface Custom {
|
|
5
|
+
name: string;
|
|
6
|
+
file: string;
|
|
7
|
+
}
|
|
8
|
+
interface Generic {
|
|
9
|
+
params: GeneralType[];
|
|
10
|
+
}
|
|
11
|
+
export type GeneralType = ({
|
|
12
|
+
cat: 'standard';
|
|
13
|
+
} & Standard) | ({
|
|
14
|
+
cat: 'standard-generic';
|
|
15
|
+
} & Standard & Generic) | ({
|
|
16
|
+
cat: 'custom';
|
|
17
|
+
} & Custom) | ({
|
|
18
|
+
cat: 'custom-generic';
|
|
19
|
+
} & Custom & Generic);
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/discoverer/types.ts"],"names":[],"mappings":""}
|
package/ts/logging.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Node } from 'typescript';
|
|
2
|
+
export type Level = keyof typeof levels;
|
|
3
|
+
declare const levels: {
|
|
4
|
+
readonly trace: 5;
|
|
5
|
+
readonly debug: 4;
|
|
6
|
+
readonly info: 3;
|
|
7
|
+
readonly warn: 2;
|
|
8
|
+
readonly error: 1;
|
|
9
|
+
readonly fatal: 0;
|
|
10
|
+
};
|
|
11
|
+
declare const log: (msg: unknown, options?: {
|
|
12
|
+
lvl?: Level;
|
|
13
|
+
node?: Node;
|
|
14
|
+
e?: unknown;
|
|
15
|
+
}) => void, logStart: () => () => void, setLogDir: (dir: string) => void, setAreaName: (areaName: string) => void;
|
|
16
|
+
export { log, logStart, setAreaName, setLogDir };
|
package/ts/logging.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setLogDir = exports.setAreaName = exports.logStart = exports.log = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const node_perf_hooks_1 = require("node:perf_hooks");
|
|
6
|
+
const winston_1 = require("winston");
|
|
7
|
+
const levels = {
|
|
8
|
+
trace: 5,
|
|
9
|
+
debug: 4,
|
|
10
|
+
info: 3,
|
|
11
|
+
warn: 2,
|
|
12
|
+
error: 1,
|
|
13
|
+
fatal: 0,
|
|
14
|
+
};
|
|
15
|
+
const colors = {
|
|
16
|
+
trace: 'white',
|
|
17
|
+
debug: 'white',
|
|
18
|
+
info: 'white',
|
|
19
|
+
warn: 'yellow',
|
|
20
|
+
error: 'red',
|
|
21
|
+
fatal: 'white redBG',
|
|
22
|
+
};
|
|
23
|
+
function init() {
|
|
24
|
+
let errorCount = 0;
|
|
25
|
+
let warnCount = 0;
|
|
26
|
+
let areaName = '';
|
|
27
|
+
let fileName = '';
|
|
28
|
+
const startTime = node_perf_hooks_1.performance.now();
|
|
29
|
+
const separation = '================================================================';
|
|
30
|
+
const logger = (0, winston_1.createLogger)({
|
|
31
|
+
levels,
|
|
32
|
+
format: winston_1.format.combine(winston_1.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSSS' }), winston_1.format.printf((info) => `${info.timestamp} | ${info.level[0].toUpperCase() + info.level.slice(1)} | ${areaName}\n${info.message}`)),
|
|
33
|
+
transports: [
|
|
34
|
+
new winston_1.transports.Console({
|
|
35
|
+
level: 'info',
|
|
36
|
+
format: winston_1.format.colorize({ all: true, colors }),
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
log(message, { lvl = 'info', node, e } = {}) {
|
|
42
|
+
if (lvl === 'warn') {
|
|
43
|
+
warnCount += 1;
|
|
44
|
+
}
|
|
45
|
+
if (lvl === 'error' || lvl === 'fatal') {
|
|
46
|
+
errorCount += 1;
|
|
47
|
+
}
|
|
48
|
+
const paragraphs = [
|
|
49
|
+
typeof message === 'string' ? message : JSON.stringify(message),
|
|
50
|
+
];
|
|
51
|
+
if (node)
|
|
52
|
+
paragraphs.push(stringifyNode(node));
|
|
53
|
+
if (e)
|
|
54
|
+
paragraphs.push(stringifyException(e));
|
|
55
|
+
logger.log(lvl, paragraphs.join('\n\n'));
|
|
56
|
+
},
|
|
57
|
+
setLogDir(dir) {
|
|
58
|
+
fileName = (0, node_path_1.resolve)(dir, 'internal-tools-log.txt');
|
|
59
|
+
logger.info(`Path to log file: ${fileName}`);
|
|
60
|
+
logger.add(new winston_1.transports.File({
|
|
61
|
+
filename: fileName,
|
|
62
|
+
level: 'trace',
|
|
63
|
+
}));
|
|
64
|
+
},
|
|
65
|
+
setAreaName(name) {
|
|
66
|
+
areaName = name;
|
|
67
|
+
},
|
|
68
|
+
logStart() {
|
|
69
|
+
const message = '\n' + `${separation}\n` + `${areaName} Started\n` + `${separation}\n`;
|
|
70
|
+
logger.log('trace', message);
|
|
71
|
+
return () => {
|
|
72
|
+
const elapsed = node_perf_hooks_1.performance.now() - startTime;
|
|
73
|
+
const seconds = Math.floor(elapsed / 1000);
|
|
74
|
+
const milis = Math.round(elapsed % 1000);
|
|
75
|
+
const resultMessage = errorCount > 0 ? 'FAILED' : 'SUCCEEDED';
|
|
76
|
+
const logLevel = errorCount > 0 ? 'error' : 'info';
|
|
77
|
+
const startMessage = '\n' +
|
|
78
|
+
`${separation}\n` +
|
|
79
|
+
`\n${areaName} ${resultMessage}\n` +
|
|
80
|
+
`\nWarnings: ${warnCount}\n` +
|
|
81
|
+
`Errors: ${errorCount}\n` +
|
|
82
|
+
`Elapsed time: ${seconds}.${milis} sec\n` +
|
|
83
|
+
'\n';
|
|
84
|
+
errorCount = 0;
|
|
85
|
+
warnCount = 0;
|
|
86
|
+
logger.log(logLevel, startMessage);
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function stringifyNode(node) {
|
|
92
|
+
const text = `\n${node.getText()}\n\nSyntaxKind: ${node.kind}`;
|
|
93
|
+
const sourceFile = node.getSourceFile();
|
|
94
|
+
if (sourceFile) {
|
|
95
|
+
const pos = sourceFile.getLineAndCharacterOfPosition(node.pos);
|
|
96
|
+
return `${text}\n${sourceFile.fileName}:${pos.line}:${pos.character}`;
|
|
97
|
+
}
|
|
98
|
+
return text;
|
|
99
|
+
}
|
|
100
|
+
function stringifyException(e) {
|
|
101
|
+
if (e instanceof Error)
|
|
102
|
+
return e.message;
|
|
103
|
+
if (typeof e === 'string')
|
|
104
|
+
return e;
|
|
105
|
+
return 'Unknown exception';
|
|
106
|
+
}
|
|
107
|
+
const { log, logStart, setLogDir, setAreaName } = init();
|
|
108
|
+
exports.log = log;
|
|
109
|
+
exports.logStart = logStart;
|
|
110
|
+
exports.setLogDir = setLogDir;
|
|
111
|
+
exports.setAreaName = setAreaName;
|
|
112
|
+
//# sourceMappingURL=logging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../ts/logging.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA8C;AAE9C,qCAA2D;AAK3D,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACA,CAAC;AAEX,MAAM,MAAM,GAA0B;IACpC,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,KAAK,E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M,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,CAAC;AAEhD,kBAAG;AAAE,4BAAQ;AAAe,8BAAS;AAAtB,kCAAW"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompilerOptions } from 'typescript';
|
|
2
|
+
export declare function generateModulesMeta(targetFiles: string[], targetDir: string, output: string, compilerOptions: CompilerOptions | undefined, toolsVersion?: string): void;
|
|
3
|
+
export declare function getModulesData(fileNames: string[], baseDir: string, compilerOptions?: CompilerOptions): Record<string, Record<string, unknown>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateModulesMeta = generateModulesMeta;
|
|
4
|
+
exports.getModulesData = getModulesData;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const typescript_1 = require("typescript");
|
|
7
|
+
const common_resolving_1 = require("../common/common-resolving");
|
|
8
|
+
const ts_utils_1 = require("../common/ts-utils");
|
|
9
|
+
const logging_1 = require("../logging");
|
|
10
|
+
function generateModulesMeta(targetFiles, targetDir, output, compilerOptions, toolsVersion) {
|
|
11
|
+
(0, logging_1.log)('Discovering modules');
|
|
12
|
+
const modulesData = getModulesData(targetFiles, targetDir, compilerOptions);
|
|
13
|
+
const modulesCount = Object.entries(modulesData).length;
|
|
14
|
+
if (!modulesCount)
|
|
15
|
+
throw new Error('No modules found');
|
|
16
|
+
(0, logging_1.log)(`${modulesCount} modules discovered`);
|
|
17
|
+
const metaData = {
|
|
18
|
+
ToolsVersion: toolsVersion,
|
|
19
|
+
Modules: modulesData,
|
|
20
|
+
};
|
|
21
|
+
(0, node_fs_1.writeFileSync)(output, JSON.stringify(metaData, null, 2));
|
|
22
|
+
}
|
|
23
|
+
function getModulesData(fileNames, baseDir, compilerOptions) {
|
|
24
|
+
const program = (0, typescript_1.createProgram)(fileNames, compilerOptions !== null && compilerOptions !== void 0 ? compilerOptions : {});
|
|
25
|
+
const checker = program.getTypeChecker();
|
|
26
|
+
return fileNames.reduce((modules, module) => {
|
|
27
|
+
const sourceFile = program.getSourceFile(module);
|
|
28
|
+
if (!sourceFile) {
|
|
29
|
+
return modules;
|
|
30
|
+
}
|
|
31
|
+
const moduleName = (0, ts_utils_1.getModule)(sourceFile, baseDir);
|
|
32
|
+
if (!moduleName) {
|
|
33
|
+
return modules;
|
|
34
|
+
}
|
|
35
|
+
const fileSymbol = checker.getSymbolAtLocation(sourceFile);
|
|
36
|
+
if (!fileSymbol) {
|
|
37
|
+
return modules;
|
|
38
|
+
}
|
|
39
|
+
const exports = getModuleExports(fileSymbol);
|
|
40
|
+
if (Object.entries(exports).length) {
|
|
41
|
+
modules[moduleName] = exports;
|
|
42
|
+
}
|
|
43
|
+
return modules;
|
|
44
|
+
}, {});
|
|
45
|
+
function getModuleExports(fileSymbol) {
|
|
46
|
+
return checker.getExportsOfModule(fileSymbol).reduce((exports, symbol) => {
|
|
47
|
+
if (hasPublicTags(symbol) || hasDeclarationsWithPublicTags(symbol)) {
|
|
48
|
+
exports[symbol.escapedName.toString()] = {};
|
|
49
|
+
}
|
|
50
|
+
return exports;
|
|
51
|
+
}, {});
|
|
52
|
+
}
|
|
53
|
+
function hasDeclarationsWithPublicTags(symbol) {
|
|
54
|
+
return symbol.declarations.filter(typescript_1.isExportAssignment).some((d) => {
|
|
55
|
+
const exportedSymbol = checker.getSymbolAtLocation(d.expression);
|
|
56
|
+
return !!exportedSymbol && hasPublicTags(exportedSymbol);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function hasPublicTags(symbol) {
|
|
60
|
+
return (0, common_resolving_1.hasTag)(symbol, 'public') || (0, common_resolving_1.hasTag)(symbol, 'docid');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=modules-meta-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules-meta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IACL,CAAC;IAED,SAAS,aAAa,CAAC,MAAc;QACnC,OAAO,IAAA,yBAAM,EAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAA,yBAAM,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
package/ts/program.d.ts
ADDED
package/ts/program.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initProgram = initProgram;
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
|
+
const utils_1 = require("./common/utils");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
const logging_1 = require("./logging");
|
|
8
|
+
function initProgram(area, config) {
|
|
9
|
+
(0, utils_1.ensureDir)(config.args.artifacts);
|
|
10
|
+
(0, logging_1.setLogDir)(config.args.artifacts);
|
|
11
|
+
(0, logging_1.setAreaName)(area);
|
|
12
|
+
(0, logging_1.log)(`Tools version: ${config_1.TOOLS_VERSION}\nTS version: ${typescript_1.version}`);
|
|
13
|
+
(0, logging_1.log)(`Args: ${JSON.stringify(config.args)}`, { lvl: 'debug' });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../ts/program.ts"],"names":[],"mappings":";;AASA,kCASC;AAlBD,2CAAkD;AAElD,0CAA2C;AAC3C,qCAAyC;AACzC,uCAAwD;AAKxD,SAAgB,WAAW,CACzB,IAAY,EACZ,MAAuC;IAEvC,IAAA,iBAAS,EAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,IAAA,mBAAS,EAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,IAAA,qBAAW,EAAC,IAAI,CAAC,CAAC;IAClB,IAAA,aAAG,EAAC,kBAAkB,sBAAa,iBAAiB,oBAAS,EAAE,CAAC,CAAC;IACjE,IAAA,aAAG,EAAC,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAChE,CAAC"}
|