@codedrifters/configulator 0.0.454 → 0.0.455

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/lib/index.mjs CHANGED
@@ -38452,6 +38452,42 @@ var AwsDeploymentTarget = class _AwsDeploymentTarget extends Component13 {
38452
38452
  );
38453
38453
  }
38454
38454
  };
38455
+ /*****************************************************************************
38456
+ *
38457
+ * Destroy Tasks
38458
+ *
38459
+ * - If local deploy, add a destroy task.
38460
+ *
38461
+ * Mirrors the deploy task family so `destroyDefaults`, per-account
38462
+ * `destroy` overrides, and a target's `cdkOptions.destroy` all reach a
38463
+ * rendered command. Projen's generic `destroy` passthrough is deliberately
38464
+ * left intact as an ad-hoc escape hatch — unlike the generic `deploy` and
38465
+ * `watch` tasks, it is not reset to a disabled stub.
38466
+ *
38467
+ ****************************************************************************/
38468
+ this.configureDestroyTask = () => {
38469
+ if (this.localDeployment) {
38470
+ const taskName = [
38471
+ "destroy",
38472
+ this.awsStageType,
38473
+ this.account,
38474
+ this.region
38475
+ ].join(":");
38476
+ const destroyTask = this.project.tasks.addTask(taskName, {
38477
+ env: this.awsDeploymentConfig.env
38478
+ });
38479
+ const destroyOpts = this.awsDeploymentConfig.cdkCli.destroyOptionsFor(this);
38480
+ destroyTask.exec(
38481
+ `cdk ${renderCdkDestroy({
38482
+ ...destroyOpts,
38483
+ lookups: false,
38484
+ profile: this.localDeploymentConfig?.profile,
38485
+ app: this.awsDeploymentConfig.cdkOut,
38486
+ stackPatterns: this.localDeploymentConfig?.stackPattern ? [this.localDeploymentConfig.stackPattern] : void 0
38487
+ })}`
38488
+ );
38489
+ }
38490
+ };
38455
38491
  this.account = options.account;
38456
38492
  this.region = options.region;
38457
38493
  this.cdkOptions = options.cdkOptions;
@@ -38494,6 +38530,7 @@ var AwsDeploymentTarget = class _AwsDeploymentTarget extends Component13 {
38494
38530
  this.awsDeploymentConfig.awsDeploymentTargets.push(this);
38495
38531
  this.configureDeployTask();
38496
38532
  this.configureWatchTask();
38533
+ this.configureDestroyTask();
38497
38534
  }
38498
38535
  /**
38499
38536
  * Static method to discovert targets in a project.