@ankhorage/infra 4.1.10 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +21 -32
- package/dist/cli/bin.d.ts +1 -8
- package/dist/cli/bin.d.ts.map +1 -1
- package/dist/cli/bin.js +2 -34
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/commands/destroy.d.ts +11 -0
- package/dist/cli/commands/destroy.d.ts.map +1 -0
- package/dist/cli/commands/destroy.js +51 -0
- package/dist/cli/commands/destroy.js.map +1 -0
- package/dist/cli/commands/down.d.ts +11 -0
- package/dist/cli/commands/down.d.ts.map +1 -0
- package/dist/cli/commands/down.js +27 -0
- package/dist/cli/commands/down.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +11 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +29 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/outputs.d.ts +11 -0
- package/dist/cli/commands/outputs.d.ts.map +1 -0
- package/dist/cli/commands/outputs.js +25 -0
- package/dist/cli/commands/outputs.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +11 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +19 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/status.d.ts +11 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +19 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/up.d.ts +11 -0
- package/dist/cli/commands/up.d.ts.map +1 -0
- package/dist/cli/commands/up.js +28 -0
- package/dist/cli/commands/up.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +11 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +19 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/constants.d.ts +66 -0
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/constants.js +19 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/createDefaultInfraCommandContext.d.ts +4 -0
- package/dist/cli/createDefaultInfraCommandContext.d.ts.map +1 -0
- package/dist/{commandContext.js → cli/createDefaultInfraCommandContext.js} +4 -3
- package/dist/cli/createDefaultInfraCommandContext.js.map +1 -0
- package/dist/cli/createInfraRuntimeProvider.d.ts +5 -0
- package/dist/cli/createInfraRuntimeProvider.d.ts.map +1 -0
- package/dist/cli/createInfraRuntimeProvider.js +22 -0
- package/dist/cli/createInfraRuntimeProvider.js.map +1 -0
- package/dist/cli/createProviderCommandDescriptors.d.ts +4 -0
- package/dist/cli/createProviderCommandDescriptors.d.ts.map +1 -0
- package/dist/cli/createProviderCommandDescriptors.js +6 -0
- package/dist/cli/createProviderCommandDescriptors.js.map +1 -0
- package/dist/cli/findInfraCommand.d.ts +4 -0
- package/dist/cli/findInfraCommand.d.ts.map +1 -0
- package/dist/cli/findInfraCommand.js +6 -0
- package/dist/cli/findInfraCommand.js.map +1 -0
- package/dist/cli/index.d.ts +3 -8
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/renderInfraRootHelp.d.ts +3 -0
- package/dist/cli/renderInfraRootHelp.d.ts.map +1 -0
- package/dist/cli/renderInfraRootHelp.js +21 -0
- package/dist/cli/renderInfraRootHelp.js.map +1 -0
- package/dist/cli/renderUnknownInfraCommand.d.ts +3 -0
- package/dist/cli/renderUnknownInfraCommand.d.ts.map +1 -0
- package/dist/cli/renderUnknownInfraCommand.js +5 -0
- package/dist/cli/renderUnknownInfraCommand.js.map +1 -0
- package/dist/cli/runInfraCliAsync.d.ts +10 -0
- package/dist/cli/runInfraCliAsync.d.ts.map +1 -0
- package/dist/cli/runInfraCliAsync.js +34 -0
- package/dist/cli/runInfraCliAsync.js.map +1 -0
- package/dist/cli/runInfraCommandAsync.d.ts +4 -0
- package/dist/cli/runInfraCommandAsync.d.ts.map +1 -0
- package/dist/cli/runInfraCommandAsync.js +100 -0
- package/dist/cli/runInfraCommandAsync.js.map +1 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.d.ts +4 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.d.ts.map +1 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.js +45 -0
- package/dist/cli/utils/prepareInfraCommandOperationAsync.js.map +1 -0
- package/dist/cli/utils/requireInfraSuccess.d.ts +7 -0
- package/dist/cli/utils/requireInfraSuccess.d.ts.map +1 -0
- package/dist/cli/utils/requireInfraSuccess.js +17 -0
- package/dist/cli/utils/requireInfraSuccess.js.map +1 -0
- package/dist/cli/utils/resolveInfraPersistence.d.ts +4 -0
- package/dist/cli/utils/resolveInfraPersistence.d.ts.map +1 -0
- package/dist/cli/utils/resolveInfraPersistence.js +17 -0
- package/dist/cli/utils/resolveInfraPersistence.js.map +1 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.d.ts +5 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.d.ts.map +1 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.js +16 -0
- package/dist/cli/utils/writeInfraEnvironmentOutputs.js.map +1 -0
- package/dist/cli/utils/writeInfraStructured.d.ts +4 -0
- package/dist/cli/utils/writeInfraStructured.d.ts.map +1 -0
- package/dist/cli/utils/writeInfraStructured.js +8 -0
- package/dist/cli/utils/writeInfraStructured.js.map +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/{packageMetadata.js → constants.js} +6 -3
- package/dist/constants.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js +35 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js +23 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js +9 -0
- package/dist/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js +28 -0
- package/dist/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js +7 -0
- package/dist/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.d.ts +7 -0
- package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.d.ts.map +1 -0
- package/dist/{project.js → features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.js} +10 -34
- package/dist/features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js +28 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js +16 -0
- package/dist/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.d.ts +9 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js +2 -0
- package/dist/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.js +15 -0
- package/dist/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js +84 -0
- package/dist/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js +55 -0
- package/dist/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js +38 -0
- package/dist/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js +34 -0
- package/dist/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js +57 -0
- package/dist/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.js +109 -0
- package/dist/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.d.ts +6 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js +181 -0
- package/dist/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js +68 -0
- package/dist/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js +98 -0
- package/dist/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.d.ts +5 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.js +17 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.d.ts +4 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js +13 -0
- package/dist/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js.map +1 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.d.ts +4 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.js +43 -0
- package/dist/features/environment-lifecycle/composition/createInfraCommandServices.js.map +1 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.d.ts +4 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.js +54 -0
- package/dist/features/environment-lifecycle/domain/orderInfraPlanActions.js.map +1 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.d.ts +5 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.js +39 -0
- package/dist/features/environment-lifecycle/domain/resolveInfraEnvironment.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.d.ts +7 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.js +5 -0
- package/dist/features/environment-lifecycle/utils/appendInfraFailure.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.d.ts +5 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.js +13 -0
- package/dist/features/environment-lifecycle/utils/createInfraExecutionContext.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.js +5 -0
- package/dist/features/environment-lifecycle/utils/createInfraFailure.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.d.ts +12 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.js +14 -0
- package/dist/features/environment-lifecycle/utils/createInfraLedger.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.js +5 -0
- package/dist/features/environment-lifecycle/utils/infraIdentityKey.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.js +103 -0
- package/dist/features/environment-lifecycle/utils/isInfraStoredState.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.js +10 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraOutputs.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.js +10 -0
- package/dist/features/environment-lifecycle/utils/mergeInfraResources.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.d.ts +3 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.js +8 -0
- package/dist/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.js +11 -0
- package/dist/features/environment-lifecycle/utils/resolveInfraStatePath.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.d.ts +3 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.js +19 -0
- package/dist/features/environment-lifecycle/utils/resolveProjectFile.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.js +6 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.js.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.d.ts +4 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.js +6 -0
- package/dist/features/environment-lifecycle/utils/retainUnchangedAdapterResources.js.map +1 -0
- package/dist/index.d.ts +16 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -15
- package/dist/index.js.map +1 -1
- package/dist/metadata/index.d.ts +1 -1
- package/dist/metadata/index.d.ts.map +1 -1
- package/dist/metadata/index.js +1 -1
- package/dist/metadata/index.js.map +1 -1
- package/dist/project/index.d.ts +7 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +6 -5
- package/dist/project/index.js.map +1 -1
- package/dist/readme-usage.js +17 -26
- package/dist/readme-usage.js.map +1 -1
- package/dist/testSupport.d.ts +1 -1
- package/dist/testSupport.d.ts.map +1 -1
- package/dist/testSupport.js +11 -1
- package/dist/testSupport.js.map +1 -1
- package/dist/types/infraCli.d.ts +91 -0
- package/dist/types/infraCli.d.ts.map +1 -0
- package/dist/types/infraCli.js +2 -0
- package/dist/types/infraCli.js.map +1 -0
- package/dist/types/infraOrchestration.d.ts +84 -0
- package/dist/types/infraOrchestration.d.ts.map +1 -0
- package/dist/types/infraOrchestration.js +2 -0
- package/dist/types/infraOrchestration.js.map +1 -0
- package/dist/{project.d.ts → types/infraProject.d.ts} +6 -6
- package/dist/types/infraProject.d.ts.map +1 -0
- package/dist/types/infraProject.js +2 -0
- package/dist/types/infraProject.js.map +1 -0
- package/package.json +21 -11
- package/src/adapterPackages.integration.test.ts +79 -0
- package/src/cli/bin.ts +2 -61
- package/src/cli/cli.test.ts +35 -126
- package/src/cli/commands/destroy.ts +57 -0
- package/src/cli/commands/down.ts +28 -0
- package/src/cli/commands/generate.ts +34 -0
- package/src/cli/commands/outputs.ts +25 -0
- package/src/cli/commands/plan.ts +20 -0
- package/src/cli/commands/status.ts +20 -0
- package/src/cli/commands/up.ts +29 -0
- package/src/cli/commands/validate.ts +20 -0
- package/src/cli/constants.ts +19 -0
- package/src/cli/createDefaultInfraCommandContext.ts +17 -0
- package/src/cli/createInfraRuntimeProvider.ts +35 -0
- package/src/cli/createProviderCommandDescriptors.ts +8 -0
- package/src/cli/findInfraCommand.ts +7 -0
- package/src/cli/index.test.ts +12 -20
- package/src/cli/index.ts +7 -49
- package/src/cli/renderInfraRootHelp.ts +23 -0
- package/src/cli/renderUnknownInfraCommand.ts +4 -0
- package/src/cli/runInfraCliAsync.ts +51 -0
- package/src/cli/runInfraCommandAsync.ts +114 -0
- package/src/cli/utils/prepareInfraCommandOperationAsync.ts +64 -0
- package/src/cli/utils/requireInfraSuccess.ts +24 -0
- package/src/cli/utils/resolveInfraPersistence.ts +22 -0
- package/src/cli/utils/writeInfraEnvironmentOutputs.ts +24 -0
- package/src/cli/utils/writeInfraStructured.ts +11 -0
- package/src/commands.test.ts +198 -196
- package/src/{packageMetadata.ts → constants.ts} +5 -2
- package/src/environmentLifecycle.test.ts +193 -0
- package/src/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.ts +52 -0
- package/src/features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.ts +32 -0
- package/src/features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.ts +10 -0
- package/src/features/environment-lifecycle/adapters/outbound/readStoredInfraStateAsync.ts +34 -0
- package/src/features/environment-lifecycle/adapters/outbound/removeStoredInfraStateAsync.ts +12 -0
- package/src/{project.ts → features/environment-lifecycle/adapters/outbound/resolveInfraProjectAsync.ts} +10 -45
- package/src/features/environment-lifecycle/adapters/outbound/writeInfraGeneratedArtifactsAsync.ts +34 -0
- package/src/features/environment-lifecycle/adapters/outbound/writeStoredInfraStateAsync.ts +21 -0
- package/src/features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.ts +10 -0
- package/src/features/environment-lifecycle/application/use-cases/collectInfraWorkloadsAsync.ts +25 -0
- package/src/features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.ts +119 -0
- package/src/features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.ts +65 -0
- package/src/features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.ts +51 -0
- package/src/features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.ts +41 -0
- package/src/features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.ts +67 -0
- package/src/features/environment-lifecycle/application/use-cases/prepareInfraOperationAsync.ts +137 -0
- package/src/features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.ts +257 -0
- package/src/features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.ts +80 -0
- package/src/features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.ts +126 -0
- package/src/features/environment-lifecycle/application/use-cases/validateInfraAdaptersAsync.ts +25 -0
- package/src/features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.ts +21 -0
- package/src/features/environment-lifecycle/composition/createInfraCommandServices.ts +47 -0
- package/src/features/environment-lifecycle/domain/orderInfraPlanActions.ts +64 -0
- package/src/features/environment-lifecycle/domain/resolveInfraEnvironment.ts +62 -0
- package/src/features/environment-lifecycle/utils/appendInfraFailure.ts +9 -0
- package/src/features/environment-lifecycle/utils/createInfraExecutionContext.ts +24 -0
- package/src/features/environment-lifecycle/utils/createInfraFailure.ts +6 -0
- package/src/features/environment-lifecycle/utils/createInfraLedger.ts +30 -0
- package/src/features/environment-lifecycle/utils/infraIdentityKey.ts +6 -0
- package/src/features/environment-lifecycle/utils/isInfraStoredState.ts +141 -0
- package/src/features/environment-lifecycle/utils/mergeInfraOutputs.ts +14 -0
- package/src/features/environment-lifecycle/utils/mergeInfraResources.ts +14 -0
- package/src/features/environment-lifecycle/utils/normalizeInfraEnvironmentKey.ts +7 -0
- package/src/features/environment-lifecycle/utils/resolveInfraStatePath.ts +12 -0
- package/src/features/environment-lifecycle/utils/resolveProjectFile.ts +22 -0
- package/src/features/environment-lifecycle/utils/retainUnchangedAdapterOutputs.ts +15 -0
- package/src/features/environment-lifecycle/utils/retainUnchangedAdapterResources.ts +15 -0
- package/src/index.test.ts +22 -315
- package/src/index.ts +41 -53
- package/src/infraComposition.integration.test.ts +128 -0
- package/src/infraOperations.test.ts +386 -0
- package/src/infraUp.test.ts +260 -0
- package/src/metadata/index.ts +1 -1
- package/src/package.test.ts +4 -2
- package/src/project/index.test.ts +8 -188
- package/src/project/index.ts +7 -22
- package/src/project.test.ts +39 -189
- package/src/projectContractsParser.test.ts +2 -2
- package/src/projectInfrastructure.test.ts +121 -167
- package/src/readme-usage.ts +17 -26
- package/src/testSupport.ts +12 -2
- package/src/types/infraCli.ts +115 -0
- package/src/types/infraOrchestration.ts +126 -0
- package/src/types/infraProject.ts +15 -0
- package/dist/adapters/minikube/auth/index.d.ts +0 -8
- package/dist/adapters/minikube/auth/index.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/index.js +0 -29
- package/dist/adapters/minikube/auth/index.js.map +0 -1
- package/dist/adapters/minikube/auth/oauthRuntime.d.ts +0 -4
- package/dist/adapters/minikube/auth/oauthRuntime.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/oauthRuntime.js +0 -138
- package/dist/adapters/minikube/auth/oauthRuntime.js.map +0 -1
- package/dist/adapters/minikube/auth/supabase/index.d.ts +0 -7
- package/dist/adapters/minikube/auth/supabase/index.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/supabase/index.js +0 -232
- package/dist/adapters/minikube/auth/supabase/index.js.map +0 -1
- package/dist/adapters/minikube/auth/supabase/profile.d.ts +0 -20
- package/dist/adapters/minikube/auth/supabase/profile.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/supabase/profile.js +0 -452
- package/dist/adapters/minikube/auth/supabase/profile.js.map +0 -1
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.d.ts +0 -7
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.d.ts.map +0 -1
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.js +0 -104
- package/dist/adapters/minikube/auth/targetAwareOAuthRuntime.js.map +0 -1
- package/dist/adapters/minikube/authz/cerbos/index.d.ts +0 -13
- package/dist/adapters/minikube/authz/cerbos/index.d.ts.map +0 -1
- package/dist/adapters/minikube/authz/cerbos/index.js +0 -382
- package/dist/adapters/minikube/authz/cerbos/index.js.map +0 -1
- package/dist/adapters/minikube/authz/index.d.ts +0 -9
- package/dist/adapters/minikube/authz/index.d.ts.map +0 -1
- package/dist/adapters/minikube/authz/index.js +0 -23
- package/dist/adapters/minikube/authz/index.js.map +0 -1
- package/dist/adapters/minikube/base/index.d.ts +0 -14
- package/dist/adapters/minikube/base/index.d.ts.map +0 -1
- package/dist/adapters/minikube/base/index.js +0 -3433
- package/dist/adapters/minikube/base/index.js.map +0 -1
- package/dist/adapters/minikube/base/supabaseMigrations.d.ts +0 -2
- package/dist/adapters/minikube/base/supabaseMigrations.d.ts.map +0 -1
- package/dist/adapters/minikube/base/supabaseMigrations.js +0 -6
- package/dist/adapters/minikube/base/supabaseMigrations.js.map +0 -1
- package/dist/adapters/minikube/contracts.d.ts +0 -34
- package/dist/adapters/minikube/contracts.d.ts.map +0 -1
- package/dist/adapters/minikube/contracts.js +0 -10
- package/dist/adapters/minikube/contracts.js.map +0 -1
- package/dist/adapters/minikube/index.d.ts +0 -3
- package/dist/adapters/minikube/index.d.ts.map +0 -1
- package/dist/adapters/minikube/index.js +0 -136
- package/dist/adapters/minikube/index.js.map +0 -1
- package/dist/adapters/minikube/secrets/index.d.ts +0 -7
- package/dist/adapters/minikube/secrets/index.d.ts.map +0 -1
- package/dist/adapters/minikube/secrets/index.js +0 -13
- package/dist/adapters/minikube/secrets/index.js.map +0 -1
- package/dist/adapters/minikube/secrets/supabase-vault/index.d.ts +0 -8
- package/dist/adapters/minikube/secrets/supabase-vault/index.d.ts.map +0 -1
- package/dist/adapters/minikube/secrets/supabase-vault/index.js +0 -118
- package/dist/adapters/minikube/secrets/supabase-vault/index.js.map +0 -1
- package/dist/adapters/minikube/storage/index.d.ts +0 -7
- package/dist/adapters/minikube/storage/index.d.ts.map +0 -1
- package/dist/adapters/minikube/storage/index.js +0 -77
- package/dist/adapters/minikube/storage/index.js.map +0 -1
- package/dist/adapters/minikube/storage/supabase/index.d.ts +0 -7
- package/dist/adapters/minikube/storage/supabase/index.d.ts.map +0 -1
- package/dist/adapters/minikube/storage/supabase/index.js +0 -82
- package/dist/adapters/minikube/storage/supabase/index.js.map +0 -1
- package/dist/authRedirects.d.ts +0 -19
- package/dist/authRedirects.d.ts.map +0 -1
- package/dist/authRedirects.js +0 -80
- package/dist/authRedirects.js.map +0 -1
- package/dist/authTargetRedirects.d.ts +0 -12
- package/dist/authTargetRedirects.d.ts.map +0 -1
- package/dist/authTargetRedirects.js +0 -32
- package/dist/authTargetRedirects.js.map +0 -1
- package/dist/commandContext.d.ts +0 -12
- package/dist/commandContext.d.ts.map +0 -1
- package/dist/commandContext.js.map +0 -1
- package/dist/commands.d.ts +0 -95
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -256
- package/dist/commands.js.map +0 -1
- package/dist/infraValidation.d.ts +0 -4
- package/dist/infraValidation.d.ts.map +0 -1
- package/dist/infraValidation.js +0 -63
- package/dist/infraValidation.js.map +0 -1
- package/dist/packageMetadata.d.ts +0 -10
- package/dist/packageMetadata.d.ts.map +0 -1
- package/dist/packageMetadata.js.map +0 -1
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js.map +0 -1
- package/dist/projectDatabase.d.ts +0 -5
- package/dist/projectDatabase.d.ts.map +0 -1
- package/dist/projectDatabase.js +0 -22
- package/dist/projectDatabase.js.map +0 -1
- package/dist/projectEnvironment.d.ts +0 -6
- package/dist/projectEnvironment.d.ts.map +0 -1
- package/dist/projectEnvironment.js +0 -45
- package/dist/projectEnvironment.js.map +0 -1
- package/dist/projectInfrastructure.d.ts +0 -38
- package/dist/projectInfrastructure.d.ts.map +0 -1
- package/dist/projectInfrastructure.js +0 -145
- package/dist/projectInfrastructure.js.map +0 -1
- package/dist/runtime.d.ts +0 -54
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -151
- package/dist/runtime.js.map +0 -1
- package/dist/secretStore.d.ts +0 -19
- package/dist/secretStore.d.ts.map +0 -1
- package/dist/secretStore.js +0 -22
- package/dist/secretStore.js.map +0 -1
- package/dist/types.d.ts +0 -70
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/src/adapters/minikube/README.md +0 -115
- package/src/adapters/minikube/appRuntimeServing.test.ts +0 -28
- package/src/adapters/minikube/auth/index.ts +0 -40
- package/src/adapters/minikube/auth/oauthRuntime.ts +0 -163
- package/src/adapters/minikube/auth/supabase/index.test.ts +0 -227
- package/src/adapters/minikube/auth/supabase/index.ts +0 -293
- package/src/adapters/minikube/auth/supabase/oauthRuntime.test.ts +0 -154
- package/src/adapters/minikube/auth/supabase/profile.integration.test.ts +0 -1028
- package/src/adapters/minikube/auth/supabase/profile.ts +0 -526
- package/src/adapters/minikube/auth/supabase/providerAssignments.test.ts +0 -36
- package/src/adapters/minikube/auth/targetAwareOAuthRuntime.test.ts +0 -83
- package/src/adapters/minikube/auth/targetAwareOAuthRuntime.ts +0 -136
- package/src/adapters/minikube/authz/cerbos/index.ts +0 -486
- package/src/adapters/minikube/authz/index.ts +0 -32
- package/src/adapters/minikube/base/appImageBuild.test.ts +0 -352
- package/src/adapters/minikube/base/index.test.ts +0 -693
- package/src/adapters/minikube/base/index.ts +0 -3763
- package/src/adapters/minikube/base/portForwardRuntime.test.ts +0 -624
- package/src/adapters/minikube/base/supabaseMigrations.test.ts +0 -168
- package/src/adapters/minikube/base/supabaseMigrations.ts +0 -5
- package/src/adapters/minikube/base/twoAppIsolation.integration.test.ts +0 -898
- package/src/adapters/minikube/base/upgradeReconciliation.test.ts +0 -135
- package/src/adapters/minikube/contracts.ts +0 -46
- package/src/adapters/minikube/index.ts +0 -172
- package/src/adapters/minikube/secrets/index.test.ts +0 -147
- package/src/adapters/minikube/secrets/index.ts +0 -19
- package/src/adapters/minikube/secrets/supabase-vault/index.ts +0 -139
- package/src/adapters/minikube/storage/index.ts +0 -91
- package/src/adapters/minikube/storage/supabase/index.ts +0 -108
- package/src/apiInfrastructure.test.ts +0 -69
- package/src/authRedirects.test.ts +0 -63
- package/src/authRedirects.ts +0 -113
- package/src/authTargetRedirects.test.ts +0 -62
- package/src/authTargetRedirects.ts +0 -46
- package/src/commandContext.ts +0 -27
- package/src/commands.ts +0 -404
- package/src/generatedApiLedgerCleanup.test.ts +0 -72
- package/src/infraApiValidation.test.ts +0 -42
- package/src/infraValidation.ts +0 -99
- package/src/minikubeImageLifecycle.test.ts +0 -35
- package/src/projectDatabase.ts +0 -27
- package/src/projectEnvironment.ts +0 -51
- package/src/projectInfrastructure.ts +0 -221
- package/src/runtime.test.ts +0 -124
- package/src/runtime.ts +0 -234
- package/src/secretStore.test.ts +0 -76
- package/src/secretStore.ts +0 -44
- package/src/types.ts +0 -82
package/dist/runtime.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'child_process';
|
|
2
|
-
import { promises as fs } from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { readProjectInfrastructureEnvironment } from './projectEnvironment.js';
|
|
5
|
-
export class InfraScriptExecutionError extends Error {
|
|
6
|
-
exitCode;
|
|
7
|
-
stderr;
|
|
8
|
-
stdout;
|
|
9
|
-
constructor(args) {
|
|
10
|
-
super(args.message);
|
|
11
|
-
this.name = 'InfraScriptExecutionError';
|
|
12
|
-
this.exitCode = args.exitCode;
|
|
13
|
-
this.stderr = args.stderr;
|
|
14
|
-
this.stdout = args.stdout;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export async function runProjectInfrastructureLifecycle(args) {
|
|
18
|
-
const scriptPath = resolveProjectInfraScriptPath(args);
|
|
19
|
-
if (!(await pathExists(scriptPath))) {
|
|
20
|
-
throw new Error(`Infra script not found: ${scriptPath}. Run infra generate for project '${args.projectId}' first.`);
|
|
21
|
-
}
|
|
22
|
-
return runShellScript({
|
|
23
|
-
args: args.args ?? [],
|
|
24
|
-
env: args.env ?? process.env,
|
|
25
|
-
onStderr: args.onStderr,
|
|
26
|
-
onStdout: args.onStdout,
|
|
27
|
-
scriptPath,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
export async function resolveProjectInfrastructurePortForward(args) {
|
|
31
|
-
const environment = await readProjectInfrastructureEnvironment({
|
|
32
|
-
keys: ['APP_PORT_FORWARD_LOCAL_PORT'],
|
|
33
|
-
projectPath: args.projectPath,
|
|
34
|
-
target: args.target,
|
|
35
|
-
});
|
|
36
|
-
const localPort = parsePositivePort(environment.APP_PORT_FORWARD_LOCAL_PORT);
|
|
37
|
-
if (localPort === null) {
|
|
38
|
-
throw new Error('Generated Infra did not provide a valid APP_PORT_FORWARD_LOCAL_PORT. Regenerate infrastructure first.');
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
localPort,
|
|
42
|
-
url: `http://127.0.0.1:${localPort}`,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/** Ensures the generated host forwards required by a running application are active. */
|
|
46
|
-
export async function ensureProjectInfrastructureRuntime(args) {
|
|
47
|
-
try {
|
|
48
|
-
return await runProjectInfrastructureLifecycle({
|
|
49
|
-
args: ['start', 'runtime'],
|
|
50
|
-
projectId: args.projectId,
|
|
51
|
-
projectPath: args.projectPath,
|
|
52
|
-
script: 'port-forward',
|
|
53
|
-
target: args.target,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
if (!(error instanceof InfraScriptExecutionError)) {
|
|
58
|
-
throw error;
|
|
59
|
-
}
|
|
60
|
-
const detail = error.stderr.trim() || error.stdout.trim();
|
|
61
|
-
throw new InfraScriptExecutionError({
|
|
62
|
-
exitCode: error.exitCode,
|
|
63
|
-
message: `Failed to ensure infrastructure runtime for project '${args.projectId}'${detail.length > 0 ? `: ${detail}` : '.'}`,
|
|
64
|
-
stderr: error.stderr,
|
|
65
|
-
stdout: error.stdout,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export async function runProjectInfraScript(args) {
|
|
70
|
-
await runProjectInfrastructureLifecycle({
|
|
71
|
-
env: args.context.env,
|
|
72
|
-
onStderr: (chunk) => args.context.writeStderr(chunk),
|
|
73
|
-
onStdout: (chunk) => args.context.writeStdout(chunk),
|
|
74
|
-
projectId: args.projectId,
|
|
75
|
-
projectPath: args.projectPath,
|
|
76
|
-
script: args.script,
|
|
77
|
-
target: args.target,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export function resolveProjectInfraScriptPath(args) {
|
|
81
|
-
return path.join(args.projectPath, getInfraScriptsDirectory(args.target), `${args.script}.sh`);
|
|
82
|
-
}
|
|
83
|
-
function getInfraScriptsDirectory(target) {
|
|
84
|
-
switch (target) {
|
|
85
|
-
case 'minikube':
|
|
86
|
-
return 'infra/minikube/scripts';
|
|
87
|
-
default:
|
|
88
|
-
throw new Error(`Unsupported deployment target for infra scripts: ${target}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async function runShellScript(args) {
|
|
92
|
-
return new Promise((resolve, reject) => {
|
|
93
|
-
const child = spawn('bash', [args.scriptPath, ...args.args], {
|
|
94
|
-
cwd: path.dirname(args.scriptPath),
|
|
95
|
-
env: { ...args.env },
|
|
96
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
97
|
-
});
|
|
98
|
-
let stdout = '';
|
|
99
|
-
let stderr = '';
|
|
100
|
-
child.stdout.setEncoding('utf8');
|
|
101
|
-
child.stderr.setEncoding('utf8');
|
|
102
|
-
child.stdout.on('data', (chunk) => {
|
|
103
|
-
stdout += chunk;
|
|
104
|
-
args.onStdout?.(chunk);
|
|
105
|
-
});
|
|
106
|
-
child.stderr.on('data', (chunk) => {
|
|
107
|
-
stderr += chunk;
|
|
108
|
-
args.onStderr?.(chunk);
|
|
109
|
-
});
|
|
110
|
-
child.once('error', (error) => reject(createStartError(args.scriptPath, error, stdout, stderr)));
|
|
111
|
-
child.once('close', (exitCode) => {
|
|
112
|
-
if (exitCode === 0) {
|
|
113
|
-
resolve({ stderr, stdout });
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
reject(createExitError(args.scriptPath, exitCode, stdout, stderr));
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
function createStartError(scriptPath, error, stdout, stderr) {
|
|
121
|
-
return new InfraScriptExecutionError({
|
|
122
|
-
exitCode: null,
|
|
123
|
-
message: `Failed to start infra script '${scriptPath}': ${error.message}`,
|
|
124
|
-
stderr,
|
|
125
|
-
stdout,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
function createExitError(scriptPath, exitCode, stdout, stderr) {
|
|
129
|
-
return new InfraScriptExecutionError({
|
|
130
|
-
exitCode,
|
|
131
|
-
message: `Infra script '${scriptPath}' exited with code ${exitCode ?? 'unknown'}.`,
|
|
132
|
-
stderr,
|
|
133
|
-
stdout,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function parsePositivePort(value) {
|
|
137
|
-
if (value === undefined)
|
|
138
|
-
return null;
|
|
139
|
-
const parsed = Number.parseInt(value.trim(), 10);
|
|
140
|
-
return Number.isInteger(parsed) && parsed >= 1 && parsed <= 65_535 ? parsed : null;
|
|
141
|
-
}
|
|
142
|
-
async function pathExists(filePath) {
|
|
143
|
-
try {
|
|
144
|
-
await fs.access(filePath);
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
catch {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
//# sourceMappingURL=runtime.js.map
|
package/dist/runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAc/E,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACzC,QAAQ,CAAgB;IACxB,MAAM,CAAS;IACf,MAAM,CAAS;IAExB,YAAY,IAKX;QACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,iCAAiC,CAAC,IASvD;IACC,MAAM,UAAU,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,2BAA2B,UAAU,qCAAqC,IAAI,CAAC,SAAS,UAAU,CACnG,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CAAC;QACpB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;QACrB,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;QAC5B,QAAQ,E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promises as fs } from 'fs';\nimport path from 'path';\n\nimport type { InfraCommandContext } from './commandContext.js';\nimport { readProjectInfrastructureEnvironment } from './projectEnvironment.js';\n\nexport type InfraLifecycleScript = 'destroy' | 'down' | 'port-forward' | 'reset' | 'status' | 'up';\n\nexport interface InfraScriptOutput {\n readonly stderr: string;\n readonly stdout: string;\n}\n\nexport interface InfraPortForwardInfo {\n readonly localPort: number;\n readonly url: string;\n}\n\nexport class InfraScriptExecutionError extends Error {\n readonly exitCode: number | null;\n readonly stderr: string;\n readonly stdout: string;\n\n constructor(args: {\n readonly exitCode: number | null;\n readonly message: string;\n readonly stderr: string;\n readonly stdout: string;\n }) {\n super(args.message);\n this.name = 'InfraScriptExecutionError';\n this.exitCode = args.exitCode;\n this.stderr = args.stderr;\n this.stdout = args.stdout;\n }\n}\n\nexport async function runProjectInfrastructureLifecycle(args: {\n readonly args?: readonly string[];\n readonly env?: Readonly<Record<string, string | undefined>>;\n readonly onStderr?: (chunk: string) => void;\n readonly onStdout?: (chunk: string) => void;\n readonly projectId: string;\n readonly projectPath: string;\n readonly script: InfraLifecycleScript;\n readonly target: string;\n}): Promise<InfraScriptOutput> {\n const scriptPath = resolveProjectInfraScriptPath(args);\n if (!(await pathExists(scriptPath))) {\n throw new Error(\n `Infra script not found: ${scriptPath}. Run infra generate for project '${args.projectId}' first.`,\n );\n }\n\n return runShellScript({\n args: args.args ?? [],\n env: args.env ?? process.env,\n onStderr: args.onStderr,\n onStdout: args.onStdout,\n scriptPath,\n });\n}\n\nexport async function resolveProjectInfrastructurePortForward(args: {\n readonly projectPath: string;\n readonly target: string;\n}): Promise<InfraPortForwardInfo> {\n const environment = await readProjectInfrastructureEnvironment({\n keys: ['APP_PORT_FORWARD_LOCAL_PORT'],\n projectPath: args.projectPath,\n target: args.target,\n });\n const localPort = parsePositivePort(environment.APP_PORT_FORWARD_LOCAL_PORT);\n\n if (localPort === null) {\n throw new Error(\n 'Generated Infra did not provide a valid APP_PORT_FORWARD_LOCAL_PORT. Regenerate infrastructure first.',\n );\n }\n\n return {\n localPort,\n url: `http://127.0.0.1:${localPort}`,\n };\n}\n\n/** Ensures the generated host forwards required by a running application are active. */\nexport async function ensureProjectInfrastructureRuntime(args: {\n readonly projectId: string;\n readonly projectPath: string;\n readonly target: string;\n}): Promise<InfraScriptOutput> {\n try {\n return await runProjectInfrastructureLifecycle({\n args: ['start', 'runtime'],\n projectId: args.projectId,\n projectPath: args.projectPath,\n script: 'port-forward',\n target: args.target,\n });\n } catch (error) {\n if (!(error instanceof InfraScriptExecutionError)) {\n throw error;\n }\n\n const detail = error.stderr.trim() || error.stdout.trim();\n throw new InfraScriptExecutionError({\n exitCode: error.exitCode,\n message: `Failed to ensure infrastructure runtime for project '${args.projectId}'${\n detail.length > 0 ? `: ${detail}` : '.'\n }`,\n stderr: error.stderr,\n stdout: error.stdout,\n });\n }\n}\n\nexport async function runProjectInfraScript(args: {\n readonly context: InfraCommandContext;\n readonly projectId: string;\n readonly projectPath: string;\n readonly script: InfraLifecycleScript;\n readonly target: string;\n}): Promise<void> {\n await runProjectInfrastructureLifecycle({\n env: args.context.env,\n onStderr: (chunk) => args.context.writeStderr(chunk),\n onStdout: (chunk) => args.context.writeStdout(chunk),\n projectId: args.projectId,\n projectPath: args.projectPath,\n script: args.script,\n target: args.target,\n });\n}\n\nexport function resolveProjectInfraScriptPath(args: {\n readonly projectPath: string;\n readonly script: InfraLifecycleScript;\n readonly target: string;\n}): string {\n return path.join(args.projectPath, getInfraScriptsDirectory(args.target), `${args.script}.sh`);\n}\n\nfunction getInfraScriptsDirectory(target: string): string {\n switch (target) {\n case 'minikube':\n return 'infra/minikube/scripts';\n default:\n throw new Error(`Unsupported deployment target for infra scripts: ${target}`);\n }\n}\n\nasync function runShellScript(args: {\n readonly args: readonly string[];\n readonly env: Readonly<Record<string, string | undefined>>;\n readonly onStderr?: (chunk: string) => void;\n readonly onStdout?: (chunk: string) => void;\n readonly scriptPath: string;\n}): Promise<InfraScriptOutput> {\n return new Promise<InfraScriptOutput>((resolve, reject) => {\n const child = spawn('bash', [args.scriptPath, ...args.args], {\n cwd: path.dirname(args.scriptPath),\n env: { ...args.env },\n stdio: ['ignore', 'pipe', 'pipe'],\n });\n\n let stdout = '';\n let stderr = '';\n child.stdout.setEncoding('utf8');\n child.stderr.setEncoding('utf8');\n child.stdout.on('data', (chunk: string) => {\n stdout += chunk;\n args.onStdout?.(chunk);\n });\n child.stderr.on('data', (chunk: string) => {\n stderr += chunk;\n args.onStderr?.(chunk);\n });\n child.once('error', (error) =>\n reject(createStartError(args.scriptPath, error, stdout, stderr)),\n );\n child.once('close', (exitCode) => {\n if (exitCode === 0) {\n resolve({ stderr, stdout });\n return;\n }\n reject(createExitError(args.scriptPath, exitCode, stdout, stderr));\n });\n });\n}\n\nfunction createStartError(\n scriptPath: string,\n error: Error,\n stdout: string,\n stderr: string,\n): InfraScriptExecutionError {\n return new InfraScriptExecutionError({\n exitCode: null,\n message: `Failed to start infra script '${scriptPath}': ${error.message}`,\n stderr,\n stdout,\n });\n}\n\nfunction createExitError(\n scriptPath: string,\n exitCode: number | null,\n stdout: string,\n stderr: string,\n): InfraScriptExecutionError {\n return new InfraScriptExecutionError({\n exitCode,\n message: `Infra script '${scriptPath}' exited with code ${exitCode ?? 'unknown'}.`,\n stderr,\n stdout,\n });\n}\n\nfunction parsePositivePort(value: string | undefined): number | null {\n if (value === undefined) return null;\n const parsed = Number.parseInt(value.trim(), 10);\n return Number.isInteger(parsed) && parsed >= 1 && parsed <= 65_535 ? parsed : null;\n}\n\nasync function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n"]}
|
package/dist/secretStore.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { SecretStoreAdapter } from '@ankhorage/contracts/secrets';
|
|
2
|
-
import { type SupabaseVaultAdapterOptions } from '@ankhorage/supabase-vault';
|
|
3
|
-
import type { InfraManifestInput } from './types';
|
|
4
|
-
export interface InfraSecretStoreProviders {
|
|
5
|
-
readonly supabaseVault?: SupabaseVaultAdapterOptions;
|
|
6
|
-
}
|
|
7
|
-
export interface CreateInfraSecretStoreAdapterInput {
|
|
8
|
-
readonly manifest: Pick<InfraManifestInput, 'secretStore'>;
|
|
9
|
-
readonly providers: InfraSecretStoreProviders;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Creates the configured server-only secret-store adapter.
|
|
13
|
-
*
|
|
14
|
-
* Bootstrap credentials and trusted clients belong in `providers`; they must never be read from
|
|
15
|
-
* the public app manifest. A missing `infra.secretStore` returns `null` because apps without
|
|
16
|
-
* secret-backed features do not require a secret store.
|
|
17
|
-
*/
|
|
18
|
-
export declare function createInfraSecretStoreAdapter(input: CreateInfraSecretStoreAdapterInput): SecretStoreAdapter | null;
|
|
19
|
-
//# sourceMappingURL=secretStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secretStore.d.ts","sourceRoot":"","sources":["../src/secretStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,2BAA2B,CAAC;CACtD;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;IAC3D,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,kCAAkC,GACxC,kBAAkB,GAAG,IAAI,CAgB3B"}
|
package/dist/secretStore.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createSupabaseVaultAdapter, SUPABASE_VAULT_SECRET_STORE_PROVIDER, } from '@ankhorage/supabase-vault';
|
|
2
|
-
/**
|
|
3
|
-
* Creates the configured server-only secret-store adapter.
|
|
4
|
-
*
|
|
5
|
-
* Bootstrap credentials and trusted clients belong in `providers`; they must never be read from
|
|
6
|
-
* the public app manifest. A missing `infra.secretStore` returns `null` because apps without
|
|
7
|
-
* secret-backed features do not require a secret store.
|
|
8
|
-
*/
|
|
9
|
-
export function createInfraSecretStoreAdapter(input) {
|
|
10
|
-
const provider = input.manifest.secretStore?.provider;
|
|
11
|
-
if (!provider)
|
|
12
|
-
return null;
|
|
13
|
-
if (provider === SUPABASE_VAULT_SECRET_STORE_PROVIDER) {
|
|
14
|
-
const options = input.providers.supabaseVault;
|
|
15
|
-
if (!options) {
|
|
16
|
-
throw new Error('Secret-store provider "supabase-vault" requires trusted Supabase Vault adapter options.');
|
|
17
|
-
}
|
|
18
|
-
return createSupabaseVaultAdapter(options);
|
|
19
|
-
}
|
|
20
|
-
throw new Error(`Unsupported secret-store provider: "${provider}".`);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=secretStore.js.map
|
package/dist/secretStore.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secretStore.js","sourceRoot":"","sources":["../src/secretStore.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,GAErC,MAAM,2BAA2B,CAAC;AAanC;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC3C,KAAyC;IAEzC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;IACtD,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,IAAI,QAAQ,KAAK,oCAAoC,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;QACJ,CAAC;QAED,OAAO,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,uCAAuC,QAAQ,IAAI,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { SecretStoreAdapter } from '@ankhorage/contracts/secrets';\nimport {\n createSupabaseVaultAdapter,\n SUPABASE_VAULT_SECRET_STORE_PROVIDER,\n type SupabaseVaultAdapterOptions,\n} from '@ankhorage/supabase-vault';\n\nimport type { InfraManifestInput } from './types';\n\nexport interface InfraSecretStoreProviders {\n readonly supabaseVault?: SupabaseVaultAdapterOptions;\n}\n\nexport interface CreateInfraSecretStoreAdapterInput {\n readonly manifest: Pick<InfraManifestInput, 'secretStore'>;\n readonly providers: InfraSecretStoreProviders;\n}\n\n/**\n * Creates the configured server-only secret-store adapter.\n *\n * Bootstrap credentials and trusted clients belong in `providers`; they must never be read from\n * the public app manifest. A missing `infra.secretStore` returns `null` because apps without\n * secret-backed features do not require a secret store.\n */\nexport function createInfraSecretStoreAdapter(\n input: CreateInfraSecretStoreAdapterInput,\n): SecretStoreAdapter | null {\n const provider = input.manifest.secretStore?.provider;\n if (!provider) return null;\n\n if (provider === SUPABASE_VAULT_SECRET_STORE_PROVIDER) {\n const options = input.providers.supabaseVault;\n if (!options) {\n throw new Error(\n 'Secret-store provider \"supabase-vault\" requires trusted Supabase Vault adapter options.',\n );\n }\n\n return createSupabaseVaultAdapter(options);\n }\n\n throw new Error(`Unsupported secret-store provider: \"${provider}\".`);\n}\n"]}
|
package/dist/types.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { AppManifest, InfraManifest } from '@ankhorage/contracts';
|
|
2
|
-
export interface GeneratedInfrastructureFile {
|
|
3
|
-
/**
|
|
4
|
-
* Path relative to the target app root.
|
|
5
|
-
*/
|
|
6
|
-
readonly path: string;
|
|
7
|
-
readonly content: string;
|
|
8
|
-
readonly executable?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface GeneratedPackageDependency {
|
|
11
|
-
readonly name: string;
|
|
12
|
-
readonly version: string;
|
|
13
|
-
readonly reason: string;
|
|
14
|
-
}
|
|
15
|
-
export interface InfrastructureGenerationMeta {
|
|
16
|
-
readonly target: NonNullable<InfraManifest['deployment']>['target'];
|
|
17
|
-
readonly providers: readonly string[];
|
|
18
|
-
}
|
|
19
|
-
export interface InfrastructureGenerationResult {
|
|
20
|
-
readonly files: readonly GeneratedInfrastructureFile[];
|
|
21
|
-
readonly warnings: readonly string[];
|
|
22
|
-
readonly meta: InfrastructureGenerationMeta;
|
|
23
|
-
readonly dependencies: readonly GeneratedPackageDependency[];
|
|
24
|
-
}
|
|
25
|
-
export interface InfrastructureGenerationOptions {
|
|
26
|
-
/**
|
|
27
|
-
* Optional namespace hint from caller context, such as app slug or project id.
|
|
28
|
-
*/
|
|
29
|
-
readonly namespaceHint?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Optional app-level context used by provider/engine-specific generators.
|
|
32
|
-
*/
|
|
33
|
-
readonly appManifest?: Pick<AppManifest, 'deploy' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'>;
|
|
34
|
-
}
|
|
35
|
-
export interface InfraGenerationInput {
|
|
36
|
-
/**
|
|
37
|
-
* Infra manifest section from an app manifest.
|
|
38
|
-
*/
|
|
39
|
-
readonly manifest: InfraManifestInput;
|
|
40
|
-
/**
|
|
41
|
-
* Optional root used by callers that want to keep output intent alongside generation.
|
|
42
|
-
* The generator itself still returns relative file paths and does not write to disk.
|
|
43
|
-
*/
|
|
44
|
-
readonly outputRoot?: string;
|
|
45
|
-
readonly options?: InfrastructureGenerationOptions;
|
|
46
|
-
}
|
|
47
|
-
export type InfraGenerationOptions = InfrastructureGenerationOptions;
|
|
48
|
-
export type InfraGenerationResult = InfrastructureGenerationResult;
|
|
49
|
-
export type GeneratedFile = GeneratedInfrastructureFile;
|
|
50
|
-
export type PackageDependency = GeneratedPackageDependency;
|
|
51
|
-
export interface InfraDiagnostic {
|
|
52
|
-
readonly severity: 'warning';
|
|
53
|
-
readonly message: string;
|
|
54
|
-
}
|
|
55
|
-
type InfraStorageProvider = NonNullable<InfraManifest['storage']>['provider'] | 'supabase';
|
|
56
|
-
interface InfraStorageSpecInput {
|
|
57
|
-
readonly provider: InfraStorageProvider;
|
|
58
|
-
readonly buckets: readonly string[];
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Infra-local manifest input type.
|
|
62
|
-
*
|
|
63
|
-
* This is intentionally broader than `@ankhorage/contracts` to allow adapters to support
|
|
64
|
-
* additional providers before the shared contracts package officially includes them.
|
|
65
|
-
*/
|
|
66
|
-
export type InfraManifestInput = Omit<InfraManifest, 'storage'> & {
|
|
67
|
-
readonly storage?: InfraStorageSpecInput;
|
|
68
|
-
};
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC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AAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAC1C,CAAC"}
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppManifest, InfraManifest } from '@ankhorage/contracts';\n\nexport interface GeneratedInfrastructureFile {\n /**\n * Path relative to the target app root.\n */\n readonly path: string;\n readonly content: string;\n readonly executable?: boolean;\n}\n\nexport interface GeneratedPackageDependency {\n readonly name: string;\n readonly version: string;\n readonly reason: string;\n}\n\nexport interface InfrastructureGenerationMeta {\n readonly target: NonNullable<InfraManifest['deployment']>['target'];\n readonly providers: readonly string[];\n}\n\nexport interface InfrastructureGenerationResult {\n readonly files: readonly GeneratedInfrastructureFile[];\n readonly warnings: readonly string[];\n readonly meta: InfrastructureGenerationMeta;\n readonly dependencies: readonly GeneratedPackageDependency[];\n}\n\nexport interface InfrastructureGenerationOptions {\n /**\n * Optional namespace hint from caller context, such as app slug or project id.\n */\n readonly namespaceHint?: string;\n /**\n * Optional app-level context used by provider/engine-specific generators.\n */\n readonly appManifest?: Pick<\n AppManifest,\n 'deploy' | 'infra' | 'metadata' | 'navigator' | 'screens' | 'settings'\n >;\n}\n\nexport interface InfraGenerationInput {\n /**\n * Infra manifest section from an app manifest.\n */\n readonly manifest: InfraManifestInput;\n /**\n * Optional root used by callers that want to keep output intent alongside generation.\n * The generator itself still returns relative file paths and does not write to disk.\n */\n readonly outputRoot?: string;\n readonly options?: InfrastructureGenerationOptions;\n}\n\nexport type InfraGenerationOptions = InfrastructureGenerationOptions;\nexport type InfraGenerationResult = InfrastructureGenerationResult;\nexport type GeneratedFile = GeneratedInfrastructureFile;\nexport type PackageDependency = GeneratedPackageDependency;\n\nexport interface InfraDiagnostic {\n readonly severity: 'warning';\n readonly message: string;\n}\n\ntype InfraStorageProvider = NonNullable<InfraManifest['storage']>['provider'] | 'supabase';\n\ninterface InfraStorageSpecInput {\n readonly provider: InfraStorageProvider;\n readonly buckets: readonly string[];\n}\n\n/**\n * Infra-local manifest input type.\n *\n * This is intentionally broader than `@ankhorage/contracts` to allow adapters to support\n * additional providers before the shared contracts package officially includes them.\n */\nexport type InfraManifestInput = Omit<InfraManifest, 'storage'> & {\n readonly storage?: InfraStorageSpecInput;\n};\n"]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# Minikube Adapter
|
|
2
|
-
|
|
3
|
-
Generates local Kubernetes artifacts under `infra/minikube/*` from `InfraManifest`.
|
|
4
|
-
|
|
5
|
-
## Ownership Model
|
|
6
|
-
|
|
7
|
-
- One canonical app slug owns one Minikube profile.
|
|
8
|
-
- The generated app runtime lives in namespace `app`.
|
|
9
|
-
- Supabase-owned runtime workloads live in namespace `supabase`.
|
|
10
|
-
- Future self-hosted providers should own deterministic provider namespaces.
|
|
11
|
-
|
|
12
|
-
There is no shared `minikube` profile, no host-level Supabase Compose runtime, and no
|
|
13
|
-
compatibility path for `supabase start`.
|
|
14
|
-
|
|
15
|
-
## Structure
|
|
16
|
-
|
|
17
|
-
- `base/`: app-owned profile lifecycle, `app` namespace, Supabase namespace, kustomization, helper scripts.
|
|
18
|
-
- `auth/`: auth provider artifacts (implemented: `supabase`).
|
|
19
|
-
- `authz/`: authorization engine artifacts (implemented: `cerbos`; `native` warning-only/no resources; `opa` unsupported).
|
|
20
|
-
- `storage/`: storage provider app-runtime config (implemented: `supabase`).
|
|
21
|
-
- `secrets/`: secret-store provider migrations and docs (implemented: `supabase-vault`).
|
|
22
|
-
|
|
23
|
-
Cerbos policy generation uses app manifest intent (navigator routes/screens + authFlow)
|
|
24
|
-
when provided by caller.
|
|
25
|
-
|
|
26
|
-
## Runtime Scripts
|
|
27
|
-
|
|
28
|
-
- `scripts/up.sh`: starts `minikube -p <slug>`, applies manifests, waits for Supabase, runs migrations with CLI telemetry disabled for that command, and starts slug-owned port-forwards. It builds and deploys the Kubernetes Web app runtime only when the canonical app manifest enables `deploy.targets.web` (legacy manifests without `deploy` retain the Web runtime).
|
|
29
|
-
- `scripts/down.sh`: stops slug-owned port-forwards, then runs `minikube stop -p <slug>`. Persistent profile data remains.
|
|
30
|
-
- `scripts/reset.sh`: requires `ANKH_RESET_CONFIRM=<slug>` and deletes/recreates namespaces `app` and `supabase`, including Supabase DB and Storage PVC data. It does not delete the Minikube profile.
|
|
31
|
-
- `scripts/destroy.sh`: stops slug-owned port-forwards and runs `minikube delete -p <slug>`.
|
|
32
|
-
- `scripts/status.sh`: reports profile, namespace, workload, and port-forward health.
|
|
33
|
-
- `scripts/port-forward.sh`: owns topology-derived named forwards plus provider-aware `runtime` and `all` groups.
|
|
34
|
-
- `scripts/build-app-image.sh`: exports Expo web build from app source and builds the Docker image.
|
|
35
|
-
|
|
36
|
-
The `runtime` group is the canonical repair lifecycle for host endpoints required by the
|
|
37
|
-
running app. It contains `app` only when the generated topology includes the Kubernetes Web
|
|
38
|
-
app Service, and adds `supabase-gateway` when the generated Supabase Kubernetes runtime is
|
|
39
|
-
enabled. Native-only apps therefore restore provider endpoints without requiring a fictional
|
|
40
|
-
app Service. The group deliberately excludes `studio` and `db-migration`; `all` retains
|
|
41
|
-
those operational/bootstrap forwards. Start, stop, or inspect the group with
|
|
42
|
-
`scripts/port-forward.sh {start|stop|status} runtime`. Package consumers should call
|
|
43
|
-
`ensureProjectInfrastructureRuntime()` from `@ankhorage/infra/project` instead of depending
|
|
44
|
-
on concrete provider forward names. Forward startup retries bounded transient Kubernetes
|
|
45
|
-
pod-selection and readiness failures that can occur immediately after a profile restart.
|
|
46
|
-
Active runtime/all groups contain only targets in the generated topology. Cleanup retains
|
|
47
|
-
the exact identities of all Infra-managed forwards so a Web-to-native regeneration safely
|
|
48
|
-
stops an obsolete owned `app` forward without making it an active start target.
|
|
49
|
-
|
|
50
|
-
When the Web app runtime is disabled, `up.sh` also reconciles the former generated
|
|
51
|
-
`Deployment/app-runtime`, `Service/app-runtime`, and `ConfigMap/app-infra-config` with exact,
|
|
52
|
-
idempotent deletes. It does not prune unrelated resources or delete the `app` namespace.
|
|
53
|
-
|
|
54
|
-
## Supabase Runtime
|
|
55
|
-
|
|
56
|
-
Runtime ownership is Kubernetes. Migration authoring/history remains Supabase migration
|
|
57
|
-
files. Migration execution targets the Kubernetes Postgres endpoint via
|
|
58
|
-
`SUPABASE_TELEMETRY_DISABLED=1 supabase --yes migration up --db-url "$SUPABASE_DB_URL"`.
|
|
59
|
-
The migration process does not require stdin. `--yes` remains defense in depth for future
|
|
60
|
-
CLI prompts; it is not the hang fix. Command-scoped telemetry disable avoids the unbounded
|
|
61
|
-
telemetry shutdown in Supabase CLI 2.106.0 when PostHog is blocked, without changing the
|
|
62
|
-
user's persistent telemetry preference. Migration failures remain fatal under
|
|
63
|
-
`set -Eeuo pipefail`, and the completion message is printed only after a zero exit status.
|
|
64
|
-
The lifecycle adds no migration deadline and supports the affected CLI version; using a
|
|
65
|
-
current Supabase CLI is still recommended.
|
|
66
|
-
|
|
67
|
-
The generated manifests are based on the current official Supabase self-hosting Docker
|
|
68
|
-
topology, service documentation, environment-variable contracts, and pinned official
|
|
69
|
-
images. Kubernetes/Helm is treated as community-driven upstream guidance, not an
|
|
70
|
-
official Supabase Kubernetes distribution.
|
|
71
|
-
|
|
72
|
-
## App Image Behavior
|
|
73
|
-
|
|
74
|
-
- Default app image: `ankh/<slug>:dev`.
|
|
75
|
-
- By default `up.sh` triggers `build-app-image.sh` (`APP_BUILD_ENABLED=true`) before apply.
|
|
76
|
-
- `build-app-image.sh` requires the app's installed `node_modules/.bin/expo`, runs
|
|
77
|
-
`expo export --platform web --clear` through that pinned local CLI, then builds via
|
|
78
|
-
`app-image/Dockerfile`. Missing app dependencies fail with an explicit frozen-install
|
|
79
|
-
instruction; the script never resolves Expo through `bunx` or the network. Clearing the
|
|
80
|
-
Expo/Metro cache ensures rotated `EXPO_PUBLIC_*` values replace cached transforms before the
|
|
81
|
-
browser bundle and Docker image are created.
|
|
82
|
-
- `up.sh` syncs runtime image using `APP_IMAGE_SYNC_STRATEGY`:
|
|
83
|
-
- `docker-load` (default): loads existing local Docker image into the app profile.
|
|
84
|
-
- `minikube-build`: builds exported web artifacts directly into the profile image store.
|
|
85
|
-
- `none`: skips local image sync.
|
|
86
|
-
- Private registries are supported via optional `.env` keys:
|
|
87
|
-
- `APP_IMAGE_PULL_SECRET_NAME`
|
|
88
|
-
- `APP_IMAGE_PULL_SECRET_SERVER`
|
|
89
|
-
- `APP_IMAGE_PULL_SECRET_USERNAME`
|
|
90
|
-
- `APP_IMAGE_PULL_SECRET_PASSWORD`
|
|
91
|
-
- `APP_IMAGE_PULL_SECRET_EMAIL`
|
|
92
|
-
|
|
93
|
-
When pull-secret values are provided, `up.sh` creates/updates the secret and patches
|
|
94
|
-
`deployment/app-runtime` with `imagePullSecrets`.
|
|
95
|
-
|
|
96
|
-
## Security Boundary
|
|
97
|
-
|
|
98
|
-
The app namespace receives only browser-safe Supabase URL and anon key material through
|
|
99
|
-
`Secret/supabase-public-runtime`. Privileged Supabase runtime credentials remain in
|
|
100
|
-
`Secret/supabase-runtime-secrets` in namespace `supabase`.
|
|
101
|
-
|
|
102
|
-
For local Expo/Metro development, `up.sh` also mirrors only the browser-safe
|
|
103
|
-
`EXPO_PUBLIC_SUPABASE_URL` and `EXPO_PUBLIC_SUPABASE_ANON_KEY` values into the generated
|
|
104
|
-
app root `.env.local`, preserving unrelated entries. Restart Expo after Infra Up so the
|
|
105
|
-
client bundle sees the refreshed public Supabase values.
|
|
106
|
-
|
|
107
|
-
Only browser-safe `EXPO_PUBLIC_SUPABASE_URL` and `EXPO_PUBLIC_SUPABASE_ANON_KEY` values are
|
|
108
|
-
eligible for client bundling. Service-role and other privileged Supabase credentials remain
|
|
109
|
-
outside the app public environment and must never be referenced through `EXPO_PUBLIC_*` names.
|
|
110
|
-
|
|
111
|
-
## Practical Selector Rule
|
|
112
|
-
|
|
113
|
-
When building config UI or pickers, only show currently supported values from adapter-owned
|
|
114
|
-
support lists (`DEPLOYMENT_TARGETS`, `DATABASE_PROVIDERS`, `AUTH_PROVIDERS`, `AUTH_SCOPES`,
|
|
115
|
-
`AUTHZ_ENGINES`). Do not show planned values until an adapter path exists in this folder.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
import { generateInfrastructure } from '../../index';
|
|
4
|
-
import { createAppManifest } from '../../testSupport';
|
|
5
|
-
|
|
6
|
-
describe('generated Minikube app runtime serving', () => {
|
|
7
|
-
test('keeps nginx redirects relative so port-forwarded browser origins are preserved', () => {
|
|
8
|
-
const result = generateInfrastructure(
|
|
9
|
-
{
|
|
10
|
-
deployment: {
|
|
11
|
-
target: 'minikube',
|
|
12
|
-
monitoring: false,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
appManifest: createAppManifest('forwarded-origin'),
|
|
17
|
-
},
|
|
18
|
-
);
|
|
19
|
-
const dockerfile = result.files.find(
|
|
20
|
-
(file) => file.path === 'infra/minikube/app-image/Dockerfile',
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
expect(dockerfile).toBeDefined();
|
|
24
|
-
expect(dockerfile?.content).toContain('listen 8080;\n absolute_redirect off;');
|
|
25
|
-
expect(dockerfile?.content).toContain('try_files $uri $uri/ /index.html;');
|
|
26
|
-
expect(dockerfile?.content).not.toContain('port_in_redirect off;');
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { InfraManifestInput, InfrastructureGenerationOptions } from '../../../types';
|
|
2
|
-
import { emptyMinikubeArtifacts, type MinikubeAdapterArtifacts } from '../contracts';
|
|
3
|
-
import { generateSupabaseAuthArtifacts } from './supabase';
|
|
4
|
-
import { generateTargetAwareSupabaseOAuthRuntimeArtifacts } from './targetAwareOAuthRuntime';
|
|
5
|
-
|
|
6
|
-
export function generateAuthProviderArtifacts(args: {
|
|
7
|
-
appManifest: InfrastructureGenerationOptions['appManifest'];
|
|
8
|
-
manifest: InfraManifestInput;
|
|
9
|
-
namespace: string;
|
|
10
|
-
}): MinikubeAdapterArtifacts {
|
|
11
|
-
const { appManifest, manifest, namespace } = args;
|
|
12
|
-
const { auth } = manifest;
|
|
13
|
-
|
|
14
|
-
if (!auth) {
|
|
15
|
-
return emptyMinikubeArtifacts();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (auth.provider !== 'supabase') {
|
|
19
|
-
throw new Error(
|
|
20
|
-
`Unsupported auth provider for minikube adapter: "${auth.provider}". Only "supabase" is currently supported.`,
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const providerArtifacts = generateSupabaseAuthArtifacts({ manifest, namespace });
|
|
25
|
-
const oauthArtifacts = generateTargetAwareSupabaseOAuthRuntimeArtifacts({
|
|
26
|
-
appManifest,
|
|
27
|
-
manifest,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
files: [...providerArtifacts.files, ...oauthArtifacts.files],
|
|
32
|
-
resources: [...providerArtifacts.resources, ...oauthArtifacts.resources],
|
|
33
|
-
providerLifecycle: [
|
|
34
|
-
...providerArtifacts.providerLifecycle,
|
|
35
|
-
...oauthArtifacts.providerLifecycle,
|
|
36
|
-
],
|
|
37
|
-
envEntries: [...providerArtifacts.envEntries, ...oauthArtifacts.envEntries],
|
|
38
|
-
warnings: [...providerArtifacts.warnings, ...oauthArtifacts.warnings],
|
|
39
|
-
};
|
|
40
|
-
}
|