@ankhorage/infra 4.1.12 → 5.1.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 +16 -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/composition/createProjectInfraLifecycle.d.ts +4 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.d.ts.map +1 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.js +123 -0
- package/dist/features/environment-lifecycle/composition/createProjectInfraLifecycle.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 +8 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +7 -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/types/infraProject.d.ts +43 -0
- 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 +20 -10
- 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/composition/createProjectInfraLifecycle.ts +157 -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 +10 -188
- package/src/project/index.ts +15 -22
- package/src/project.test.ts +39 -189
- package/src/projectContractsParser.test.ts +2 -2
- package/src/projectInfrastructure.test.ts +121 -167
- package/src/projectLifecycle.test.ts +136 -0
- 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 +58 -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 +0 -14
- 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
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { APP_ENVIRONMENT_IDS } from '@ankhorage/contracts/environments';
|
|
2
|
+
import {
|
|
3
|
+
INFRA_ADAPTER_CATALOG,
|
|
4
|
+
type InfraLedger,
|
|
5
|
+
isInfraEnvironmentSpec,
|
|
6
|
+
} from '@ankhorage/contracts/infra';
|
|
7
|
+
|
|
8
|
+
import type { InfraStoredState } from '../../../types/infraOrchestration.js';
|
|
9
|
+
|
|
10
|
+
/*** Validate persisted ownership state before any provider receives it. */
|
|
11
|
+
export function isInfraStoredState(value: unknown): value is InfraStoredState {
|
|
12
|
+
return (
|
|
13
|
+
isRecord(value) &&
|
|
14
|
+
value.schemaVersion === 1 &&
|
|
15
|
+
isInfraEnvironmentSpec(value.desired) &&
|
|
16
|
+
isInfraLedger(value.ledger)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/*** Validate the canonical ledger's serializable outer boundary. */
|
|
21
|
+
function isInfraLedger(value: unknown): value is InfraLedger {
|
|
22
|
+
if (
|
|
23
|
+
isRecord(value) &&
|
|
24
|
+
value.schemaVersion === 1 &&
|
|
25
|
+
typeof value.projectId === 'string' &&
|
|
26
|
+
typeof value.environment === 'string' &&
|
|
27
|
+
APP_ENVIRONMENT_IDS.some((environment) => environment === value.environment) &&
|
|
28
|
+
Array.isArray(value.targets) &&
|
|
29
|
+
Array.isArray(value.resources) &&
|
|
30
|
+
Array.isArray(value.outputs) &&
|
|
31
|
+
Array.isArray(value.artifacts)
|
|
32
|
+
) {
|
|
33
|
+
const { environment, projectId } = value;
|
|
34
|
+
return (
|
|
35
|
+
value.targets.every(isComputeTarget) &&
|
|
36
|
+
value.resources.every((resource) => isOwnedResource(resource, projectId, environment)) &&
|
|
37
|
+
value.outputs.every((output) => isOutput(output, projectId, environment)) &&
|
|
38
|
+
value.artifacts.every((artifact) => isArtifactIdentity(artifact, projectId, environment))
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*** Validate portable compute targets without accepting resolved credential payloads. */
|
|
45
|
+
function isComputeTarget(value: unknown): boolean {
|
|
46
|
+
if (
|
|
47
|
+
!isRecord(value) ||
|
|
48
|
+
typeof value.id !== 'string' ||
|
|
49
|
+
!['linux', 'darwin', 'windows'].includes(String(value.os)) ||
|
|
50
|
+
!['amd64', 'arm64'].includes(String(value.architecture))
|
|
51
|
+
) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
if (value.kind === 'local-host') return true;
|
|
55
|
+
return (
|
|
56
|
+
value.kind === 'ssh-host' &&
|
|
57
|
+
typeof value.host === 'string' &&
|
|
58
|
+
typeof value.port === 'number' &&
|
|
59
|
+
typeof value.user === 'string' &&
|
|
60
|
+
typeof value.hostKeyFingerprint === 'string' &&
|
|
61
|
+
isControlPlaneReference(value.credential)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/*** Validate one exact resource plus its dependency identities. */
|
|
66
|
+
function isOwnedResource(value: unknown, projectId: string, environment: string): boolean {
|
|
67
|
+
return (
|
|
68
|
+
isRecord(value) &&
|
|
69
|
+
isScopedIdentity(value.identity, projectId, environment) &&
|
|
70
|
+
typeof value.persistent === 'boolean' &&
|
|
71
|
+
(value.retention === 'retain' || value.retention === 'delete-on-destroy') &&
|
|
72
|
+
Array.isArray(value.dependsOn) &&
|
|
73
|
+
value.dependsOn.every((identity) => isScopedIdentity(identity, projectId, environment))
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/*** Enforce the public-value versus secret-reference output union at rest. */
|
|
78
|
+
function isOutput(value: unknown, projectId: string, environment: string): boolean {
|
|
79
|
+
if (
|
|
80
|
+
!isRecord(value) ||
|
|
81
|
+
!isScopedIdentity(value.owner, projectId, environment) ||
|
|
82
|
+
typeof value.name !== 'string'
|
|
83
|
+
) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (value.visibility === 'public') {
|
|
87
|
+
return (
|
|
88
|
+
['string', 'number', 'boolean'].includes(typeof value.value) &&
|
|
89
|
+
value.reference === undefined &&
|
|
90
|
+
(value.environmentVariable === undefined || typeof value.environmentVariable === 'string')
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return (
|
|
94
|
+
value.visibility === 'secret' &&
|
|
95
|
+
value.value === undefined &&
|
|
96
|
+
value.environmentVariable === undefined &&
|
|
97
|
+
isSecretReference(value.reference, projectId, environment)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*** Validate one generated-artifact ledger identity without accepting file content. */
|
|
102
|
+
function isArtifactIdentity(value: unknown, projectId: string, environment: string): boolean {
|
|
103
|
+
return (
|
|
104
|
+
isRecord(value) &&
|
|
105
|
+
isScopedIdentity(value.owner, projectId, environment) &&
|
|
106
|
+
typeof value.path === 'string'
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/*** Validate scope, adapter catalog identity, and resource ID. */
|
|
111
|
+
function isScopedIdentity(value: unknown, projectId: string, environment: string): boolean {
|
|
112
|
+
return (
|
|
113
|
+
isRecord(value) &&
|
|
114
|
+
value.projectId === projectId &&
|
|
115
|
+
value.environment === environment &&
|
|
116
|
+
Object.values(INFRA_ADAPTER_CATALOG).some(({ id }) => id === value.adapter) &&
|
|
117
|
+
typeof value.resourceId === 'string'
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/*** Validate an unresolved control-plane credential identity. */
|
|
122
|
+
function isControlPlaneReference(value: unknown): boolean {
|
|
123
|
+
return isRecord(value) && value.source === 'control-plane' && typeof value.name === 'string';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*** Validate an unresolved secret reference scoped to this exact ledger. */
|
|
127
|
+
function isSecretReference(value: unknown, projectId: string, environment: string): boolean {
|
|
128
|
+
return (
|
|
129
|
+
isRecord(value) &&
|
|
130
|
+
value.source === 'secret-store' &&
|
|
131
|
+
value.projectId === projectId &&
|
|
132
|
+
value.environment === environment &&
|
|
133
|
+
typeof value.ref === 'string' &&
|
|
134
|
+
typeof value.key === 'string'
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/*** Narrow parsed values. */
|
|
139
|
+
function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
140
|
+
return typeof value === 'object' && value !== null;
|
|
141
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InfraOutput } from '@ankhorage/contracts/infra';
|
|
2
|
+
|
|
3
|
+
import { infraIdentityKey } from './infraIdentityKey.js';
|
|
4
|
+
|
|
5
|
+
/*** Merge output identities while preferring the last adapter result for each owner and name. */
|
|
6
|
+
export function mergeInfraOutputs(
|
|
7
|
+
...groups: readonly (readonly InfraOutput[])[]
|
|
8
|
+
): readonly InfraOutput[] {
|
|
9
|
+
const outputs = new Map<string, InfraOutput>();
|
|
10
|
+
for (const output of groups.flat()) {
|
|
11
|
+
outputs.set(`${infraIdentityKey(output.owner)}\0${output.name}`, output);
|
|
12
|
+
}
|
|
13
|
+
return [...outputs.values()];
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InfraOwnedResource } from '@ankhorage/contracts/infra';
|
|
2
|
+
|
|
3
|
+
import { infraIdentityKey } from './infraIdentityKey.js';
|
|
4
|
+
|
|
5
|
+
/*** Merge resource identities while preferring the last adapter result for each owner. */
|
|
6
|
+
export function mergeInfraResources(
|
|
7
|
+
...groups: readonly (readonly InfraOwnedResource[])[]
|
|
8
|
+
): readonly InfraOwnedResource[] {
|
|
9
|
+
const resources = new Map<string, InfraOwnedResource>();
|
|
10
|
+
for (const resource of groups.flat()) {
|
|
11
|
+
resources.set(infraIdentityKey(resource.identity), resource);
|
|
12
|
+
}
|
|
13
|
+
return [...resources.values()];
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*** Convert arbitrary credential and secret identifiers into stable environment-variable segments. */
|
|
2
|
+
export function normalizeInfraEnvironmentKey(value: string): string {
|
|
3
|
+
return value
|
|
4
|
+
.replaceAll(/[^A-Za-z0-9]+/gu, '_')
|
|
5
|
+
.replaceAll(/^_+|_+$/gu, '')
|
|
6
|
+
.toUpperCase();
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { APP_ENVIRONMENT_IDS, type AppEnvironmentId } from '@ankhorage/contracts/environments';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
const INFRA_STATE_ROOT = '.ankh/infra';
|
|
5
|
+
|
|
6
|
+
/*** Build an exact state-file path from a closed canonical environment identifier. */
|
|
7
|
+
export function resolveInfraStatePath(projectPath: string, environment: AppEnvironmentId): string {
|
|
8
|
+
if (!APP_ENVIRONMENT_IDS.includes(environment)) {
|
|
9
|
+
throw new Error(`Invalid Infra state environment: ${environment}`);
|
|
10
|
+
}
|
|
11
|
+
return path.join(projectPath, INFRA_STATE_ROOT, environment, 'state.json');
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
const INFRA_STATE_ROOT = '.ankh/infra';
|
|
4
|
+
|
|
5
|
+
/*** Resolve one generated path inside the project while protecting Infra state and traversal. */
|
|
6
|
+
export function resolveProjectFile(projectPath: string, filePath: string): string {
|
|
7
|
+
if (
|
|
8
|
+
filePath.length === 0 ||
|
|
9
|
+
path.isAbsolute(filePath) ||
|
|
10
|
+
filePath === INFRA_STATE_ROOT ||
|
|
11
|
+
filePath.startsWith(`${INFRA_STATE_ROOT}/`)
|
|
12
|
+
) {
|
|
13
|
+
throw new Error(`Invalid generated Infra artifact path: ${filePath}`);
|
|
14
|
+
}
|
|
15
|
+
const rootPath = path.resolve(projectPath);
|
|
16
|
+
const resolvedPath = path.resolve(rootPath, filePath);
|
|
17
|
+
const relativePath = path.relative(rootPath, resolvedPath);
|
|
18
|
+
if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) {
|
|
19
|
+
throw new Error(`Invalid generated Infra artifact path outside project root: ${filePath}`);
|
|
20
|
+
}
|
|
21
|
+
return resolvedPath;
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InfraOutput } from '@ankhorage/contracts/infra';
|
|
2
|
+
|
|
3
|
+
import { mergeInfraOutputs } from './mergeInfraOutputs.js';
|
|
4
|
+
|
|
5
|
+
/*** Keep prior outputs not owned by adapters that returned a replacement snapshot. */
|
|
6
|
+
export function retainUnchangedAdapterOutputs(
|
|
7
|
+
previous: readonly InfraOutput[],
|
|
8
|
+
replacements: readonly InfraOutput[],
|
|
9
|
+
replacedAdapters: ReadonlySet<string>,
|
|
10
|
+
): readonly InfraOutput[] {
|
|
11
|
+
return mergeInfraOutputs(
|
|
12
|
+
previous.filter(({ owner }) => !replacedAdapters.has(owner.adapter)),
|
|
13
|
+
replacements,
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InfraOwnedResource } from '@ankhorage/contracts/infra';
|
|
2
|
+
|
|
3
|
+
import { mergeInfraResources } from './mergeInfraResources.js';
|
|
4
|
+
|
|
5
|
+
/*** Keep prior resources not owned by adapters that returned a replacement snapshot. */
|
|
6
|
+
export function retainUnchangedAdapterResources(
|
|
7
|
+
previous: readonly InfraOwnedResource[],
|
|
8
|
+
replacements: readonly InfraOwnedResource[],
|
|
9
|
+
replacedAdapters: ReadonlySet<string>,
|
|
10
|
+
): readonly InfraOwnedResource[] {
|
|
11
|
+
return mergeInfraResources(
|
|
12
|
+
previous.filter(({ identity }) => !replacedAdapters.has(identity.adapter)),
|
|
13
|
+
replacements,
|
|
14
|
+
);
|
|
15
|
+
}
|
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
|
-
}
|