@uapkg/cli 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/CompositionRoot.d.ts +36 -33
- package/dist/app/CompositionRoot.d.ts.map +1 -1
- package/dist/app/CompositionRoot.js +91 -109
- package/dist/app/CompositionRoot.js.map +1 -1
- package/dist/app/UAPKGApplication.d.ts +6 -3
- package/dist/app/UAPKGApplication.d.ts.map +1 -1
- package/dist/app/UAPKGApplication.js +155 -169
- package/dist/app/UAPKGApplication.js.map +1 -1
- package/dist/build/BuildMetadata.d.ts +9 -6
- package/dist/build/BuildMetadata.d.ts.map +1 -1
- package/dist/build/BuildMetadata.js +2 -2
- package/dist/cli/UAPKGCommandLine.d.ts +259 -257
- package/dist/cli/UAPKGCommandLine.d.ts.map +1 -1
- package/dist/cli/UAPKGCommandLine.js +248 -239
- package/dist/cli/UAPKGCommandLine.js.map +1 -1
- package/dist/cli/parseCommandLine.d.ts +5 -1
- package/dist/cli/parseCommandLine.d.ts.map +1 -1
- package/dist/cli/parseCommandLine.js +8 -3
- package/dist/cli/parseCommandLine.js.map +1 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.d.ts +9 -6
- package/dist/cli/parsing/UAPKGCommandLineParser.d.ts.map +1 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.js +23 -31
- package/dist/cli/parsing/UAPKGCommandLineParser.js.map +1 -1
- package/dist/cli/parsing/UAPKGParserRegistry.d.ts +12 -9
- package/dist/cli/parsing/UAPKGParserRegistry.d.ts.map +1 -1
- package/dist/cli/parsing/UAPKGParserRegistry.js +53 -50
- package/dist/cli/parsing/UAPKGParserRegistry.js.map +1 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts +9 -6
- package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.js +1 -2
- package/dist/cli/parsing/modules/AddCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/AddCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/AddCommandModule.js +49 -36
- package/dist/cli/parsing/modules/AddCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/ConfigCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.js +87 -83
- package/dist/cli/parsing/modules/ConfigCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/InitCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/InitCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/InitCommandModule.js +25 -22
- package/dist/cli/parsing/modules/InitCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/InstallCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/InstallCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/InstallCommandModule.js +36 -28
- package/dist/cli/parsing/modules/InstallCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.js +78 -50
- package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/ListCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/ListCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/ListCommandModule.js +26 -15
- package/dist/cli/parsing/modules/ListCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/LoginCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/LoginCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/LoginCommandModule.js +34 -33
- package/dist/cli/parsing/modules/LoginCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/LogoutCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.js +30 -28
- package/dist/cli/parsing/modules/LogoutCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.js +21 -16
- package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/PackCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/PackCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/PackCommandModule.js +30 -28
- package/dist/cli/parsing/modules/PackCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js +14 -11
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/PublishCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/PublishCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/PublishCommandModule.js +63 -47
- package/dist/cli/parsing/modules/PublishCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/RegistryCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.js +117 -120
- package/dist/cli/parsing/modules/RegistryCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/RemoveCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.js +25 -14
- package/dist/cli/parsing/modules/RemoveCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/RequestsCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.js +56 -60
- package/dist/cli/parsing/modules/RequestsCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/UpdateCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.js +38 -25
- package/dist/cli/parsing/modules/UpdateCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.js +30 -28
- package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/WhyCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/WhyCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/WhyCommandModule.js +25 -14
- package/dist/cli/parsing/modules/WhyCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/sharedOptions.d.ts +8 -5
- package/dist/cli/parsing/modules/sharedOptions.d.ts.map +1 -1
- package/dist/cli/parsing/modules/sharedOptions.js +18 -23
- package/dist/cli/parsing/modules/sharedOptions.js.map +1 -1
- package/dist/cli/runUAPKGCLI.d.ts +4 -1
- package/dist/cli/runUAPKGCLI.d.ts.map +1 -1
- package/dist/cli/runUAPKGCLI.js +10 -5
- package/dist/cli/runUAPKGCLI.js.map +1 -1
- package/dist/cli-bootstrap.d.ts +1 -2
- package/dist/cli-bootstrap.js +15 -12
- package/dist/cli-bootstrap.js.map +1 -1
- package/dist/commands/AddCommand.d.ts +19 -16
- package/dist/commands/AddCommand.d.ts.map +1 -1
- package/dist/commands/AddCommand.js +49 -53
- package/dist/commands/AddCommand.js.map +1 -1
- package/dist/commands/Command.d.ts +5 -2
- package/dist/commands/Command.d.ts.map +1 -1
- package/dist/commands/Command.js +1 -2
- package/dist/commands/ConfigCommand.d.ts +28 -25
- package/dist/commands/ConfigCommand.d.ts.map +1 -1
- package/dist/commands/ConfigCommand.js +165 -186
- package/dist/commands/ConfigCommand.js.map +1 -1
- package/dist/commands/InitCommand.d.ts +19 -16
- package/dist/commands/InitCommand.d.ts.map +1 -1
- package/dist/commands/InitCommand.js +65 -60
- package/dist/commands/InitCommand.js.map +1 -1
- package/dist/commands/InstallCommand.d.ts +16 -13
- package/dist/commands/InstallCommand.d.ts.map +1 -1
- package/dist/commands/InstallCommand.js +118 -110
- package/dist/commands/InstallCommand.js.map +1 -1
- package/dist/commands/ListCommand.d.ts +13 -10
- package/dist/commands/ListCommand.d.ts.map +1 -1
- package/dist/commands/ListCommand.js +76 -81
- package/dist/commands/ListCommand.js.map +1 -1
- package/dist/commands/LoginCommand.d.ts +17 -14
- package/dist/commands/LoginCommand.d.ts.map +1 -1
- package/dist/commands/LoginCommand.js +66 -72
- package/dist/commands/LoginCommand.js.map +1 -1
- package/dist/commands/LogoutCommand.d.ts +15 -12
- package/dist/commands/LogoutCommand.d.ts.map +1 -1
- package/dist/commands/LogoutCommand.js +36 -37
- package/dist/commands/LogoutCommand.js.map +1 -1
- package/dist/commands/OutdatedCommand.d.ts +12 -9
- package/dist/commands/OutdatedCommand.d.ts.map +1 -1
- package/dist/commands/OutdatedCommand.js +41 -40
- package/dist/commands/OutdatedCommand.js.map +1 -1
- package/dist/commands/PackCommand.d.ts +13 -10
- package/dist/commands/PackCommand.d.ts.map +1 -1
- package/dist/commands/PackCommand.js +26 -21
- package/dist/commands/PackCommand.js.map +1 -1
- package/dist/commands/PackageLifecycleCommand.d.ts +23 -19
- package/dist/commands/PackageLifecycleCommand.d.ts.map +1 -1
- package/dist/commands/PackageLifecycleCommand.js +144 -138
- package/dist/commands/PackageLifecycleCommand.js.map +1 -1
- package/dist/commands/PostinstallCandidateBuilder.d.ts +11 -8
- package/dist/commands/PostinstallCandidateBuilder.d.ts.map +1 -1
- package/dist/commands/PostinstallCandidateBuilder.js +42 -42
- package/dist/commands/PostinstallCandidateBuilder.js.map +1 -1
- package/dist/commands/ProjectGetNameCommand.d.ts +10 -7
- package/dist/commands/ProjectGetNameCommand.d.ts.map +1 -1
- package/dist/commands/ProjectGetNameCommand.js +25 -25
- package/dist/commands/ProjectGetNameCommand.js.map +1 -1
- package/dist/commands/PublishCommand.d.ts +29 -23
- package/dist/commands/PublishCommand.d.ts.map +1 -1
- package/dist/commands/PublishCommand.js +243 -254
- package/dist/commands/PublishCommand.js.map +1 -1
- package/dist/commands/RegistryCommand.d.ts +38 -35
- package/dist/commands/RegistryCommand.d.ts.map +1 -1
- package/dist/commands/RegistryCommand.js +195 -223
- package/dist/commands/RegistryCommand.js.map +1 -1
- package/dist/commands/RemoveCommand.d.ts +14 -11
- package/dist/commands/RemoveCommand.d.ts.map +1 -1
- package/dist/commands/RemoveCommand.js +47 -54
- package/dist/commands/RemoveCommand.js.map +1 -1
- package/dist/commands/RequestsCommand.d.ts +21 -18
- package/dist/commands/RequestsCommand.d.ts.map +1 -1
- package/dist/commands/RequestsCommand.js +82 -95
- package/dist/commands/RequestsCommand.js.map +1 -1
- package/dist/commands/UpdateCommand.d.ts +29 -26
- package/dist/commands/UpdateCommand.d.ts.map +1 -1
- package/dist/commands/UpdateCommand.js +111 -111
- package/dist/commands/UpdateCommand.js.map +1 -1
- package/dist/commands/WhoamiCommand.d.ts +30 -27
- package/dist/commands/WhoamiCommand.d.ts.map +1 -1
- package/dist/commands/WhoamiCommand.js +63 -72
- package/dist/commands/WhoamiCommand.js.map +1 -1
- package/dist/commands/WhyCommand.d.ts +13 -10
- package/dist/commands/WhyCommand.d.ts.map +1 -1
- package/dist/commands/WhyCommand.js +45 -44
- package/dist/commands/WhyCommand.js.map +1 -1
- package/dist/commands/add/DependencyAddResolver.d.ts +14 -11
- package/dist/commands/add/DependencyAddResolver.d.ts.map +1 -1
- package/dist/commands/add/DependencyAddResolver.js +36 -36
- package/dist/commands/add/DependencyAddResolver.js.map +1 -1
- package/dist/control-plane/AccountManager.d.ts +96 -94
- package/dist/control-plane/AccountManager.d.ts.map +1 -1
- package/dist/control-plane/AccountManager.js +775 -967
- package/dist/control-plane/AccountManager.js.map +1 -1
- package/dist/control-plane/ArtifactObserver.d.ts +19 -16
- package/dist/control-plane/ArtifactObserver.d.ts.map +1 -1
- package/dist/control-plane/ArtifactObserver.js +73 -59
- package/dist/control-plane/ArtifactObserver.js.map +1 -1
- package/dist/control-plane/AuthMetadataStore.d.ts +16 -13
- package/dist/control-plane/AuthMetadataStore.d.ts.map +1 -1
- package/dist/control-plane/AuthMetadataStore.js +111 -113
- package/dist/control-plane/AuthMetadataStore.js.map +1 -1
- package/dist/control-plane/AuthStoragePaths.d.ts +7 -4
- package/dist/control-plane/AuthStoragePaths.d.ts.map +1 -1
- package/dist/control-plane/AuthStoragePaths.js +19 -14
- package/dist/control-plane/AuthStoragePaths.js.map +1 -1
- package/dist/control-plane/AuthenticationSelector.d.ts +21 -18
- package/dist/control-plane/AuthenticationSelector.d.ts.map +1 -1
- package/dist/control-plane/AuthenticationSelector.js +69 -63
- package/dist/control-plane/AuthenticationSelector.js.map +1 -1
- package/dist/control-plane/ControlPlaneClient.d.ts +37 -28
- package/dist/control-plane/ControlPlaneClient.d.ts.map +1 -1
- package/dist/control-plane/ControlPlaneClient.js +265 -254
- package/dist/control-plane/ControlPlaneClient.js.map +1 -1
- package/dist/control-plane/ControlPlaneEndpoints.d.ts +9 -6
- package/dist/control-plane/ControlPlaneEndpoints.d.ts.map +1 -1
- package/dist/control-plane/ControlPlaneEndpoints.js +17 -12
- package/dist/control-plane/ControlPlaneEndpoints.js.map +1 -1
- package/dist/control-plane/ControlPlaneTypes.d.ts +176 -152
- package/dist/control-plane/ControlPlaneTypes.d.ts.map +1 -1
- package/dist/control-plane/ControlPlaneTypes.js +88 -81
- package/dist/control-plane/ControlPlaneTypes.js.map +1 -1
- package/dist/control-plane/CredentialStore.d.ts +20 -18
- package/dist/control-plane/CredentialStore.d.ts.map +1 -1
- package/dist/control-plane/CredentialStore.js +66 -83
- package/dist/control-plane/CredentialStore.js.map +1 -1
- package/dist/control-plane/DPoPKeyStore.d.ts +12 -9
- package/dist/control-plane/DPoPKeyStore.d.ts.map +1 -1
- package/dist/control-plane/DPoPKeyStore.js +57 -53
- package/dist/control-plane/DPoPKeyStore.js.map +1 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts +37 -4
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts.map +1 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js +197 -63
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +1 -1
- package/dist/control-plane/PublishIdempotencyStore.d.ts +25 -9
- package/dist/control-plane/PublishIdempotencyStore.d.ts.map +1 -1
- package/dist/control-plane/PublishIdempotencyStore.js +97 -68
- package/dist/control-plane/PublishIdempotencyStore.js.map +1 -1
- package/dist/control-plane/PublishRequestErrorMapper.d.ts +155 -0
- package/dist/control-plane/PublishRequestErrorMapper.d.ts.map +1 -0
- package/dist/control-plane/PublishRequestErrorMapper.js +597 -0
- package/dist/control-plane/PublishRequestErrorMapper.js.map +1 -0
- package/dist/control-plane/RegistryGrantLock.d.ts +29 -26
- package/dist/control-plane/RegistryGrantLock.d.ts.map +1 -1
- package/dist/control-plane/RegistryGrantLock.js +149 -185
- package/dist/control-plane/RegistryGrantLock.js.map +1 -1
- package/dist/control-plane/RegistryTrustResolver.d.ts +13 -10
- package/dist/control-plane/RegistryTrustResolver.d.ts.map +1 -1
- package/dist/control-plane/RegistryTrustResolver.js +97 -132
- package/dist/control-plane/RegistryTrustResolver.js.map +1 -1
- package/dist/index.d.ts +62 -39
- package/dist/index.js +60 -53
- package/dist/postinstall/api/PostinstallDsl.d.ts +24 -21
- package/dist/postinstall/api/PostinstallDsl.d.ts.map +1 -1
- package/dist/postinstall/api/PostinstallDsl.js +32 -35
- package/dist/postinstall/api/PostinstallDsl.js.map +1 -1
- package/dist/postinstall/api/definePostinstall.d.ts +5 -2
- package/dist/postinstall/api/definePostinstall.d.ts.map +1 -1
- package/dist/postinstall/api/definePostinstall.js +20 -16
- package/dist/postinstall/api/definePostinstall.js.map +1 -1
- package/dist/postinstall/index.d.ts +25 -26
- package/dist/postinstall/index.js +25 -37
- package/dist/postinstall/loader/EntryResolver.d.ts +11 -9
- package/dist/postinstall/loader/EntryResolver.d.ts.map +1 -1
- package/dist/postinstall/loader/EntryResolver.js +36 -32
- package/dist/postinstall/loader/EntryResolver.js.map +1 -1
- package/dist/postinstall/loader/EsbuildTranspiler.d.ts +6 -3
- package/dist/postinstall/loader/EsbuildTranspiler.d.ts.map +1 -1
- package/dist/postinstall/loader/EsbuildTranspiler.js +52 -56
- package/dist/postinstall/loader/EsbuildTranspiler.js.map +1 -1
- package/dist/postinstall/loader/ExportValidator.d.ts +8 -5
- package/dist/postinstall/loader/ExportValidator.d.ts.map +1 -1
- package/dist/postinstall/loader/ExportValidator.js +36 -32
- package/dist/postinstall/loader/ExportValidator.js.map +1 -1
- package/dist/postinstall/loader/ModuleImporter.d.ts +17 -14
- package/dist/postinstall/loader/ModuleImporter.d.ts.map +1 -1
- package/dist/postinstall/loader/ModuleImporter.js +50 -58
- package/dist/postinstall/loader/ModuleImporter.js.map +1 -1
- package/dist/postinstall/loader/PostinstallLoader.d.ts +22 -19
- package/dist/postinstall/loader/PostinstallLoader.d.ts.map +1 -1
- package/dist/postinstall/loader/PostinstallLoader.js +62 -58
- package/dist/postinstall/loader/PostinstallLoader.js.map +1 -1
- package/dist/postinstall/markers/MarkerBlockEditor.d.ts +19 -16
- package/dist/postinstall/markers/MarkerBlockEditor.d.ts.map +1 -1
- package/dist/postinstall/markers/MarkerBlockEditor.js +48 -44
- package/dist/postinstall/markers/MarkerBlockEditor.js.map +1 -1
- package/dist/postinstall/markers/MarkerBlockService.d.ts +10 -7
- package/dist/postinstall/markers/MarkerBlockService.d.ts.map +1 -1
- package/dist/postinstall/markers/MarkerBlockService.js +44 -44
- package/dist/postinstall/markers/MarkerBlockService.js.map +1 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts +12 -9
- package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts.map +1 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.js +47 -52
- package/dist/postinstall/markers/MarkerIntegrityValidator.js.map +1 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.d.ts +25 -23
- package/dist/postinstall/policy/PostinstallPolicyGate.d.ts.map +1 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.js +63 -52
- package/dist/postinstall/policy/PostinstallPolicyGate.js.map +1 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.d.ts +48 -45
- package/dist/postinstall/runner/PostinstallOrchestrator.d.ts.map +1 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.js +172 -170
- package/dist/postinstall/runner/PostinstallOrchestrator.js.map +1 -1
- package/dist/postinstall/unreal/BuildCsInjector.d.ts +16 -13
- package/dist/postinstall/unreal/BuildCsInjector.d.ts.map +1 -1
- package/dist/postinstall/unreal/BuildCsInjector.js +58 -53
- package/dist/postinstall/unreal/BuildCsInjector.js.map +1 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts +13 -10
- package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.js +56 -59
- package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +1 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts +11 -8
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js +123 -127
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +1 -1
- package/dist/postinstall/unreal/CSharpStructures.d.ts +18 -15
- package/dist/postinstall/unreal/CSharpStructures.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpStructures.js +1 -2
- package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts +7 -4
- package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpWrapperFactory.js +54 -58
- package/dist/postinstall/unreal/CSharpWrapperFactory.js.map +1 -1
- package/dist/postinstall/unreal/PluginHash.d.ts +5 -2
- package/dist/postinstall/unreal/PluginHash.d.ts.map +1 -1
- package/dist/postinstall/unreal/PluginHash.js +13 -8
- package/dist/postinstall/unreal/PluginHash.js.map +1 -1
- package/dist/postinstall/unreal/PrettyParseError.d.ts +8 -5
- package/dist/postinstall/unreal/PrettyParseError.d.ts.map +1 -1
- package/dist/postinstall/unreal/PrettyParseError.js +37 -37
- package/dist/postinstall/unreal/PrettyParseError.js.map +1 -1
- package/dist/postinstall/unreal/ProjectFileLocator.d.ts +12 -9
- package/dist/postinstall/unreal/ProjectFileLocator.d.ts.map +1 -1
- package/dist/postinstall/unreal/ProjectFileLocator.js +49 -51
- package/dist/postinstall/unreal/ProjectFileLocator.js.map +1 -1
- package/dist/postinstall/unreal/TargetCsInjector.d.ts +16 -13
- package/dist/postinstall/unreal/TargetCsInjector.d.ts.map +1 -1
- package/dist/postinstall/unreal/TargetCsInjector.js +58 -53
- package/dist/postinstall/unreal/TargetCsInjector.js.map +1 -1
- package/dist/postinstall/unreal/UProjectInjector.d.ts +6 -3
- package/dist/postinstall/unreal/UProjectInjector.d.ts.map +1 -1
- package/dist/postinstall/unreal/UProjectInjector.js +56 -52
- package/dist/postinstall/unreal/UProjectInjector.js.map +1 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.d.ts +5 -2
- package/dist/postinstall/unreal/UProjectMetadataReader.d.ts.map +1 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.js +22 -18
- package/dist/postinstall/unreal/UProjectMetadataReader.js.map +1 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts +17 -14
- package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts.map +1 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.js +50 -50
- package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +1 -1
- package/dist/prompts/InkPromptService.d.ts +10 -7
- package/dist/prompts/InkPromptService.d.ts.map +1 -1
- package/dist/prompts/InkPromptService.js +100 -71
- package/dist/prompts/InkPromptService.js.map +1 -1
- package/dist/prompts/ProjectContextDetector.d.ts +10 -7
- package/dist/prompts/ProjectContextDetector.d.ts.map +1 -1
- package/dist/prompts/ProjectContextDetector.js +32 -26
- package/dist/prompts/ProjectContextDetector.js.map +1 -1
- package/dist/prompts/PromptService.d.ts +11 -8
- package/dist/prompts/PromptService.d.ts.map +1 -1
- package/dist/prompts/PromptService.js +1 -8
- package/dist/reporting/DiagnosticDeduplicator.d.ts +8 -5
- package/dist/reporting/DiagnosticDeduplicator.d.ts.map +1 -1
- package/dist/reporting/DiagnosticDeduplicator.js +36 -35
- package/dist/reporting/DiagnosticDeduplicator.js.map +1 -1
- package/dist/reporting/DiagnosticRenderer.d.ts +11 -8
- package/dist/reporting/DiagnosticRenderer.d.ts.map +1 -1
- package/dist/reporting/DiagnosticRenderer.js +1 -2
- package/dist/reporting/DiagnosticReporter.d.ts +12 -9
- package/dist/reporting/DiagnosticReporter.d.ts.map +1 -1
- package/dist/reporting/DiagnosticReporter.js +40 -39
- package/dist/reporting/DiagnosticReporter.js.map +1 -1
- package/dist/reporting/InkDiagnosticRenderer.d.ts +12 -9
- package/dist/reporting/InkDiagnosticRenderer.d.ts.map +1 -1
- package/dist/reporting/InkDiagnosticRenderer.js +50 -42
- package/dist/reporting/InkDiagnosticRenderer.js.map +1 -1
- package/dist/reporting/InstallProgressReporter.d.ts +23 -20
- package/dist/reporting/InstallProgressReporter.d.ts.map +1 -1
- package/dist/reporting/InstallProgressReporter.js +48 -47
- package/dist/reporting/InstallProgressReporter.js.map +1 -1
- package/dist/reporting/JsonReporter.d.ts +16 -13
- package/dist/reporting/JsonReporter.d.ts.map +1 -1
- package/dist/reporting/JsonReporter.js +34 -20
- package/dist/reporting/JsonReporter.js.map +1 -1
- package/dist/reporting/RegistryRequestTerminalFormatter.d.ts +36 -0
- package/dist/reporting/RegistryRequestTerminalFormatter.d.ts.map +1 -0
- package/dist/reporting/RegistryRequestTerminalFormatter.js +90 -0
- package/dist/reporting/RegistryRequestTerminalFormatter.js.map +1 -0
- package/dist/reporting/TextDiagnosticRenderer.d.ts +11 -8
- package/dist/reporting/TextDiagnosticRenderer.d.ts.map +1 -1
- package/dist/reporting/TextDiagnosticRenderer.js +36 -28
- package/dist/reporting/TextDiagnosticRenderer.js.map +1 -1
- package/dist/reporting/TextSink.d.ts +14 -11
- package/dist/reporting/TextSink.d.ts.map +1 -1
- package/dist/reporting/TextSink.js +24 -20
- package/dist/reporting/TextSink.js.map +1 -1
- package/package.json +31 -32
- package/dist/cli/parsing/contracts/UAPKGCommandModule.js.map +0 -1
- package/dist/cli-bootstrap.d.ts.map +0 -1
- package/dist/commands/Command.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/postinstall/index.d.ts.map +0 -1
- package/dist/postinstall/index.js.map +0 -1
- package/dist/postinstall/unreal/CSharpStructures.js.map +0 -1
- package/dist/prompts/PromptService.js.map +0 -1
- package/dist/reporting/DiagnosticRenderer.js.map +0 -1
|
@@ -1,172 +1,174 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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
|
|
10
12
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
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 };
|
|
172
174
|
//# sourceMappingURL=PostinstallOrchestrator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostinstallOrchestrator.js","sourceRoot":"","sources":["../../../src/postinstall/runner/PostinstallOrchestrator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE1G,OAAO,EAA0B,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAgC7E;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,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,WAAW,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACtG,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,SAAS,CAAC;IACpB,CAAC;IAEO,MAAM,CAAC,MAAoB,EAAE,GAAkB,EAAE,MAAkB;QACzE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,WAAW;YAAE,GAAG,CAAC,GAAG,CAAC,CAAe,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,CAAC,EAAE;YAAE,MAAM,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
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 '../api/PostinstallDsl.js';\nimport { type LoadedPostinstall, PostinstallLoader } from '../loader/PostinstallLoader.js';\nimport { PostinstallPolicyGate } from '../policy/PostinstallPolicyGate.js';\nimport { BuildCsInjector } from '../unreal/BuildCsInjector.js';\nimport { ProjectFileLocator } from '../unreal/ProjectFileLocator.js';\nimport { TargetCsInjector } from '../unreal/TargetCsInjector.js';\nimport { UnrealSourceCatalogBuilder } from '../unreal/UnrealSourceCatalog.js';\nimport { UProjectInjector } from '../unreal/UProjectInjector.js';\nimport { UProjectMetadataReader } from '../unreal/UProjectMetadataReader.js';\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAa,0BAAb,MAAqC;CAEhB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CARnB,AAAO,YACL,AAAiB,SAA4B,IAAI,kBAAkB,GACnE,AAAiB,SAAgC,IAAI,sBAAsB,GAC3E,AAAiB,iBAA6C,IAAI,2BAA2B,GAC7F,AAAiB,gBAAiC,IAAI,gBAAgB,GACtE,AAAiB,iBAAmC,IAAI,iBAAiB,GACzE,AAAiB,kBAAoC,IAAI,iBAAiB,GAC1E,AAAiB,qBAAyC,IAAI,mBAAmB,GACjF,AAAiB,iBAAyC,IAAI,uBAAuB,GACrF;EARiB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAChB;CAEH,MAAa,IAAI,OAAyE;EACxF,MAAM,MAAM,IAAI,cAAc;EAC9B,MAAM,WAAqB,CAAC;EAC5B,MAAM,UAA4E,CAAC;EAEnF,IAAI,MAAM,iBAAiB,aAAa,MAAM,WAAW,WAAW,GAClE,OAAO,IAAI,SAAS;GAAE;GAAU;EAAQ,CAAC;EAG3C,MAAM,OAAO,MAAM,KAAK,UAAU,MAAM,YAAY,KAAK,OAAO;EAChE,IAAI,KAAK,WAAW,GAClB,OAAO,IAAI,SAAS;GAAE;GAAU;EAAQ,CAAC;EAG3C,MAAM,gBAAgB,KAAK,aAAa,MAAM,aAAa,MAAM,MAAM,kBAAkB;EACzF,IAAI,CAAC,cAAc,IAAI;GACrB,IAAI,WAAW,cAAc,WAAW;GACxC,OAAO,IAAI,UAAU;EACvB;EACA,MAAM,EAAE,SAAS,gBAAgB,cAAc;EAE/C,KAAK,MAAM,SAAS,MAElB,IADgB,KAAK,YAAY,MAAM,aAAa,OAAO,SAAS,aAAa,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,OAAO,aAAa,IAAI,IAAI,CAAe;EAC3D,IAAI,CAAC,OAAO,IAAI,OAAO;CACzB;AACF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { ZoneDefinition } from "../api/PostinstallDsl.js";
|
|
2
|
+
import { MarkerBlockEditor } from "../markers/MarkerBlockEditor.js";
|
|
3
|
+
import { CSharpInjectionEngine } from "./CSharpInjectionEngine.js";
|
|
4
|
+
import { CSharpStructureAnalyzer } from "./CSharpStructureAnalyzer.js";
|
|
5
|
+
import { CSharpWrapperFactory } from "./CSharpWrapperFactory.js";
|
|
6
|
+
import { Result } from "@uapkg/diagnostics";
|
|
7
|
+
//#region src/postinstall/unreal/BuildCsInjector.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* Injects a plugin's `setupModules` content into a single `*.Build.cs` file.
|
|
9
10
|
*
|
|
@@ -12,12 +13,14 @@ import { CSharpWrapperFactory } from './CSharpWrapperFactory.js';
|
|
|
12
13
|
* mutation, pre-existing owned marker blocks are checked for corruption
|
|
13
14
|
* (orphaned / nested markers) and surfaced as `POSTINSTALL_MARKER_CORRUPT`.
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
declare class BuildCsInjector {
|
|
17
|
+
private readonly analyzer;
|
|
18
|
+
private readonly wrapperFactory;
|
|
19
|
+
private readonly injector;
|
|
20
|
+
private readonly markerEditor;
|
|
21
|
+
constructor(analyzer?: CSharpStructureAnalyzer, wrapperFactory?: CSharpWrapperFactory, injector?: CSharpInjectionEngine, markerEditor?: MarkerBlockEditor);
|
|
22
|
+
apply(filePath: string, pluginName: string, zones: ZoneDefinition): Result<void>;
|
|
22
23
|
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { BuildCsInjector };
|
|
23
26
|
//# sourceMappingURL=BuildCsInjector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildCsInjector.d.ts","
|
|
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,55 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
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
|
+
];
|
|
9
15
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
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 };
|
|
55
60
|
//# sourceMappingURL=BuildCsInjector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildCsInjector.js","
|
|
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 '../api/PostinstallDsl.js';\nimport { MarkerBlockEditor } from '../markers/MarkerBlockEditor.js';\nimport { CSharpInjectionEngine } from './CSharpInjectionEngine.js';\nimport { CSharpStructureAnalyzer } from './CSharpStructureAnalyzer.js';\nimport { CSharpWrapperFactory } from './CSharpWrapperFactory.js';\nimport { getWrapperClassName } from './PluginHash.js';\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,5 +1,6 @@
|
|
|
1
|
-
import { MarkerBlockService } from
|
|
2
|
-
import
|
|
1
|
+
import { MarkerBlockService } from "../markers/MarkerBlockService.js";
|
|
2
|
+
import { ParsedCSharpFile } from "./CSharpStructures.js";
|
|
3
|
+
//#region src/postinstall/unreal/CSharpInjectionEngine.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Applies marker-delimited edits to a parsed C# file at three well-known anchors:
|
|
5
6
|
*
|
|
@@ -10,13 +11,15 @@ import type { ParsedCSharpFile } from './CSharpStructures.js';
|
|
|
10
11
|
* Every edit is wrapped in an owned `UAPKG-BEGIN/END` marker block so re-running
|
|
11
12
|
* uapkg is idempotent. Existing owned blocks are stripped before re-insert.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
declare class CSharpInjectionEngine {
|
|
15
|
+
private readonly markerBlock;
|
|
16
|
+
constructor(markerBlock?: MarkerBlockService);
|
|
17
|
+
applyIncludes(source: string, pluginName: string, includesContent: string, zone: string): string;
|
|
18
|
+
applyClassWrapper(parsed: ParsedCSharpFile, pluginName: string, wrapperContent: string, zone: string): string;
|
|
19
|
+
applyConstructorCall(parsed: ParsedCSharpFile, pluginName: string, callExpression: string, zone: string): string;
|
|
20
|
+
private detectClassMemberIndent;
|
|
21
|
+
private detectConstructorIndent;
|
|
21
22
|
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CSharpInjectionEngine };
|
|
22
25
|
//# sourceMappingURL=CSharpInjectionEngine.d.ts.map
|