stackcanvas 0.2.1 → 0.2.2
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/README.md
CHANGED
|
@@ -78,11 +78,14 @@ What's provider-specific is only the curation layer, shipped as **provider packs
|
|
|
78
78
|
|
|
79
79
|
- a palette pack (`packages/ui/src/resource-palette.ts`) — curated drag-and-drop types
|
|
80
80
|
- containment rules (`DEFAULT_CONTAINMENT_RULES` in `@stackcanvas/core`) — which
|
|
81
|
-
resources render as visual containers (AWS VPC/subnet
|
|
81
|
+
resources render as visual containers (AWS VPC/subnet, GCP network/subnetwork,
|
|
82
|
+
Azure subnet, Cloudflare zone today)
|
|
82
83
|
- icon patterns (`packages/ui/src/icons.tsx`)
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
Four packs ship today: **AWS** (complete — the reference pack) and **GCP /
|
|
86
|
+
Azure / Cloudflare starter packs** covering the common resource types per
|
|
87
|
+
provider. Rounding out a starter pack, or adding a new provider entirely, is
|
|
88
|
+
pure data and makes a great first PR.
|
|
86
89
|
|
|
87
90
|
## OpenTofu
|
|
88
91
|
|
package/dist/cli.js
CHANGED
|
@@ -40,7 +40,15 @@ function deriveEdges(nodes) {
|
|
|
40
40
|
}
|
|
41
41
|
var DEFAULT_CONTAINMENT_RULES = [
|
|
42
42
|
{ containerType: "aws_vpc", memberAttr: "vpc_id", kind: "vpc" },
|
|
43
|
-
{ containerType: "aws_subnet", memberAttr: "subnet_id", kind: "subnet" }
|
|
43
|
+
{ containerType: "aws_subnet", memberAttr: "subnet_id", kind: "subnet" },
|
|
44
|
+
// GCP networks/subnetworks are referenced by `self_link`, not `id`.
|
|
45
|
+
{ containerType: "google_compute_network", memberAttr: "network", kind: "vpc", containerIdAttr: "self_link" },
|
|
46
|
+
{ containerType: "google_compute_subnetwork", memberAttr: "subnetwork", kind: "subnet", containerIdAttr: "self_link" },
|
|
47
|
+
{ containerType: "azurerm_subnet", memberAttr: "subnet_id", kind: "subnet" },
|
|
48
|
+
// Cloudflare zones aren't a network container, but they group the
|
|
49
|
+
// resources scoped to them the same way a VPC groups its members — reuse
|
|
50
|
+
// the 'vpc' kind rather than introducing a one-off styling kind.
|
|
51
|
+
{ containerType: "cloudflare_zone", memberAttr: "zone_id", kind: "vpc" }
|
|
44
52
|
];
|
|
45
53
|
function deriveContainment(g, rules = DEFAULT_CONTAINMENT_RULES) {
|
|
46
54
|
const groups = [...g.groups];
|
|
@@ -48,7 +56,7 @@ function deriveContainment(g, rules = DEFAULT_CONTAINMENT_RULES) {
|
|
|
48
56
|
for (const rule of rules) {
|
|
49
57
|
const groupByPhysicalId = /* @__PURE__ */ new Map();
|
|
50
58
|
for (const n of nodes.filter((n2) => n2.type === rule.containerType)) {
|
|
51
|
-
const pid = n.attributes["id"];
|
|
59
|
+
const pid = n.attributes[rule.containerIdAttr ?? "id"];
|
|
52
60
|
if (typeof pid !== "string") continue;
|
|
53
61
|
const gid = `${rule.kind}:${n.id}`;
|
|
54
62
|
groups.push({ id: gid, label: n.name, kind: rule.kind, parent: n.group });
|
|
@@ -926,7 +934,7 @@ function openBrowser(url) {
|
|
|
926
934
|
}
|
|
927
935
|
|
|
928
936
|
// src/version.ts
|
|
929
|
-
var VERSION = "0.2.
|
|
937
|
+
var VERSION = "0.2.2";
|
|
930
938
|
|
|
931
939
|
// src/server.ts
|
|
932
940
|
function looksLikeTerraformRoot(dir) {
|