typekro 0.5.0 → 0.8.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/dist/.tsbuildinfo +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.d.ts +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.d.ts.map +1 -1
- package/dist/compositions/typekro-runtime/typekro-runtime.js +16 -2
- package/dist/compositions/typekro-runtime/typekro-runtime.js.map +1 -1
- package/dist/core/composition/context.d.ts +14 -0
- package/dist/core/composition/context.d.ts.map +1 -1
- package/dist/core/composition/context.js.map +1 -1
- package/dist/core/composition/imperative.d.ts.map +1 -1
- package/dist/core/composition/imperative.js +59 -30
- package/dist/core/composition/imperative.js.map +1 -1
- package/dist/core/composition/nested-status-cel.d.ts +50 -0
- package/dist/core/composition/nested-status-cel.d.ts.map +1 -0
- package/dist/core/composition/nested-status-cel.js +169 -0
- package/dist/core/composition/nested-status-cel.js.map +1 -0
- package/dist/core/constants/brands.d.ts +1 -1
- package/dist/core/constants/brands.d.ts.map +1 -1
- package/dist/core/constants/brands.js +1 -1
- package/dist/core/constants/brands.js.map +1 -1
- package/dist/core/containers/build.d.ts +50 -0
- package/dist/core/containers/build.d.ts.map +1 -0
- package/dist/core/containers/build.js +146 -0
- package/dist/core/containers/build.js.map +1 -0
- package/dist/core/containers/errors.d.ts +14 -0
- package/dist/core/containers/errors.d.ts.map +1 -0
- package/dist/core/containers/errors.js +48 -0
- package/dist/core/containers/errors.js.map +1 -0
- package/dist/core/containers/exec.d.ts +36 -0
- package/dist/core/containers/exec.d.ts.map +1 -0
- package/dist/core/containers/exec.js +110 -0
- package/dist/core/containers/exec.js.map +1 -0
- package/dist/core/containers/index.d.ts +21 -0
- package/dist/core/containers/index.d.ts.map +1 -0
- package/dist/core/containers/index.js +20 -0
- package/dist/core/containers/index.js.map +1 -0
- package/dist/core/containers/registries/ecr.d.ts +22 -0
- package/dist/core/containers/registries/ecr.d.ts.map +1 -0
- package/dist/core/containers/registries/ecr.js +118 -0
- package/dist/core/containers/registries/ecr.js.map +1 -0
- package/dist/core/containers/registries/index.d.ts +9 -0
- package/dist/core/containers/registries/index.d.ts.map +1 -0
- package/dist/core/containers/registries/index.js +23 -0
- package/dist/core/containers/registries/index.js.map +1 -0
- package/dist/core/containers/registries/orbstack.d.ts +14 -0
- package/dist/core/containers/registries/orbstack.d.ts.map +1 -0
- package/dist/core/containers/registries/orbstack.js +24 -0
- package/dist/core/containers/registries/orbstack.js.map +1 -0
- package/dist/core/containers/registries/types.d.ts +94 -0
- package/dist/core/containers/registries/types.d.ts.map +1 -0
- package/dist/core/containers/registries/types.js +11 -0
- package/dist/core/containers/registries/types.js.map +1 -0
- package/dist/core/dependencies/graph.d.ts +4 -0
- package/dist/core/dependencies/graph.d.ts.map +1 -1
- package/dist/core/dependencies/graph.js +6 -0
- package/dist/core/dependencies/graph.js.map +1 -1
- package/dist/core/dependencies/resolver.d.ts +28 -0
- package/dist/core/dependencies/resolver.d.ts.map +1 -1
- package/dist/core/dependencies/resolver.js +138 -5
- package/dist/core/dependencies/resolver.js.map +1 -1
- package/dist/core/deployment/direct-factory.d.ts +13 -0
- package/dist/core/deployment/direct-factory.d.ts.map +1 -1
- package/dist/core/deployment/direct-factory.js +99 -0
- package/dist/core/deployment/direct-factory.js.map +1 -1
- package/dist/core/deployment/engine.d.ts.map +1 -1
- package/dist/core/deployment/engine.js +45 -2
- package/dist/core/deployment/engine.js.map +1 -1
- package/dist/core/deployment/kro-factory.d.ts +28 -0
- package/dist/core/deployment/kro-factory.d.ts.map +1 -1
- package/dist/core/deployment/kro-factory.js +243 -13
- package/dist/core/deployment/kro-factory.js.map +1 -1
- package/dist/core/deployment/kro-readiness.d.ts.map +1 -1
- package/dist/core/deployment/kro-readiness.js +10 -1
- package/dist/core/deployment/kro-readiness.js.map +1 -1
- package/dist/core/deployment/nested-composition-status.d.ts +33 -0
- package/dist/core/deployment/nested-composition-status.d.ts.map +1 -0
- package/dist/core/deployment/nested-composition-status.js +101 -0
- package/dist/core/deployment/nested-composition-status.js.map +1 -0
- package/dist/core/deployment/readiness-waiter.d.ts.map +1 -1
- package/dist/core/deployment/readiness-waiter.js +23 -6
- package/dist/core/deployment/readiness-waiter.js.map +1 -1
- package/dist/core/deployment/rollback-manager.d.ts.map +1 -1
- package/dist/core/deployment/rollback-manager.js +19 -0
- package/dist/core/deployment/rollback-manager.js.map +1 -1
- package/dist/core/deployment/strategies/direct-strategy.d.ts +6 -0
- package/dist/core/deployment/strategies/direct-strategy.d.ts.map +1 -1
- package/dist/core/deployment/strategies/direct-strategy.js +133 -35
- package/dist/core/deployment/strategies/direct-strategy.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts +8 -2
- package/dist/core/expressions/composition/composition-analyzer-helpers.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-helpers.js +34 -2
- package/dist/core/expressions/composition/composition-analyzer-helpers.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-ternary.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-ternary.js +52 -28
- package/dist/core/expressions/composition/composition-analyzer-ternary.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-traversal.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-traversal.js +11 -4
- package/dist/core/expressions/composition/composition-analyzer-traversal.js.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer-types.d.ts +8 -0
- package/dist/core/expressions/composition/composition-analyzer-types.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer.d.ts +1 -1
- package/dist/core/expressions/composition/composition-analyzer.d.ts.map +1 -1
- package/dist/core/expressions/composition/composition-analyzer.js +8 -2
- package/dist/core/expressions/composition/composition-analyzer.js.map +1 -1
- package/dist/core/expressions/composition/imperative-analyzer.d.ts +8 -0
- package/dist/core/expressions/composition/imperative-analyzer.d.ts.map +1 -1
- package/dist/core/expressions/composition/imperative-analyzer.js +111 -16
- package/dist/core/expressions/composition/imperative-analyzer.js.map +1 -1
- package/dist/core/metadata/resource-metadata.d.ts +4 -0
- package/dist/core/metadata/resource-metadata.d.ts.map +1 -1
- package/dist/core/metadata/resource-metadata.js.map +1 -1
- package/dist/core/proxy/create-resource.d.ts.map +1 -1
- package/dist/core/proxy/create-resource.js +63 -21
- package/dist/core/proxy/create-resource.js.map +1 -1
- package/dist/core/references/cel.d.ts +48 -0
- package/dist/core/references/cel.d.ts.map +1 -1
- package/dist/core/references/cel.js +82 -0
- package/dist/core/references/cel.js.map +1 -1
- package/dist/core/references/external-refs.d.ts +2 -0
- package/dist/core/references/external-refs.d.ts.map +1 -1
- package/dist/core/references/external-refs.js +3 -0
- package/dist/core/references/external-refs.js.map +1 -1
- package/dist/core/references/resolver.d.ts +12 -4
- package/dist/core/references/resolver.d.ts.map +1 -1
- package/dist/core/references/resolver.js +152 -69
- package/dist/core/references/resolver.js.map +1 -1
- package/dist/core/references/schema-proxy.d.ts.map +1 -1
- package/dist/core/references/schema-proxy.js +5 -4
- package/dist/core/references/schema-proxy.js.map +1 -1
- package/dist/core/serialization/cel-references.d.ts +1 -1
- package/dist/core/serialization/cel-references.d.ts.map +1 -1
- package/dist/core/serialization/cel-references.js +191 -24
- package/dist/core/serialization/cel-references.js.map +1 -1
- package/dist/core/serialization/core.d.ts +8 -1
- package/dist/core/serialization/core.d.ts.map +1 -1
- package/dist/core/serialization/core.js +434 -7
- package/dist/core/serialization/core.js.map +1 -1
- package/dist/core/serialization/kro-post-processing.d.ts +46 -0
- package/dist/core/serialization/kro-post-processing.d.ts.map +1 -0
- package/dist/core/serialization/kro-post-processing.js +103 -0
- package/dist/core/serialization/kro-post-processing.js.map +1 -0
- package/dist/core/serialization/schema.d.ts +61 -3
- package/dist/core/serialization/schema.d.ts.map +1 -1
- package/dist/core/serialization/schema.js +520 -18
- package/dist/core/serialization/schema.js.map +1 -1
- package/dist/core/serialization/status-analysis-pipeline.d.ts +4 -0
- package/dist/core/serialization/status-analysis-pipeline.d.ts.map +1 -1
- package/dist/core/serialization/status-analysis-pipeline.js +127 -10
- package/dist/core/serialization/status-analysis-pipeline.js.map +1 -1
- package/dist/core/serialization/yaml.d.ts.map +1 -1
- package/dist/core/serialization/yaml.js +27 -4
- package/dist/core/serialization/yaml.js.map +1 -1
- package/dist/core/types/composable.d.ts +62 -0
- package/dist/core/types/composable.d.ts.map +1 -0
- package/dist/core/types/composable.js +51 -0
- package/dist/core/types/composable.js.map +1 -0
- package/dist/core/types/deployment.d.ts +2 -1
- package/dist/core/types/deployment.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/index.js +1 -0
- package/dist/core/types/index.js.map +1 -1
- package/dist/core/types/serialization.d.ts +40 -1
- package/dist/core/types/serialization.d.ts.map +1 -1
- package/dist/core/validation/cel-validator.d.ts.map +1 -1
- package/dist/core/validation/cel-validator.js +55 -31
- package/dist/core/validation/cel-validator.js.map +1 -1
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts +55 -0
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.d.ts.map +1 -0
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.js +92 -0
- package/dist/factories/cnpg/compositions/cnpg-bootstrap.js.map +1 -0
- package/dist/factories/cnpg/compositions/index.d.ts +2 -0
- package/dist/factories/cnpg/compositions/index.d.ts.map +1 -0
- package/dist/factories/cnpg/compositions/index.js +2 -0
- package/dist/factories/cnpg/compositions/index.js.map +1 -0
- package/dist/factories/cnpg/index.d.ts +42 -0
- package/dist/factories/cnpg/index.d.ts.map +1 -0
- package/dist/factories/cnpg/index.js +42 -0
- package/dist/factories/cnpg/index.js.map +1 -0
- package/dist/factories/cnpg/resources/backup.d.ts +34 -0
- package/dist/factories/cnpg/resources/backup.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/backup.js +87 -0
- package/dist/factories/cnpg/resources/backup.js.map +1 -0
- package/dist/factories/cnpg/resources/cluster.d.ts +55 -0
- package/dist/factories/cnpg/resources/cluster.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/cluster.js +123 -0
- package/dist/factories/cnpg/resources/cluster.js.map +1 -0
- package/dist/factories/cnpg/resources/helm.d.ts +45 -0
- package/dist/factories/cnpg/resources/helm.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/helm.js +78 -0
- package/dist/factories/cnpg/resources/helm.js.map +1 -0
- package/dist/factories/cnpg/resources/index.d.ts +6 -0
- package/dist/factories/cnpg/resources/index.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/index.js +6 -0
- package/dist/factories/cnpg/resources/index.js.map +1 -0
- package/dist/factories/cnpg/resources/pooler.d.ts +38 -0
- package/dist/factories/cnpg/resources/pooler.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/pooler.js +97 -0
- package/dist/factories/cnpg/resources/pooler.js.map +1 -0
- package/dist/factories/cnpg/resources/scheduled-backup.d.ts +35 -0
- package/dist/factories/cnpg/resources/scheduled-backup.d.ts.map +1 -0
- package/dist/factories/cnpg/resources/scheduled-backup.js +68 -0
- package/dist/factories/cnpg/resources/scheduled-backup.js.map +1 -0
- package/dist/factories/cnpg/types.d.ts +507 -0
- package/dist/factories/cnpg/types.d.ts.map +1 -0
- package/dist/factories/cnpg/types.js +398 -0
- package/dist/factories/cnpg/types.js.map +1 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.d.ts +70 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.js +79 -0
- package/dist/factories/cnpg/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/cnpg/utils/index.d.ts +2 -0
- package/dist/factories/cnpg/utils/index.d.ts.map +1 -0
- package/dist/factories/cnpg/utils/index.js +2 -0
- package/dist/factories/cnpg/utils/index.js.map +1 -0
- package/dist/factories/helm/helm-release.d.ts.map +1 -1
- package/dist/factories/helm/helm-release.js +4 -0
- package/dist/factories/helm/helm-release.js.map +1 -1
- package/dist/factories/helm/types.d.ts +2 -0
- package/dist/factories/helm/types.d.ts.map +1 -1
- package/dist/factories/inngest/compositions/index.d.ts +2 -0
- package/dist/factories/inngest/compositions/index.d.ts.map +1 -0
- package/dist/factories/inngest/compositions/index.js +2 -0
- package/dist/factories/inngest/compositions/index.js.map +1 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts +150 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts.map +1 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.js +90 -0
- package/dist/factories/inngest/compositions/inngest-bootstrap.js.map +1 -0
- package/dist/factories/inngest/index.d.ts +45 -0
- package/dist/factories/inngest/index.d.ts.map +1 -0
- package/dist/factories/inngest/index.js +45 -0
- package/dist/factories/inngest/index.js.map +1 -0
- package/dist/factories/inngest/resources/helm.d.ts +53 -0
- package/dist/factories/inngest/resources/helm.d.ts.map +1 -0
- package/dist/factories/inngest/resources/helm.js +88 -0
- package/dist/factories/inngest/resources/helm.js.map +1 -0
- package/dist/factories/inngest/resources/index.d.ts +2 -0
- package/dist/factories/inngest/resources/index.d.ts.map +1 -0
- package/dist/factories/inngest/resources/index.js +2 -0
- package/dist/factories/inngest/resources/index.js.map +1 -0
- package/dist/factories/inngest/types.d.ts +177 -0
- package/dist/factories/inngest/types.d.ts.map +1 -0
- package/dist/factories/inngest/types.js +189 -0
- package/dist/factories/inngest/types.js.map +1 -0
- package/dist/factories/inngest/utils/helm-values-mapper.d.ts +127 -0
- package/dist/factories/inngest/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/inngest/utils/helm-values-mapper.js +116 -0
- package/dist/factories/inngest/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/inngest/utils/index.d.ts +2 -0
- package/dist/factories/inngest/utils/index.d.ts.map +1 -0
- package/dist/factories/inngest/utils/index.js +2 -0
- package/dist/factories/inngest/utils/index.js.map +1 -0
- package/dist/factories/kubernetes/config/secret.d.ts.map +1 -1
- package/dist/factories/kubernetes/config/secret.js +11 -1
- package/dist/factories/kubernetes/config/secret.js.map +1 -1
- package/dist/factories/kubernetes/core/namespace.d.ts.map +1 -1
- package/dist/factories/kubernetes/core/namespace.js +1 -1
- package/dist/factories/kubernetes/core/namespace.js.map +1 -1
- package/dist/factories/searxng/compositions/index.d.ts +2 -0
- package/dist/factories/searxng/compositions/index.d.ts.map +1 -0
- package/dist/factories/searxng/compositions/index.js +2 -0
- package/dist/factories/searxng/compositions/index.js.map +1 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.d.ts +65 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.d.ts.map +1 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.js +237 -0
- package/dist/factories/searxng/compositions/searxng-bootstrap.js.map +1 -0
- package/dist/factories/searxng/index.d.ts +29 -0
- package/dist/factories/searxng/index.d.ts.map +1 -0
- package/dist/factories/searxng/index.js +27 -0
- package/dist/factories/searxng/index.js.map +1 -0
- package/dist/factories/searxng/resources/index.d.ts +2 -0
- package/dist/factories/searxng/resources/index.d.ts.map +1 -0
- package/dist/factories/searxng/resources/index.js +2 -0
- package/dist/factories/searxng/resources/index.js.map +1 -0
- package/dist/factories/searxng/resources/searxng.d.ts +65 -0
- package/dist/factories/searxng/resources/searxng.d.ts.map +1 -0
- package/dist/factories/searxng/resources/searxng.js +188 -0
- package/dist/factories/searxng/resources/searxng.js.map +1 -0
- package/dist/factories/searxng/types.d.ts +126 -0
- package/dist/factories/searxng/types.d.ts.map +1 -0
- package/dist/factories/searxng/types.js +176 -0
- package/dist/factories/searxng/types.js.map +1 -0
- package/dist/factories/searxng/utils/settings-builder.d.ts +46 -0
- package/dist/factories/searxng/utils/settings-builder.d.ts.map +1 -0
- package/dist/factories/searxng/utils/settings-builder.js +52 -0
- package/dist/factories/searxng/utils/settings-builder.js.map +1 -0
- package/dist/factories/simple/config/secret.d.ts.map +1 -1
- package/dist/factories/simple/config/secret.js +28 -0
- package/dist/factories/simple/config/secret.js.map +1 -1
- package/dist/factories/valkey/compositions/index.d.ts +2 -0
- package/dist/factories/valkey/compositions/index.d.ts.map +1 -0
- package/dist/factories/valkey/compositions/index.js +2 -0
- package/dist/factories/valkey/compositions/index.js.map +1 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts +41 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.d.ts.map +1 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.js +105 -0
- package/dist/factories/valkey/compositions/valkey-bootstrap.js.map +1 -0
- package/dist/factories/valkey/index.d.ts +50 -0
- package/dist/factories/valkey/index.d.ts.map +1 -0
- package/dist/factories/valkey/index.js +50 -0
- package/dist/factories/valkey/index.js.map +1 -0
- package/dist/factories/valkey/resources/helm.d.ts +53 -0
- package/dist/factories/valkey/resources/helm.d.ts.map +1 -0
- package/dist/factories/valkey/resources/helm.js +82 -0
- package/dist/factories/valkey/resources/helm.js.map +1 -0
- package/dist/factories/valkey/resources/index.d.ts +3 -0
- package/dist/factories/valkey/resources/index.d.ts.map +1 -0
- package/dist/factories/valkey/resources/index.js +3 -0
- package/dist/factories/valkey/resources/index.js.map +1 -0
- package/dist/factories/valkey/resources/valkey.d.ts +46 -0
- package/dist/factories/valkey/resources/valkey.d.ts.map +1 -0
- package/dist/factories/valkey/resources/valkey.js +123 -0
- package/dist/factories/valkey/resources/valkey.js.map +1 -0
- package/dist/factories/valkey/types.d.ts +185 -0
- package/dist/factories/valkey/types.d.ts.map +1 -0
- package/dist/factories/valkey/types.js +204 -0
- package/dist/factories/valkey/types.js.map +1 -0
- package/dist/factories/valkey/utils/helm-values-mapper.d.ts +32 -0
- package/dist/factories/valkey/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/valkey/utils/helm-values-mapper.js +58 -0
- package/dist/factories/valkey/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/valkey/utils/index.d.ts +2 -0
- package/dist/factories/valkey/utils/index.d.ts.map +1 -0
- package/dist/factories/valkey/utils/index.js +2 -0
- package/dist/factories/valkey/utils/index.js.map +1 -0
- package/dist/factories/webapp/compositions/index.d.ts +2 -0
- package/dist/factories/webapp/compositions/index.d.ts.map +1 -0
- package/dist/factories/webapp/compositions/index.js +2 -0
- package/dist/factories/webapp/compositions/index.js.map +1 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.d.ts +97 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.d.ts.map +1 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.js +220 -0
- package/dist/factories/webapp/compositions/web-app-with-processing.js.map +1 -0
- package/dist/factories/webapp/index.d.ts +53 -0
- package/dist/factories/webapp/index.d.ts.map +1 -0
- package/dist/factories/webapp/index.js +53 -0
- package/dist/factories/webapp/index.js.map +1 -0
- package/dist/factories/webapp/types.d.ts +69 -0
- package/dist/factories/webapp/types.d.ts.map +1 -0
- package/dist/factories/webapp/types.js +92 -0
- package/dist/factories/webapp/types.js.map +1 -0
- package/dist/shared/brands.d.ts +16 -0
- package/dist/shared/brands.d.ts.map +1 -1
- package/dist/shared/brands.js +16 -0
- package/dist/shared/brands.js.map +1 -1
- package/package.json +29 -1
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* New code within `src/utils/` should import directly from `../../shared/brands.js`
|
|
6
6
|
* to maintain the clean dependency direction: `shared/ <-- utils/ <-- core/`.
|
|
7
7
|
*/
|
|
8
|
-
export { CALLABLE_COMPOSITION_BRAND, CEL_EXPRESSION_BRAND, KUBERNETES_REF_BRAND, MIXED_TEMPLATE_BRAND, NESTED_COMPOSITION_BRAND, } from '../../shared/brands.js';
|
|
8
|
+
export { CALLABLE_COMPOSITION_BRAND, CEL_EXPRESSION_BRAND, KUBERNETES_REF_BRAND, KUBERNETES_REF_MARKER_PATTERN, MIXED_TEMPLATE_BRAND, NESTED_COMPOSITION_BRAND, } from '../../shared/brands.js';
|
|
9
9
|
//# sourceMappingURL=brands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../src/core/constants/brands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../src/core/constants/brands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Build Utility
|
|
3
|
+
*
|
|
4
|
+
* Builds a Docker image from a Dockerfile and optionally pushes it to a
|
|
5
|
+
* container registry. Returns the full image URI for use in K8s deployments.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { buildContainer } from 'typekro/containers';
|
|
10
|
+
*
|
|
11
|
+
* // Local Orbstack (no push needed)
|
|
12
|
+
* const result = await buildContainer({
|
|
13
|
+
* context: './apps/my-app',
|
|
14
|
+
* imageName: 'my-app',
|
|
15
|
+
* registry: { type: 'orbstack' },
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* // AWS ECR (auto-creates repo, pushes)
|
|
19
|
+
* const result = await buildContainer({
|
|
20
|
+
* context: './apps/my-app',
|
|
21
|
+
* imageName: 'my-app',
|
|
22
|
+
* tag: 'content-hash',
|
|
23
|
+
* platform: 'linux/amd64',
|
|
24
|
+
* registry: { type: 'ecr', region: 'us-west-2' },
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Use the image URI in a TypeKro composition
|
|
28
|
+
* await factory.deploy({
|
|
29
|
+
* app: { image: result.imageUri, port: 3000 },
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
import type { ContainerBuildOptions, ContainerBuildResult } from './registries/types.js';
|
|
34
|
+
/**
|
|
35
|
+
* Build a Docker image and optionally push it to a container registry.
|
|
36
|
+
*
|
|
37
|
+
* Docker's own layer cache handles memoization — if nothing in the build
|
|
38
|
+
* context changed, the build returns near-instantly.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildContainer(options: ContainerBuildOptions): Promise<ContainerBuildResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Compute a content-based hash of the build context for deterministic tagging.
|
|
43
|
+
* Exported for direct unit testing without Docker.
|
|
44
|
+
*
|
|
45
|
+
* Hashes the Dockerfile content plus all file contents in the context,
|
|
46
|
+
* respecting .dockerignore if present. Files are streamed (not loaded into
|
|
47
|
+
* memory) and hashed in sorted order for determinism.
|
|
48
|
+
*/
|
|
49
|
+
export declare function computeContentHash(contextPath: string, dockerfilePath: string): Promise<string>;
|
|
50
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/core/containers/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAQH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAIzF;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA6FlG;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCrG"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Build Utility
|
|
3
|
+
*
|
|
4
|
+
* Builds a Docker image from a Dockerfile and optionally pushes it to a
|
|
5
|
+
* container registry. Returns the full image URI for use in K8s deployments.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { buildContainer } from 'typekro/containers';
|
|
10
|
+
*
|
|
11
|
+
* // Local Orbstack (no push needed)
|
|
12
|
+
* const result = await buildContainer({
|
|
13
|
+
* context: './apps/my-app',
|
|
14
|
+
* imageName: 'my-app',
|
|
15
|
+
* registry: { type: 'orbstack' },
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* // AWS ECR (auto-creates repo, pushes)
|
|
19
|
+
* const result = await buildContainer({
|
|
20
|
+
* context: './apps/my-app',
|
|
21
|
+
* imageName: 'my-app',
|
|
22
|
+
* tag: 'content-hash',
|
|
23
|
+
* platform: 'linux/amd64',
|
|
24
|
+
* registry: { type: 'ecr', region: 'us-west-2' },
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Use the image URI in a TypeKro composition
|
|
28
|
+
* await factory.deploy({
|
|
29
|
+
* app: { image: result.imageUri, port: 3000 },
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
import { existsSync } from 'node:fs';
|
|
34
|
+
import { resolve, join } from 'node:path';
|
|
35
|
+
import { getComponentLogger } from '../logging/index.js';
|
|
36
|
+
import { ContainerBuildError } from './errors.js';
|
|
37
|
+
import { checkDockerAvailable, execDocker, validateBuildArgs } from './exec.js';
|
|
38
|
+
import { resolveRegistry } from './registries/index.js';
|
|
39
|
+
const logger = getComponentLogger('container-build');
|
|
40
|
+
/**
|
|
41
|
+
* Build a Docker image and optionally push it to a container registry.
|
|
42
|
+
*
|
|
43
|
+
* Docker's own layer cache handles memoization — if nothing in the build
|
|
44
|
+
* context changed, the build returns near-instantly.
|
|
45
|
+
*/
|
|
46
|
+
export async function buildContainer(options) {
|
|
47
|
+
const startTime = Date.now();
|
|
48
|
+
const { context, dockerfile = 'Dockerfile', imageName, platform, buildArgs, target, quiet = false, timeout = 300_000, extraDockerArgs = [], registry: registryConfig, } = options;
|
|
49
|
+
// Validate inputs
|
|
50
|
+
const contextPath = resolve(context);
|
|
51
|
+
if (!existsSync(contextPath)) {
|
|
52
|
+
throw new ContainerBuildError(`Build context directory not found: ${contextPath}`, 'INVALID_CONTEXT', ['Check the context path is correct.', `Directory: ${contextPath}`]);
|
|
53
|
+
}
|
|
54
|
+
const dockerfilePath = join(contextPath, dockerfile);
|
|
55
|
+
if (!existsSync(dockerfilePath)) {
|
|
56
|
+
throw new ContainerBuildError(`Dockerfile not found: ${dockerfilePath}`, 'INVALID_DOCKERFILE', [`Expected Dockerfile at: ${dockerfilePath}`, 'Set the dockerfile option if using a non-default name.']);
|
|
57
|
+
}
|
|
58
|
+
// Validate image name — must be a valid Docker/OCI image reference.
|
|
59
|
+
// Must start and end with alphanumeric, no trailing dots/slashes/hyphens.
|
|
60
|
+
if (!/^[a-z0-9]([a-z0-9._/-]*[a-z0-9])?$/.test(imageName)) {
|
|
61
|
+
throw new ContainerBuildError(`Invalid image name: "${imageName}". Must be lowercase alphanumeric, may contain dots/hyphens/underscores/slashes, must not start or end with a separator.`, 'INVALID_IMAGE_NAME', ['Image names must match: /^[a-z0-9]([a-z0-9._/-]*[a-z0-9])?$/']);
|
|
62
|
+
}
|
|
63
|
+
if (buildArgs) {
|
|
64
|
+
validateBuildArgs(buildArgs);
|
|
65
|
+
}
|
|
66
|
+
// Resolve tag
|
|
67
|
+
let tag = options.tag ?? 'latest';
|
|
68
|
+
if (tag === 'content-hash') {
|
|
69
|
+
tag = await computeContentHash(contextPath, dockerfilePath);
|
|
70
|
+
}
|
|
71
|
+
logger.info('Building container image', { imageName, tag, context: contextPath, registry: registryConfig.type });
|
|
72
|
+
// Check Docker availability
|
|
73
|
+
await checkDockerAvailable();
|
|
74
|
+
// Resolve registry handler
|
|
75
|
+
const registry = resolveRegistry(registryConfig);
|
|
76
|
+
// Resolve full image URI
|
|
77
|
+
const imageUri = await registry.resolveImageUri(imageName, tag);
|
|
78
|
+
// Authenticate with registry (no-op for local registries)
|
|
79
|
+
await registry.authenticate();
|
|
80
|
+
// Build the image
|
|
81
|
+
const buildArgFlags = buildArgs
|
|
82
|
+
? Object.entries(buildArgs).flatMap(([k, v]) => ['--build-arg', `${k}=${v}`])
|
|
83
|
+
: [];
|
|
84
|
+
const dockerBuildArgs = [
|
|
85
|
+
'build',
|
|
86
|
+
'-t', imageUri,
|
|
87
|
+
'-f', dockerfilePath,
|
|
88
|
+
...(platform ? ['--platform', platform] : []),
|
|
89
|
+
...(target ? ['--target', target] : []),
|
|
90
|
+
...buildArgFlags,
|
|
91
|
+
...extraDockerArgs,
|
|
92
|
+
contextPath,
|
|
93
|
+
];
|
|
94
|
+
await execDocker(dockerBuildArgs, { quiet, timeout });
|
|
95
|
+
// Push to registry — handler returns whether it actually pushed
|
|
96
|
+
const pushed = await registry.push(imageUri, imageName);
|
|
97
|
+
const duration = Date.now() - startTime;
|
|
98
|
+
logger.info('Container build complete', { imageUri, tag, duration, pushed });
|
|
99
|
+
return { imageUri, tag, duration, pushed };
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Compute a content-based hash of the build context for deterministic tagging.
|
|
103
|
+
* Exported for direct unit testing without Docker.
|
|
104
|
+
*
|
|
105
|
+
* Hashes the Dockerfile content plus all file contents in the context,
|
|
106
|
+
* respecting .dockerignore if present. Files are streamed (not loaded into
|
|
107
|
+
* memory) and hashed in sorted order for determinism.
|
|
108
|
+
*/
|
|
109
|
+
export async function computeContentHash(contextPath, dockerfilePath) {
|
|
110
|
+
const hasher = new Bun.CryptoHasher('sha256');
|
|
111
|
+
// Hash the Dockerfile content (streamed for memory efficiency)
|
|
112
|
+
for await (const chunk of Bun.file(dockerfilePath).stream()) {
|
|
113
|
+
hasher.update(chunk);
|
|
114
|
+
}
|
|
115
|
+
// Parse .dockerignore if present — same format as .gitignore
|
|
116
|
+
const ignore = (await import('ignore')).default;
|
|
117
|
+
const ig = ignore();
|
|
118
|
+
// Always exclude .git and node_modules (Docker does this implicitly)
|
|
119
|
+
ig.add(['.git', 'node_modules']);
|
|
120
|
+
const dockerignorePath = join(contextPath, '.dockerignore');
|
|
121
|
+
if (existsSync(dockerignorePath)) {
|
|
122
|
+
const patterns = await Bun.file(dockerignorePath).text();
|
|
123
|
+
ig.add(patterns);
|
|
124
|
+
}
|
|
125
|
+
// Collect files, excluding .dockerignore matches
|
|
126
|
+
const glob = new Bun.Glob('**/*');
|
|
127
|
+
const files = [];
|
|
128
|
+
for await (const path of glob.scan({ cwd: contextPath, onlyFiles: true })) {
|
|
129
|
+
if (ig.ignores(path))
|
|
130
|
+
continue;
|
|
131
|
+
files.push(path);
|
|
132
|
+
}
|
|
133
|
+
files.sort();
|
|
134
|
+
for (const file of files) {
|
|
135
|
+
// Hash the file path (so renames change the hash)
|
|
136
|
+
hasher.update(file);
|
|
137
|
+
// Stream file contents through the hasher (binary-safe, memory-efficient)
|
|
138
|
+
const stream = Bun.file(join(contextPath, file)).stream();
|
|
139
|
+
for await (const chunk of stream) {
|
|
140
|
+
hasher.update(chunk);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const hash = hasher.digest('hex');
|
|
144
|
+
return `sha-${hash.slice(0, 12)}`;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/core/containers/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM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AAC,IAAI,EAAE,CAAC;QACzD,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC;IAED,iDAAiD;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1E,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,SAAS;QAC/B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,KAAK,CAAC,IAAI,EAAE,CAAC;IAEb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,kDAAkD;QAClD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,0EAA0E;QAC1E,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC1D,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACjC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Build Errors
|
|
3
|
+
*/
|
|
4
|
+
import { TypeKroError } from '../errors.js';
|
|
5
|
+
export declare class ContainerBuildError extends TypeKroError {
|
|
6
|
+
readonly suggestions: string[];
|
|
7
|
+
constructor(message: string, code: string, suggestions?: string[], cause?: Error);
|
|
8
|
+
static dockerNotAvailable(detail?: string): ContainerBuildError;
|
|
9
|
+
static buildFailed(exitCode: number, stderr: string): ContainerBuildError;
|
|
10
|
+
static pushFailed(imageUri: string, cause: Error): ContainerBuildError;
|
|
11
|
+
static ecrAuthFailed(cause: Error): ContainerBuildError;
|
|
12
|
+
static registryNotSupported(type: string): ContainerBuildError;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/containers/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,qBAAa,mBAAoB,SAAQ,YAAY;aAIjC,WAAW,EAAE,MAAM,EAAE;gBAFrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACI,WAAW,GAAE,MAAM,EAAO,EAC1C,KAAK,CAAC,EAAE,KAAK;IAMf,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,mBAAmB;IAY/D,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB;IAYzE,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,mBAAmB;IAatE,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB;IAcvD,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB;CAU/D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Build Errors
|
|
3
|
+
*/
|
|
4
|
+
import { TypeKroError } from '../errors.js';
|
|
5
|
+
export class ContainerBuildError extends TypeKroError {
|
|
6
|
+
suggestions;
|
|
7
|
+
constructor(message, code, suggestions = [], cause) {
|
|
8
|
+
super(message, code, { suggestions }, cause ? { cause } : undefined);
|
|
9
|
+
this.suggestions = suggestions;
|
|
10
|
+
this.name = 'ContainerBuildError';
|
|
11
|
+
}
|
|
12
|
+
static dockerNotAvailable(detail) {
|
|
13
|
+
return new ContainerBuildError(`Docker is not available${detail ? `: ${detail}` : ''}`, 'DOCKER_NOT_AVAILABLE', [
|
|
14
|
+
'Is Docker or Orbstack running?',
|
|
15
|
+
"Run 'docker info' to check the Docker daemon status.",
|
|
16
|
+
'If using Orbstack, ensure the Docker engine is enabled in settings.',
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
static buildFailed(exitCode, stderr) {
|
|
20
|
+
return new ContainerBuildError(`Docker build failed with exit code ${exitCode}:\n${stderr.slice(0, 500)}`, 'BUILD_FAILED', [
|
|
21
|
+
'Check the Dockerfile for syntax errors.',
|
|
22
|
+
'Verify the build context contains all required files.',
|
|
23
|
+
"Run 'docker build' manually to see the full output.",
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
static pushFailed(imageUri, cause) {
|
|
27
|
+
return new ContainerBuildError(`Failed to push ${imageUri}: ${cause.message}`, 'PUSH_FAILED', [
|
|
28
|
+
'Verify registry credentials are valid.',
|
|
29
|
+
'Check that the repository exists (or enable createRepository).',
|
|
30
|
+
`Run 'docker push ${imageUri}' manually to diagnose.`,
|
|
31
|
+
], cause);
|
|
32
|
+
}
|
|
33
|
+
static ecrAuthFailed(cause) {
|
|
34
|
+
return new ContainerBuildError(`ECR authentication failed: ${cause.message}`, 'ECR_AUTH_FAILED', [
|
|
35
|
+
'Verify AWS credentials: aws sts get-caller-identity',
|
|
36
|
+
'If using SSO: aws sso login --profile <your-profile>',
|
|
37
|
+
'Set AWS_REGION or pass region in the ECR config.',
|
|
38
|
+
'Check IAM permissions: ecr:GetAuthorizationToken is required.',
|
|
39
|
+
], cause);
|
|
40
|
+
}
|
|
41
|
+
static registryNotSupported(type) {
|
|
42
|
+
return new ContainerBuildError(`Registry type '${type}' is not yet implemented.`, 'REGISTRY_NOT_SUPPORTED', [
|
|
43
|
+
'Supported registries: orbstack, ecr.',
|
|
44
|
+
'GCR and ACR support is planned — contributions welcome.',
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/core/containers/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IAIjC;IAHlB,YACE,OAAe,EACf,IAAY,EACI,cAAwB,EAAE,EAC1C,KAAa;QAEb,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAHrD,gBAAW,GAAX,WAAW,CAAe;QAI1C,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,MAAe;QACvC,OAAO,IAAI,mBAAmB,CAC5B,0BAA0B,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACvD,sBAAsB,EACtB;YACE,gCAAgC;YAChC,sDAAsD;YACtD,qEAAqE;SACtE,CACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,QAAgB,EAAE,MAAc;QACjD,OAAO,IAAI,mBAAmB,CAC5B,sCAAsC,QAAQ,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAC1E,cAAc,EACd;YACE,yCAAyC;YACzC,uDAAuD;YACvD,qDAAqD;SACtD,CACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,QAAgB,EAAE,KAAY;QAC9C,OAAO,IAAI,mBAAmB,CAC5B,kBAAkB,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,EAC9C,aAAa,EACb;YACE,wCAAwC;YACxC,gEAAgE;YAChE,oBAAoB,QAAQ,yBAAyB;SACtD,EACD,KAAK,CACN,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,KAAY;QAC/B,OAAO,IAAI,mBAAmB,CAC5B,8BAA8B,KAAK,CAAC,OAAO,EAAE,EAC7C,iBAAiB,EACjB;YACE,qDAAqD;YACrD,sDAAsD;YACtD,kDAAkD;YAClD,+DAA+D;SAChE,EACD,KAAK,CACN,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,IAAY;QACtC,OAAO,IAAI,mBAAmB,CAC5B,kBAAkB,IAAI,2BAA2B,EACjD,wBAAwB,EACxB;YACE,sCAAsC;YACtC,yDAAyD;SAC1D,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docker CLI Execution Helper
|
|
3
|
+
*
|
|
4
|
+
* Wraps Bun.spawn for Docker commands with streaming output,
|
|
5
|
+
* timeout support, and actionable error messages.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExecDockerOptions {
|
|
8
|
+
/** Pipe this string to stdin (used for docker login --password-stdin). */
|
|
9
|
+
stdin?: string;
|
|
10
|
+
/** Suppress stdout streaming (only log on error). */
|
|
11
|
+
quiet?: boolean;
|
|
12
|
+
/** Timeout in milliseconds. */
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ExecDockerResult {
|
|
16
|
+
exitCode: number;
|
|
17
|
+
stdout: string;
|
|
18
|
+
stderr: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Validate that build arg keys are safe Docker ARG names.
|
|
22
|
+
* Prevents flag injection via malicious keys like "--platform".
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateBuildArgs(buildArgs: Record<string, string>): void;
|
|
25
|
+
/**
|
|
26
|
+
* Execute a Docker CLI command.
|
|
27
|
+
*
|
|
28
|
+
* Streams output to the logger in real-time unless `quiet` is set.
|
|
29
|
+
* Throws ContainerBuildError on non-zero exit or timeout.
|
|
30
|
+
*/
|
|
31
|
+
export declare function execDocker(args: string[], options?: ExecDockerOptions): Promise<ExecDockerResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if Docker is available and the daemon is running.
|
|
34
|
+
*/
|
|
35
|
+
export declare function checkDockerAvailable(): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/core/containers/exec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAiBzE;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CAkE3B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuB1D"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docker CLI Execution Helper
|
|
3
|
+
*
|
|
4
|
+
* Wraps Bun.spawn for Docker commands with streaming output,
|
|
5
|
+
* timeout support, and actionable error messages.
|
|
6
|
+
*/
|
|
7
|
+
import { getComponentLogger } from '../logging/index.js';
|
|
8
|
+
import { ContainerBuildError } from './errors.js';
|
|
9
|
+
const logger = getComponentLogger('container-exec');
|
|
10
|
+
/** Valid Docker build-arg key pattern. */
|
|
11
|
+
const VALID_BUILD_ARG_KEY = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
12
|
+
/**
|
|
13
|
+
* Validate that build arg keys are safe Docker ARG names.
|
|
14
|
+
* Prevents flag injection via malicious keys like "--platform".
|
|
15
|
+
*/
|
|
16
|
+
export function validateBuildArgs(buildArgs) {
|
|
17
|
+
for (const [key, value] of Object.entries(buildArgs)) {
|
|
18
|
+
if (!VALID_BUILD_ARG_KEY.test(key)) {
|
|
19
|
+
throw new ContainerBuildError(`Invalid build arg key: "${key}". Must match ${VALID_BUILD_ARG_KEY.source}`, 'INVALID_BUILD_ARG', ['Build arg keys must be valid Docker ARG names (alphanumeric + underscore, starting with letter/underscore).']);
|
|
20
|
+
}
|
|
21
|
+
if (typeof value === 'string' && value.includes('\n')) {
|
|
22
|
+
throw new ContainerBuildError(`Build arg value for "${key}" contains newlines, which may break Docker --build-arg parsing.`, 'INVALID_BUILD_ARG', ['Remove newlines from build arg values.']);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Execute a Docker CLI command.
|
|
28
|
+
*
|
|
29
|
+
* Streams output to the logger in real-time unless `quiet` is set.
|
|
30
|
+
* Throws ContainerBuildError on non-zero exit or timeout.
|
|
31
|
+
*/
|
|
32
|
+
export async function execDocker(args, options = {}) {
|
|
33
|
+
const { stdin, quiet = false, timeout = 300_000 } = options;
|
|
34
|
+
// Redact --build-arg values in logs to prevent secret leakage
|
|
35
|
+
const redactedArgs = args.map((arg, i) => args[i - 1] === '--build-arg' && arg.includes('=')
|
|
36
|
+
? `${arg.split('=')[0]}=***`
|
|
37
|
+
: arg);
|
|
38
|
+
logger.debug('Executing docker command', { args: ['docker', ...redactedArgs] });
|
|
39
|
+
const proc = Bun.spawn(['docker', ...args], {
|
|
40
|
+
stdout: 'pipe',
|
|
41
|
+
stderr: 'pipe',
|
|
42
|
+
stdin: stdin ? 'pipe' : undefined,
|
|
43
|
+
});
|
|
44
|
+
if (stdin && proc.stdin) {
|
|
45
|
+
proc.stdin.write(stdin);
|
|
46
|
+
proc.stdin.end();
|
|
47
|
+
}
|
|
48
|
+
// Start reading streams immediately (before awaiting exit) to prevent
|
|
49
|
+
// resource leaks if the process is killed by timeout.
|
|
50
|
+
const stdoutPromise = new Response(proc.stdout).text().catch(() => '');
|
|
51
|
+
const stderrPromise = new Response(proc.stderr).text().catch(() => '');
|
|
52
|
+
// Race exit against timeout. The timeout promise has a .catch() no-op to
|
|
53
|
+
// prevent unhandled rejections if the timeout fires at the exact moment
|
|
54
|
+
// the process exits (race condition at the boundary).
|
|
55
|
+
let timeoutTimer;
|
|
56
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
57
|
+
timeoutTimer = setTimeout(() => {
|
|
58
|
+
proc.kill();
|
|
59
|
+
reject(new ContainerBuildError(`Docker command timed out after ${timeout}ms: docker ${redactedArgs.join(' ')}`, 'BUILD_TIMEOUT', ['Increase the timeout option.', 'Check network connectivity for pulls.']));
|
|
60
|
+
}, timeout);
|
|
61
|
+
});
|
|
62
|
+
timeoutPromise.catch(() => { });
|
|
63
|
+
const exitCode = await Promise.race([proc.exited, timeoutPromise]).finally(() => {
|
|
64
|
+
if (timeoutTimer !== undefined)
|
|
65
|
+
clearTimeout(timeoutTimer);
|
|
66
|
+
});
|
|
67
|
+
const stdout = await stdoutPromise;
|
|
68
|
+
const stderr = await stderrPromise;
|
|
69
|
+
if (!quiet && stdout.trim()) {
|
|
70
|
+
for (const line of stdout.trim().split('\n').slice(-20)) {
|
|
71
|
+
logger.info(line);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (exitCode !== 0) {
|
|
75
|
+
if (!quiet) {
|
|
76
|
+
for (const line of stderr.trim().split('\n')) {
|
|
77
|
+
logger.error(line);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
throw ContainerBuildError.buildFailed(exitCode, stderr);
|
|
81
|
+
}
|
|
82
|
+
return { exitCode, stdout, stderr };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Check if Docker is available and the daemon is running.
|
|
86
|
+
*/
|
|
87
|
+
export async function checkDockerAvailable() {
|
|
88
|
+
try {
|
|
89
|
+
const proc = Bun.spawn(['docker', 'version', '--format', '{{.Server.Version}}'], {
|
|
90
|
+
stdout: 'pipe',
|
|
91
|
+
stderr: 'pipe',
|
|
92
|
+
});
|
|
93
|
+
// Read both streams concurrently before awaiting exit
|
|
94
|
+
const stdoutPromise = new Response(proc.stdout).text().catch(() => '');
|
|
95
|
+
const stderrPromise = new Response(proc.stderr).text().catch(() => '');
|
|
96
|
+
const exitCode = await proc.exited;
|
|
97
|
+
const stdout = await stdoutPromise;
|
|
98
|
+
const stderr = await stderrPromise;
|
|
99
|
+
if (exitCode !== 0) {
|
|
100
|
+
throw ContainerBuildError.dockerNotAvailable(stderr.trim());
|
|
101
|
+
}
|
|
102
|
+
logger.debug('Docker available', { version: stdout.trim() });
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (error instanceof ContainerBuildError)
|
|
106
|
+
throw error;
|
|
107
|
+
throw ContainerBuildError.dockerNotAvailable(error instanceof Error ? error.message : String(error));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../src/core/containers/exec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,m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ro compositions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { buildContainer } from 'typekro/containers';
|
|
10
|
+
*
|
|
11
|
+
* const { imageUri } = await buildContainer({
|
|
12
|
+
* context: './apps/my-app',
|
|
13
|
+
* imageName: 'my-app',
|
|
14
|
+
* registry: { type: 'orbstack' },
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { buildContainer } from './build.js';
|
|
19
|
+
export { ContainerBuildError } from './errors.js';
|
|
20
|
+
export type { ContainerBuildOptions, ContainerBuildResult, EcrRegistryConfig, OrbstackRegistryConfig, RegistryConfig, } from './registries/types.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/containers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Build Utilities
|
|
3
|
+
*
|
|
4
|
+
* Build Docker images and push them to container registries.
|
|
5
|
+
* Returns image URIs for use in TypeKro compositions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { buildContainer } from 'typekro/containers';
|
|
10
|
+
*
|
|
11
|
+
* const { imageUri } = await buildContainer({
|
|
12
|
+
* context: './apps/my-app',
|
|
13
|
+
* imageName: 'my-app',
|
|
14
|
+
* registry: { type: 'orbstack' },
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { buildContainer } from './build.js';
|
|
19
|
+
export { ContainerBuildError } from './errors.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/containers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Amazon ECR Registry Handler
|
|
3
|
+
*
|
|
4
|
+
* Uses the AWS SDK's credential provider chain for all authentication.
|
|
5
|
+
* Supports env vars, profiles, SSO sessions, instance roles, and role
|
|
6
|
+
* assumption — all through the SDK's standard mechanisms.
|
|
7
|
+
*/
|
|
8
|
+
import type { EcrRegistryConfig, RegistryHandler } from './types.js';
|
|
9
|
+
export declare class EcrRegistryHandler implements RegistryHandler {
|
|
10
|
+
private readonly config;
|
|
11
|
+
private resolvedAccountId;
|
|
12
|
+
private resolvedRegion;
|
|
13
|
+
private credentialProvider;
|
|
14
|
+
private ecrClient;
|
|
15
|
+
constructor(config: EcrRegistryConfig);
|
|
16
|
+
resolveImageUri(imageName: string, tag: string): Promise<string>;
|
|
17
|
+
authenticate(): Promise<void>;
|
|
18
|
+
push(imageUri: string, imageName: string): Promise<boolean>;
|
|
19
|
+
private getAccountId;
|
|
20
|
+
private ensureRepositoryExists;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ecr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecr.d.ts","sourceRoot":"","sources":["../../../../src/core/containers/registries/ecr.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIrE,qBAAa,kBAAmB,YAAW,eAAe;IAM5C,OAAO,CAAC,QAAQ,CAAC,MAAM;IALnC,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,kBAAkB,CAAgC;IAC1D,OAAO,CAAC,SAAS,CAAY;gBAEA,MAAM,EAAE,iBAAiB;IAYhD,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKhE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAgC7B,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAiBnD,YAAY;YAuBZ,sBAAsB;CAoBrC"}
|