@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/src/index.test.ts
CHANGED
|
@@ -1,319 +1,26 @@
|
|
|
1
|
-
import type { AppManifest } from '@ankhorage/contracts';
|
|
2
1
|
import { describe, expect, test } from 'bun:test';
|
|
3
2
|
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
optionalFields: ['firstName', 'lastName'],
|
|
27
|
-
signUpPolicy: 'requireVerification',
|
|
28
|
-
},
|
|
29
|
-
profile: {
|
|
30
|
-
fields: ['email', 'firstName', 'lastName', 'avatarUrl'],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
database: {
|
|
34
|
-
provider: 'supabase',
|
|
35
|
-
tier: 'dev',
|
|
36
|
-
},
|
|
37
|
-
storage: {
|
|
38
|
-
provider: 'auto',
|
|
39
|
-
buckets: ['assets'],
|
|
40
|
-
},
|
|
41
|
-
networking: {
|
|
42
|
-
domain: 'alpha.local',
|
|
43
|
-
cdn: false,
|
|
44
|
-
},
|
|
45
|
-
modules: [],
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const result = generateInfrastructure(manifest, { appManifest: createAppManifest('alpha') });
|
|
49
|
-
const paths = result.files.map((file) => file.path);
|
|
50
|
-
|
|
51
|
-
expect(result.meta.target).toBe('minikube');
|
|
52
|
-
expect(result.meta.providers).toEqual(['auto', 'cerbos', 'supabase']);
|
|
53
|
-
expect(paths).toContain('infra/minikube/k8s/namespaces/app.yaml');
|
|
54
|
-
expect(paths).toContain('infra/minikube/k8s/namespaces/supabase.yaml');
|
|
55
|
-
expect(paths).toContain('infra/minikube/k8s/app/deployment.yaml');
|
|
56
|
-
expect(paths).toContain('infra/minikube/k8s/app/service.yaml');
|
|
57
|
-
expect(paths).toContain('infra/minikube/k8s/supabase/postgres.yaml');
|
|
58
|
-
expect(paths).toContain('infra/minikube/k8s/supabase/gateway.yaml');
|
|
59
|
-
expect(paths).toContain('infra/minikube/k8s/auth/supabase/supabase-auth.configmap.yaml');
|
|
60
|
-
expect(paths).toContain('infra/minikube/k8s/auth/supabase/app-runtime-auth.env.configmap.yaml');
|
|
61
|
-
expect(paths).toContain('infra/minikube/k8s/authz/cerbos/cerbos.policy.configmap.yaml');
|
|
62
|
-
expect(paths).toContain('infra/minikube/k8s/authz/cerbos/cerbos.deployment.yaml');
|
|
63
|
-
expect(paths).toContain('infra/minikube/k8s/storage/supabase/supabase-storage.configmap.yaml');
|
|
64
|
-
expect(paths).toContain(
|
|
65
|
-
'infra/minikube/k8s/storage/supabase/app-runtime-storage.env.configmap.yaml',
|
|
66
|
-
);
|
|
67
|
-
expect(paths).toContain('infra/minikube/scripts/up.sh');
|
|
68
|
-
expect(paths).toContain('infra/minikube/scripts/down.sh');
|
|
69
|
-
expect(paths).toContain('infra/minikube/scripts/reset.sh');
|
|
70
|
-
expect(paths).toContain('infra/minikube/scripts/destroy.sh');
|
|
71
|
-
expect(paths).toContain('infra/minikube/scripts/status.sh');
|
|
72
|
-
expect(paths).toContain('infra/minikube/scripts/port-forward.sh');
|
|
73
|
-
expect(paths).not.toContain('infra/minikube/scripts/supabase-local-env.sh');
|
|
74
|
-
|
|
75
|
-
const envExample = getFile(result.files, 'infra/minikube/.env.example');
|
|
76
|
-
expect(envExample).toContain('ANKH_APP_SLUG=alpha');
|
|
77
|
-
expect(envExample).not.toContain('SUPABASE_RUNTIME_ENABLED=');
|
|
78
|
-
expect(envExample).toContain('EXPO_PUBLIC_SUPABASE_URL=');
|
|
79
|
-
expect(envExample).toContain('APP_IMAGE=ankh/alpha:dev');
|
|
80
|
-
expect(envExample).not.toContain('MINIKUBE_PROFILE=');
|
|
81
|
-
expect(envExample).not.toContain('SUPABASE_PROJECT_DIR=');
|
|
82
|
-
|
|
83
|
-
const upScript = getFile(result.files, 'infra/minikube/scripts/up.sh');
|
|
84
|
-
expect(upScript).toContain('SUPABASE_RUNTIME_ENABLED="true"');
|
|
85
|
-
expect(upScript).not.toContain('SUPABASE_RUNTIME_ENABLED="${SUPABASE_RUNTIME_ENABLED');
|
|
86
|
-
expect(upScript).toContain('minikube start -p "${PROFILE}"');
|
|
87
|
-
expect(upScript).toContain('kubectl --context "${PROFILE}" apply -k "${K8S_DIR}"');
|
|
88
|
-
expect(upScript).toContain(
|
|
89
|
-
'SUPABASE_TELEMETRY_DISABLED=1 supabase --yes migration up --db-url "${SUPABASE_DB_URL}"',
|
|
90
|
-
);
|
|
91
|
-
expect(upScript).not.toContain('supabase migration up --db-url "${SUPABASE_DB_URL}"');
|
|
92
|
-
expect(upScript).toContain('create secret generic supabase-runtime-secrets');
|
|
93
|
-
expect(upScript).toContain('create secret generic supabase-public-runtime');
|
|
94
|
-
expect(upScript).toContain('rollout status deployment/app-runtime --timeout=180s');
|
|
95
|
-
expect(upScript).not.toContain('supabase start');
|
|
96
|
-
expect(upScript).not.toContain('supabase status');
|
|
97
|
-
|
|
98
|
-
const appDeployment = getFile(result.files, 'infra/minikube/k8s/app/deployment.yaml');
|
|
99
|
-
expect(appDeployment).toContain('namespace: app');
|
|
100
|
-
expect(appDeployment).toContain('image: ankh/alpha:dev');
|
|
101
|
-
expect(appDeployment).toContain('name: supabase-public-runtime');
|
|
102
|
-
expect(appDeployment).not.toContain('supabase-auth-secrets');
|
|
103
|
-
|
|
104
|
-
const runtimeGuide = getFile(result.files, 'infra/minikube/auth/supabase-runtime-wiring.md');
|
|
105
|
-
expect(runtimeGuide).toContain('supabase-public-runtime');
|
|
106
|
-
expect(runtimeGuide).toContain('${APP_SOURCE_DIR}/.env.local');
|
|
107
|
-
expect(runtimeGuide).not.toContain('SUPABASE_SERVICE_ROLE_KEY');
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
test('generates minikube storage artifacts for explicit supabase provider with normalized buckets', () => {
|
|
111
|
-
const manifest: InfraManifestInput = {
|
|
112
|
-
deployment: {
|
|
113
|
-
target: 'minikube',
|
|
114
|
-
monitoring: false,
|
|
115
|
-
},
|
|
116
|
-
auth: {
|
|
117
|
-
scope: 'global',
|
|
118
|
-
provider: 'supabase',
|
|
119
|
-
},
|
|
120
|
-
database: {
|
|
121
|
-
provider: 'supabase',
|
|
122
|
-
tier: 'dev',
|
|
123
|
-
},
|
|
124
|
-
storage: {
|
|
125
|
-
provider: 'supabase',
|
|
126
|
-
buckets: ['assets', ' assets ', '', 'assets', 'uploads'],
|
|
127
|
-
},
|
|
128
|
-
modules: [],
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const result = generateInfrastructure(manifest, {
|
|
132
|
-
appManifest: createAppManifest('shop'),
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
expect(result.warnings).toContain(
|
|
136
|
-
'Storage buckets are configured but not created automatically yet. Ensure buckets exist in Supabase Storage: assets,uploads.',
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const storageConfig = getFile(
|
|
140
|
-
result.files,
|
|
141
|
-
'infra/minikube/k8s/storage/supabase/supabase-storage.configmap.yaml',
|
|
142
|
-
);
|
|
143
|
-
expect(storageConfig).toContain('namespace: app');
|
|
144
|
-
expect(storageConfig).toContain('STORAGE_BUCKETS: "assets,uploads"');
|
|
145
|
-
expect(storageConfig).toContain('STORAGE_DEFAULT_BUCKET: "assets"');
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
test('generates route and screen cerbos policies when app manifest context is provided', () => {
|
|
149
|
-
const manifest: InfraManifestInput = {
|
|
150
|
-
deployment: {
|
|
151
|
-
target: 'minikube',
|
|
152
|
-
monitoring: false,
|
|
153
|
-
},
|
|
154
|
-
auth: {
|
|
155
|
-
scope: 'global',
|
|
156
|
-
provider: 'supabase',
|
|
157
|
-
authorization: {
|
|
158
|
-
kind: 'ABAC',
|
|
159
|
-
engine: 'cerbos',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
database: {
|
|
163
|
-
provider: 'supabase',
|
|
164
|
-
tier: 'dev',
|
|
165
|
-
},
|
|
166
|
-
modules: [],
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const appManifest: Pick<AppManifest, 'metadata' | 'navigator' | 'screens' | 'settings'> = {
|
|
170
|
-
metadata: {
|
|
171
|
-
name: 'Shop',
|
|
172
|
-
slug: 'shop',
|
|
173
|
-
version: '1.0.0',
|
|
174
|
-
themeId: 'default',
|
|
175
|
-
},
|
|
176
|
-
navigator: {
|
|
177
|
-
type: 'stack',
|
|
178
|
-
routes: [
|
|
179
|
-
{ name: 'sign-in', screenId: 'screen-sign-in' },
|
|
180
|
-
{ name: 'sign-up', screenId: 'screen-sign-up', guards: ['public'] },
|
|
181
|
-
{ name: 'index', screenId: 'screen-home' },
|
|
182
|
-
{ name: 'cart', screenId: 'screen-cart', guards: ['auth'] },
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
screens: {
|
|
186
|
-
'screen-sign-in': {
|
|
187
|
-
id: 'screen-sign-in',
|
|
188
|
-
name: 'SignIn',
|
|
189
|
-
root: { id: 'sign-in-root', type: 'View', children: [] },
|
|
190
|
-
},
|
|
191
|
-
'screen-sign-up': {
|
|
192
|
-
id: 'screen-sign-up',
|
|
193
|
-
name: 'SignUp',
|
|
194
|
-
root: { id: 'sign-up-root', type: 'View', children: [] },
|
|
195
|
-
},
|
|
196
|
-
'screen-home': {
|
|
197
|
-
id: 'screen-home',
|
|
198
|
-
name: 'Home',
|
|
199
|
-
root: { id: 'home-root', type: 'View', children: [] },
|
|
200
|
-
},
|
|
201
|
-
'screen-cart': {
|
|
202
|
-
id: 'screen-cart',
|
|
203
|
-
name: 'Cart',
|
|
204
|
-
root: { id: 'cart-root', type: 'View', children: [] },
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
settings: {
|
|
208
|
-
localization: {
|
|
209
|
-
defaultLocale: 'en',
|
|
210
|
-
locales: ['en'],
|
|
211
|
-
},
|
|
212
|
-
authFlow: {
|
|
213
|
-
signInRoute: '/sign-in',
|
|
214
|
-
signUpRoute: '/sign-up',
|
|
215
|
-
signOutRoute: '/sign-out',
|
|
216
|
-
unauthorizedRoute: '/sign-in',
|
|
217
|
-
postSignInRoute: '/',
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
const result = generateInfrastructure(manifest, { appManifest });
|
|
223
|
-
const cerbosPolicy = getFile(
|
|
224
|
-
result.files,
|
|
225
|
-
'infra/minikube/k8s/authz/cerbos/cerbos.policy.configmap.yaml',
|
|
226
|
-
);
|
|
227
|
-
|
|
228
|
-
expect(cerbosPolicy).toContain('route.resource_policy.yaml: |');
|
|
229
|
-
expect(cerbosPolicy).toContain('screen.resource_policy.yaml: |');
|
|
230
|
-
expect(cerbosPolicy).toContain(
|
|
231
|
-
'expr: "request.resource.attr.route in [\\"sign-in\\",\\"sign-up\\"]"',
|
|
232
|
-
);
|
|
233
|
-
expect(cerbosPolicy).toContain(
|
|
234
|
-
'expr: "request.resource.attr.route in [\\"cart\\",\\"index\\"]"',
|
|
235
|
-
);
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
test('throws for missing deployment', () => {
|
|
239
|
-
const manifest: InfraManifestInput = {
|
|
240
|
-
modules: [],
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
expect(() => generateInfrastructure(manifest)).toThrow('Deployment configuration is missing.');
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
test('throws for unsupported deployment target', () => {
|
|
247
|
-
const manifest: InfraManifestInput = {
|
|
248
|
-
deployment: {
|
|
249
|
-
target: 'kubernetes',
|
|
250
|
-
monitoring: false,
|
|
251
|
-
},
|
|
252
|
-
modules: [],
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
expect(() => generateInfrastructure(manifest)).toThrow(
|
|
256
|
-
'Unsupported deployment target: kubernetes',
|
|
257
|
-
);
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
test('requires canonical app slug for minikube infrastructure', () => {
|
|
261
|
-
const manifest: InfraManifestInput = {
|
|
262
|
-
deployment: {
|
|
263
|
-
target: 'minikube',
|
|
264
|
-
monitoring: false,
|
|
265
|
-
},
|
|
266
|
-
database: {
|
|
267
|
-
provider: 'supabase',
|
|
268
|
-
tier: 'dev',
|
|
269
|
-
},
|
|
270
|
-
modules: [],
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
expect(() => generateInfrastructure(manifest, { namespaceHint: 'shop' })).toThrow(
|
|
274
|
-
'Cannot generate Minikube infrastructure: appManifest.metadata.slug is required.',
|
|
275
|
-
);
|
|
276
|
-
expect(() =>
|
|
277
|
-
generateInfrastructure(manifest, {
|
|
278
|
-
appManifest: createAppManifest('Scanner App'),
|
|
279
|
-
}),
|
|
280
|
-
).toThrow('appManifest.metadata.slug must be a canonical lowercase slug up to 40 characters');
|
|
3
|
+
import * as infra from './index.js';
|
|
4
|
+
|
|
5
|
+
describe('@ankhorage/infra', () => {
|
|
6
|
+
test('exports only the provider-neutral lifecycle and composition APIs', () => {
|
|
7
|
+
expect(infra).toContainAllKeys([
|
|
8
|
+
'createEnvironmentInfraCredentialPort',
|
|
9
|
+
'createEnvironmentInfraSecretPort',
|
|
10
|
+
'createNodeInfraAdapterPackageResolver',
|
|
11
|
+
'destroyInfraEnvironmentAsync',
|
|
12
|
+
'downInfraEnvironmentAsync',
|
|
13
|
+
'generateInfraEnvironmentAsync',
|
|
14
|
+
'getInfraEnvironmentOutputs',
|
|
15
|
+
'orderInfraPlanActions',
|
|
16
|
+
'planInfraEnvironmentAsync',
|
|
17
|
+
'resolveInfraAdaptersAsync',
|
|
18
|
+
'resolveInfraEnvironment',
|
|
19
|
+
'statusInfraEnvironmentAsync',
|
|
20
|
+
'upInfraEnvironmentAsync',
|
|
21
|
+
'validateInfraEnvironmentAsync',
|
|
22
|
+
]);
|
|
23
|
+
expect(Object.keys(infra)).not.toContain('createMinikubeAdapter');
|
|
24
|
+
expect(Object.keys(infra)).not.toContain('resolveAuthRedirectConfiguration');
|
|
281
25
|
});
|
|
282
26
|
});
|
|
283
|
-
|
|
284
|
-
function getFile(files: readonly { path: string; content: string }[], path: string): string {
|
|
285
|
-
const file = files.find((candidate) => candidate.path === path);
|
|
286
|
-
if (!file) throw new Error(`Missing generated file: ${path}`);
|
|
287
|
-
return file.content;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function createAppManifest(
|
|
291
|
-
slug: string,
|
|
292
|
-
): Pick<AppManifest, 'metadata' | 'navigator' | 'screens' | 'settings'> {
|
|
293
|
-
return {
|
|
294
|
-
metadata: {
|
|
295
|
-
name: slug,
|
|
296
|
-
slug,
|
|
297
|
-
version: '1.0.0',
|
|
298
|
-
themeId: 'default',
|
|
299
|
-
},
|
|
300
|
-
navigator: {
|
|
301
|
-
type: 'stack',
|
|
302
|
-
routes: [],
|
|
303
|
-
},
|
|
304
|
-
screens: {},
|
|
305
|
-
settings: {
|
|
306
|
-
localization: {
|
|
307
|
-
defaultLocale: 'en',
|
|
308
|
-
locales: ['en'],
|
|
309
|
-
},
|
|
310
|
-
authFlow: {
|
|
311
|
-
signInRoute: '/sign-in',
|
|
312
|
-
signUpRoute: '/sign-up',
|
|
313
|
-
signOutRoute: '/sign-out',
|
|
314
|
-
unauthorizedRoute: '/sign-in',
|
|
315
|
-
postSignInRoute: '/',
|
|
316
|
-
},
|
|
317
|
-
},
|
|
318
|
-
};
|
|
319
|
-
}
|
package/src/index.ts
CHANGED
|
@@ -1,54 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
InfraManifestInput,
|
|
5
|
-
InfrastructureGenerationOptions,
|
|
6
|
-
InfrastructureGenerationResult,
|
|
7
|
-
} from './types';
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
type AuthRedirectConfiguration,
|
|
11
|
-
type AuthRedirectEnvironment,
|
|
12
|
-
getLocalAuthRedirectPatterns,
|
|
13
|
-
normalizeAuthCallbackRoute,
|
|
14
|
-
resolveAuthRedirectConfiguration,
|
|
15
|
-
type ResolveAuthRedirectConfigurationInput,
|
|
16
|
-
} from './authRedirects';
|
|
17
|
-
export {
|
|
18
|
-
createInfraSecretStoreAdapter,
|
|
19
|
-
type CreateInfraSecretStoreAdapterInput,
|
|
20
|
-
type InfraSecretStoreProviders,
|
|
21
|
-
} from './secretStore';
|
|
1
|
+
export { createEnvironmentInfraCredentialPort } from './features/environment-lifecycle/adapters/outbound/createEnvironmentInfraCredentialPort.js';
|
|
2
|
+
export { createEnvironmentInfraSecretPort } from './features/environment-lifecycle/adapters/outbound/createEnvironmentInfraSecretPort.js';
|
|
3
|
+
export { createNodeInfraAdapterPackageResolver } from './features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js';
|
|
22
4
|
export type {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} from './
|
|
36
|
-
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
5
|
+
InfraAdapterPackageModule,
|
|
6
|
+
InfraAdapterPackageResolver,
|
|
7
|
+
} from './features/environment-lifecycle/application/ports/outbound/infraAdapterPackage.js';
|
|
8
|
+
export { destroyInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js';
|
|
9
|
+
export { downInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js';
|
|
10
|
+
export { generateInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/generateInfraEnvironmentAsync.js';
|
|
11
|
+
export { getInfraEnvironmentOutputs } from './features/environment-lifecycle/application/use-cases/getInfraEnvironmentOutputs.js';
|
|
12
|
+
export { planInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js';
|
|
13
|
+
export { resolveInfraAdaptersAsync } from './features/environment-lifecycle/application/use-cases/resolveInfraAdaptersAsync.js';
|
|
14
|
+
export { statusInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js';
|
|
15
|
+
export { upInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js';
|
|
16
|
+
export { validateInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/validateInfraEnvironmentAsync.js';
|
|
17
|
+
export { orderInfraPlanActions } from './features/environment-lifecycle/domain/orderInfraPlanActions.js';
|
|
18
|
+
export { resolveInfraEnvironment } from './features/environment-lifecycle/domain/resolveInfraEnvironment.js';
|
|
19
|
+
export type {
|
|
20
|
+
InfraDestroyOperationRequest,
|
|
21
|
+
InfraDestroyOperationResult,
|
|
22
|
+
InfraDestroyResult,
|
|
23
|
+
InfraDownOperationResult,
|
|
24
|
+
InfraDownResult,
|
|
25
|
+
InfraGenerateOperationResult,
|
|
26
|
+
InfraGenerateResult,
|
|
27
|
+
InfraOperationRequest,
|
|
28
|
+
InfraOrchestrationDependencies,
|
|
29
|
+
InfraOutputsOperationResult,
|
|
30
|
+
InfraOutputsResult,
|
|
31
|
+
InfraPlanOperationResult,
|
|
32
|
+
InfraStatusOperationResult,
|
|
33
|
+
InfraStoredState,
|
|
34
|
+
InfraUpOperationResult,
|
|
35
|
+
InfraUpRequest,
|
|
36
|
+
InfraUpResult,
|
|
37
|
+
InfraValidateOperationResult,
|
|
38
|
+
InfraValidateResult,
|
|
39
|
+
PreparedInfraOperation,
|
|
40
|
+
ResolvedInfraAdapters,
|
|
41
|
+
ResolvedInfraEnvironment,
|
|
42
|
+
} from './types/infraOrchestration.js';
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { InfraLedger, InfraManifest, InfraResult } from '@ankhorage/contracts/infra';
|
|
2
|
+
import { expect, test } from 'bun:test';
|
|
3
|
+
|
|
4
|
+
import { createNodeInfraAdapterPackageResolver } from './features/environment-lifecycle/adapters/outbound/createNodeInfraAdapterPackageResolver.js';
|
|
5
|
+
import { destroyInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/destroyInfraEnvironmentAsync.js';
|
|
6
|
+
import { downInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/downInfraEnvironmentAsync.js';
|
|
7
|
+
import { planInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/planInfraEnvironmentAsync.js';
|
|
8
|
+
import { statusInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/statusInfraEnvironmentAsync.js';
|
|
9
|
+
import { upInfraEnvironmentAsync } from './features/environment-lifecycle/application/use-cases/upInfraEnvironmentAsync.js';
|
|
10
|
+
import type { InfraOrchestrationDependencies } from './types/infraOrchestration.js';
|
|
11
|
+
|
|
12
|
+
const projectId = 'infra145-orchestrator-acceptance';
|
|
13
|
+
const manifest = {
|
|
14
|
+
environments: {
|
|
15
|
+
local: {
|
|
16
|
+
deployment: {
|
|
17
|
+
compute: { provider: 'local' },
|
|
18
|
+
runtime: { provider: 'docker-compose', projectName: projectId },
|
|
19
|
+
},
|
|
20
|
+
workloads: [
|
|
21
|
+
{
|
|
22
|
+
id: 'web',
|
|
23
|
+
artifact: { kind: 'image', image: 'nginx:alpine' },
|
|
24
|
+
ports: [{ name: 'http', port: 80 }],
|
|
25
|
+
exposure: 'internal',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
modules: [],
|
|
31
|
+
} as const satisfies InfraManifest;
|
|
32
|
+
|
|
33
|
+
test.skipIf(process.env.ANKH_INFRA_COMPOSITION_E2E !== '1')(
|
|
34
|
+
'runs the typed lifecycle through real Local and Docker Compose adapters',
|
|
35
|
+
async () => {
|
|
36
|
+
const dependencies = createDependencies();
|
|
37
|
+
let ledger: InfraLedger | undefined;
|
|
38
|
+
try {
|
|
39
|
+
const initialPlan = requireSuccess(
|
|
40
|
+
await planInfraEnvironmentAsync({ projectId, manifest }, dependencies),
|
|
41
|
+
);
|
|
42
|
+
expect(initialPlan.actions.some(({ operation }) => operation === 'create')).toBe(true);
|
|
43
|
+
|
|
44
|
+
const firstUp = requireSuccess(
|
|
45
|
+
await upInfraEnvironmentAsync({ projectId, manifest }, dependencies),
|
|
46
|
+
);
|
|
47
|
+
const { ledger: firstLedger } = firstUp;
|
|
48
|
+
ledger = firstLedger;
|
|
49
|
+
expect(firstUp.resources.some(({ identity }) => identity.resourceId === 'service:web')).toBe(
|
|
50
|
+
true,
|
|
51
|
+
);
|
|
52
|
+
const status = requireSuccess(
|
|
53
|
+
await statusInfraEnvironmentAsync({ projectId, manifest, previous: ledger }, dependencies),
|
|
54
|
+
);
|
|
55
|
+
expect(status.state).toBe('ready');
|
|
56
|
+
const convergedPlan = requireSuccess(
|
|
57
|
+
await planInfraEnvironmentAsync({ projectId, manifest, previous: ledger }, dependencies),
|
|
58
|
+
);
|
|
59
|
+
expect(convergedPlan.actions.every(({ operation }) => operation === 'noop')).toBe(true);
|
|
60
|
+
|
|
61
|
+
const down = requireSuccess(
|
|
62
|
+
await downInfraEnvironmentAsync({ projectId, manifest, previous: ledger }, dependencies),
|
|
63
|
+
);
|
|
64
|
+
const { ledger: downLedger } = down;
|
|
65
|
+
ledger = downLedger;
|
|
66
|
+
const resumed = requireSuccess(
|
|
67
|
+
await upInfraEnvironmentAsync({ projectId, manifest, previous: ledger }, dependencies),
|
|
68
|
+
);
|
|
69
|
+
const { ledger: resumedLedger } = resumed;
|
|
70
|
+
ledger = resumedLedger;
|
|
71
|
+
const destroyed = requireSuccess(
|
|
72
|
+
await destroyInfraEnvironmentAsync(
|
|
73
|
+
{
|
|
74
|
+
projectId,
|
|
75
|
+
manifest,
|
|
76
|
+
environment: 'local',
|
|
77
|
+
previous: ledger,
|
|
78
|
+
confirmation: { projectId, environment: 'local' },
|
|
79
|
+
persistence: { policy: 'retain' },
|
|
80
|
+
},
|
|
81
|
+
dependencies,
|
|
82
|
+
),
|
|
83
|
+
);
|
|
84
|
+
ledger = destroyed.ledger ?? undefined;
|
|
85
|
+
expect(destroyed.ledger).toBeNull();
|
|
86
|
+
} finally {
|
|
87
|
+
if (ledger !== undefined) {
|
|
88
|
+
await destroyInfraEnvironmentAsync(
|
|
89
|
+
{
|
|
90
|
+
projectId,
|
|
91
|
+
manifest,
|
|
92
|
+
environment: 'local',
|
|
93
|
+
previous: ledger,
|
|
94
|
+
confirmation: { projectId, environment: 'local' },
|
|
95
|
+
persistence: { policy: 'retain' },
|
|
96
|
+
},
|
|
97
|
+
dependencies,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
120_000,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
function createDependencies(): InfraOrchestrationDependencies {
|
|
106
|
+
return {
|
|
107
|
+
adapterResolver: createNodeInfraAdapterPackageResolver(),
|
|
108
|
+
credentials: { resolveAsync: () => Promise.resolve(success({})) },
|
|
109
|
+
secrets: {
|
|
110
|
+
resolveAsync: () =>
|
|
111
|
+
Promise.resolve({
|
|
112
|
+
ok: false,
|
|
113
|
+
diagnostics: [
|
|
114
|
+
{ severity: 'error', code: 'unexpected-secret', message: 'No secret is expected.' },
|
|
115
|
+
],
|
|
116
|
+
}),
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function requireSuccess<T>(result: InfraResult<T>): T {
|
|
122
|
+
if (!result.ok) throw new Error(result.diagnostics.map(({ message }) => message).join(' '));
|
|
123
|
+
return result.value;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function success<T>(value: T): InfraResult<T> {
|
|
127
|
+
return { ok: true, value, diagnostics: [] };
|
|
128
|
+
}
|