@codedrifters/configulator 0.0.462 → 0.0.464

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
@@ -34631,7 +34631,7 @@ var VERSION = {
34631
34631
  /**
34632
34632
  * Version of Projen to use.
34633
34633
  */
34634
- PROJEN_VERSION: "0.101.34",
34634
+ PROJEN_VERSION: "0.102.0",
34635
34635
  /**
34636
34636
  * Version of `actions/setup-node` to use in GitHub workflows.
34637
34637
  * Tracks the version projen currently emits (see node_modules/projen/lib/github/workflows.js).
@@ -42672,6 +42672,22 @@ var resolveEnvironmentGate = (gate, environmentName, componentName) => {
42672
42672
  }
42673
42673
  return trimmed;
42674
42674
  };
42675
+ var resolveDiffEnvironment = (gate, diffEnvironment, diffEnabled, componentName) => {
42676
+ if (!diffEnvironment) {
42677
+ return false;
42678
+ }
42679
+ if (gate !== DEPLOY_GATE.ENVIRONMENT) {
42680
+ throw new Error(
42681
+ `${componentName} requires \`gate\` to be "${DEPLOY_GATE.ENVIRONMENT}" when \`diff.environment\` is set, got ${gate ? `"${gate}"` : "no gate"}`
42682
+ );
42683
+ }
42684
+ if (!diffEnabled) {
42685
+ throw new Error(
42686
+ `${componentName} requires \`diff.enabled\` when \`diff.environment\` is set \u2014 there are no diff jobs to put the environment on`
42687
+ );
42688
+ }
42689
+ return true;
42690
+ };
42675
42691
 
42676
42692
  // src/workflows/diff-report-job.ts
42677
42693
  import { Component as Component23 } from "projen";
@@ -43600,10 +43616,17 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
43600
43616
  "AwsDeployWorkflow cannot disable `diff` under the `plan-apply` gate: the diff jobs are what keep the plan workflow publishing the build artifact the apply workflow deploys."
43601
43617
  );
43602
43618
  }
43619
+ const diffEnabled = options.diff?.enabled ?? isPlanApply;
43603
43620
  this.diffOptions = {
43604
- enabled: options.diff?.enabled ?? isPlanApply,
43621
+ enabled: diffEnabled,
43605
43622
  artifact: options.diff?.artifact ?? true,
43606
- summary: options.diff?.summary ?? true
43623
+ summary: options.diff?.summary ?? true,
43624
+ environment: resolveDiffEnvironment(
43625
+ options.gate,
43626
+ options.diff?.environment,
43627
+ diffEnabled,
43628
+ "AwsDeployWorkflow"
43629
+ )
43607
43630
  };
43608
43631
  this.branchScopedConcurrency = options.branchScopedConcurrency ?? false;
43609
43632
  this.environmentName = resolveEnvironmentGate(
@@ -43783,6 +43806,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
43783
43806
  contents: JobPermission7.READ,
43784
43807
  idToken: JobPermission7.WRITE
43785
43808
  },
43809
+ ...this.diffOptions.environment && this.environmentName ? { environment: this.environmentName } : void 0,
43786
43810
  concurrency: this.buildDiffConcurrency(diffJobName),
43787
43811
  if: jobCondition,
43788
43812
  steps: [...this.diffSteps(target)]
@@ -45145,6 +45169,7 @@ export {
45145
45169
  resolveBuildPolicy,
45146
45170
  resolveBundleAgentTiers,
45147
45171
  resolveDefaultAgentTier,
45172
+ resolveDiffEnvironment,
45148
45173
  resolveEnvironmentGate,
45149
45174
  resolveIssueDefaults,
45150
45175
  resolveIssueTemplates,