@intentius/chant 0.18.31 → 0.18.33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgDlD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqF/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC3E;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyF3E;AA4TD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6G3E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C/E"}
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgDlD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqF/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC3E;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyF3E;AA4TD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsI3E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant",
3
- "version": "0.18.31",
3
+ "version": "0.18.33",
4
4
  "description": "Declarative infrastructure-as-code toolkit \u2014 TypeScript on Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -5,6 +5,8 @@ import { readSnapshot, readSnapshotAt, readEnvironmentSnapshots, listSnapshots,
5
5
  import { computeBuildDigest, diffDigests } from "../../lifecycle/digest";
6
6
  import { diffLive, diffLiveArtifacts, diffSnapshots, type LiveDiffResult, type LiveArtifactDiffResult, type SnapshotDiffResult } from "../../lifecycle/live-diff";
7
7
  import { buildChangeSet, renderChangeSet, gitlabMrReport, type ChangeSet } from "../../lifecycle/change-set";
8
+ import { discoverComponents } from "../../components/discover";
9
+ import { cfnDeployStacks } from "./components";
8
10
  import { affectedStacks } from "../../lifecycle/affected";
9
11
  import { rollbackToRevision } from "../../lifecycle/rollback";
10
12
  import { loadChantConfig } from "../../config";
@@ -661,6 +663,21 @@ export async function runLifecyclePlan(ctx: CommandContext): Promise<number> {
661
663
 
662
664
  const lexicons = lexiconFilter ? [lexiconFilter] : Array.from(buildResult.manifest.lexicons);
663
665
 
666
+ // Multi-stack component projects deploy one CFN stack per component, so the
667
+ // single-stack-per-env observe below would see nothing live and plan every
668
+ // resource as "create". Resolve each component's cfn-deploy stack(s) and
669
+ // observe them all — the same fix runGraphLive uses (graph.ts). Empty for a
670
+ // single-stack project → the original single-call path is kept.
671
+ let componentStacks: string[] = [];
672
+ try {
673
+ const disc = await discoverComponents(resolveBuildRoot(args, config));
674
+ const set = new Set<string>();
675
+ for (const { component } of disc.components.values()) for (const s of cfnDeployStacks(component.deploy)) set.add(s);
676
+ componentStacks = [...set];
677
+ } catch {
678
+ // no components / discovery failed → single-stack path
679
+ }
680
+
664
681
  const merged: ChangeSet = { env: environment, entries: [] };
665
682
  let checked = 0;
666
683
 
@@ -697,15 +714,25 @@ export async function runLifecyclePlan(ctx: CommandContext): Promise<number> {
697
714
  ? rawOutput
698
715
  : (rawOutput as SerializerResult).primary;
699
716
 
700
- let observedNow: Record<string, ResourceMetadata>;
717
+ let observedNow: Record<string, ResourceMetadata> = {};
701
718
  try {
702
- observedNow = await plugin.describeResources({
703
- environment,
704
- buildOutput,
705
- entityNames: Array.from(declared),
706
- entities,
707
- owned: args.owned,
708
- });
719
+ if (componentStacks.length > 0) {
720
+ // Observe each component's own stack and union — the multi-stack fix.
721
+ for (const stack of componentStacks) {
722
+ Object.assign(
723
+ observedNow,
724
+ await plugin.describeResources({ environment, buildOutput, entityNames: Array.from(declared), entities, stack, owned: args.owned }),
725
+ );
726
+ }
727
+ } else {
728
+ observedNow = await plugin.describeResources({
729
+ environment,
730
+ buildOutput,
731
+ entityNames: Array.from(declared),
732
+ entities,
733
+ owned: args.owned,
734
+ });
735
+ }
709
736
  } catch (err) {
710
737
  console.error(formatError({
711
738
  message: `${lexiconName}: describeResources failed — ${err instanceof Error ? err.message : String(err)}`,