@go-to-k/cdkd 0.120.0 → 0.121.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.
@@ -648,6 +648,12 @@ function getCurrentStackOutputBuffer() {
648
648
  //#region src/utils/logger.ts
649
649
  /**
650
650
  * ANSI color codes
651
+ *
652
+ * Kept internal — `ConsoleLogger.formatMessage` references these for the
653
+ * verbose/compact mode level prefixes. For inline color wrapping in
654
+ * production code, import from `./colors.js` instead (which lives in a
655
+ * separate module so unit tests that mock `logger.ts` don't strip color
656
+ * helpers as a side effect).
651
657
  */
652
658
  const colors = {
653
659
  reset: "\x1B[0m",
@@ -8396,6 +8402,35 @@ function collectInlinePolicyNamesManagedBySiblings(targetPhysicalId, context, at
8396
8402
  return result;
8397
8403
  }
8398
8404
 
8405
+ //#endregion
8406
+ //#region src/utils/colors.ts
8407
+ /**
8408
+ * ANSI color helpers for inline wrapping. Always emit ANSI escape codes —
8409
+ * the terminal (or vhs / a downstream piped consumer) decides whether to
8410
+ * render them.
8411
+ *
8412
+ * Kept in its own module so unit tests that mock `logger.ts` (a common
8413
+ * pattern) do not also strip color helpers and crash any code path that
8414
+ * uses them. Import from here, not from `logger.ts`, in production code.
8415
+ */
8416
+ const codes = {
8417
+ reset: "\x1B[0m",
8418
+ bright: "\x1B[1m",
8419
+ dim: "\x1B[2m",
8420
+ red: "\x1B[31m",
8421
+ green: "\x1B[32m",
8422
+ yellow: "\x1B[33m",
8423
+ blue: "\x1B[34m",
8424
+ cyan: "\x1B[36m",
8425
+ gray: "\x1B[90m"
8426
+ };
8427
+ const green = (s) => `${codes.green}${s}${codes.reset}`;
8428
+ const yellow = (s) => `${codes.yellow}${s}${codes.reset}`;
8429
+ const red = (s) => `${codes.red}${s}${codes.reset}`;
8430
+ const cyan = (s) => `${codes.cyan}${s}${codes.reset}`;
8431
+ const gray = (s) => `${codes.gray}${s}${codes.reset}`;
8432
+ const bold = (s) => `${codes.bright}${s}${codes.reset}`;
8433
+
8399
8434
  //#endregion
8400
8435
  //#region src/deployment/dag-executor.ts
8401
8436
  /**
@@ -9032,7 +9067,7 @@ var DeployEngine = class {
9032
9067
  const createChanges = this.diffCalculator.filterByType(changes, "CREATE");
9033
9068
  const updateChanges = this.diffCalculator.filterByType(changes, "UPDATE");
9034
9069
  const deleteChanges = this.diffCalculator.filterByType(changes, "DELETE");
9035
- this.logger.info(`Changes: ${createChanges.length} to create, ${updateChanges.length} to update, ${deleteChanges.length} to delete`);
9070
+ this.logger.info(`Changes: ${green(createChanges.length)} to create, ${yellow(updateChanges.length)} to update, ${red(deleteChanges.length)} to delete`);
9036
9071
  if (this.options.dryRun) {
9037
9072
  this.logger.info("Dry run mode - skipping actual deployment");
9038
9073
  return {
@@ -9132,7 +9167,7 @@ var DeployEngine = class {
9132
9167
  createUpdateIds.push(id);
9133
9168
  }
9134
9169
  if (createUpdateIds.length > 0) {
9135
- this.logger.info(`Deploying ${createUpdateIds.length} resource(s) (DAG: ${executionLevels.length} levels, max parallel: ${concurrency})`);
9170
+ this.logger.info(`${cyan("Deploying")} ${cyan(createUpdateIds.length)} resource(s) (DAG: ${executionLevels.length} levels, max parallel: ${concurrency})`);
9136
9171
  const createUpdateExecutor = new DagExecutor();
9137
9172
  const provisionable = new Set(createUpdateIds);
9138
9173
  for (const id of createUpdateIds) {
@@ -9172,7 +9207,7 @@ var DeployEngine = class {
9172
9207
  if (this.interrupted && this.hasPending(createUpdateExecutor)) throw new InterruptedError();
9173
9208
  }
9174
9209
  if (deleteChanges.size > 0) {
9175
- this.logger.info(`Deleting ${deleteChanges.size} resource(s)`);
9210
+ this.logger.info(`${red("Deleting")} ${red(deleteChanges.size)} resource(s)`);
9176
9211
  const deleteDeps = this.buildDeletionDependencies(deleteChanges, currentState);
9177
9212
  const deleteExecutor = new DagExecutor();
9178
9213
  for (const id of deleteChanges) deleteExecutor.add({
@@ -9483,7 +9518,7 @@ var DeployEngine = class {
9483
9518
  if (progress) progress.current++;
9484
9519
  const createPrefix = progress ? `[${progress.current}/${progress.total}] ` : " ";
9485
9520
  renderer.removeTask(logicalId);
9486
- this.logger.info(`${createPrefix} ${logicalId} (${resourceType}) created`);
9521
+ this.logger.info(`${createPrefix}${green("✓")} ${bold(logicalId)} ${gray(`(${resourceType})`)} ${green("created")}`);
9487
9522
  break;
9488
9523
  }
9489
9524
  case "UPDATE": {
@@ -9510,7 +9545,7 @@ var DeployEngine = class {
9510
9545
  if (progress) progress.current++;
9511
9546
  const attrPrefix = progress ? `[${progress.current}/${progress.total}] ` : " ";
9512
9547
  renderer.removeTask(logicalId);
9513
- this.logger.info(`${attrPrefix} ${logicalId} (${resourceType}) updated (metadata)`);
9548
+ this.logger.info(`${attrPrefix}${yellow("~")} ${bold(logicalId)} ${gray(`(${resourceType})`)} ${yellow("updated (metadata)")}`);
9514
9549
  break;
9515
9550
  }
9516
9551
  this.logger.debug(`Skipping ${logicalId}: no actual changes after intrinsic function resolution`);
@@ -9530,7 +9565,7 @@ var DeployEngine = class {
9530
9565
  this.logger.info(` Deleting old ${logicalId} (${currentResource.physicalId})...`);
9531
9566
  try {
9532
9567
  await provider.delete(logicalId, currentResource.physicalId, resourceType, currentResource.properties, { expectedRegion: this.stackRegion });
9533
- this.logger.info(` ✓ Old resource deleted`);
9568
+ this.logger.info(` ${green("")} Old resource deleted`);
9534
9569
  } catch (deleteError) {
9535
9570
  this.logger.warn(` ⚠ Failed to delete old resource ${logicalId} (${currentResource.physicalId}): ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`);
9536
9571
  }
@@ -9548,7 +9583,7 @@ var DeployEngine = class {
9548
9583
  if (progress) progress.current++;
9549
9584
  const replacePrefix = progress ? `[${progress.current}/${progress.total}] ` : " ";
9550
9585
  renderer.removeTask(logicalId);
9551
- this.logger.info(`${replacePrefix} ${logicalId} (${resourceType}) replaced`);
9586
+ this.logger.info(`${replacePrefix}${yellow("↻")} ${bold(logicalId)} ${gray(`(${resourceType})`)} ${yellow("replaced")}`);
9552
9587
  } else {
9553
9588
  this.logger.debug(`Updating ${logicalId} (${resourceType})`);
9554
9589
  const { provider: updateProvider, properties: updateProps } = this.selectProviderWithSafetyNet(provider, resourceType, resolvedProps, logicalId);
@@ -9589,7 +9624,7 @@ var DeployEngine = class {
9589
9624
  if (progress) progress.current++;
9590
9625
  const updatePrefix = progress ? `[${progress.current}/${progress.total}] ` : " ";
9591
9626
  renderer.removeTask(logicalId);
9592
- this.logger.info(`${updatePrefix} ${logicalId} (${resourceType}) updated`);
9627
+ this.logger.info(`${updatePrefix}${yellow("~")} ${bold(logicalId)} ${gray(`(${resourceType})`)} ${yellow("updated")}`);
9593
9628
  }
9594
9629
  break;
9595
9630
  }
@@ -9615,7 +9650,7 @@ var DeployEngine = class {
9615
9650
  if (progress) progress.current++;
9616
9651
  const deletePrefix = progress ? `[${progress.current}/${progress.total}] ` : " ";
9617
9652
  renderer.removeTask(logicalId);
9618
- this.logger.info(`${deletePrefix} ${logicalId} (${resourceType}) deleted`);
9653
+ this.logger.info(`${deletePrefix}${red("✗")} ${bold(logicalId)} ${gray(`(${resourceType})`)} ${red("deleted")}`);
9619
9654
  break;
9620
9655
  }
9621
9656
  }
@@ -9821,5 +9856,5 @@ var DeployEngine = class {
9821
9856
  };
9822
9857
 
9823
9858
  //#endregion
9824
- export { RouteDiscoveryError as $, runDockerStreaming as A, AssemblyReader as B, AssetPublisher as C, formatDockerLoginError as D, buildDockerImage as E, resolveCaptureObservedState as F, ConfigError as G, resolveBucketRegion as H, resolveSkipPrefix as I, LockError as J, DependencyError as K, resolveStateBucketWithDefault as L, getDefaultStateBucketName as M, getLegacyStateBucketName as N, getDockerCmd as O, resolveApp as P, ResourceUpdateNotSupportedError as Q, resolveStateBucketWithDefaultAndSource as R, shouldRetainResource as S, WorkGraph as T, AssetError as U, clearBucketRegionCache as V, CdkdError as W, ProvisioningError as X, PartialFailureError as Y, ResourceTimeoutError as Z, DiffCalculator as _, withSkipPrefix as _t, withRetry as a, isCdkdError as at, LockManager as b, collectInlinePolicyNamesManagedBySiblings as c, ConsoleLogger as ct, normalizeAwsTagsToCfn as d, runStackBuffered as dt, StackHasActiveImportsError as et, resolveExplicitPhysicalId as f, getLiveRenderer as ft, IntrinsicFunctionResolver as g, generateResourceNameWithFallback as gt, assertRegionMatch as h, generateResourceName as ht, withResourceDeadline as i, formatError as it, Synthesizer as j, runDockerForeground as k, CDK_PATH_TAG as l, getLogger as lt, CloudControlProvider as m, PATTERN_B_RESOURCE_TYPES as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, StateError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, normalizeAwsError as ot, ProviderRegistry as p, PATTERN_B_NAME_PROPERTIES as pt, LocalInvokeBuildError as q, DeployEngine as r, SynthesisError as rt, IAMRoleProvider as s, withErrorHandling as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, StackTerminationProtectionError as tt, matchesCdkPath as u, setLogger as ut, DagBuilder as v, withStackName as vt, stringifyValue as w, S3StateBackend as x, TemplateParser as y, warnDeprecatedNoPrefixCliFlag as z };
9825
- //# sourceMappingURL=deploy-engine-Chzg_hDE.js.map
9859
+ export { LocalInvokeBuildError as $, stringifyValue as A, resolveApp as B, DiffCalculator as C, withSkipPrefix as Ct, S3StateBackend as D, LockManager as E, runDockerForeground as F, warnDeprecatedNoPrefixCliFlag as G, resolveSkipPrefix as H, runDockerStreaming as I, resolveBucketRegion as J, AssemblyReader as K, Synthesizer as L, buildDockerImage as M, formatDockerLoginError as N, shouldRetainResource as O, getDockerCmd as P, DependencyError as Q, getDefaultStateBucketName as R, IntrinsicFunctionResolver as S, generateResourceNameWithFallback as St, TemplateParser as T, resolveStateBucketWithDefault as U, resolveCaptureObservedState as V, resolveStateBucketWithDefaultAndSource as W, CdkdError as X, AssetError as Y, ConfigError as Z, normalizeAwsTagsToCfn as _, runStackBuffered as _t, withRetry as a, RouteDiscoveryError as at, CloudControlProvider as b, PATTERN_B_RESOURCE_TYPES as bt, cyan as c, StateError as ct, red as d, isCdkdError as dt, LockError as et, yellow as f, normalizeAwsError as ft, matchesCdkPath as g, setLogger as gt, CDK_PATH_TAG as h, getLogger as ht, withResourceDeadline as i, ResourceUpdateNotSupportedError as it, WorkGraph as j, AssetPublisher as k, gray as l, SynthesisError as lt, collectInlinePolicyNamesManagedBySiblings as m, ConsoleLogger as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, ProvisioningError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, StackHasActiveImportsError as ot, IAMRoleProvider as p, withErrorHandling as pt, clearBucketRegionCache as q, DeployEngine as r, ResourceTimeoutError as rt, bold as s, StackTerminationProtectionError as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, PartialFailureError as tt, green as u, formatError as ut, resolveExplicitPhysicalId as v, getLiveRenderer as vt, DagBuilder as w, withStackName as wt, assertRegionMatch as x, generateResourceName as xt, ProviderRegistry as y, PATTERN_B_NAME_PROPERTIES as yt, getLegacyStateBucketName as z };
9860
+ //# sourceMappingURL=deploy-engine-B2RZT3ai.js.map