From 6403fe87998d5f72de06ba576609c46977d73f5b Mon Sep 17 00:00:00 2001 From: Aaron Dernley Date: Thu, 15 Jan 2026 20:24:02 +0000 Subject: [PATCH] feat(clover): add cloudformationonly prop to cloudformation aws assets --- .../aws/pipeline-steps/pruneCfAssets.ts | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/bin/clover/src/pipelines/aws/pipeline-steps/pruneCfAssets.ts b/bin/clover/src/pipelines/aws/pipeline-steps/pruneCfAssets.ts index 57fe542daa..af05c9a9fc 100644 --- a/bin/clover/src/pipelines/aws/pipeline-steps/pruneCfAssets.ts +++ b/bin/clover/src/pipelines/aws/pipeline-steps/pruneCfAssets.ts @@ -4,6 +4,11 @@ import { createFunc, strippedBase64 } from "../../../spec/funcs.ts"; import { CODE_GENERATION_FUNC_SPECS } from "../funcs.ts"; import { ulid } from "https://deno.land/x/ulid@v0.3.0/mod.ts"; import { FuncArgumentSpec } from "../../../bindings/FuncArgumentSpec.ts"; +import { + createScalarProp, + ExpandedPropSpecFor, + findPropByName, +} from "../../../spec/props.ts"; const logger = _logger.ns("pruneCfAssets").seal(); @@ -12,11 +17,11 @@ export function pruneCfAssets(specs: ExpandedPkgSpec[]): ExpandedPkgSpec[] { const [schema] = spec.schemas; const [variant] = schema.variants; - if (!spec.name.includes("::") || variant.superSchema.handlers) { + if (!spec.name.includes("::") || variant.superSchema.handlers?.read) { continue; } - logger.debug(`Pruning ${schema.name} because it has no handlers`); + logger.debug(`Pruning ${schema.name} because it has no read handler`); variant.managementFuncs = []; @@ -26,6 +31,23 @@ export function pruneCfAssets(specs: ExpandedPkgSpec[]): ExpandedPkgSpec[] { CODE_GENERATION_FUNC_SPECS.awsCloudFormationLint.id, ); + // Add CloudFormationOnly prop to extra + const extraProp = findPropByName( + variant.domain, + "extra", + ) as ExpandedPropSpecFor["object"]; + if (extraProp) { + const cfOnlyProp = createScalarProp( + "CloudFormationOnly", + "boolean", + extraProp.metadata.propPath, + false, + ); + cfOnlyProp.data.defaultValue = "true"; + cfOnlyProp.data.hidden = true; + extraProp.entries.push(cfOnlyProp); + } + const attrFunc = createAttributeFunc(); spec.funcs.push(attrFunc); }