@go-to-k/cdkd 0.223.2 → 0.223.3

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/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { A as withErrorHandling, B as generateResourceNameWithFallback, C as StackHasActiveImportsError, F as getLiveRenderer, H as withStackName, I as PATTERN_B_NAME_PROPERTIES, L as PATTERN_B_RESOURCE_TYPES, M as getLogger, P as runStackBuffered, S as ResourceUpdateNotSupportedError, V as withSkipPrefix, _ as MissingCdkCliError, a as assertRegionMatch, b as ProvisioningError, f as LocalInvokeBuildError$1, i as resolveExplicitPhysicalId, k as normalizeAwsError, l as CdkdError, m as LocalStartServiceError, n as matchesCdkPath, o as disableInstanceApiTermination, p as LocalMigrateError, r as normalizeAwsTagsToCfn, s as isTerminationProtectionPropagationError, t as CDK_PATH_TAG, v as NestedStackChildDirectDestroyError, w as StackTerminationProtectionError, x as ResourceTimeoutError, y as PartialFailureError, z as generateResourceName } from "./import-helpers-wLipXr5g.js";
3
3
  import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-pjPwZz1r.js";
4
- import { $ as AssemblyReader, A as shouldRetainResource, B as getDefaultStateBucketName, C as applyRoleArnIfSet, D as LockManager, E as TemplateParser, F as formatDockerLoginError, G as resolveStateBucketWithDefault, H as resolveApp, I as getDockerCmd, J as CFN_TEMPLATE_BODY_LIMIT, K as resolveStateBucketWithDefaultAndSource, L as runDockerForeground, M as stringifyValue, N as WorkGraph, O as S3StateBackend, P as buildDockerImage, Q as uploadCfnTemplate, R as runDockerStreaming, S as IntrinsicFunctionResolver, T as DagBuilder, U as resolveCaptureObservedState, V as getLegacyStateBucketName, W as resolveSkipPrefix, X as MIGRATE_TMP_PREFIX, Y as CFN_TEMPLATE_URL_LIMIT, Z as findLargeInlineResources, _ as IAMRoleProvider, a as withRetry, b as findActionableSilentDrops, c as computeImplicitDeleteEdges, d as bold, f as cyan, g as yellow, h as red, i as withResourceDeadline, j as AssetPublisher, k as rebuildClientForBucketRegion, l as extractDeploymentEventError, m as green, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as gray, q as warnDeprecatedNoPrefixCliFlag, r as DeployEngine, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as resolveBucketRegion, u as formatResourceLine, v as collectInlinePolicyNamesManagedBySiblings, w as DiffCalculator, x as CloudControlProvider, y as ProviderRegistry, z as Synthesizer } from "./deploy-engine-CmN65bEv.js";
4
+ import { $ as AssemblyReader, A as shouldRetainResource, B as getDefaultStateBucketName, C as applyRoleArnIfSet, D as LockManager, E as TemplateParser, F as formatDockerLoginError, G as resolveStateBucketWithDefault, H as resolveApp, I as getDockerCmd, J as CFN_TEMPLATE_BODY_LIMIT, K as resolveStateBucketWithDefaultAndSource, L as runDockerForeground, M as stringifyValue, N as WorkGraph, O as S3StateBackend, P as buildDockerImage, Q as uploadCfnTemplate, R as runDockerStreaming, S as IntrinsicFunctionResolver, T as DagBuilder, U as resolveCaptureObservedState, V as getLegacyStateBucketName, W as resolveSkipPrefix, X as MIGRATE_TMP_PREFIX, Y as CFN_TEMPLATE_URL_LIMIT, Z as findLargeInlineResources, _ as IAMRoleProvider, a as withRetry, b as findActionableSilentDrops, c as computeImplicitDeleteEdges, d as bold, f as cyan, g as yellow, h as red, i as withResourceDeadline, j as AssetPublisher, k as rebuildClientForBucketRegion, l as extractDeploymentEventError, m as green, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as gray, q as warnDeprecatedNoPrefixCliFlag, r as DeployEngine, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as resolveBucketRegion, u as formatResourceLine, v as collectInlinePolicyNamesManagedBySiblings, w as DiffCalculator, x as CloudControlProvider, y as ProviderRegistry, z as Synthesizer } from "./deploy-engine-OWyKAOyJ.js";
5
5
  import { t as ASGProvider } from "./asg-provider-B_hrCxRx.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  import { randomBytes, randomUUID } from "node:crypto";
@@ -1553,7 +1553,7 @@ const FLUSH_INTERVAL_MS = 2e3;
1553
1553
  const FLUSH_EVENT_THRESHOLD = 50;
1554
1554
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
1555
1555
  function getCdkdVersion() {
1556
- return "0.223.2";
1556
+ return "0.223.3";
1557
1557
  }
1558
1558
  /**
1559
1559
  * Generate a time-sortable unique run id, e.g.
@@ -54528,7 +54528,7 @@ function reorderArgs(argv) {
54528
54528
  async function main() {
54529
54529
  installPipeCloseHandler();
54530
54530
  const program = new Command();
54531
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.223.2");
54531
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.223.3");
54532
54532
  program.addCommand(createBootstrapCommand());
54533
54533
  program.addCommand(createSynthCommand());
54534
54534
  program.addCommand(createListCommand());
@@ -11935,6 +11935,36 @@ function deriveLabelRouting(change, existingState, registry) {
11935
11935
  return;
11936
11936
  }
11937
11937
  }
11938
+ /**
11939
+ * Structural equality for resolved Outputs maps (issue #875).
11940
+ *
11941
+ * Output values are intrinsic-resolved primitives or nested objects/arrays
11942
+ * and key order is irrelevant. Used by the no-change deploy path to decide
11943
+ * whether an Outputs-only change (a new Export added because a downstream
11944
+ * stack now references this one, with no resource diff) must be persisted.
11945
+ */
11946
+ function outputMapsEqual(a, b) {
11947
+ return deepEqualValue(a, b);
11948
+ }
11949
+ function deepEqualValue(a, b) {
11950
+ if (a === b) return true;
11951
+ if (a == null || b == null) return a === b;
11952
+ if (typeof a !== typeof b) return false;
11953
+ if (typeof a !== "object") return false;
11954
+ if (Array.isArray(a) || Array.isArray(b)) {
11955
+ if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
11956
+ return a.every((v, i) => deepEqualValue(v, b[i]));
11957
+ }
11958
+ const ao = a;
11959
+ const bo = b;
11960
+ const ak = Object.keys(ao);
11961
+ if (ak.length !== Object.keys(bo).length) return false;
11962
+ for (const k of ak) {
11963
+ if (!Object.prototype.hasOwnProperty.call(bo, k)) return false;
11964
+ if (!deepEqualValue(ao[k], bo[k])) return false;
11965
+ }
11966
+ return true;
11967
+ }
11938
11968
  var DeployEngine = class {
11939
11969
  logger = getLogger().child("DeployEngine");
11940
11970
  resolver;
@@ -12214,15 +12244,19 @@ var DeployEngine = class {
12214
12244
  const changes = await this.diffCalculator.calculateDiff(currentState, effectiveTemplate, diffResolveFn);
12215
12245
  if (!this.diffCalculator.hasChanges(changes)) {
12216
12246
  this.logger.info("No changes detected. Stack is up to date.");
12217
- if (!this.options.dryRun && this.observedCaptureTasks.size > 0) {
12218
- await this.drainObservedCaptures(currentState.resources);
12219
- try {
12247
+ let persistedOutputs = currentState.outputs ?? {};
12248
+ if (!this.options.dryRun) {
12249
+ const resolvedOutputs = await this.resolveOutputs(effectiveTemplate, currentState.resources, stackName, parameterValues, conditions);
12250
+ const outputsChanged = !Object.values(resolvedOutputs).some((v) => v === void 0) && !outputMapsEqual(persistedOutputs, resolvedOutputs);
12251
+ const observedRefresh = this.observedCaptureTasks.size > 0;
12252
+ if (observedRefresh) await this.drainObservedCaptures(currentState.resources);
12253
+ if (observedRefresh || outputsChanged) try {
12220
12254
  const refreshedState = {
12221
12255
  version: 8,
12222
12256
  region: this.stackRegion,
12223
12257
  stackName: currentState.stackName,
12224
12258
  resources: currentState.resources,
12225
- outputs: currentState.outputs,
12259
+ outputs: outputsChanged ? resolvedOutputs : persistedOutputs,
12226
12260
  ...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
12227
12261
  ...currentState.outputReads && currentState.outputReads.length > 0 && { outputReads: currentState.outputReads },
12228
12262
  lastModified: Date.now()
@@ -12231,9 +12265,13 @@ var DeployEngine = class {
12231
12265
  if (currentEtag !== void 0) saveOptions.expectedEtag = currentEtag;
12232
12266
  if (migrationPending) saveOptions.migrateLegacy = true;
12233
12267
  await this.stateBackend.saveState(stackName, this.stackRegion, this.withParentInfo(refreshedState), saveOptions);
12234
- this.logger.debug("Persisted refreshed observedProperties (no-change path)");
12268
+ if (outputsChanged) {
12269
+ persistedOutputs = resolvedOutputs;
12270
+ this.logger.info("Persisted Outputs-only change (no resource diff).");
12271
+ if (this.exportIndexStore) await this.exportIndexStore.updateForStack(stackName, this.stackRegion, persistedOutputs);
12272
+ } else this.logger.debug("Persisted refreshed observedProperties (no-change path)");
12235
12273
  } catch (saveError) {
12236
- this.logger.warn(`Failed to persist refreshed observedProperties: ${saveError instanceof Error ? saveError.message : String(saveError)} — drift baseline will be re-fetched on next deploy.`);
12274
+ this.logger.warn(`Failed to persist no-change state update: ${saveError instanceof Error ? saveError.message : String(saveError)} — drift baseline / outputs will be re-resolved on next deploy.`);
12237
12275
  }
12238
12276
  }
12239
12277
  return {
@@ -12243,7 +12281,7 @@ var DeployEngine = class {
12243
12281
  deleted: 0,
12244
12282
  unchanged: Object.keys(currentState.resources).length,
12245
12283
  durationMs: Date.now() - startTime,
12246
- outputs: this.buildDisplayOutputs(template, currentState.outputs ?? {})
12284
+ outputs: this.buildDisplayOutputs(template, persistedOutputs)
12247
12285
  };
12248
12286
  }
12249
12287
  const createChanges = this.diffCalculator.filterByType(changes, "CREATE");
@@ -13195,4 +13233,4 @@ var DeployEngine = class {
13195
13233
 
13196
13234
  //#endregion
13197
13235
  export { AssemblyReader as $, shouldRetainResource as A, getDefaultStateBucketName as B, applyRoleArnIfSet as C, LockManager as D, TemplateParser as E, formatDockerLoginError as F, resolveStateBucketWithDefault as G, resolveApp as H, getDockerCmd as I, CFN_TEMPLATE_BODY_LIMIT as J, resolveStateBucketWithDefaultAndSource as K, runDockerForeground as L, stringifyValue as M, WorkGraph as N, S3StateBackend as O, buildDockerImage as P, uploadCfnTemplate as Q, runDockerStreaming as R, IntrinsicFunctionResolver as S, DagBuilder as T, resolveCaptureObservedState as U, getLegacyStateBucketName as V, resolveSkipPrefix as W, MIGRATE_TMP_PREFIX as X, CFN_TEMPLATE_URL_LIMIT as Y, findLargeInlineResources as Z, IAMRoleProvider as _, withRetry as a, findActionableSilentDrops as b, computeImplicitDeleteEdges as c, bold as d, clearBucketRegionCache as et, cyan as f, yellow as g, red as h, withResourceDeadline as i, AssetPublisher as j, rebuildClientForBucketRegion as k, extractDeploymentEventError as l, green as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, isRetryableTransientError as o, gray as p, warnDeprecatedNoPrefixCliFlag as q, DeployEngine as r, IMPLICIT_DELETE_DEPENDENCIES as s, DEFAULT_RESOURCE_TIMEOUT_MS as t, resolveBucketRegion as tt, formatResourceLine as u, collectInlinePolicyNamesManagedBySiblings as v, DiffCalculator as w, CloudControlProvider as x, ProviderRegistry as y, Synthesizer as z };
13198
- //# sourceMappingURL=deploy-engine-CmN65bEv.js.map
13236
+ //# sourceMappingURL=deploy-engine-OWyKAOyJ.js.map