@uapkg/cli 1.4.0 → 1.5.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 +3 -0
- package/dist/build/BuildMetadata.js +2 -2
- package/dist/cli-bootstrap.js +19846 -13
- package/dist/cli.js +1 -1
- package/dist/index.js +19980 -60
- package/dist/licenses/semver-LICENSE +15 -0
- package/dist/profile.js +25 -0
- package/dist/runtime-lock.json +2142 -0
- package/dist/{app → types/uapkg/app}/CompositionRoot.d.ts +4 -5
- package/dist/{app → types/uapkg/app}/UAPKGApplication.d.ts +0 -1
- package/dist/{build → types/uapkg/build}/BuildMetadata.d.ts +1 -2
- package/dist/types/uapkg/cli/DebugEnvironment.d.ts +15 -0
- package/dist/types/uapkg/cli/DebugInfo.d.ts +15 -0
- package/dist/{cli → types/uapkg/cli}/UAPKGCommandLine.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parseCommandLine.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/UAPKGCommandLineParser.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/UAPKGParserRegistry.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/contracts/UAPKGCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/AddCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/ConfigCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/InitCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/InstallCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/LifecycleCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/ListCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/LoginCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/LogoutCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/OutdatedCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/PackCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/ProjectGetNameCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/PublishCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/RegistryCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/RemoveCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/RequestsCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/UpdateCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/WhoamiCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/WhyCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/sharedOptions.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/runUAPKGCLI.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/AddCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/Command.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/ConfigCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/InitCommand.d.ts +1 -2
- package/dist/{commands → types/uapkg/commands}/InstallCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/ListCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/LoginCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/LogoutCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/OutdatedCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PackCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PackageLifecycleCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PostinstallCandidateBuilder.d.ts +2 -3
- package/dist/{commands → types/uapkg/commands}/ProjectGetNameCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PublishCommand.d.ts +1 -2
- package/dist/{commands → types/uapkg/commands}/RegistryCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/RemoveCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/RequestsCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/UpdateCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/WhoamiCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/WhyCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/add/DependencyAddResolver.d.ts +3 -4
- package/dist/{control-plane → types/uapkg/control-plane}/AccountManager.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/ArtifactObserver.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/AuthMetadataStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/AuthStoragePaths.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/AuthenticationSelector.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/ControlPlaneClient.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/ControlPlaneEndpoints.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/ControlPlaneTypes.d.ts +4 -2
- package/dist/{control-plane → types/uapkg/control-plane}/CredentialStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/DPoPKeyStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/GitHubActionsOidcCredentialProvider.d.ts +4 -3
- package/dist/{control-plane → types/uapkg/control-plane}/PublishIdempotencyStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/PublishRequestErrorMapper.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/RegistryGrantLock.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/RegistryTrustResolver.d.ts +0 -1
- package/dist/types/uapkg/control-plane/RequestWatch.d.ts +15 -0
- package/dist/types/uapkg/control-plane/RetryAfter.d.ts +6 -0
- package/dist/{postinstall → types/uapkg/postinstall}/api/PostinstallDsl.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/api/definePostinstall.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/loader/EntryResolver.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/EsbuildTranspiler.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/ExportValidator.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/ModuleImporter.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/PostinstallLoader.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/markers/MarkerBlockEditor.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/markers/MarkerBlockService.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/markers/MarkerIntegrityValidator.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/policy/PostinstallPolicyGate.d.ts +2 -3
- package/dist/{postinstall → types/uapkg/postinstall}/runner/PostinstallOrchestrator.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/BuildCsInjector.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpInjectionEngine.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpStructureAnalyzer.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpStructures.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpWrapperFactory.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/PluginHash.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/PrettyParseError.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/ProjectFileLocator.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/TargetCsInjector.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/UProjectInjector.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/UProjectMetadataReader.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/UnrealSourceCatalog.d.ts +0 -1
- package/dist/{prompts → types/uapkg/prompts}/InkPromptService.d.ts +0 -1
- package/dist/{prompts → types/uapkg/prompts}/ProjectContextDetector.d.ts +1 -2
- package/dist/{prompts → types/uapkg/prompts}/PromptService.d.ts +0 -1
- package/dist/{reporting → types/uapkg/reporting}/DiagnosticDeduplicator.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/DiagnosticRenderer.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/DiagnosticReporter.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/InkDiagnosticRenderer.d.ts +2 -3
- package/dist/{reporting → types/uapkg/reporting}/InstallProgressReporter.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/JsonReporter.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/RegistryRequestTerminalFormatter.d.ts +0 -1
- package/dist/{reporting → types/uapkg/reporting}/TextDiagnosticRenderer.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/TextSink.d.ts +1 -2
- package/dist/types/uapkg-common/format/prettyBytes.d.ts +19 -0
- package/dist/types/uapkg-common/hash/registryIdentifier.d.ts +28 -0
- package/dist/types/uapkg-common/hash/sha256.d.ts +12 -0
- package/dist/types/uapkg-common/index.d.ts +10 -0
- package/dist/types/uapkg-common/json/safeJsonParse.d.ts +9 -0
- package/dist/types/uapkg-common/json/stableStringify.d.ts +9 -0
- package/dist/types/uapkg-common/normalize/normalizeUrl.d.ts +11 -0
- package/dist/types/uapkg-common/paths/forwardSlash.d.ts +12 -0
- package/dist/types/uapkg-common/runtime/UapkgRuntimeProfile.d.ts +19 -0
- package/dist/types/uapkg-common/spec/parsePackageSpec.d.ts +21 -0
- package/dist/types/uapkg-common-schema/brand/Brand.d.ts +15 -0
- package/dist/types/uapkg-common-schema/index.d.ts +17 -0
- package/dist/types/uapkg-common-schema/primitives/AssetHash.d.ts +11 -0
- package/dist/types/uapkg-common-schema/primitives/ConcurrencyCount.d.ts +11 -0
- package/dist/types/uapkg-common-schema/primitives/DurationSeconds.d.ts +11 -0
- package/dist/types/uapkg-common-schema/primitives/GitTree.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/InstallPath.d.ts +18 -0
- package/dist/types/uapkg-common-schema/primitives/OrgName.d.ts +12 -0
- package/dist/types/uapkg-common-schema/primitives/PackageName.d.ts +14 -0
- package/dist/types/uapkg-common-schema/primitives/PackageSpec.d.ts +21 -0
- package/dist/types/uapkg-common-schema/primitives/PackageVersion.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/PostInstallPolicy.d.ts +21 -0
- package/dist/types/uapkg-common-schema/primitives/RegistryIdentifier.d.ts +15 -0
- package/dist/types/uapkg-common-schema/primitives/RegistryName.d.ts +18 -0
- package/dist/types/uapkg-common-schema/primitives/RegistryURL.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/UnixTimestamp.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/VersionRange.d.ts +10 -0
- package/dist/types/uapkg-config/contracts/ConfigTypes.d.ts +58 -0
- package/dist/types/uapkg-config/core/ConfigInstance.d.ts +43 -0
- package/dist/types/uapkg-config/core/ConfigLayerBuilder.d.ts +13 -0
- package/dist/types/uapkg-config/core/ConfigResolver.d.ts +19 -0
- package/dist/types/uapkg-config/core/ConfigSemanticValidator.d.ts +13 -0
- package/dist/types/uapkg-config/core/ConfigWriter.d.ts +25 -0
- package/dist/types/uapkg-config/core/PostInstallPolicyResolver.d.ts +22 -0
- package/dist/types/uapkg-config/factory/createConfig.d.ts +6 -0
- package/dist/types/uapkg-config/files/ConfigFileRepository.d.ts +11 -0
- package/dist/types/uapkg-config/files/ConfigPathResolver.d.ts +14 -0
- package/dist/types/uapkg-config/index.d.ts +127 -0
- package/dist/types/uapkg-config/merge/ConfigMerger.d.ts +10 -0
- package/dist/types/uapkg-config/merge/ConfigSchemaMergeEngine.d.ts +26 -0
- package/dist/types/uapkg-config/schema/configSchema.d.ts +114 -0
- package/dist/types/uapkg-config/schema/pathSchema.d.ts +12 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigCliValueParser.d.ts +18 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigSchemaIntrospection.d.ts +13 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigSchemaRuntime.d.ts +26 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigSchemaRuntimeProvider.d.ts +7 -0
- package/dist/types/uapkg-diagnostics/base/Diagnostic.d.ts +32 -0
- package/dist/types/uapkg-diagnostics/base/DiagnosticBag.d.ts +44 -0
- package/dist/types/uapkg-diagnostics/base/DiagnosticFingerprint.d.ts +12 -0
- package/dist/types/uapkg-diagnostics/base/DiagnosticLevel.d.ts +11 -0
- package/dist/types/uapkg-diagnostics/base/Result.d.ts +26 -0
- package/dist/types/uapkg-diagnostics/config/ConfigDiagnostics.d.ts +49 -0
- package/dist/types/uapkg-diagnostics/controlPlane/ControlPlaneDiagnostics.d.ts +25 -0
- package/dist/types/uapkg-diagnostics/general/GeneralDiagnostics.d.ts +23 -0
- package/dist/types/uapkg-diagnostics/index.d.ts +20 -0
- package/dist/types/uapkg-diagnostics/installer/InstallerDiagnostics.d.ts +55 -0
- package/dist/types/uapkg-diagnostics/manifest/ManifestDiagnostics.d.ts +70 -0
- package/dist/types/uapkg-diagnostics/pack/PackDiagnostics.d.ts +49 -0
- package/dist/types/uapkg-diagnostics/postinstall/PostinstallDiagnostics.d.ts +47 -0
- package/dist/types/uapkg-diagnostics/publishing/PublishingDiagnostics.d.ts +77 -0
- package/dist/types/uapkg-diagnostics/registry/RegistryDiagnostics.d.ts +71 -0
- package/dist/types/uapkg-diagnostics/registryTools/RegistryToolsDiagnostics.d.ts +130 -0
- package/dist/types/uapkg-diagnostics/resolver/ResolverDiagnostics.d.ts +38 -0
- package/dist/types/uapkg-diagnostics/safety/SafetyDiagnostics.d.ts +33 -0
- package/dist/types/uapkg-diagnostics/spec/SpecDiagnostics.d.ts +23 -0
- package/dist/types/uapkg-diagnostics/types.d.ts +37 -0
- package/dist/types/uapkg-diagnostics-format/contracts/FormatterTypes.d.ts +23 -0
- package/dist/types/uapkg-diagnostics-format/defaults/defaultFormatters.d.ts +8 -0
- package/dist/types/uapkg-diagnostics-format/formatters/PlainTextFormatter.d.ts +11 -0
- package/dist/types/uapkg-diagnostics-format/formatters/config/configFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/installer/installerFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/manifest/manifestFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/pack/packFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/postinstall/postinstallFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/publishing/publishingFormatters.d.ts +13 -0
- package/dist/types/uapkg-diagnostics-format/formatters/registry/registryFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/registryTools/registryToolsFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/resolver/resolverFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/safety/safetyFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/spec/specFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/index.d.ts +15 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/configInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/installerInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/manifestInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/packInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/postinstallInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/publishingInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/registryInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/resolverInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/safetyInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/specInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/contracts/InkTypes.d.ts +35 -0
- package/dist/types/uapkg-diagnostics-format/ink/defaults/defaultInkComponents.d.ts +15 -0
- package/dist/types/uapkg-diagnostics-format/ink/index.d.ts +17 -0
- package/dist/types/uapkg-diagnostics-format/ink/primitives/HintLine.d.ts +12 -0
- package/dist/types/uapkg-diagnostics-format/ink/primitives/PlainTextBody.d.ts +11 -0
- package/dist/types/uapkg-diagnostics-format/ink/primitives/SeverityBadge.d.ts +13 -0
- package/dist/types/uapkg-diagnostics-format/ink/registry/DiagnosticInkRegistry.d.ts +24 -0
- package/dist/types/uapkg-diagnostics-format/ink/views/DiagnosticView.d.ts +21 -0
- package/dist/types/uapkg-diagnostics-format/ink/views/DiagnosticsListView.d.ts +16 -0
- package/dist/types/uapkg-diagnostics-format/registry/FormatterRegistry.d.ts +26 -0
- package/dist/types/uapkg-diagnostics-format/utils/indent.d.ts +7 -0
- package/dist/types/uapkg-installer/contracts/InstallerTypes.d.ts +91 -0
- package/dist/types/uapkg-installer/contracts/SafetyPolicyTypes.d.ts +43 -0
- package/dist/types/uapkg-installer/contracts/StatusStreamTypes.d.ts +42 -0
- package/dist/types/uapkg-installer/core/ClaimsVerifier.d.ts +22 -0
- package/dist/types/uapkg-installer/core/DiskStateInspector.d.ts +29 -0
- package/dist/types/uapkg-installer/core/InstallPlanner.d.ts +35 -0
- package/dist/types/uapkg-installer/core/Installer.d.ts +61 -0
- package/dist/types/uapkg-installer/core/IntegrityVerifier.d.ts +16 -0
- package/dist/types/uapkg-installer/core/PackageDownloader.d.ts +40 -0
- package/dist/types/uapkg-installer/core/PackageExtractor.d.ts +20 -0
- package/dist/types/uapkg-installer/core/PackageRemover.d.ts +14 -0
- package/dist/types/uapkg-installer/index.d.ts +16 -0
- package/dist/types/uapkg-installer/safety/NoMarkerPolicy.d.ts +17 -0
- package/dist/types/uapkg-installer/safety/SafetyPolicyRegistry.d.ts +32 -0
- package/dist/types/uapkg-installer/status/SlotTable.d.ts +36 -0
- package/dist/types/uapkg-installer/status/StatusStream.d.ts +25 -0
- package/dist/types/uapkg-log/contracts/LoggerTypes.d.ts +22 -0
- package/dist/types/uapkg-log/core/LogLevelPolicy.d.ts +15 -0
- package/dist/types/uapkg-log/core/LoggerFactory.d.ts +11 -0
- package/dist/types/uapkg-log/core/LoggerInstance.d.ts +17 -0
- package/dist/types/uapkg-log/core/WinstonLoggerAdapter.d.ts +8 -0
- package/dist/types/uapkg-log/index.d.ts +8 -0
- package/dist/types/uapkg-pack/contracts/PackTypes.d.ts +29 -0
- package/dist/types/uapkg-pack/core/FileCrawler.d.ts +12 -0
- package/dist/types/uapkg-pack/core/IgnoreEvaluator.d.ts +7 -0
- package/dist/types/uapkg-pack/core/IgnoreRuleLoader.d.ts +14 -0
- package/dist/types/uapkg-pack/core/IntegrityWriter.d.ts +6 -0
- package/dist/types/uapkg-pack/core/LFSPointerDetector.d.ts +6 -0
- package/dist/types/uapkg-pack/core/PackArtifactExcluder.d.ts +11 -0
- package/dist/types/uapkg-pack/core/PackManifestReader.d.ts +8 -0
- package/dist/types/uapkg-pack/core/PackService.d.ts +32 -0
- package/dist/types/uapkg-pack/core/PluginDescriptorGuard.d.ts +11 -0
- package/dist/types/uapkg-pack/core/PluginRootResolver.d.ts +14 -0
- package/dist/types/uapkg-pack/core/TarArchiveWriter.d.ts +11 -0
- package/dist/types/uapkg-pack/index.d.ts +7 -0
- package/dist/types/uapkg-package-claims/archive/PackagedManifestReader.d.ts +28 -0
- package/dist/types/uapkg-package-claims/claims/ClaimsComparison.d.ts +44 -0
- package/dist/types/uapkg-package-claims/claims/PackageClaims.d.ts +9 -0
- package/dist/types/uapkg-package-claims/index.d.ts +7 -0
- package/dist/types/uapkg-package-claims/json/CanonicalJson.d.ts +17 -0
- package/dist/types/uapkg-package-claims/schema/PackageClaimsSchema.d.ts +27 -0
- package/dist/types/uapkg-package-claims/schema/index.d.ts +2 -0
- package/dist/types/uapkg-package-manifest/contracts/ManifestTypes.d.ts +37 -0
- package/dist/types/uapkg-package-manifest/core/DependencyMutator.d.ts +48 -0
- package/dist/types/uapkg-package-manifest/core/DevDependencyPolicy.d.ts +30 -0
- package/dist/types/uapkg-package-manifest/core/InstallPathResolver.d.ts +35 -0
- package/dist/types/uapkg-package-manifest/core/LockfileDiffer.d.ts +40 -0
- package/dist/types/uapkg-package-manifest/core/LockfileSyncIssue.d.ts +11 -0
- package/dist/types/uapkg-package-manifest/core/LockfileSyncValidator.d.ts +26 -0
- package/dist/types/uapkg-package-manifest/core/OutdatedChecker.d.ts +36 -0
- package/dist/types/uapkg-package-manifest/core/PackageManifest.d.ts +63 -0
- package/dist/types/uapkg-package-manifest/core/WhyGraph.d.ts +31 -0
- package/dist/types/uapkg-package-manifest/index.d.ts +18 -0
- package/dist/types/uapkg-package-manifest/io/LockfileReader.d.ts +12 -0
- package/dist/types/uapkg-package-manifest/io/LockfileSyncIssueWriter.d.ts +12 -0
- package/dist/types/uapkg-package-manifest/io/LockfileWriter.d.ts +11 -0
- package/dist/types/uapkg-package-manifest/io/ManifestReader.d.ts +12 -0
- package/dist/types/uapkg-package-manifest/io/ManifestWriter.d.ts +13 -0
- package/dist/types/uapkg-package-manifest/resolver/LockfileSync.d.ts +13 -0
- package/dist/types/uapkg-package-manifest/resolver/Resolver.d.ts +16 -0
- package/dist/types/uapkg-package-manifest-schema/index.d.ts +10 -0
- package/dist/types/uapkg-package-manifest-schema/lockfile/LockDependencySchema.d.ts +15 -0
- package/dist/types/uapkg-package-manifest-schema/lockfile/LockfileSchema.d.ts +22 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/BaseManifestSchema.d.ts +56 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/DependencySchema.d.ts +57 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/ManifestKind.d.ts +17 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/ManifestSchema.d.ts +106 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/PluginManifestSchema.d.ts +52 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/ProjectManifestSchema.d.ts +80 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/PublishSchema.d.ts +15 -0
- package/dist/types/uapkg-registry-core/contracts/RegistryCoreTypes.d.ts +54 -0
- package/dist/types/uapkg-registry-core/core/RegistryCore.d.ts +26 -0
- package/dist/types/uapkg-registry-core/index.d.ts +14 -0
- package/dist/types/uapkg-registry-core/paths/RegistryPaths.d.ts +15 -0
- package/dist/types/uapkg-registry-core/registry/GitRunner.d.ts +31 -0
- package/dist/types/uapkg-registry-core/registry/Registry.d.ts +46 -0
- package/dist/types/uapkg-registry-core/registry/RegistryCacheValidator.d.ts +21 -0
- package/dist/types/uapkg-registry-core/registry/RegistryLock.d.ts +27 -0
- package/dist/types/uapkg-registry-core/registry/RegistryMetadataReader.d.ts +18 -0
- package/dist/types/uapkg-registry-core/registry/RegistryPackageReader.d.ts +24 -0
- package/dist/types/uapkg-registry-core/registry/RegistrySyncPolicy.d.ts +14 -0
- package/dist/types/uapkg-registry-core/registry/RegistryUpdater.d.ts +23 -0
- package/dist/types/uapkg-registry-core/registry/RegistryUrlSanitizer.d.ts +10 -0
- package/dist/types/uapkg-registry-core/resolution/PackageResolver.d.ts +21 -0
- package/dist/types/uapkg-registry-core/resolution/SemverSelectionPolicy.d.ts +36 -0
- package/dist/types/uapkg-registry-schema/index.d.ts +9 -0
- package/dist/types/uapkg-registry-schema/paths/RegistryPackagePath.d.ts +15 -0
- package/dist/types/uapkg-registry-schema/schemas/IntegritySchema.d.ts +12 -0
- package/dist/types/uapkg-registry-schema/schemas/PackageRegistryManifestSchema.d.ts +108 -0
- package/dist/types/uapkg-registry-schema/schemas/PackageSourceSchema.d.ts +12 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryAssetSchema.d.ts +15 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryDependencySchema.d.ts +36 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryMetaSchema.d.ts +29 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryVersionSchema.d.ts +71 -0
- package/dist/types/uapkg-registry-tools/aggregator/RegistryToolsAggregator.d.ts +45 -0
- package/dist/types/uapkg-registry-tools/contracts/RegistryToolsTypes.d.ts +116 -0
- package/dist/types/uapkg-registry-tools/index.d.ts +18 -0
- package/dist/types/uapkg-registry-tools/io/IntegrityCalculator.d.ts +20 -0
- package/dist/types/uapkg-registry-tools/io/ManifestStore.d.ts +41 -0
- package/dist/types/uapkg-registry-tools/listing/PackageLister.d.ts +22 -0
- package/dist/types/uapkg-registry-tools/mutation/AddPackageVersionPlanner.d.ts +25 -0
- package/dist/types/uapkg-registry-tools/mutation/RemovePackagePlanner.d.ts +22 -0
- package/dist/types/uapkg-registry-tools/mutation/RemovePackageVersionPlanner.d.ts +21 -0
- package/dist/types/uapkg-registry-tools/mutation/VersionSorter.d.ts +10 -0
- package/dist/types/uapkg-registry-tools/paths/RegistryRepoPaths.d.ts +23 -0
- package/dist/types/uapkg-registry-tools/tools/RegistryTools.d.ts +64 -0
- package/dist/types/uapkg-registry-tools/validation/DependencyReachabilityValidator.d.ts +24 -0
- package/dist/types/uapkg-registry-tools/validation/ExternalRegistryPolicyValidator.d.ts +22 -0
- package/dist/types/uapkg-registry-tools/validation/ManifestValidator.d.ts +16 -0
- package/dist/types/uapkg-registry-tools/validation/OfficialRegistryPolicyValidator.d.ts +34 -0
- package/dist/types/uapkg-registry-tools/validation/RegistryValidator.d.ts +31 -0
- package/dist/types/uapkg-registry-tools/validation/ReleaseFileNameValidator.d.ts +21 -0
- package/package.json +21 -48
- package/dist/app/CompositionRoot.d.ts.map +0 -1
- package/dist/app/CompositionRoot.js +0 -93
- package/dist/app/CompositionRoot.js.map +0 -1
- package/dist/app/UAPKGApplication.d.ts.map +0 -1
- package/dist/app/UAPKGApplication.js +0 -157
- package/dist/app/UAPKGApplication.js.map +0 -1
- package/dist/build/BuildMetadata.d.ts.map +0 -1
- package/dist/cli/UAPKGCommandLine.d.ts.map +0 -1
- package/dist/cli/UAPKGCommandLine.js +0 -250
- package/dist/cli/UAPKGCommandLine.js.map +0 -1
- package/dist/cli/parseCommandLine.d.ts.map +0 -1
- package/dist/cli/parseCommandLine.js +0 -11
- package/dist/cli/parseCommandLine.js.map +0 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.d.ts.map +0 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.js +0 -24
- package/dist/cli/parsing/UAPKGCommandLineParser.js.map +0 -1
- package/dist/cli/parsing/UAPKGParserRegistry.d.ts.map +0 -1
- package/dist/cli/parsing/UAPKGParserRegistry.js +0 -54
- package/dist/cli/parsing/UAPKGParserRegistry.js.map +0 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.js +0 -1
- package/dist/cli/parsing/modules/AddCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/AddCommandModule.js +0 -50
- package/dist/cli/parsing/modules/AddCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.js +0 -88
- package/dist/cli/parsing/modules/ConfigCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/InitCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/InitCommandModule.js +0 -26
- package/dist/cli/parsing/modules/InitCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/InstallCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/InstallCommandModule.js +0 -37
- package/dist/cli/parsing/modules/InstallCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.js +0 -84
- package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/ListCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/ListCommandModule.js +0 -27
- package/dist/cli/parsing/modules/ListCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/LoginCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/LoginCommandModule.js +0 -35
- package/dist/cli/parsing/modules/LoginCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.js +0 -31
- package/dist/cli/parsing/modules/LogoutCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.js +0 -22
- package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/PackCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/PackCommandModule.js +0 -31
- package/dist/cli/parsing/modules/PackCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js +0 -15
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/PublishCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/PublishCommandModule.js +0 -66
- package/dist/cli/parsing/modules/PublishCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.js +0 -118
- package/dist/cli/parsing/modules/RegistryCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.js +0 -26
- package/dist/cli/parsing/modules/RemoveCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.js +0 -59
- package/dist/cli/parsing/modules/RequestsCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.js +0 -39
- package/dist/cli/parsing/modules/UpdateCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.js +0 -31
- package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/WhyCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/WhyCommandModule.js +0 -26
- package/dist/cli/parsing/modules/WhyCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/sharedOptions.d.ts.map +0 -1
- package/dist/cli/parsing/modules/sharedOptions.js +0 -21
- package/dist/cli/parsing/modules/sharedOptions.js.map +0 -1
- package/dist/cli/runUAPKGCLI.d.ts.map +0 -1
- package/dist/cli/runUAPKGCLI.js +0 -12
- package/dist/cli/runUAPKGCLI.js.map +0 -1
- package/dist/cli-bootstrap.js.map +0 -1
- package/dist/commands/AddCommand.d.ts.map +0 -1
- package/dist/commands/AddCommand.js +0 -51
- package/dist/commands/AddCommand.js.map +0 -1
- package/dist/commands/Command.d.ts.map +0 -1
- package/dist/commands/Command.js +0 -1
- package/dist/commands/ConfigCommand.d.ts.map +0 -1
- package/dist/commands/ConfigCommand.js +0 -166
- package/dist/commands/ConfigCommand.js.map +0 -1
- package/dist/commands/InitCommand.d.ts.map +0 -1
- package/dist/commands/InitCommand.js +0 -66
- package/dist/commands/InitCommand.js.map +0 -1
- package/dist/commands/InstallCommand.d.ts.map +0 -1
- package/dist/commands/InstallCommand.js +0 -120
- package/dist/commands/InstallCommand.js.map +0 -1
- package/dist/commands/ListCommand.d.ts.map +0 -1
- package/dist/commands/ListCommand.js +0 -78
- package/dist/commands/ListCommand.js.map +0 -1
- package/dist/commands/LoginCommand.d.ts.map +0 -1
- package/dist/commands/LoginCommand.js +0 -67
- package/dist/commands/LoginCommand.js.map +0 -1
- package/dist/commands/LogoutCommand.d.ts.map +0 -1
- package/dist/commands/LogoutCommand.js +0 -37
- package/dist/commands/LogoutCommand.js.map +0 -1
- package/dist/commands/OutdatedCommand.d.ts.map +0 -1
- package/dist/commands/OutdatedCommand.js +0 -43
- package/dist/commands/OutdatedCommand.js.map +0 -1
- package/dist/commands/PackCommand.d.ts.map +0 -1
- package/dist/commands/PackCommand.js +0 -27
- package/dist/commands/PackCommand.js.map +0 -1
- package/dist/commands/PackageLifecycleCommand.d.ts.map +0 -1
- package/dist/commands/PackageLifecycleCommand.js +0 -149
- package/dist/commands/PackageLifecycleCommand.js.map +0 -1
- package/dist/commands/PostinstallCandidateBuilder.d.ts.map +0 -1
- package/dist/commands/PostinstallCandidateBuilder.js +0 -44
- package/dist/commands/PostinstallCandidateBuilder.js.map +0 -1
- package/dist/commands/ProjectGetNameCommand.d.ts.map +0 -1
- package/dist/commands/ProjectGetNameCommand.js +0 -26
- package/dist/commands/ProjectGetNameCommand.js.map +0 -1
- package/dist/commands/PublishCommand.d.ts.map +0 -1
- package/dist/commands/PublishCommand.js +0 -259
- package/dist/commands/PublishCommand.js.map +0 -1
- package/dist/commands/RegistryCommand.d.ts.map +0 -1
- package/dist/commands/RegistryCommand.js +0 -197
- package/dist/commands/RegistryCommand.js.map +0 -1
- package/dist/commands/RemoveCommand.d.ts.map +0 -1
- package/dist/commands/RemoveCommand.js +0 -48
- package/dist/commands/RemoveCommand.js.map +0 -1
- package/dist/commands/RequestsCommand.d.ts.map +0 -1
- package/dist/commands/RequestsCommand.js +0 -85
- package/dist/commands/RequestsCommand.js.map +0 -1
- package/dist/commands/UpdateCommand.d.ts.map +0 -1
- package/dist/commands/UpdateCommand.js +0 -113
- package/dist/commands/UpdateCommand.js.map +0 -1
- package/dist/commands/WhoamiCommand.d.ts.map +0 -1
- package/dist/commands/WhoamiCommand.js +0 -66
- package/dist/commands/WhoamiCommand.js.map +0 -1
- package/dist/commands/WhyCommand.d.ts.map +0 -1
- package/dist/commands/WhyCommand.js +0 -47
- package/dist/commands/WhyCommand.js.map +0 -1
- package/dist/commands/add/DependencyAddResolver.d.ts.map +0 -1
- package/dist/commands/add/DependencyAddResolver.js +0 -38
- package/dist/commands/add/DependencyAddResolver.js.map +0 -1
- package/dist/control-plane/AccountManager.d.ts.map +0 -1
- package/dist/control-plane/AccountManager.js +0 -822
- package/dist/control-plane/AccountManager.js.map +0 -1
- package/dist/control-plane/ArtifactObserver.d.ts.map +0 -1
- package/dist/control-plane/ArtifactObserver.js +0 -77
- package/dist/control-plane/ArtifactObserver.js.map +0 -1
- package/dist/control-plane/AuthMetadataStore.d.ts.map +0 -1
- package/dist/control-plane/AuthMetadataStore.js +0 -114
- package/dist/control-plane/AuthMetadataStore.js.map +0 -1
- package/dist/control-plane/AuthStoragePaths.d.ts.map +0 -1
- package/dist/control-plane/AuthStoragePaths.js +0 -22
- package/dist/control-plane/AuthStoragePaths.js.map +0 -1
- package/dist/control-plane/AuthenticationSelector.d.ts.map +0 -1
- package/dist/control-plane/AuthenticationSelector.js +0 -70
- package/dist/control-plane/AuthenticationSelector.js.map +0 -1
- package/dist/control-plane/ControlPlaneClient.d.ts.map +0 -1
- package/dist/control-plane/ControlPlaneClient.js +0 -291
- package/dist/control-plane/ControlPlaneClient.js.map +0 -1
- package/dist/control-plane/ControlPlaneEndpoints.d.ts.map +0 -1
- package/dist/control-plane/ControlPlaneEndpoints.js +0 -24
- package/dist/control-plane/ControlPlaneEndpoints.js.map +0 -1
- package/dist/control-plane/ControlPlaneTypes.d.ts.map +0 -1
- package/dist/control-plane/ControlPlaneTypes.js +0 -100
- package/dist/control-plane/ControlPlaneTypes.js.map +0 -1
- package/dist/control-plane/CredentialStore.d.ts.map +0 -1
- package/dist/control-plane/CredentialStore.js +0 -70
- package/dist/control-plane/CredentialStore.js.map +0 -1
- package/dist/control-plane/DPoPKeyStore.d.ts.map +0 -1
- package/dist/control-plane/DPoPKeyStore.js +0 -58
- package/dist/control-plane/DPoPKeyStore.js.map +0 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts.map +0 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js +0 -201
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +0 -1
- package/dist/control-plane/PublishIdempotencyStore.d.ts.map +0 -1
- package/dist/control-plane/PublishIdempotencyStore.js +0 -100
- package/dist/control-plane/PublishIdempotencyStore.js.map +0 -1
- package/dist/control-plane/PublishRequestErrorMapper.d.ts.map +0 -1
- package/dist/control-plane/PublishRequestErrorMapper.js +0 -597
- package/dist/control-plane/PublishRequestErrorMapper.js.map +0 -1
- package/dist/control-plane/RegistryGrantLock.d.ts.map +0 -1
- package/dist/control-plane/RegistryGrantLock.js +0 -163
- package/dist/control-plane/RegistryGrantLock.js.map +0 -1
- package/dist/control-plane/RegistryTrustResolver.d.ts.map +0 -1
- package/dist/control-plane/RegistryTrustResolver.js +0 -105
- package/dist/control-plane/RegistryTrustResolver.js.map +0 -1
- package/dist/postinstall/api/PostinstallDsl.d.ts.map +0 -1
- package/dist/postinstall/api/PostinstallDsl.js +0 -36
- package/dist/postinstall/api/PostinstallDsl.js.map +0 -1
- package/dist/postinstall/api/definePostinstall.d.ts.map +0 -1
- package/dist/postinstall/api/definePostinstall.js +0 -23
- package/dist/postinstall/api/definePostinstall.js.map +0 -1
- package/dist/postinstall/index.js +0 -25
- package/dist/postinstall/loader/EntryResolver.d.ts.map +0 -1
- package/dist/postinstall/loader/EntryResolver.js +0 -39
- package/dist/postinstall/loader/EntryResolver.js.map +0 -1
- package/dist/postinstall/loader/EsbuildTranspiler.d.ts.map +0 -1
- package/dist/postinstall/loader/EsbuildTranspiler.js +0 -54
- package/dist/postinstall/loader/EsbuildTranspiler.js.map +0 -1
- package/dist/postinstall/loader/ExportValidator.d.ts.map +0 -1
- package/dist/postinstall/loader/ExportValidator.js +0 -38
- package/dist/postinstall/loader/ExportValidator.js.map +0 -1
- package/dist/postinstall/loader/ModuleImporter.d.ts.map +0 -1
- package/dist/postinstall/loader/ModuleImporter.js +0 -52
- package/dist/postinstall/loader/ModuleImporter.js.map +0 -1
- package/dist/postinstall/loader/PostinstallLoader.d.ts.map +0 -1
- package/dist/postinstall/loader/PostinstallLoader.js +0 -64
- package/dist/postinstall/loader/PostinstallLoader.js.map +0 -1
- package/dist/postinstall/markers/MarkerBlockEditor.d.ts.map +0 -1
- package/dist/postinstall/markers/MarkerBlockEditor.js +0 -50
- package/dist/postinstall/markers/MarkerBlockEditor.js.map +0 -1
- package/dist/postinstall/markers/MarkerBlockService.d.ts.map +0 -1
- package/dist/postinstall/markers/MarkerBlockService.js +0 -46
- package/dist/postinstall/markers/MarkerBlockService.js.map +0 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts.map +0 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.js +0 -48
- package/dist/postinstall/markers/MarkerIntegrityValidator.js.map +0 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.d.ts.map +0 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.js +0 -68
- package/dist/postinstall/policy/PostinstallPolicyGate.js.map +0 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.d.ts.map +0 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.js +0 -174
- package/dist/postinstall/runner/PostinstallOrchestrator.js.map +0 -1
- package/dist/postinstall/unreal/BuildCsInjector.d.ts.map +0 -1
- package/dist/postinstall/unreal/BuildCsInjector.js +0 -60
- package/dist/postinstall/unreal/BuildCsInjector.js.map +0 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.js +0 -58
- package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +0 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js +0 -126
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +0 -1
- package/dist/postinstall/unreal/CSharpStructures.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpStructures.js +0 -1
- package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpWrapperFactory.js +0 -56
- package/dist/postinstall/unreal/CSharpWrapperFactory.js.map +0 -1
- package/dist/postinstall/unreal/PluginHash.d.ts.map +0 -1
- package/dist/postinstall/unreal/PluginHash.js +0 -18
- package/dist/postinstall/unreal/PluginHash.js.map +0 -1
- package/dist/postinstall/unreal/PrettyParseError.d.ts.map +0 -1
- package/dist/postinstall/unreal/PrettyParseError.js +0 -43
- package/dist/postinstall/unreal/PrettyParseError.js.map +0 -1
- package/dist/postinstall/unreal/ProjectFileLocator.d.ts.map +0 -1
- package/dist/postinstall/unreal/ProjectFileLocator.js +0 -51
- package/dist/postinstall/unreal/ProjectFileLocator.js.map +0 -1
- package/dist/postinstall/unreal/TargetCsInjector.d.ts.map +0 -1
- package/dist/postinstall/unreal/TargetCsInjector.js +0 -60
- package/dist/postinstall/unreal/TargetCsInjector.js.map +0 -1
- package/dist/postinstall/unreal/UProjectInjector.d.ts.map +0 -1
- package/dist/postinstall/unreal/UProjectInjector.js +0 -58
- package/dist/postinstall/unreal/UProjectInjector.js.map +0 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.d.ts.map +0 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.js +0 -24
- package/dist/postinstall/unreal/UProjectMetadataReader.js.map +0 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts.map +0 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.js +0 -52
- package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +0 -1
- package/dist/prompts/InkPromptService.d.ts.map +0 -1
- package/dist/prompts/InkPromptService.js +0 -105
- package/dist/prompts/InkPromptService.js.map +0 -1
- package/dist/prompts/ProjectContextDetector.d.ts.map +0 -1
- package/dist/prompts/ProjectContextDetector.js +0 -33
- package/dist/prompts/ProjectContextDetector.js.map +0 -1
- package/dist/prompts/PromptService.d.ts.map +0 -1
- package/dist/prompts/PromptService.js +0 -1
- package/dist/reporting/DiagnosticDeduplicator.d.ts.map +0 -1
- package/dist/reporting/DiagnosticDeduplicator.js +0 -38
- package/dist/reporting/DiagnosticDeduplicator.js.map +0 -1
- package/dist/reporting/DiagnosticRenderer.d.ts.map +0 -1
- package/dist/reporting/DiagnosticRenderer.js +0 -1
- package/dist/reporting/DiagnosticReporter.d.ts.map +0 -1
- package/dist/reporting/DiagnosticReporter.js +0 -42
- package/dist/reporting/DiagnosticReporter.js.map +0 -1
- package/dist/reporting/InkDiagnosticRenderer.d.ts.map +0 -1
- package/dist/reporting/InkDiagnosticRenderer.js +0 -52
- package/dist/reporting/InkDiagnosticRenderer.js.map +0 -1
- package/dist/reporting/InstallProgressReporter.d.ts.map +0 -1
- package/dist/reporting/InstallProgressReporter.js +0 -50
- package/dist/reporting/InstallProgressReporter.js.map +0 -1
- package/dist/reporting/JsonReporter.d.ts.map +0 -1
- package/dist/reporting/JsonReporter.js +0 -36
- package/dist/reporting/JsonReporter.js.map +0 -1
- package/dist/reporting/RegistryRequestTerminalFormatter.d.ts.map +0 -1
- package/dist/reporting/RegistryRequestTerminalFormatter.js +0 -90
- package/dist/reporting/RegistryRequestTerminalFormatter.js.map +0 -1
- package/dist/reporting/TextDiagnosticRenderer.d.ts.map +0 -1
- package/dist/reporting/TextDiagnosticRenderer.js +0 -38
- package/dist/reporting/TextDiagnosticRenderer.js.map +0 -1
- package/dist/reporting/TextSink.d.ts.map +0 -1
- package/dist/reporting/TextSink.js +0 -29
- package/dist/reporting/TextSink.js.map +0 -1
- /package/dist/{cli-bootstrap.d.ts → types/uapkg/cli-bootstrap.d.ts} +0 -0
- /package/dist/{index.d.ts → types/uapkg/index.d.ts} +0 -0
- /package/dist/{postinstall → types/uapkg/postinstall}/index.d.ts +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { PostinstallLoader } from "../loader/PostinstallLoader.js";
|
|
2
|
-
import { PostinstallPolicyGate } from "../policy/PostinstallPolicyGate.js";
|
|
3
|
-
import { BuildCsInjector } from "../unreal/BuildCsInjector.js";
|
|
4
|
-
import { ProjectFileLocator } from "../unreal/ProjectFileLocator.js";
|
|
5
|
-
import { TargetCsInjector } from "../unreal/TargetCsInjector.js";
|
|
6
|
-
import { UnrealSourceCatalogBuilder } from "../unreal/UnrealSourceCatalog.js";
|
|
7
|
-
import { UProjectInjector } from "../unreal/UProjectInjector.js";
|
|
8
|
-
import { UProjectMetadataReader } from "../unreal/UProjectMetadataReader.js";
|
|
9
|
-
import { DiagnosticBag, createIoErrorDiagnostic, createUnknownErrorDiagnostic } from "@uapkg/diagnostics";
|
|
10
|
-
|
|
11
|
-
//#region src/postinstall/runner/PostinstallOrchestrator.ts
|
|
12
|
-
/**
|
|
13
|
-
* Top-level postinstall flow:
|
|
14
|
-
*
|
|
15
|
-
* 1. Fast path: if the host is a plugin manifest, nothing runs.
|
|
16
|
-
* 2. For each candidate plugin:
|
|
17
|
-
* a. PolicyGate decides allow/deny. Deny → info diagnostic, skip.
|
|
18
|
-
* b. Loader locates + transpiles + imports + validates the script.
|
|
19
|
-
* c. Accumulate `(plugin, definition)` pairs into a plan.
|
|
20
|
-
* 3. Build a single {@link UnrealSourceCatalog} covering every module
|
|
21
|
-
* any script wants to touch.
|
|
22
|
-
* 4. Apply injectors idempotently per zone.
|
|
23
|
-
*
|
|
24
|
-
* Always returns a {@link Result}; never throws. The caller inspects
|
|
25
|
-
* `diagnostics` to render errors/warnings/info lines.
|
|
26
|
-
*/
|
|
27
|
-
var PostinstallOrchestrator = class {
|
|
28
|
-
loader;
|
|
29
|
-
policy;
|
|
30
|
-
catalogBuilder;
|
|
31
|
-
buildInjector;
|
|
32
|
-
targetInjector;
|
|
33
|
-
projectInjector;
|
|
34
|
-
projectFileLocator;
|
|
35
|
-
uprojectReader;
|
|
36
|
-
constructor(loader = new PostinstallLoader(), policy = new PostinstallPolicyGate(), catalogBuilder = new UnrealSourceCatalogBuilder(), buildInjector = new BuildCsInjector(), targetInjector = new TargetCsInjector(), projectInjector = new UProjectInjector(), projectFileLocator = new ProjectFileLocator(), uprojectReader = new UProjectMetadataReader()) {
|
|
37
|
-
this.loader = loader;
|
|
38
|
-
this.policy = policy;
|
|
39
|
-
this.catalogBuilder = catalogBuilder;
|
|
40
|
-
this.buildInjector = buildInjector;
|
|
41
|
-
this.targetInjector = targetInjector;
|
|
42
|
-
this.projectInjector = projectInjector;
|
|
43
|
-
this.projectFileLocator = projectFileLocator;
|
|
44
|
-
this.uprojectReader = uprojectReader;
|
|
45
|
-
}
|
|
46
|
-
async run(input) {
|
|
47
|
-
const bag = new DiagnosticBag();
|
|
48
|
-
const executed = [];
|
|
49
|
-
const skipped = [];
|
|
50
|
-
if (input.manifestType !== "project" || input.candidates.length === 0) return bag.toResult({
|
|
51
|
-
executed,
|
|
52
|
-
skipped
|
|
53
|
-
});
|
|
54
|
-
const plan = await this.buildPlan(input.candidates, bag, skipped);
|
|
55
|
-
if (plan.length === 0) return bag.toResult({
|
|
56
|
-
executed,
|
|
57
|
-
skipped
|
|
58
|
-
});
|
|
59
|
-
const catalogResult = this.buildCatalog(input.projectRoot, plan, input.moduleNameOverride);
|
|
60
|
-
if (!catalogResult.ok) {
|
|
61
|
-
bag.mergeArray(catalogResult.diagnostics);
|
|
62
|
-
return bag.toFailure();
|
|
63
|
-
}
|
|
64
|
-
const { catalog, moduleNames } = catalogResult.value;
|
|
65
|
-
for (const entry of plan) if (this.applyScript(input.projectRoot, entry, catalog, moduleNames, bag)) executed.push(entry.loaded.packageName);
|
|
66
|
-
return bag.toResult({
|
|
67
|
-
executed,
|
|
68
|
-
skipped
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async buildPlan(candidates, bag, skipped) {
|
|
72
|
-
const plan = [];
|
|
73
|
-
for (const candidate of candidates) {
|
|
74
|
-
const decision = this.policy.evaluate(candidate.packageName, candidate.registry);
|
|
75
|
-
if (!decision.allowed) {
|
|
76
|
-
if (decision.denialDiagnostic) bag.add(decision.denialDiagnostic);
|
|
77
|
-
skipped.push({
|
|
78
|
-
packageName: candidate.packageName,
|
|
79
|
-
reason: "policy-denied"
|
|
80
|
-
});
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
const loaded = await this.loader.load(candidate.packageName, candidate.pluginRoot);
|
|
84
|
-
bag.mergeArray(loaded.diagnostics);
|
|
85
|
-
if (!loaded.ok) continue;
|
|
86
|
-
if (loaded.value === null) {
|
|
87
|
-
skipped.push({
|
|
88
|
-
packageName: candidate.packageName,
|
|
89
|
-
reason: "no-script"
|
|
90
|
-
});
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
plan.push({
|
|
94
|
-
candidate,
|
|
95
|
-
loaded: loaded.value
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return plan;
|
|
99
|
-
}
|
|
100
|
-
buildCatalog(projectRoot, plan, moduleNameOverride) {
|
|
101
|
-
const hasModuleSetup = plan.some((entry) => Boolean(entry.loaded.definition.setupModules));
|
|
102
|
-
let moduleNames = [];
|
|
103
|
-
if (hasModuleSetup) {
|
|
104
|
-
if (moduleNameOverride !== void 0) moduleNames = moduleNameOverride;
|
|
105
|
-
else try {
|
|
106
|
-
const uprojectPath = this.projectFileLocator.findProjectFile(projectRoot);
|
|
107
|
-
moduleNames = this.uprojectReader.readModuleNames(uprojectPath);
|
|
108
|
-
} catch (error) {
|
|
109
|
-
return {
|
|
110
|
-
ok: false,
|
|
111
|
-
diagnostics: [createIoErrorDiagnostic(projectRoot, error instanceof Error ? error.message : String(error))]
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
return {
|
|
117
|
-
ok: true,
|
|
118
|
-
value: {
|
|
119
|
-
catalog: this.catalogBuilder.build(projectRoot, moduleNames),
|
|
120
|
-
moduleNames
|
|
121
|
-
},
|
|
122
|
-
diagnostics: []
|
|
123
|
-
};
|
|
124
|
-
} catch (error) {
|
|
125
|
-
return {
|
|
126
|
-
ok: false,
|
|
127
|
-
diagnostics: [createUnknownErrorDiagnostic(error instanceof Error ? error.message : String(error))]
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
applyScript(projectRoot, entry, catalog, moduleNames, bag) {
|
|
132
|
-
const { loaded } = entry;
|
|
133
|
-
const def = loaded.definition;
|
|
134
|
-
let anyFailed = false;
|
|
135
|
-
if (def.setupModules) for (const moduleName of moduleNames) {
|
|
136
|
-
const moduleFile = catalog.moduleFiles.get(moduleName);
|
|
137
|
-
if (!moduleFile) {
|
|
138
|
-
bag.add(createUnknownErrorDiagnostic(`Missing module mapping for ${moduleName} (plugin ${loaded.packageName})`));
|
|
139
|
-
anyFailed = true;
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
const result = this.buildInjector.apply(moduleFile, loaded.packageName, def.setupModules);
|
|
143
|
-
this.absorb(result, bag, () => {
|
|
144
|
-
anyFailed = true;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (def.setupTargets) for (const targetFile of catalog.targetFiles) {
|
|
148
|
-
const result = this.targetInjector.apply(targetFile, loaded.packageName, def.setupTargets);
|
|
149
|
-
this.absorb(result, bag, () => {
|
|
150
|
-
anyFailed = true;
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
const projectPlugins = def.setupProject?.plugins ?? [];
|
|
154
|
-
if (projectPlugins.length > 0) try {
|
|
155
|
-
const uprojectPath = this.projectFileLocator.findProjectFile(projectRoot);
|
|
156
|
-
const result = this.projectInjector.apply(uprojectPath, projectPlugins);
|
|
157
|
-
this.absorb(result, bag, () => {
|
|
158
|
-
anyFailed = true;
|
|
159
|
-
});
|
|
160
|
-
} catch (error) {
|
|
161
|
-
bag.add(createIoErrorDiagnostic(projectRoot, error instanceof Error ? error.message : String(error)));
|
|
162
|
-
anyFailed = true;
|
|
163
|
-
}
|
|
164
|
-
return !anyFailed;
|
|
165
|
-
}
|
|
166
|
-
absorb(result, bag, onFail) {
|
|
167
|
-
for (const d of result.diagnostics) bag.add(d);
|
|
168
|
-
if (!result.ok) onFail();
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
//#endregion
|
|
173
|
-
export { PostinstallOrchestrator };
|
|
174
|
-
//# sourceMappingURL=PostinstallOrchestrator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PostinstallOrchestrator.js","names":[],"sources":["../../../src/postinstall/runner/PostinstallOrchestrator.ts"],"sourcesContent":["import type { Diagnostic, Result } from '@uapkg/diagnostics';\nimport { createIoErrorDiagnostic, createUnknownErrorDiagnostic, DiagnosticBag } from '@uapkg/diagnostics';\nimport type { PostinstallDefinition } from '#cli/postinstall/api/PostinstallDsl.ts';\nimport { type LoadedPostinstall, PostinstallLoader } from '#cli/postinstall/loader/PostinstallLoader.ts';\nimport { PostinstallPolicyGate } from '#cli/postinstall/policy/PostinstallPolicyGate.ts';\nimport { BuildCsInjector } from '#cli/postinstall/unreal/BuildCsInjector.ts';\nimport { ProjectFileLocator } from '#cli/postinstall/unreal/ProjectFileLocator.ts';\nimport { TargetCsInjector } from '#cli/postinstall/unreal/TargetCsInjector.ts';\nimport { UnrealSourceCatalogBuilder } from '#cli/postinstall/unreal/UnrealSourceCatalog.ts';\nimport { UProjectInjector } from '#cli/postinstall/unreal/UProjectInjector.ts';\nimport { UProjectMetadataReader } from '#cli/postinstall/unreal/UProjectMetadataReader.ts';\n\n/**\n * Projection of an installer action that the orchestrator needs. The CLI\n * (Phase 8) will map `InstallAction` → `PostinstallCandidate` by filtering\n * `type === 'add' | 'update'` and joining with the lockfile for registry\n * metadata.\n */\nexport interface PostinstallCandidate {\n readonly packageName: string;\n readonly registry: string;\n /** Absolute path to the installed plugin root. */\n readonly pluginRoot: string;\n}\n\nexport interface PostinstallReport {\n readonly executed: readonly string[];\n readonly skipped: readonly { packageName: string; reason: 'no-script' | 'policy-denied' }[];\n}\n\nexport interface PostinstallOrchestratorInput {\n readonly projectRoot: string;\n readonly manifestType: 'project' | 'plugin';\n readonly candidates: readonly PostinstallCandidate[];\n /**\n * Optional explicit module-name list (from `postinstall.modules` in the\n * project manifest). When provided, overrides the names discovered from\n * `.uproject`'s `Modules[]`. An empty array = override to \"no modules\".\n */\n readonly moduleNameOverride?: readonly string[];\n}\n\n/**\n * Top-level postinstall flow:\n *\n * 1. Fast path: if the host is a plugin manifest, nothing runs.\n * 2. For each candidate plugin:\n * a. PolicyGate decides allow/deny. Deny → info diagnostic, skip.\n * b. Loader locates + transpiles + imports + validates the script.\n * c. Accumulate `(plugin, definition)` pairs into a plan.\n * 3. Build a single {@link UnrealSourceCatalog} covering every module\n * any script wants to touch.\n * 4. Apply injectors idempotently per zone.\n *\n * Always returns a {@link Result}; never throws. The caller inspects\n * `diagnostics` to render errors/warnings/info lines.\n */\nexport class PostinstallOrchestrator {\n public constructor(\n private readonly loader: PostinstallLoader = new PostinstallLoader(),\n private readonly policy: PostinstallPolicyGate = new PostinstallPolicyGate(),\n private readonly catalogBuilder: UnrealSourceCatalogBuilder = new UnrealSourceCatalogBuilder(),\n private readonly buildInjector: BuildCsInjector = new BuildCsInjector(),\n private readonly targetInjector: TargetCsInjector = new TargetCsInjector(),\n private readonly projectInjector: UProjectInjector = new UProjectInjector(),\n private readonly projectFileLocator: ProjectFileLocator = new ProjectFileLocator(),\n private readonly uprojectReader: UProjectMetadataReader = new UProjectMetadataReader(),\n ) {}\n\n public async run(input: PostinstallOrchestratorInput): Promise<Result<PostinstallReport>> {\n const bag = new DiagnosticBag();\n const executed: string[] = [];\n const skipped: { packageName: string; reason: 'no-script' | 'policy-denied' }[] = [];\n\n if (input.manifestType !== 'project' || input.candidates.length === 0) {\n return bag.toResult({ executed, skipped });\n }\n\n const plan = await this.buildPlan(input.candidates, bag, skipped);\n if (plan.length === 0) {\n return bag.toResult({ executed, skipped });\n }\n\n const catalogResult = this.buildCatalog(input.projectRoot, plan, input.moduleNameOverride);\n if (!catalogResult.ok) {\n bag.mergeArray(catalogResult.diagnostics);\n return bag.toFailure();\n }\n const { catalog, moduleNames } = catalogResult.value;\n\n for (const entry of plan) {\n const applied = this.applyScript(input.projectRoot, entry, catalog, moduleNames, bag);\n if (applied) executed.push(entry.loaded.packageName);\n }\n\n return bag.toResult({ executed, skipped });\n }\n\n // ---- private helpers --------------------------------------------------\n\n private async buildPlan(\n candidates: readonly PostinstallCandidate[],\n bag: DiagnosticBag,\n skipped: { packageName: string; reason: 'no-script' | 'policy-denied' }[],\n ): Promise<Array<{ candidate: PostinstallCandidate; loaded: LoadedPostinstall }>> {\n const plan: Array<{ candidate: PostinstallCandidate; loaded: LoadedPostinstall }> = [];\n for (const candidate of candidates) {\n const decision = this.policy.evaluate(candidate.packageName, candidate.registry);\n if (!decision.allowed) {\n if (decision.denialDiagnostic) bag.add(decision.denialDiagnostic);\n skipped.push({ packageName: candidate.packageName, reason: 'policy-denied' });\n continue;\n }\n const loaded = await this.loader.load(candidate.packageName, candidate.pluginRoot);\n bag.mergeArray(loaded.diagnostics);\n if (!loaded.ok) continue; // Errors already in bag.\n if (loaded.value === null) {\n skipped.push({ packageName: candidate.packageName, reason: 'no-script' });\n continue;\n }\n plan.push({ candidate, loaded: loaded.value });\n }\n return plan;\n }\n\n private buildCatalog(\n projectRoot: string,\n plan: Array<{ candidate: PostinstallCandidate; loaded: LoadedPostinstall }>,\n moduleNameOverride: readonly string[] | undefined,\n ): Result<{ catalog: ReturnType<UnrealSourceCatalogBuilder['build']>; moduleNames: readonly string[] }> {\n const hasModuleSetup = plan.some((entry) => Boolean(entry.loaded.definition.setupModules));\n let moduleNames: readonly string[] = [];\n if (hasModuleSetup) {\n if (moduleNameOverride !== undefined) {\n // Explicit override from project manifest wins; empty = no modules.\n moduleNames = moduleNameOverride;\n } else {\n try {\n const uprojectPath = this.projectFileLocator.findProjectFile(projectRoot);\n moduleNames = this.uprojectReader.readModuleNames(uprojectPath);\n } catch (error) {\n return {\n ok: false,\n diagnostics: [createIoErrorDiagnostic(projectRoot, error instanceof Error ? error.message : String(error))],\n };\n }\n }\n }\n\n try {\n const catalog = this.catalogBuilder.build(projectRoot, moduleNames);\n return { ok: true, value: { catalog, moduleNames }, diagnostics: [] };\n } catch (error) {\n return {\n ok: false,\n diagnostics: [createUnknownErrorDiagnostic(error instanceof Error ? error.message : String(error))],\n };\n }\n }\n\n private applyScript(\n projectRoot: string,\n entry: { candidate: PostinstallCandidate; loaded: LoadedPostinstall },\n catalog: ReturnType<UnrealSourceCatalogBuilder['build']>,\n moduleNames: readonly string[],\n bag: DiagnosticBag,\n ): boolean {\n const { loaded } = entry;\n const def: PostinstallDefinition = loaded.definition;\n let anyFailed = false;\n\n if (def.setupModules) {\n for (const moduleName of moduleNames) {\n const moduleFile = catalog.moduleFiles.get(moduleName);\n if (!moduleFile) {\n bag.add(\n createUnknownErrorDiagnostic(`Missing module mapping for ${moduleName} (plugin ${loaded.packageName})`),\n );\n anyFailed = true;\n continue;\n }\n const result = this.buildInjector.apply(moduleFile, loaded.packageName, def.setupModules);\n this.absorb(result, bag, () => {\n anyFailed = true;\n });\n }\n }\n\n if (def.setupTargets) {\n for (const targetFile of catalog.targetFiles) {\n const result = this.targetInjector.apply(targetFile, loaded.packageName, def.setupTargets);\n this.absorb(result, bag, () => {\n anyFailed = true;\n });\n }\n }\n\n const projectPlugins = def.setupProject?.plugins ?? [];\n if (projectPlugins.length > 0) {\n try {\n const uprojectPath = this.projectFileLocator.findProjectFile(projectRoot);\n const result = this.projectInjector.apply(uprojectPath, projectPlugins);\n this.absorb(result, bag, () => {\n anyFailed = true;\n });\n } catch (error) {\n bag.add(createIoErrorDiagnostic(projectRoot, error instanceof Error ? error.message : String(error)));\n anyFailed = true;\n }\n }\n\n return !anyFailed;\n }\n\n private absorb(result: Result<void>, bag: DiagnosticBag, onFail: () => void): void {\n for (const d of result.diagnostics) bag.add(d as Diagnostic);\n if (!result.ok) onFail();\n }\n}\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildCsInjector.d.ts","names":[],"sources":["../../../src/postinstall/unreal/BuildCsInjector.ts"],"mappings":";;;;;;;;;;;;;;;cAmBa;mBAEQ;mBACA;mBACA;mBACA;EAJnB,YACmB,WAAU,yBACV,iBAAgB,sBAChB,WAAU,uBACV,eAAc;EAG1B,MAAM,kBAAkB,oBAAoB,OAAO,iBAAiB"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { MarkerBlockEditor } from "../markers/MarkerBlockEditor.js";
|
|
2
|
-
import { CSharpInjectionEngine } from "./CSharpInjectionEngine.js";
|
|
3
|
-
import { CSharpStructureAnalyzer } from "./CSharpStructureAnalyzer.js";
|
|
4
|
-
import { CSharpWrapperFactory } from "./CSharpWrapperFactory.js";
|
|
5
|
-
import { getWrapperClassName } from "./PluginHash.js";
|
|
6
|
-
import { createIoErrorDiagnostic, fail, ok } from "@uapkg/diagnostics";
|
|
7
|
-
import fs from "node:fs";
|
|
8
|
-
|
|
9
|
-
//#region src/postinstall/unreal/BuildCsInjector.ts
|
|
10
|
-
const BUILD_CS_ZONES = [
|
|
11
|
-
"module-includes",
|
|
12
|
-
"module-class-body",
|
|
13
|
-
"module-constructor"
|
|
14
|
-
];
|
|
15
|
-
/**
|
|
16
|
-
* Injects a plugin's `setupModules` content into a single `*.Build.cs` file.
|
|
17
|
-
*
|
|
18
|
-
* The operation is idempotent: re-running overwrites the owned marker blocks.
|
|
19
|
-
* All failures are returned as `Result.fail` — this class never throws. Before
|
|
20
|
-
* mutation, pre-existing owned marker blocks are checked for corruption
|
|
21
|
-
* (orphaned / nested markers) and surfaced as `POSTINSTALL_MARKER_CORRUPT`.
|
|
22
|
-
*/
|
|
23
|
-
var BuildCsInjector = class {
|
|
24
|
-
analyzer;
|
|
25
|
-
wrapperFactory;
|
|
26
|
-
injector;
|
|
27
|
-
markerEditor;
|
|
28
|
-
constructor(analyzer = new CSharpStructureAnalyzer(), wrapperFactory = new CSharpWrapperFactory(), injector = new CSharpInjectionEngine(), markerEditor = new MarkerBlockEditor()) {
|
|
29
|
-
this.analyzer = analyzer;
|
|
30
|
-
this.wrapperFactory = wrapperFactory;
|
|
31
|
-
this.injector = injector;
|
|
32
|
-
this.markerEditor = markerEditor;
|
|
33
|
-
}
|
|
34
|
-
apply(filePath, pluginName, zones) {
|
|
35
|
-
try {
|
|
36
|
-
let source = fs.readFileSync(filePath, "utf-8");
|
|
37
|
-
for (const zone of BUILD_CS_ZONES) {
|
|
38
|
-
const check = this.markerEditor.validate(source, pluginName, zone, filePath);
|
|
39
|
-
if (!check.ok) return fail(check.diagnostics);
|
|
40
|
-
}
|
|
41
|
-
if (zones.includes?.trim()) source = this.injector.applyIncludes(source, pluginName, zones.includes, "module-includes");
|
|
42
|
-
if (zones.classBody?.trim()) {
|
|
43
|
-
const parsedForWrapper = this.analyzer.parseModule(filePath, source);
|
|
44
|
-
const wrapperClassName = getWrapperClassName(pluginName);
|
|
45
|
-
const wrapper = this.wrapperFactory.createWrapper(wrapperClassName, "ModuleRules", "rules", zones.classBody);
|
|
46
|
-
source = this.injector.applyClassWrapper(parsedForWrapper, pluginName, wrapper, "module-class-body");
|
|
47
|
-
const parsedForCtor = this.analyzer.parseModule(filePath, source);
|
|
48
|
-
source = this.injector.applyConstructorCall(parsedForCtor, pluginName, `${wrapperClassName}.Apply(this)`, "module-constructor");
|
|
49
|
-
}
|
|
50
|
-
fs.writeFileSync(filePath, source, "utf-8");
|
|
51
|
-
return ok(void 0);
|
|
52
|
-
} catch (error) {
|
|
53
|
-
return fail([createIoErrorDiagnostic(filePath, error instanceof Error ? error.message : String(error))]);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
//#endregion
|
|
59
|
-
export { BuildCsInjector };
|
|
60
|
-
//# sourceMappingURL=BuildCsInjector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildCsInjector.js","names":[],"sources":["../../../src/postinstall/unreal/BuildCsInjector.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { createIoErrorDiagnostic, fail, ok, type Result } from '@uapkg/diagnostics';\nimport type { ZoneDefinition } from '#cli/postinstall/api/PostinstallDsl.ts';\nimport { MarkerBlockEditor } from '#cli/postinstall/markers/MarkerBlockEditor.ts';\nimport { CSharpInjectionEngine } from '#cli/postinstall/unreal/CSharpInjectionEngine.ts';\nimport { CSharpStructureAnalyzer } from '#cli/postinstall/unreal/CSharpStructureAnalyzer.ts';\nimport { CSharpWrapperFactory } from '#cli/postinstall/unreal/CSharpWrapperFactory.ts';\nimport { getWrapperClassName } from '#cli/postinstall/unreal/PluginHash.ts';\n\nconst BUILD_CS_ZONES = ['module-includes', 'module-class-body', 'module-constructor'] as const;\n\n/**\n * Injects a plugin's `setupModules` content into a single `*.Build.cs` file.\n *\n * The operation is idempotent: re-running overwrites the owned marker blocks.\n * All failures are returned as `Result.fail` — this class never throws. Before\n * mutation, pre-existing owned marker blocks are checked for corruption\n * (orphaned / nested markers) and surfaced as `POSTINSTALL_MARKER_CORRUPT`.\n */\nexport class BuildCsInjector {\n public constructor(\n private readonly analyzer: CSharpStructureAnalyzer = new CSharpStructureAnalyzer(),\n private readonly wrapperFactory: CSharpWrapperFactory = new CSharpWrapperFactory(),\n private readonly injector: CSharpInjectionEngine = new CSharpInjectionEngine(),\n private readonly markerEditor: MarkerBlockEditor = new MarkerBlockEditor(),\n ) {}\n\n public apply(filePath: string, pluginName: string, zones: ZoneDefinition): Result<void> {\n try {\n let source = fs.readFileSync(filePath, 'utf-8');\n\n for (const zone of BUILD_CS_ZONES) {\n const check = this.markerEditor.validate(source, pluginName, zone, filePath);\n if (!check.ok) return fail(check.diagnostics);\n }\n\n if (zones.includes?.trim()) {\n source = this.injector.applyIncludes(source, pluginName, zones.includes, 'module-includes');\n }\n if (zones.classBody?.trim()) {\n const parsedForWrapper = this.analyzer.parseModule(filePath, source);\n const wrapperClassName = getWrapperClassName(pluginName);\n const wrapper = this.wrapperFactory.createWrapper(wrapperClassName, 'ModuleRules', 'rules', zones.classBody);\n source = this.injector.applyClassWrapper(parsedForWrapper, pluginName, wrapper, 'module-class-body');\n\n const parsedForCtor = this.analyzer.parseModule(filePath, source);\n source = this.injector.applyConstructorCall(\n parsedForCtor,\n pluginName,\n `${wrapperClassName}.Apply(this)`,\n 'module-constructor',\n );\n }\n fs.writeFileSync(filePath, source, 'utf-8');\n return ok(undefined);\n } catch (error) {\n return fail([createIoErrorDiagnostic(filePath, error instanceof Error ? error.message : String(error))]);\n }\n }\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,iBAAiB;CAAC;CAAmB;CAAqB;AAAoB;;;;;;;;;AAUpF,IAAa,kBAAb,MAA6B;CAER;CACA;CACA;CACA;CAJnB,AAAO,YACL,AAAiB,WAAoC,IAAI,wBAAwB,GACjF,AAAiB,iBAAuC,IAAI,qBAAqB,GACjF,AAAiB,WAAkC,IAAI,sBAAsB,GAC7E,AAAiB,eAAkC,IAAI,kBAAkB,GACzE;EAJiB;EACA;EACA;EACA;CAChB;CAEH,AAAO,MAAM,UAAkB,YAAoB,OAAqC;EACtF,IAAI;GACF,IAAI,SAAS,GAAG,aAAa,UAAU,OAAO;GAE9C,KAAK,MAAM,QAAQ,gBAAgB;IACjC,MAAM,QAAQ,KAAK,aAAa,SAAS,QAAQ,YAAY,MAAM,QAAQ;IAC3E,IAAI,CAAC,MAAM,IAAI,OAAO,KAAK,MAAM,WAAW;GAC9C;GAEA,IAAI,MAAM,UAAU,KAAK,GACvB,SAAS,KAAK,SAAS,cAAc,QAAQ,YAAY,MAAM,UAAU,iBAAiB;GAE5F,IAAI,MAAM,WAAW,KAAK,GAAG;IAC3B,MAAM,mBAAmB,KAAK,SAAS,YAAY,UAAU,MAAM;IACnE,MAAM,mBAAmB,oBAAoB,UAAU;IACvD,MAAM,UAAU,KAAK,eAAe,cAAc,kBAAkB,eAAe,SAAS,MAAM,SAAS;IAC3G,SAAS,KAAK,SAAS,kBAAkB,kBAAkB,YAAY,SAAS,mBAAmB;IAEnG,MAAM,gBAAgB,KAAK,SAAS,YAAY,UAAU,MAAM;IAChE,SAAS,KAAK,SAAS,qBACrB,eACA,YACA,GAAG,iBAAiB,eACpB,oBACF;GACF;GACA,GAAG,cAAc,UAAU,QAAQ,OAAO;GAC1C,OAAO,GAAG,MAAS;EACrB,SAAS,OAAO;GACd,OAAO,KAAK,CAAC,wBAAwB,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC;EACzG;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpInjectionEngine.d.ts","names":[],"sources":["../../../src/postinstall/unreal/CSharpInjectionEngine.ts"],"mappings":";;;;;;;;;;;;;cAaa;mBACyB;EAApC,YAAoC,cAAa;EAE1C,cAAc,gBAAgB,oBAAoB,yBAAyB;EAa3E,kBAAkB,QAAQ,kBAAkB,oBAAoB,wBAAwB;EAWxF,qBACL,QAAQ,kBACR,oBACA,wBACA;UAeM;UAOA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { MarkerBlockService } from "../markers/MarkerBlockService.js";
|
|
2
|
-
|
|
3
|
-
//#region src/postinstall/unreal/CSharpInjectionEngine.ts
|
|
4
|
-
/**
|
|
5
|
-
* Applies marker-delimited edits to a parsed C# file at three well-known anchors:
|
|
6
|
-
*
|
|
7
|
-
* 1. `applyIncludes` — `using ...;` block just after the last top-level `using`.
|
|
8
|
-
* 2. `applyClassWrapper` — nested helper class inside the rules class body.
|
|
9
|
-
* 3. `applyConstructorCall` — a single statement at the top of the constructor.
|
|
10
|
-
*
|
|
11
|
-
* Every edit is wrapped in an owned `UAPKG-BEGIN/END` marker block so re-running
|
|
12
|
-
* uapkg is idempotent. Existing owned blocks are stripped before re-insert.
|
|
13
|
-
*/
|
|
14
|
-
var CSharpInjectionEngine = class {
|
|
15
|
-
markerBlock;
|
|
16
|
-
constructor(markerBlock = new MarkerBlockService()) {
|
|
17
|
-
this.markerBlock = markerBlock;
|
|
18
|
-
}
|
|
19
|
-
applyIncludes(source, pluginName, includesContent, zone) {
|
|
20
|
-
const withoutOwnedBlock = this.markerBlock.stripOwnedBlock(source, pluginName, zone);
|
|
21
|
-
const includeBlock = this.markerBlock.createBlock(pluginName, zone, includesContent);
|
|
22
|
-
const usingMatches = [...withoutOwnedBlock.matchAll(/^[ \t]*using\s+[^;]+;\s*$/gm)];
|
|
23
|
-
if (usingMatches.length === 0) return `${includeBlock}\n${withoutOwnedBlock}`.trimStart();
|
|
24
|
-
const lastUsing = usingMatches[usingMatches.length - 1];
|
|
25
|
-
const lastUsingIndex = (lastUsing.index ?? 0) + lastUsing[0].length;
|
|
26
|
-
return `${withoutOwnedBlock.slice(0, lastUsingIndex)}\n${includeBlock}\n${withoutOwnedBlock.slice(lastUsingIndex).trimStart()}`;
|
|
27
|
-
}
|
|
28
|
-
applyClassWrapper(parsed, pluginName, wrapperContent, zone) {
|
|
29
|
-
const classStart = parsed.classInfo.classOpenBraceIndex + 1;
|
|
30
|
-
const classEnd = parsed.classInfo.classCloseBraceIndex;
|
|
31
|
-
const classBody = parsed.source.slice(classStart, classEnd);
|
|
32
|
-
const stripped = this.markerBlock.stripOwnedBlock(classBody, pluginName, zone).trimStart();
|
|
33
|
-
const indent = this.detectClassMemberIndent(parsed.source, parsed.classInfo.classOpenBraceIndex);
|
|
34
|
-
const nextBody = `\n${this.markerBlock.createBlock(pluginName, zone, wrapperContent, indent)}\n\n${stripped}`.replace(/\n{3,}/g, "\n\n");
|
|
35
|
-
return `${parsed.source.slice(0, classStart)}${nextBody}${parsed.source.slice(classEnd)}`;
|
|
36
|
-
}
|
|
37
|
-
applyConstructorCall(parsed, pluginName, callExpression, zone) {
|
|
38
|
-
const bodyStart = parsed.constructorInfo.bodyOpenBraceIndex + 1;
|
|
39
|
-
const bodyEnd = parsed.constructorInfo.bodyCloseBraceIndex;
|
|
40
|
-
const body = parsed.source.slice(bodyStart, bodyEnd);
|
|
41
|
-
const withoutOwnedBlock = this.markerBlock.stripOwnedBlock(body, pluginName, zone).trimStart();
|
|
42
|
-
const indent = this.detectConstructorIndent(parsed.source, parsed.constructorInfo.bodyOpenBraceIndex);
|
|
43
|
-
const nextBody = `\n${this.markerBlock.createBlock(pluginName, zone, `${callExpression};`, indent)}\n${withoutOwnedBlock.length > 0 ? `\n${withoutOwnedBlock}` : ""}`.replace(/\n{3,}/g, "\n\n");
|
|
44
|
-
return `${parsed.source.slice(0, bodyStart)}${nextBody}${parsed.source.slice(bodyEnd)}`;
|
|
45
|
-
}
|
|
46
|
-
detectClassMemberIndent(source, classOpenBraceIndex) {
|
|
47
|
-
const lineStart = source.lastIndexOf("\n", classOpenBraceIndex);
|
|
48
|
-
return `${source.slice(lineStart + 1, classOpenBraceIndex).match(/^\s*/)?.[0] ?? ""} `;
|
|
49
|
-
}
|
|
50
|
-
detectConstructorIndent(source, constructorOpenBraceIndex) {
|
|
51
|
-
const lineStart = source.lastIndexOf("\n", constructorOpenBraceIndex);
|
|
52
|
-
return `${source.slice(lineStart + 1, constructorOpenBraceIndex).match(/^\s*/)?.[0] ?? ""} `;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
export { CSharpInjectionEngine };
|
|
58
|
-
//# sourceMappingURL=CSharpInjectionEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpInjectionEngine.js","names":[],"sources":["../../../src/postinstall/unreal/CSharpInjectionEngine.ts"],"sourcesContent":["import { MarkerBlockService } from '#cli/postinstall/markers/MarkerBlockService.ts';\nimport type { ParsedCSharpFile } from '#cli/postinstall/unreal/CSharpStructures.ts';\n\n/**\n * Applies marker-delimited edits to a parsed C# file at three well-known anchors:\n *\n * 1. `applyIncludes` — `using ...;` block just after the last top-level `using`.\n * 2. `applyClassWrapper` — nested helper class inside the rules class body.\n * 3. `applyConstructorCall` — a single statement at the top of the constructor.\n *\n * Every edit is wrapped in an owned `UAPKG-BEGIN/END` marker block so re-running\n * uapkg is idempotent. Existing owned blocks are stripped before re-insert.\n */\nexport class CSharpInjectionEngine {\n public constructor(private readonly markerBlock: MarkerBlockService = new MarkerBlockService()) {}\n\n public applyIncludes(source: string, pluginName: string, includesContent: string, zone: string): string {\n const withoutOwnedBlock = this.markerBlock.stripOwnedBlock(source, pluginName, zone);\n const includeBlock = this.markerBlock.createBlock(pluginName, zone, includesContent);\n const usingMatches = [...withoutOwnedBlock.matchAll(/^[ \\t]*using\\s+[^;]+;\\s*$/gm)];\n if (usingMatches.length === 0) {\n return `${includeBlock}\\n${withoutOwnedBlock}`.trimStart();\n }\n\n const lastUsing = usingMatches[usingMatches.length - 1];\n const lastUsingIndex = (lastUsing.index ?? 0) + lastUsing[0].length;\n return `${withoutOwnedBlock.slice(0, lastUsingIndex)}\\n${includeBlock}\\n${withoutOwnedBlock.slice(lastUsingIndex).trimStart()}`;\n }\n\n public applyClassWrapper(parsed: ParsedCSharpFile, pluginName: string, wrapperContent: string, zone: string): string {\n const classStart = parsed.classInfo.classOpenBraceIndex + 1;\n const classEnd = parsed.classInfo.classCloseBraceIndex;\n const classBody = parsed.source.slice(classStart, classEnd);\n const stripped = this.markerBlock.stripOwnedBlock(classBody, pluginName, zone).trimStart();\n const indent = this.detectClassMemberIndent(parsed.source, parsed.classInfo.classOpenBraceIndex);\n const block = this.markerBlock.createBlock(pluginName, zone, wrapperContent, indent);\n const nextBody = `\\n${block}\\n\\n${stripped}`.replace(/\\n{3,}/g, '\\n\\n');\n return `${parsed.source.slice(0, classStart)}${nextBody}${parsed.source.slice(classEnd)}`;\n }\n\n public applyConstructorCall(\n parsed: ParsedCSharpFile,\n pluginName: string,\n callExpression: string,\n zone: string,\n ): string {\n const bodyStart = parsed.constructorInfo.bodyOpenBraceIndex + 1;\n const bodyEnd = parsed.constructorInfo.bodyCloseBraceIndex;\n const body = parsed.source.slice(bodyStart, bodyEnd);\n const withoutOwnedBlock = this.markerBlock.stripOwnedBlock(body, pluginName, zone).trimStart();\n const indent = this.detectConstructorIndent(parsed.source, parsed.constructorInfo.bodyOpenBraceIndex);\n const block = this.markerBlock.createBlock(pluginName, zone, `${callExpression};`, indent);\n const nextBody = `\\n${block}\\n${withoutOwnedBlock.length > 0 ? `\\n${withoutOwnedBlock}` : ''}`.replace(\n /\\n{3,}/g,\n '\\n\\n',\n );\n return `${parsed.source.slice(0, bodyStart)}${nextBody}${parsed.source.slice(bodyEnd)}`;\n }\n\n private detectClassMemberIndent(source: string, classOpenBraceIndex: number): string {\n const lineStart = source.lastIndexOf('\\n', classOpenBraceIndex);\n const classLine = source.slice(lineStart + 1, classOpenBraceIndex);\n const classIndent = classLine.match(/^\\s*/)?.[0] ?? '';\n return `${classIndent} `;\n }\n\n private detectConstructorIndent(source: string, constructorOpenBraceIndex: number): string {\n const lineStart = source.lastIndexOf('\\n', constructorOpenBraceIndex);\n const constructorLine = source.slice(lineStart + 1, constructorOpenBraceIndex);\n const constructorIndent = constructorLine.match(/^\\s*/)?.[0] ?? '';\n return `${constructorIndent} `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,wBAAb,MAAmC;CACG;CAApC,AAAO,YAAY,AAAiB,cAAkC,IAAI,mBAAmB,GAAG;EAA5D;CAA6D;CAEjG,AAAO,cAAc,QAAgB,YAAoB,iBAAyB,MAAsB;EACtG,MAAM,oBAAoB,KAAK,YAAY,gBAAgB,QAAQ,YAAY,IAAI;EACnF,MAAM,eAAe,KAAK,YAAY,YAAY,YAAY,MAAM,eAAe;EACnF,MAAM,eAAe,CAAC,GAAG,kBAAkB,SAAS,6BAA6B,CAAC;EAClF,IAAI,aAAa,WAAW,GAC1B,OAAO,GAAG,aAAa,IAAI,oBAAoB,UAAU;EAG3D,MAAM,YAAY,aAAa,aAAa,SAAS;EACrD,MAAM,kBAAkB,UAAU,SAAS,KAAK,UAAU,EAAE,CAAC;EAC7D,OAAO,GAAG,kBAAkB,MAAM,GAAG,cAAc,EAAE,IAAI,aAAa,IAAI,kBAAkB,MAAM,cAAc,CAAC,CAAC,UAAU;CAC9H;CAEA,AAAO,kBAAkB,QAA0B,YAAoB,gBAAwB,MAAsB;EACnH,MAAM,aAAa,OAAO,UAAU,sBAAsB;EAC1D,MAAM,WAAW,OAAO,UAAU;EAClC,MAAM,YAAY,OAAO,OAAO,MAAM,YAAY,QAAQ;EAC1D,MAAM,WAAW,KAAK,YAAY,gBAAgB,WAAW,YAAY,IAAI,CAAC,CAAC,UAAU;EACzF,MAAM,SAAS,KAAK,wBAAwB,OAAO,QAAQ,OAAO,UAAU,mBAAmB;EAE/F,MAAM,WAAW,KADH,KAAK,YAAY,YAAY,YAAY,MAAM,gBAAgB,MACnD,EAAE,MAAM,WAAW,QAAQ,WAAW,MAAM;EACtE,OAAO,GAAG,OAAO,OAAO,MAAM,GAAG,UAAU,IAAI,WAAW,OAAO,OAAO,MAAM,QAAQ;CACxF;CAEA,AAAO,qBACL,QACA,YACA,gBACA,MACQ;EACR,MAAM,YAAY,OAAO,gBAAgB,qBAAqB;EAC9D,MAAM,UAAU,OAAO,gBAAgB;EACvC,MAAM,OAAO,OAAO,OAAO,MAAM,WAAW,OAAO;EACnD,MAAM,oBAAoB,KAAK,YAAY,gBAAgB,MAAM,YAAY,IAAI,CAAC,CAAC,UAAU;EAC7F,MAAM,SAAS,KAAK,wBAAwB,OAAO,QAAQ,OAAO,gBAAgB,kBAAkB;EAEpG,MAAM,WAAW,KADH,KAAK,YAAY,YAAY,YAAY,MAAM,GAAG,eAAe,IAAI,MACzD,EAAE,IAAI,kBAAkB,SAAS,IAAI,KAAK,sBAAsB,KAAK,QAC7F,WACA,MACF;EACA,OAAO,GAAG,OAAO,OAAO,MAAM,GAAG,SAAS,IAAI,WAAW,OAAO,OAAO,MAAM,OAAO;CACtF;CAEA,AAAQ,wBAAwB,QAAgB,qBAAqC;EACnF,MAAM,YAAY,OAAO,YAAY,MAAM,mBAAmB;EAG9D,OAAO,GAFW,OAAO,MAAM,YAAY,GAAG,mBAClB,CAAC,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,GAC9B;CACxB;CAEA,AAAQ,wBAAwB,QAAgB,2BAA2C;EACzF,MAAM,YAAY,OAAO,YAAY,MAAM,yBAAyB;EAGpE,OAAO,GAFiB,OAAO,MAAM,YAAY,GAAG,yBACZ,CAAC,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,GACpC;CAC9B;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpStructureAnalyzer.d.ts","names":[],"sources":["../../../src/postinstall/unreal/CSharpStructureAnalyzer.ts"],"mappings":";;;;;;;;;;;;;;cAsBa;EACJ,YAAY,kBAAkB,iBAAiB;EAI/C,YAAY,kBAAkB,iBAAiB;UAQ9C;UAqBA;UAoBA;UAgCA"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { PrettyParseError } from "./PrettyParseError.js";
|
|
2
|
-
|
|
3
|
-
//#region src/postinstall/unreal/CSharpStructureAnalyzer.ts
|
|
4
|
-
const CLASS_REGEX = /\bclass\s+([A-Za-z_][A-Za-z0-9_]*)\s*:\s*([^{\r\n]+)/g;
|
|
5
|
-
/**
|
|
6
|
-
* Lightweight C# structural parser tailored to Unreal build files.
|
|
7
|
-
*
|
|
8
|
-
* We do NOT invoke the Roslyn / csharp-ast graph for analysis because the
|
|
9
|
-
* pipeline only needs three anchors:
|
|
10
|
-
* 1. The single class inheriting `ModuleRules` / `TargetRules`.
|
|
11
|
-
* 2. Its constructor matching `(ModuleRules|TargetRules)(Type Target) : base(Target)`.
|
|
12
|
-
* 3. The body braces of (1) and (2) so injectors can splice content.
|
|
13
|
-
*
|
|
14
|
-
* Lighter-than-AST parsing keeps this file < 200 LOC and avoids pulling a
|
|
15
|
-
* heavyweight runtime into `uapkg install`.
|
|
16
|
-
*/
|
|
17
|
-
var CSharpStructureAnalyzer = class {
|
|
18
|
-
parseModule(filePath, source) {
|
|
19
|
-
return this.parseFile("module", filePath, source, "ModuleRules", "ReadOnlyTargetRules");
|
|
20
|
-
}
|
|
21
|
-
parseTarget(filePath, source) {
|
|
22
|
-
const parsed = this.parseFile("target", filePath, source, "TargetRules", "TargetInfo");
|
|
23
|
-
if (!/\bType\s*=\s*TargetType\.[A-Za-z_][A-Za-z0-9_]*\s*;/.test(source)) throw new PrettyParseError(filePath, "TargetRules file missing `Type = TargetType.X;` assignment", source, 0);
|
|
24
|
-
return parsed;
|
|
25
|
-
}
|
|
26
|
-
parseFile(kind, filePath, source, expectedBaseClass, expectedConstructorArgType) {
|
|
27
|
-
const matchingClasses = this.findClassesByBase(source, expectedBaseClass);
|
|
28
|
-
if (matchingClasses.length !== 1) throw new PrettyParseError(filePath, `Expected exactly one class extending ${expectedBaseClass}, found ${matchingClasses.length}`, source, matchingClasses[0]?.classKeywordIndex ?? 0);
|
|
29
|
-
const classInfo = matchingClasses[0];
|
|
30
|
-
return {
|
|
31
|
-
kind,
|
|
32
|
-
classInfo,
|
|
33
|
-
constructorInfo: this.findConstructor(filePath, source, classInfo, expectedConstructorArgType),
|
|
34
|
-
source
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
findClassesByBase(source, expectedBaseClass) {
|
|
38
|
-
const classes = [];
|
|
39
|
-
for (const match of source.matchAll(CLASS_REGEX)) {
|
|
40
|
-
const className = match[1];
|
|
41
|
-
if (!(match[2] ?? "").split(",").map((item) => item.trim()).some((item) => item === expectedBaseClass) || !className) continue;
|
|
42
|
-
const classKeywordIndex = match.index ?? 0;
|
|
43
|
-
const classOpenBraceIndex = source.indexOf("{", classKeywordIndex);
|
|
44
|
-
if (classOpenBraceIndex < 0) continue;
|
|
45
|
-
const classCloseBraceIndex = this.findMatchingBrace(source, classOpenBraceIndex);
|
|
46
|
-
classes.push({
|
|
47
|
-
className,
|
|
48
|
-
classKeywordIndex,
|
|
49
|
-
classOpenBraceIndex,
|
|
50
|
-
classCloseBraceIndex
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return classes;
|
|
54
|
-
}
|
|
55
|
-
findConstructor(filePath, source, classInfo, expectedConstructorArgType) {
|
|
56
|
-
const classBody = source.slice(classInfo.classOpenBraceIndex + 1, classInfo.classCloseBraceIndex);
|
|
57
|
-
const signatureRegex = new RegExp(`\\bpublic\\s+${classInfo.className}\\s*\\(\\s*${expectedConstructorArgType}\\s+Target\\s*\\)\\s*:\\s*base\\s*\\(\\s*Target\\s*\\)`, "g");
|
|
58
|
-
const matches = [...classBody.matchAll(signatureRegex)];
|
|
59
|
-
if (matches.length !== 1) throw new PrettyParseError(filePath, `Expected exactly one constructor signature for ${classInfo.className}(${expectedConstructorArgType} Target) : base(Target), found ${matches.length}`, source, classInfo.classKeywordIndex);
|
|
60
|
-
const signatureRelativeIndex = matches[0].index ?? 0;
|
|
61
|
-
const signatureIndex = classInfo.classOpenBraceIndex + 1 + signatureRelativeIndex;
|
|
62
|
-
const bodyOpenBraceIndex = source.indexOf("{", signatureIndex);
|
|
63
|
-
if (bodyOpenBraceIndex < 0) throw new PrettyParseError(filePath, "Constructor body opening brace not found", source, signatureIndex);
|
|
64
|
-
return {
|
|
65
|
-
signatureIndex,
|
|
66
|
-
bodyOpenBraceIndex,
|
|
67
|
-
bodyCloseBraceIndex: this.findMatchingBrace(source, bodyOpenBraceIndex)
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
findMatchingBrace(source, openIndex) {
|
|
71
|
-
let depth = 0;
|
|
72
|
-
let inSingleLineComment = false;
|
|
73
|
-
let inMultiLineComment = false;
|
|
74
|
-
let inSingleQuote = false;
|
|
75
|
-
let inDoubleQuote = false;
|
|
76
|
-
for (let i = openIndex; i < source.length; i += 1) {
|
|
77
|
-
const current = source[i];
|
|
78
|
-
const next = source[i + 1];
|
|
79
|
-
const prev = source[i - 1];
|
|
80
|
-
if (inSingleLineComment) {
|
|
81
|
-
if (current === "\n") inSingleLineComment = false;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
if (inMultiLineComment) {
|
|
85
|
-
if (prev === "*" && current === "/") inMultiLineComment = false;
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
if (inSingleQuote) {
|
|
89
|
-
if (current === "'" && prev !== "\\") inSingleQuote = false;
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
if (inDoubleQuote) {
|
|
93
|
-
if (current === "\"" && prev !== "\\") inDoubleQuote = false;
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
if (current === "/" && next === "/") {
|
|
97
|
-
inSingleLineComment = true;
|
|
98
|
-
i += 1;
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
if (current === "/" && next === "*") {
|
|
102
|
-
inMultiLineComment = true;
|
|
103
|
-
i += 1;
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
if (current === "'") {
|
|
107
|
-
inSingleQuote = true;
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (current === "\"") {
|
|
111
|
-
inDoubleQuote = true;
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
if (current === "{") depth += 1;
|
|
115
|
-
else if (current === "}") {
|
|
116
|
-
depth -= 1;
|
|
117
|
-
if (depth === 0) return i;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
throw new Error("Unbalanced braces in C# file");
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
//#endregion
|
|
125
|
-
export { CSharpStructureAnalyzer };
|
|
126
|
-
//# sourceMappingURL=CSharpStructureAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpStructureAnalyzer.js","names":[],"sources":["../../../src/postinstall/unreal/CSharpStructureAnalyzer.ts"],"sourcesContent":["import type {\n CSharpFileKind,\n ParsedClass,\n ParsedConstructor,\n ParsedCSharpFile,\n} from '#cli/postinstall/unreal/CSharpStructures.ts';\nimport { PrettyParseError } from '#cli/postinstall/unreal/PrettyParseError.ts';\n\nconst CLASS_REGEX = /\\bclass\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*:\\s*([^{\\r\\n]+)/g;\n\n/**\n * Lightweight C# structural parser tailored to Unreal build files.\n *\n * We do NOT invoke the Roslyn / csharp-ast graph for analysis because the\n * pipeline only needs three anchors:\n * 1. The single class inheriting `ModuleRules` / `TargetRules`.\n * 2. Its constructor matching `(ModuleRules|TargetRules)(Type Target) : base(Target)`.\n * 3. The body braces of (1) and (2) so injectors can splice content.\n *\n * Lighter-than-AST parsing keeps this file < 200 LOC and avoids pulling a\n * heavyweight runtime into `uapkg install`.\n */\nexport class CSharpStructureAnalyzer {\n public parseModule(filePath: string, source: string): ParsedCSharpFile {\n return this.parseFile('module', filePath, source, 'ModuleRules', 'ReadOnlyTargetRules');\n }\n\n public parseTarget(filePath: string, source: string): ParsedCSharpFile {\n const parsed = this.parseFile('target', filePath, source, 'TargetRules', 'TargetInfo');\n if (!/\\bType\\s*=\\s*TargetType\\.[A-Za-z_][A-Za-z0-9_]*\\s*;/.test(source)) {\n throw new PrettyParseError(filePath, 'TargetRules file missing `Type = TargetType.X;` assignment', source, 0);\n }\n return parsed;\n }\n\n private parseFile(\n kind: CSharpFileKind,\n filePath: string,\n source: string,\n expectedBaseClass: string,\n expectedConstructorArgType: string,\n ): ParsedCSharpFile {\n const matchingClasses = this.findClassesByBase(source, expectedBaseClass);\n if (matchingClasses.length !== 1) {\n throw new PrettyParseError(\n filePath,\n `Expected exactly one class extending ${expectedBaseClass}, found ${matchingClasses.length}`,\n source,\n matchingClasses[0]?.classKeywordIndex ?? 0,\n );\n }\n const classInfo = matchingClasses[0];\n const constructorInfo = this.findConstructor(filePath, source, classInfo, expectedConstructorArgType);\n return { kind, classInfo, constructorInfo, source };\n }\n\n private findClassesByBase(source: string, expectedBaseClass: string): ParsedClass[] {\n const classes: ParsedClass[] = [];\n for (const match of source.matchAll(CLASS_REGEX)) {\n const className = match[1];\n const inheritance = match[2] ?? '';\n const inheritsExpected = inheritance\n .split(',')\n .map((item) => item.trim())\n .some((item) => item === expectedBaseClass);\n if (!inheritsExpected || !className) continue;\n\n const classKeywordIndex = match.index ?? 0;\n const classOpenBraceIndex = source.indexOf('{', classKeywordIndex);\n if (classOpenBraceIndex < 0) continue;\n const classCloseBraceIndex = this.findMatchingBrace(source, classOpenBraceIndex);\n classes.push({ className, classKeywordIndex, classOpenBraceIndex, classCloseBraceIndex });\n }\n return classes;\n }\n\n private findConstructor(\n filePath: string,\n source: string,\n classInfo: ParsedClass,\n expectedConstructorArgType: string,\n ): ParsedConstructor {\n const classBody = source.slice(classInfo.classOpenBraceIndex + 1, classInfo.classCloseBraceIndex);\n const signatureRegex = new RegExp(\n `\\\\bpublic\\\\s+${classInfo.className}\\\\s*\\\\(\\\\s*${expectedConstructorArgType}\\\\s+Target\\\\s*\\\\)\\\\s*:\\\\s*base\\\\s*\\\\(\\\\s*Target\\\\s*\\\\)`,\n 'g',\n );\n\n const matches = [...classBody.matchAll(signatureRegex)];\n if (matches.length !== 1) {\n throw new PrettyParseError(\n filePath,\n `Expected exactly one constructor signature for ${classInfo.className}(${expectedConstructorArgType} Target) : base(Target), found ${matches.length}`,\n source,\n classInfo.classKeywordIndex,\n );\n }\n\n const signatureRelativeIndex = matches[0].index ?? 0;\n const signatureIndex = classInfo.classOpenBraceIndex + 1 + signatureRelativeIndex;\n const bodyOpenBraceIndex = source.indexOf('{', signatureIndex);\n if (bodyOpenBraceIndex < 0) {\n throw new PrettyParseError(filePath, 'Constructor body opening brace not found', source, signatureIndex);\n }\n const bodyCloseBraceIndex = this.findMatchingBrace(source, bodyOpenBraceIndex);\n return { signatureIndex, bodyOpenBraceIndex, bodyCloseBraceIndex };\n }\n\n private findMatchingBrace(source: string, openIndex: number): number {\n let depth = 0;\n let inSingleLineComment = false;\n let inMultiLineComment = false;\n let inSingleQuote = false;\n let inDoubleQuote = false;\n for (let i = openIndex; i < source.length; i += 1) {\n const current = source[i];\n const next = source[i + 1];\n const prev = source[i - 1];\n\n if (inSingleLineComment) {\n if (current === '\\n') inSingleLineComment = false;\n continue;\n }\n if (inMultiLineComment) {\n if (prev === '*' && current === '/') inMultiLineComment = false;\n continue;\n }\n if (inSingleQuote) {\n if (current === \"'\" && prev !== '\\\\') inSingleQuote = false;\n continue;\n }\n if (inDoubleQuote) {\n if (current === '\"' && prev !== '\\\\') inDoubleQuote = false;\n continue;\n }\n if (current === '/' && next === '/') {\n inSingleLineComment = true;\n i += 1;\n continue;\n }\n if (current === '/' && next === '*') {\n inMultiLineComment = true;\n i += 1;\n continue;\n }\n if (current === \"'\") {\n inSingleQuote = true;\n continue;\n }\n if (current === '\"') {\n inDoubleQuote = true;\n continue;\n }\n if (current === '{') depth += 1;\n else if (current === '}') {\n depth -= 1;\n if (depth === 0) return i;\n }\n }\n throw new Error('Unbalanced braces in C# file');\n }\n}\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpStructures.d.ts","names":[],"sources":["../../../src/postinstall/unreal/CSharpStructures.ts"],"mappings":";KAAY;UAEK;WACN;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;;UAGM;WACN,MAAM;WACN,WAAW;WACX,iBAAiB;WACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpWrapperFactory.d.ts","names":[],"sources":["../../../src/postinstall/unreal/CSharpWrapperFactory.ts"],"mappings":";KAEY;;;;;;;;;;;;;;;;;;;;;cAsBC;EACJ,cAAc,mBAAmB,aAAa,oBAAoB,qBAAqB;UA8BtF"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as CSharpAst from "@amplication/csharp-ast";
|
|
2
|
-
|
|
3
|
-
//#region src/postinstall/unreal/CSharpWrapperFactory.ts
|
|
4
|
-
/**
|
|
5
|
-
* Produces the hashed helper class that wraps user-supplied `classBody` content.
|
|
6
|
-
*
|
|
7
|
-
* The helper has the shape:
|
|
8
|
-
*
|
|
9
|
-
* ```csharp
|
|
10
|
-
* static class UAPKG_<hash>
|
|
11
|
-
* {
|
|
12
|
-
* public static void Apply(ModuleRules|TargetRules rules|target)
|
|
13
|
-
* {
|
|
14
|
-
* <user body>
|
|
15
|
-
* }
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* We use `@amplication/csharp-ast` to generate a syntactically valid class and
|
|
20
|
-
* then patch the output:
|
|
21
|
-
* * strip an invalid `using ;` line the library emits for empty namespaces;
|
|
22
|
-
* * retype the `object` parameter back to the requested ModuleRules/TargetRules.
|
|
23
|
-
*/
|
|
24
|
-
var CSharpWrapperFactory = class {
|
|
25
|
-
createWrapper(className, contextType, contextName, body) {
|
|
26
|
-
const wrapperClass = new CSharpAst.Class({
|
|
27
|
-
name: className,
|
|
28
|
-
namespace: "",
|
|
29
|
-
access: "private",
|
|
30
|
-
static_: true,
|
|
31
|
-
isNestedClass: true
|
|
32
|
-
});
|
|
33
|
-
const applyMethod = new CSharpAst.Method({
|
|
34
|
-
name: "Apply",
|
|
35
|
-
access: "public",
|
|
36
|
-
isAsync: false,
|
|
37
|
-
type: CSharpAst.MethodType.STATIC,
|
|
38
|
-
parameters: [new CSharpAst.Parameter({
|
|
39
|
-
name: contextName,
|
|
40
|
-
type: CSharpAst.Type.object()
|
|
41
|
-
})],
|
|
42
|
-
body: new CSharpAst.CodeBlock({ code: body.trim() })
|
|
43
|
-
});
|
|
44
|
-
wrapperClass.addMethod(applyMethod);
|
|
45
|
-
const writer = new CSharpAst.Writer({});
|
|
46
|
-
writer.writeNode(wrapperClass);
|
|
47
|
-
return this.normalize(writer.toString(), contextType, contextName);
|
|
48
|
-
}
|
|
49
|
-
normalize(source, contextType, contextName) {
|
|
50
|
-
return source.trim().replace(/[ \t]+\n/g, "\n").replace(/^private static class/m, "static class").replace(new RegExp(`public static void Apply\\(object\\s+${contextName}\\)`), `public static void Apply(${contextType} ${contextName})`).replace(/\)\s*{\n/g, ")\n {\n").replace(/;\}/g, ";\n }");
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
export { CSharpWrapperFactory };
|
|
56
|
-
//# sourceMappingURL=CSharpWrapperFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSharpWrapperFactory.js","names":[],"sources":["../../../src/postinstall/unreal/CSharpWrapperFactory.ts"],"sourcesContent":["import * as CSharpAst from '@amplication/csharp-ast';\n\nexport type WrapperContextType = 'ModuleRules' | 'TargetRules';\n\n/**\n * Produces the hashed helper class that wraps user-supplied `classBody` content.\n *\n * The helper has the shape:\n *\n * ```csharp\n * static class UAPKG_<hash>\n * {\n * public static void Apply(ModuleRules|TargetRules rules|target)\n * {\n * <user body>\n * }\n * }\n * ```\n *\n * We use `@amplication/csharp-ast` to generate a syntactically valid class and\n * then patch the output:\n * * strip an invalid `using ;` line the library emits for empty namespaces;\n * * retype the `object` parameter back to the requested ModuleRules/TargetRules.\n */\nexport class CSharpWrapperFactory {\n public createWrapper(className: string, contextType: WrapperContextType, contextName: string, body: string): string {\n const wrapperClass = new CSharpAst.Class({\n name: className,\n namespace: '',\n access: 'private',\n static_: true,\n isNestedClass: true,\n });\n const applyMethod = new CSharpAst.Method({\n name: 'Apply',\n access: 'public',\n isAsync: false,\n type: CSharpAst.MethodType.STATIC,\n parameters: [\n new CSharpAst.Parameter({\n name: contextName,\n // csharp-ast adds invalid `using ;` when ClassReference namespace is empty.\n // We emit with `object` and patch to ModuleRules/TargetRules below.\n type: CSharpAst.Type.object(),\n }),\n ],\n body: new CSharpAst.CodeBlock({ code: body.trim() }),\n });\n wrapperClass.addMethod(applyMethod);\n\n const writer = new CSharpAst.Writer({});\n writer.writeNode(wrapperClass);\n return this.normalize(writer.toString(), contextType, contextName);\n }\n\n private normalize(source: string, contextType: WrapperContextType, contextName: string): string {\n const withoutTrailing = source.trim().replace(/[ \\t]+\\n/g, '\\n');\n return withoutTrailing\n .replace(/^private static class/m, 'static class')\n .replace(\n new RegExp(`public static void Apply\\\\(object\\\\s+${contextName}\\\\)`),\n `public static void Apply(${contextType} ${contextName})`,\n )\n .replace(/\\)\\s*{\\n/g, ')\\n {\\n')\n .replace(/;\\}/g, ';\\n }');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,uBAAb,MAAkC;CAChC,AAAO,cAAc,WAAmB,aAAiC,aAAqB,MAAsB;EAClH,MAAM,eAAe,IAAI,UAAU,MAAM;GACvC,MAAM;GACN,WAAW;GACX,QAAQ;GACR,SAAS;GACT,eAAe;EACjB,CAAC;EACD,MAAM,cAAc,IAAI,UAAU,OAAO;GACvC,MAAM;GACN,QAAQ;GACR,SAAS;GACT,MAAM,UAAU,WAAW;GAC3B,YAAY,CACV,IAAI,UAAU,UAAU;IACtB,MAAM;IAGN,MAAM,UAAU,KAAK,OAAO;GAC9B,CAAC,CACH;GACA,MAAM,IAAI,UAAU,UAAU,EAAE,MAAM,KAAK,KAAK,EAAE,CAAC;EACrD,CAAC;EACD,aAAa,UAAU,WAAW;EAElC,MAAM,SAAS,IAAI,UAAU,OAAO,CAAC,CAAC;EACtC,OAAO,UAAU,YAAY;EAC7B,OAAO,KAAK,UAAU,OAAO,SAAS,GAAG,aAAa,WAAW;CACnE;CAEA,AAAQ,UAAU,QAAgB,aAAiC,aAA6B;EAE9F,OADwB,OAAO,KAAK,CAAC,CAAC,QAAQ,aAAa,IACtC,CAAC,CACnB,QAAQ,0BAA0B,cAAc,CAAC,CACjD,QACC,IAAI,OAAO,wCAAwC,YAAY,IAAI,GACnE,4BAA4B,YAAY,GAAG,YAAY,EACzD,CAAC,CACA,QAAQ,aAAa,YAAY,CAAC,CAClC,QAAQ,QAAQ,UAAU;CAC/B;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginHash.d.ts","names":[],"sources":["../../../src/postinstall/unreal/PluginHash.ts"],"mappings":";;iBAGgB,cAAc;;;;;iBAQd,oBAAoB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
|
|
3
|
-
//#region src/postinstall/unreal/PluginHash.ts
|
|
4
|
-
/** Deterministic 8-char SHA-1 hash of a plugin name; used for uniquely-named helper classes. */
|
|
5
|
-
function getPluginHash(pluginName) {
|
|
6
|
-
return createHash("sha1").update(pluginName).digest("hex").slice(0, 8).toLowerCase();
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Name of the nested helper class uapkg injects into a Build.cs / Target.cs.
|
|
10
|
-
* Hashed so two plugins can never collide inside the same module or target.
|
|
11
|
-
*/
|
|
12
|
-
function getWrapperClassName(pluginName) {
|
|
13
|
-
return `UAPKG_${getPluginHash(pluginName)}`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { getPluginHash, getWrapperClassName };
|
|
18
|
-
//# sourceMappingURL=PluginHash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginHash.js","names":[],"sources":["../../../src/postinstall/unreal/PluginHash.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\n\n/** Deterministic 8-char SHA-1 hash of a plugin name; used for uniquely-named helper classes. */\nexport function getPluginHash(pluginName: string): string {\n return createHash('sha1').update(pluginName).digest('hex').slice(0, 8).toLowerCase();\n}\n\n/**\n * Name of the nested helper class uapkg injects into a Build.cs / Target.cs.\n * Hashed so two plugins can never collide inside the same module or target.\n */\nexport function getWrapperClassName(pluginName: string): string {\n return `UAPKG_${getPluginHash(pluginName)}`;\n}\n"],"mappings":";;;;AAGA,SAAgB,cAAc,YAA4B;CACxD,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY;AACrF;;;;;AAMA,SAAgB,oBAAoB,YAA4B;CAC9D,OAAO,SAAS,cAAc,UAAU;AAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrettyParseError.d.ts","names":[],"sources":["../../../src/postinstall/unreal/PrettyParseError.ts"],"mappings":";;;;;;;;;cAQa,yBAAyB;WACpB;WACA;WACA;EAEhB,YAAmB,kBAAkB,iBAAiB,gBAAgB"}
|