@uapkg/cli 1.2.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 -129
- 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 -244
- 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,60 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { EntryResolver } from "./EntryResolver.js";
|
|
2
|
+
import { EsbuildTranspiler } from "./EsbuildTranspiler.js";
|
|
3
|
+
import { ExportValidator } from "./ExportValidator.js";
|
|
4
|
+
import { ModuleImporter } from "./ModuleImporter.js";
|
|
5
|
+
import { fail, ok } from "@uapkg/diagnostics";
|
|
6
|
+
|
|
7
|
+
//#region src/postinstall/loader/PostinstallLoader.ts
|
|
6
8
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
9
|
+
* Facade that composes the four loader stages:
|
|
10
|
+
* 1. {@link EntryResolver} locate `.uapkg/postinstall.<ext>`
|
|
11
|
+
* 2. {@link EsbuildTranspiler} if `.ts`, transpile to ESM
|
|
12
|
+
* 3. {@link ModuleImporter} dynamic import → raw module value
|
|
13
|
+
* 4. {@link ExportValidator} Zod-validate default export
|
|
14
|
+
*
|
|
15
|
+
* Returns `ok(null)` when a plugin has no postinstall — a valid, silent state.
|
|
16
|
+
* Never throws: every stage returns `Result`.
|
|
17
|
+
*/
|
|
18
|
+
var PostinstallLoader = class {
|
|
19
|
+
entryResolver;
|
|
20
|
+
transpiler;
|
|
21
|
+
importer;
|
|
22
|
+
validator;
|
|
23
|
+
constructor(entryResolver = new EntryResolver(), transpiler = new EsbuildTranspiler(), importer = new ModuleImporter(), validator = new ExportValidator()) {
|
|
24
|
+
this.entryResolver = entryResolver;
|
|
25
|
+
this.transpiler = transpiler;
|
|
26
|
+
this.importer = importer;
|
|
27
|
+
this.validator = validator;
|
|
28
|
+
}
|
|
29
|
+
async load(packageName, pluginRoot) {
|
|
30
|
+
const entryResult = this.entryResolver.resolve(packageName, pluginRoot);
|
|
31
|
+
if (!entryResult.ok) return entryResult;
|
|
32
|
+
const entry = entryResult.value;
|
|
33
|
+
if (entry === null) return ok(null);
|
|
34
|
+
const sourceResult = await this.buildModuleSource(packageName, entry);
|
|
35
|
+
if (!sourceResult.ok) return sourceResult;
|
|
36
|
+
const importResult = await this.importer.import(packageName, sourceResult.value);
|
|
37
|
+
if (!importResult.ok) return importResult;
|
|
38
|
+
const validated = this.validator.validate(packageName, entry.path, importResult.value);
|
|
39
|
+
if (!validated.ok) return validated;
|
|
40
|
+
return ok({
|
|
41
|
+
packageName,
|
|
42
|
+
pluginRoot,
|
|
43
|
+
entryFile: entry.path,
|
|
44
|
+
definition: validated.value
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async buildModuleSource(packageName, entry) {
|
|
48
|
+
if (entry.kind !== "ts") return ok({
|
|
49
|
+
kind: "file",
|
|
50
|
+
path: entry.path
|
|
51
|
+
});
|
|
52
|
+
const transpiled = await this.transpiler.transpile(packageName, entry.path);
|
|
53
|
+
if (!transpiled.ok) return fail(transpiled.diagnostics);
|
|
54
|
+
return ok({
|
|
55
|
+
kind: "transpiled",
|
|
56
|
+
code: transpiled.value,
|
|
57
|
+
originalPath: entry.path
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { PostinstallLoader };
|
|
60
64
|
//# sourceMappingURL=PostinstallLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostinstallLoader.js","
|
|
1
|
+
{"version":3,"file":"PostinstallLoader.js","names":[],"sources":["../../../src/postinstall/loader/PostinstallLoader.ts"],"sourcesContent":["import { fail, ok, type Result } from '@uapkg/diagnostics';\nimport type { PostinstallDefinition } from '../api/PostinstallDsl.js';\nimport { EntryResolver, type ResolvedEntry } from './EntryResolver.js';\nimport { EsbuildTranspiler } from './EsbuildTranspiler.js';\nimport { ExportValidator } from './ExportValidator.js';\nimport { ModuleImporter, type ModuleSource } from './ModuleImporter.js';\n\nexport interface LoadedPostinstall {\n readonly packageName: string;\n readonly pluginRoot: string;\n readonly entryFile: string;\n readonly definition: PostinstallDefinition;\n}\n\n/**\n * Facade that composes the four loader stages:\n * 1. {@link EntryResolver} locate `.uapkg/postinstall.<ext>`\n * 2. {@link EsbuildTranspiler} if `.ts`, transpile to ESM\n * 3. {@link ModuleImporter} dynamic import → raw module value\n * 4. {@link ExportValidator} Zod-validate default export\n *\n * Returns `ok(null)` when a plugin has no postinstall — a valid, silent state.\n * Never throws: every stage returns `Result`.\n */\nexport class PostinstallLoader {\n public constructor(\n private readonly entryResolver: EntryResolver = new EntryResolver(),\n private readonly transpiler: EsbuildTranspiler = new EsbuildTranspiler(),\n private readonly importer: ModuleImporter = new ModuleImporter(),\n private readonly validator: ExportValidator = new ExportValidator(),\n ) {}\n\n public async load(packageName: string, pluginRoot: string): Promise<Result<LoadedPostinstall | null>> {\n const entryResult = this.entryResolver.resolve(packageName, pluginRoot);\n if (!entryResult.ok) return entryResult;\n const entry = entryResult.value;\n if (entry === null) return ok(null);\n\n const sourceResult = await this.buildModuleSource(packageName, entry);\n if (!sourceResult.ok) return sourceResult;\n\n const importResult = await this.importer.import(packageName, sourceResult.value);\n if (!importResult.ok) return importResult;\n\n const validated = this.validator.validate(packageName, entry.path, importResult.value);\n if (!validated.ok) return validated;\n\n return ok({\n packageName,\n pluginRoot,\n entryFile: entry.path,\n definition: validated.value,\n });\n }\n\n private async buildModuleSource(packageName: string, entry: ResolvedEntry): Promise<Result<ModuleSource>> {\n if (entry.kind !== 'ts') {\n return ok({ kind: 'file', path: entry.path });\n }\n const transpiled = await this.transpiler.transpile(packageName, entry.path);\n if (!transpiled.ok) return fail(transpiled.diagnostics);\n return ok({ kind: 'transpiled', code: transpiled.value, originalPath: entry.path });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAa,oBAAb,MAA+B;CAEV;CACA;CACA;CACA;CAJnB,AAAO,YACL,AAAiB,gBAA+B,IAAI,cAAc,GAClE,AAAiB,aAAgC,IAAI,kBAAkB,GACvE,AAAiB,WAA2B,IAAI,eAAe,GAC/D,AAAiB,YAA6B,IAAI,gBAAgB,GAClE;EAJiB;EACA;EACA;EACA;CAChB;CAEH,MAAa,KAAK,aAAqB,YAA+D;EACpG,MAAM,cAAc,KAAK,cAAc,QAAQ,aAAa,UAAU;EACtE,IAAI,CAAC,YAAY,IAAI,OAAO;EAC5B,MAAM,QAAQ,YAAY;EAC1B,IAAI,UAAU,MAAM,OAAO,GAAG,IAAI;EAElC,MAAM,eAAe,MAAM,KAAK,kBAAkB,aAAa,KAAK;EACpE,IAAI,CAAC,aAAa,IAAI,OAAO;EAE7B,MAAM,eAAe,MAAM,KAAK,SAAS,OAAO,aAAa,aAAa,KAAK;EAC/E,IAAI,CAAC,aAAa,IAAI,OAAO;EAE7B,MAAM,YAAY,KAAK,UAAU,SAAS,aAAa,MAAM,MAAM,aAAa,KAAK;EACrF,IAAI,CAAC,UAAU,IAAI,OAAO;EAE1B,OAAO,GAAG;GACR;GACA;GACA,WAAW,MAAM;GACjB,YAAY,UAAU;EACxB,CAAC;CACH;CAEA,MAAc,kBAAkB,aAAqB,OAAqD;EACxG,IAAI,MAAM,SAAS,MACjB,OAAO,GAAG;GAAE,MAAM;GAAQ,MAAM,MAAM;EAAK,CAAC;EAE9C,MAAM,aAAa,MAAM,KAAK,WAAW,UAAU,aAAa,MAAM,IAAI;EAC1E,IAAI,CAAC,WAAW,IAAI,OAAO,KAAK,WAAW,WAAW;EACtD,OAAO,GAAG;GAAE,MAAM;GAAc,MAAM,WAAW;GAAO,cAAc,MAAM;EAAK,CAAC;CACpF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { MarkerBlockService } from "./MarkerBlockService.js";
|
|
2
|
+
import { MarkerIntegrityValidator } from "./MarkerIntegrityValidator.js";
|
|
3
|
+
import { Result } from "@uapkg/diagnostics";
|
|
4
|
+
//#region src/postinstall/markers/MarkerBlockEditor.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Higher-level idempotent wrapper around {@link MarkerBlockService}.
|
|
6
7
|
*
|
|
@@ -13,18 +14,20 @@ import { MarkerIntegrityValidator } from './MarkerIntegrityValidator.js';
|
|
|
13
14
|
*
|
|
14
15
|
* Injectors compose this helper to achieve "edit once, safe to re-run" semantics.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
declare class MarkerBlockEditor {
|
|
18
|
+
private readonly service;
|
|
19
|
+
private readonly integrity;
|
|
20
|
+
constructor(service?: MarkerBlockService, integrity?: MarkerIntegrityValidator);
|
|
21
|
+
upsert(source: string, pluginName: string, zone: string, content: string, indent?: string): string;
|
|
22
|
+
remove(source: string, pluginName: string, zone: string): string;
|
|
23
|
+
contains(source: string, pluginName: string, zone: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Validates that the source contains a well-formed marker block for the
|
|
26
|
+
* owning `(pluginName, zone)` pair. Returns `Result.ok` when clean; returns
|
|
27
|
+
* `Result.fail` with a `POSTINSTALL_MARKER_CORRUPT` diagnostic otherwise.
|
|
28
|
+
*/
|
|
29
|
+
validate(source: string, pluginName: string, zone: string, filePath: string): Result<void>;
|
|
29
30
|
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { MarkerBlockEditor };
|
|
30
33
|
//# sourceMappingURL=MarkerBlockEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerBlockEditor.d.ts","
|
|
1
|
+
{"version":3,"file":"MarkerBlockEditor.d.ts","names":[],"sources":["../../../src/postinstall/markers/MarkerBlockEditor.ts"],"mappings":";;;;;;;;;;;;;;;;cAgBa;mBAEQ;mBACA;EAFnB,YACmB,UAAS,oBACT,YAAW;EAGvB,OAAO,gBAAgB,oBAAoB,cAAc,iBAAiB;EAM1E,OAAO,gBAAgB,oBAAoB;EAI3C,SAAS,gBAAgB,oBAAoB;;;;;;EAS7C,SAAS,gBAAgB,oBAAoB,cAAc,mBAAmB"}
|
|
@@ -1,46 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { MarkerBlockService } from "./MarkerBlockService.js";
|
|
2
|
+
import { MarkerIntegrityValidator } from "./MarkerIntegrityValidator.js";
|
|
3
|
+
import { createPostinstallMarkerCorruptDiagnostic, fail, ok } from "@uapkg/diagnostics";
|
|
4
|
+
|
|
5
|
+
//#region src/postinstall/markers/MarkerBlockEditor.ts
|
|
4
6
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
7
|
+
* Higher-level idempotent wrapper around {@link MarkerBlockService}.
|
|
8
|
+
*
|
|
9
|
+
* - `upsert`: remove any existing owned block and re-insert fresh content.
|
|
10
|
+
* Idempotent: calling twice with the same input yields the same result.
|
|
11
|
+
* - `remove`: strip the owned block if present; no-op otherwise.
|
|
12
|
+
* - `validate`: detect corruption (orphaned/nested markers) in the source for
|
|
13
|
+
* the owning `(pluginName, zone)` pair. Returns a `POSTINSTALL_MARKER_CORRUPT`
|
|
14
|
+
* diagnostic on failure; never throws.
|
|
15
|
+
*
|
|
16
|
+
* Injectors compose this helper to achieve "edit once, safe to re-run" semantics.
|
|
17
|
+
*/
|
|
18
|
+
var MarkerBlockEditor = class {
|
|
19
|
+
service;
|
|
20
|
+
integrity;
|
|
21
|
+
constructor(service = new MarkerBlockService(), integrity = new MarkerIntegrityValidator()) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
this.integrity = integrity;
|
|
24
|
+
}
|
|
25
|
+
upsert(source, pluginName, zone, content, indent = "") {
|
|
26
|
+
const stripped = this.service.stripOwnedBlock(source, pluginName, zone);
|
|
27
|
+
const block = this.service.createBlock(pluginName, zone, content, indent);
|
|
28
|
+
return `${stripped.trimEnd()}\n${block}\n`;
|
|
29
|
+
}
|
|
30
|
+
remove(source, pluginName, zone) {
|
|
31
|
+
return this.service.stripOwnedBlock(source, pluginName, zone);
|
|
32
|
+
}
|
|
33
|
+
contains(source, pluginName, zone) {
|
|
34
|
+
return this.service.containsOwnedBlock(source, pluginName, zone);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Validates that the source contains a well-formed marker block for the
|
|
38
|
+
* owning `(pluginName, zone)` pair. Returns `Result.ok` when clean; returns
|
|
39
|
+
* `Result.fail` with a `POSTINSTALL_MARKER_CORRUPT` diagnostic otherwise.
|
|
40
|
+
*/
|
|
41
|
+
validate(source, pluginName, zone, filePath) {
|
|
42
|
+
const result = this.integrity.validate(source, pluginName, zone);
|
|
43
|
+
if (result.ok) return ok(void 0);
|
|
44
|
+
return fail([createPostinstallMarkerCorruptDiagnostic(pluginName, filePath, result.reason)]);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { MarkerBlockEditor };
|
|
46
50
|
//# sourceMappingURL=MarkerBlockEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerBlockEditor.js","
|
|
1
|
+
{"version":3,"file":"MarkerBlockEditor.js","names":[],"sources":["../../../src/postinstall/markers/MarkerBlockEditor.ts"],"sourcesContent":["import { createPostinstallMarkerCorruptDiagnostic, fail, ok, type Result } from '@uapkg/diagnostics';\nimport { MarkerBlockService } from './MarkerBlockService.js';\nimport { MarkerIntegrityValidator } from './MarkerIntegrityValidator.js';\n\n/**\n * Higher-level idempotent wrapper around {@link MarkerBlockService}.\n *\n * - `upsert`: remove any existing owned block and re-insert fresh content.\n * Idempotent: calling twice with the same input yields the same result.\n * - `remove`: strip the owned block if present; no-op otherwise.\n * - `validate`: detect corruption (orphaned/nested markers) in the source for\n * the owning `(pluginName, zone)` pair. Returns a `POSTINSTALL_MARKER_CORRUPT`\n * diagnostic on failure; never throws.\n *\n * Injectors compose this helper to achieve \"edit once, safe to re-run\" semantics.\n */\nexport class MarkerBlockEditor {\n public constructor(\n private readonly service: MarkerBlockService = new MarkerBlockService(),\n private readonly integrity: MarkerIntegrityValidator = new MarkerIntegrityValidator(),\n ) {}\n\n public upsert(source: string, pluginName: string, zone: string, content: string, indent = ''): string {\n const stripped = this.service.stripOwnedBlock(source, pluginName, zone);\n const block = this.service.createBlock(pluginName, zone, content, indent);\n return `${stripped.trimEnd()}\\n${block}\\n`;\n }\n\n public remove(source: string, pluginName: string, zone: string): string {\n return this.service.stripOwnedBlock(source, pluginName, zone);\n }\n\n public contains(source: string, pluginName: string, zone: string): boolean {\n return this.service.containsOwnedBlock(source, pluginName, zone);\n }\n\n /**\n * Validates that the source contains a well-formed marker block for the\n * owning `(pluginName, zone)` pair. Returns `Result.ok` when clean; returns\n * `Result.fail` with a `POSTINSTALL_MARKER_CORRUPT` diagnostic otherwise.\n */\n public validate(source: string, pluginName: string, zone: string, filePath: string): Result<void> {\n const result = this.integrity.validate(source, pluginName, zone);\n if (result.ok) return ok(undefined);\n return fail([createPostinstallMarkerCorruptDiagnostic(pluginName, filePath, result.reason)]);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAa,oBAAb,MAA+B;CAEV;CACA;CAFnB,AAAO,YACL,AAAiB,UAA8B,IAAI,mBAAmB,GACtE,AAAiB,YAAsC,IAAI,yBAAyB,GACpF;EAFiB;EACA;CAChB;CAEH,AAAO,OAAO,QAAgB,YAAoB,MAAc,SAAiB,SAAS,IAAY;EACpG,MAAM,WAAW,KAAK,QAAQ,gBAAgB,QAAQ,YAAY,IAAI;EACtE,MAAM,QAAQ,KAAK,QAAQ,YAAY,YAAY,MAAM,SAAS,MAAM;EACxE,OAAO,GAAG,SAAS,QAAQ,EAAE,IAAI,MAAM;CACzC;CAEA,AAAO,OAAO,QAAgB,YAAoB,MAAsB;EACtE,OAAO,KAAK,QAAQ,gBAAgB,QAAQ,YAAY,IAAI;CAC9D;CAEA,AAAO,SAAS,QAAgB,YAAoB,MAAuB;EACzE,OAAO,KAAK,QAAQ,mBAAmB,QAAQ,YAAY,IAAI;CACjE;;;;;;CAOA,AAAO,SAAS,QAAgB,YAAoB,MAAc,UAAgC;EAChG,MAAM,SAAS,KAAK,UAAU,SAAS,QAAQ,YAAY,IAAI;EAC/D,IAAI,OAAO,IAAI,OAAO,GAAG,MAAS;EAClC,OAAO,KAAK,CAAC,yCAAyC,YAAY,UAAU,OAAO,MAAM,CAAC,CAAC;CAC7F;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/postinstall/markers/MarkerBlockService.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Low-level marker-block primitives.
|
|
3
4
|
*
|
|
@@ -13,12 +14,14 @@
|
|
|
13
14
|
* blocks are ever rewritten. Behavior mirrors the legacy `MarkerBlockService`
|
|
14
15
|
* so existing host-project files stay stable across the rewrite.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
declare class MarkerBlockService {
|
|
18
|
+
makeBegin(pluginName: string, zone: string): string;
|
|
19
|
+
makeEnd(pluginName: string, zone: string): string;
|
|
20
|
+
createBlock(pluginName: string, zone: string, content: string, indent?: string): string;
|
|
21
|
+
stripOwnedBlock(source: string, pluginName: string, zone: string): string;
|
|
22
|
+
containsOwnedBlock(source: string, pluginName: string, zone: string): boolean;
|
|
23
|
+
private escapeForRegex;
|
|
23
24
|
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { MarkerBlockService };
|
|
24
27
|
//# sourceMappingURL=MarkerBlockService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerBlockService.d.ts","
|
|
1
|
+
{"version":3,"file":"MarkerBlockService.d.ts","names":[],"sources":["../../../src/postinstall/markers/MarkerBlockService.ts"],"mappings":";;;;;;;;;;;;;;;;cAea;EACJ,UAAU,oBAAoB;EAI9B,QAAQ,oBAAoB;EAI5B,YAAY,oBAAoB,cAAc,iBAAiB;EAU/D,gBAAgB,gBAAgB,oBAAoB;EAOpD,mBAAmB,gBAAgB,oBAAoB;UAKtD"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
+
//#region src/postinstall/markers/MarkerBlockService.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
}
|
|
3
|
+
* Low-level marker-block primitives.
|
|
4
|
+
*
|
|
5
|
+
* A marker block has the form:
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* <indent>// UAPKG-BEGIN <pluginName>:<zone>
|
|
9
|
+
* <indent><content...>
|
|
10
|
+
* <indent>// UAPKG-END <pluginName>:<zone>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Blocks are *owned* by a `(pluginName, zone)` pair — only the owning pair's
|
|
14
|
+
* blocks are ever rewritten. Behavior mirrors the legacy `MarkerBlockService`
|
|
15
|
+
* so existing host-project files stay stable across the rewrite.
|
|
16
|
+
*/
|
|
17
|
+
var MarkerBlockService = class {
|
|
18
|
+
makeBegin(pluginName, zone) {
|
|
19
|
+
return `// UAPKG-BEGIN ${pluginName}:${zone}`;
|
|
20
|
+
}
|
|
21
|
+
makeEnd(pluginName, zone) {
|
|
22
|
+
return `// UAPKG-END ${pluginName}:${zone}`;
|
|
23
|
+
}
|
|
24
|
+
createBlock(pluginName, zone, content, indent = "") {
|
|
25
|
+
const begin = `${indent}${this.makeBegin(pluginName, zone)}`;
|
|
26
|
+
const end = `${indent}${this.makeEnd(pluginName, zone)}`;
|
|
27
|
+
return `${begin}\n${content.trim().split(/\r?\n/).map((line) => `${indent}${line}`.replace(/[ \t]+$/g, "")).join("\n")}\n${end}`;
|
|
28
|
+
}
|
|
29
|
+
stripOwnedBlock(source, pluginName, zone) {
|
|
30
|
+
const begin = this.escapeForRegex(this.makeBegin(pluginName, zone));
|
|
31
|
+
const end = this.escapeForRegex(this.makeEnd(pluginName, zone));
|
|
32
|
+
const pattern = new RegExp(`^[ \\t]*${begin}[\\s\\S]*?^[ \\t]*${end}\\s*\\r?\\n?`, "gm");
|
|
33
|
+
return source.replace(pattern, "");
|
|
34
|
+
}
|
|
35
|
+
containsOwnedBlock(source, pluginName, zone) {
|
|
36
|
+
const begin = this.escapeForRegex(this.makeBegin(pluginName, zone));
|
|
37
|
+
return new RegExp(`^[ \\t]*${begin}$`, "m").test(source);
|
|
38
|
+
}
|
|
39
|
+
escapeForRegex(value) {
|
|
40
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { MarkerBlockService };
|
|
46
46
|
//# sourceMappingURL=MarkerBlockService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerBlockService.js","
|
|
1
|
+
{"version":3,"file":"MarkerBlockService.js","names":[],"sources":["../../../src/postinstall/markers/MarkerBlockService.ts"],"sourcesContent":["/**\n * Low-level marker-block primitives.\n *\n * A marker block has the form:\n *\n * ```\n * <indent>// UAPKG-BEGIN <pluginName>:<zone>\n * <indent><content...>\n * <indent>// UAPKG-END <pluginName>:<zone>\n * ```\n *\n * Blocks are *owned* by a `(pluginName, zone)` pair — only the owning pair's\n * blocks are ever rewritten. Behavior mirrors the legacy `MarkerBlockService`\n * so existing host-project files stay stable across the rewrite.\n */\nexport class MarkerBlockService {\n public makeBegin(pluginName: string, zone: string): string {\n return `// UAPKG-BEGIN ${pluginName}:${zone}`;\n }\n\n public makeEnd(pluginName: string, zone: string): string {\n return `// UAPKG-END ${pluginName}:${zone}`;\n }\n\n public createBlock(pluginName: string, zone: string, content: string, indent = ''): string {\n const begin = `${indent}${this.makeBegin(pluginName, zone)}`;\n const end = `${indent}${this.makeEnd(pluginName, zone)}`;\n const lines = content\n .trim()\n .split(/\\r?\\n/)\n .map((line) => `${indent}${line}`.replace(/[ \\t]+$/g, ''));\n return `${begin}\\n${lines.join('\\n')}\\n${end}`;\n }\n\n public stripOwnedBlock(source: string, pluginName: string, zone: string): string {\n const begin = this.escapeForRegex(this.makeBegin(pluginName, zone));\n const end = this.escapeForRegex(this.makeEnd(pluginName, zone));\n const pattern = new RegExp(`^[ \\\\t]*${begin}[\\\\s\\\\S]*?^[ \\\\t]*${end}\\\\s*\\\\r?\\\\n?`, 'gm');\n return source.replace(pattern, '');\n }\n\n public containsOwnedBlock(source: string, pluginName: string, zone: string): boolean {\n const begin = this.escapeForRegex(this.makeBegin(pluginName, zone));\n return new RegExp(`^[ \\\\t]*${begin}$`, 'm').test(source);\n }\n\n private escapeForRegex(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAa,qBAAb,MAAgC;CAC9B,AAAO,UAAU,YAAoB,MAAsB;EACzD,OAAO,kBAAkB,WAAW,GAAG;CACzC;CAEA,AAAO,QAAQ,YAAoB,MAAsB;EACvD,OAAO,gBAAgB,WAAW,GAAG;CACvC;CAEA,AAAO,YAAY,YAAoB,MAAc,SAAiB,SAAS,IAAY;EACzF,MAAM,QAAQ,GAAG,SAAS,KAAK,UAAU,YAAY,IAAI;EACzD,MAAM,MAAM,GAAG,SAAS,KAAK,QAAQ,YAAY,IAAI;EAKrD,OAAO,GAAG,MAAM,IAJF,QACX,KAAK,CAAC,CACN,MAAM,OAAO,CAAC,CACd,KAAK,SAAS,GAAG,SAAS,OAAO,QAAQ,YAAY,EAAE,CAClC,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI;CAC3C;CAEA,AAAO,gBAAgB,QAAgB,YAAoB,MAAsB;EAC/E,MAAM,QAAQ,KAAK,eAAe,KAAK,UAAU,YAAY,IAAI,CAAC;EAClE,MAAM,MAAM,KAAK,eAAe,KAAK,QAAQ,YAAY,IAAI,CAAC;EAC9D,MAAM,UAAU,IAAI,OAAO,WAAW,MAAM,oBAAoB,IAAI,eAAe,IAAI;EACvF,OAAO,OAAO,QAAQ,SAAS,EAAE;CACnC;CAEA,AAAO,mBAAmB,QAAgB,YAAoB,MAAuB;EACnF,MAAM,QAAQ,KAAK,eAAe,KAAK,UAAU,YAAY,IAAI,CAAC;EAClE,OAAO,IAAI,OAAO,WAAW,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,MAAM;CACzD;CAEA,AAAQ,eAAe,OAAuB;EAC5C,OAAO,MAAM,QAAQ,uBAAuB,MAAM;CACpD;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/postinstall/markers/MarkerIntegrityValidator.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Detects corruption in uapkg marker blocks for a single `(pluginName, zone)`
|
|
3
4
|
* owning pair. Corruption rules (scoped to the owning pair — foreign plugins'
|
|
@@ -14,16 +15,18 @@
|
|
|
14
15
|
* returns the first violation encountered so callers can surface exactly one
|
|
15
16
|
* diagnostic per file.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
interface MarkerIntegrityOk {
|
|
19
|
+
readonly ok: true;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
interface MarkerIntegrityFail {
|
|
22
|
+
readonly ok: false;
|
|
23
|
+
readonly reason: string;
|
|
24
|
+
readonly line: number;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
type MarkerIntegrityResult = MarkerIntegrityOk | MarkerIntegrityFail;
|
|
27
|
+
declare class MarkerIntegrityValidator {
|
|
28
|
+
validate(source: string, pluginName: string, zone: string): MarkerIntegrityResult;
|
|
28
29
|
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { MarkerIntegrityFail, MarkerIntegrityOk, MarkerIntegrityResult, MarkerIntegrityValidator };
|
|
29
32
|
//# sourceMappingURL=MarkerIntegrityValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerIntegrityValidator.d.ts","
|
|
1
|
+
{"version":3,"file":"MarkerIntegrityValidator.d.ts","names":[],"sources":["../../../src/postinstall/markers/MarkerIntegrityValidator.ts"],"mappings":";;;;;;;;;;;;;;;;;UAgBiB;WACN;;UAGM;WACN;WACA;WACA;;KAGC,wBAAwB,oBAAoB;cAE3C;EACJ,SAAS,gBAAgB,oBAAoB,eAAe"}
|
|
@@ -1,53 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
return { ok: true };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
//#region src/postinstall/markers/MarkerIntegrityValidator.ts
|
|
2
|
+
var MarkerIntegrityValidator = class {
|
|
3
|
+
validate(source, pluginName, zone) {
|
|
4
|
+
const beginToken = `UAPKG-BEGIN ${pluginName}:${zone}`;
|
|
5
|
+
const endToken = `UAPKG-END ${pluginName}:${zone}`;
|
|
6
|
+
const lines = source.split(/\r?\n/);
|
|
7
|
+
let depth = 0;
|
|
8
|
+
let lastBeginLine = -1;
|
|
9
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
10
|
+
const line = lines[i];
|
|
11
|
+
const hasBegin = line.includes(beginToken);
|
|
12
|
+
const hasEnd = line.includes(endToken);
|
|
13
|
+
if (hasBegin && hasEnd) return {
|
|
14
|
+
ok: false,
|
|
15
|
+
reason: `BEGIN and END on same line at line ${i + 1}`,
|
|
16
|
+
line: i + 1
|
|
17
|
+
};
|
|
18
|
+
if (hasBegin) {
|
|
19
|
+
if (depth >= 1) return {
|
|
20
|
+
ok: false,
|
|
21
|
+
reason: `nested BEGIN at line ${i + 1} (previous BEGIN at line ${lastBeginLine + 1} was not closed)`,
|
|
22
|
+
line: i + 1
|
|
23
|
+
};
|
|
24
|
+
depth += 1;
|
|
25
|
+
lastBeginLine = i;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (hasEnd) {
|
|
29
|
+
if (depth === 0) return {
|
|
30
|
+
ok: false,
|
|
31
|
+
reason: `orphaned END at line ${i + 1} (no preceding BEGIN)`,
|
|
32
|
+
line: i + 1
|
|
33
|
+
};
|
|
34
|
+
depth -= 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (depth > 0) return {
|
|
38
|
+
ok: false,
|
|
39
|
+
reason: `orphaned BEGIN at line ${lastBeginLine + 1} (missing END)`,
|
|
40
|
+
line: lastBeginLine + 1
|
|
41
|
+
};
|
|
42
|
+
return { ok: true };
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { MarkerIntegrityValidator };
|
|
53
48
|
//# sourceMappingURL=MarkerIntegrityValidator.js.map
|