@intentius/chant 0.42.1 → 0.44.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.
Files changed (66) hide show
  1. package/dist/build.d.ts +15 -1
  2. package/dist/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.d.ts.map +1 -1
  4. package/dist/cli/commands/lint.d.ts +10 -0
  5. package/dist/cli/commands/lint.d.ts.map +1 -1
  6. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  7. package/dist/cli/plugins.d.ts +8 -0
  8. package/dist/cli/plugins.d.ts.map +1 -1
  9. package/dist/components/cli-support.d.ts +1 -1
  10. package/dist/components/cli-support.d.ts.map +1 -1
  11. package/dist/components/deploy-units.d.ts.map +1 -1
  12. package/dist/governance.d.ts +1 -1
  13. package/dist/graph-detail.d.ts +31 -13
  14. package/dist/graph-detail.d.ts.map +1 -1
  15. package/dist/lexicon.d.ts +44 -0
  16. package/dist/lexicon.d.ts.map +1 -1
  17. package/dist/lifecycle/change-set.d.ts +7 -0
  18. package/dist/lifecycle/change-set.d.ts.map +1 -1
  19. package/dist/lifecycle/live-diff.d.ts +18 -0
  20. package/dist/lifecycle/live-diff.d.ts.map +1 -1
  21. package/dist/lifecycle/observe.d.ts.map +1 -1
  22. package/dist/lint/component-checks.d.ts +2 -1
  23. package/dist/lint/component-checks.d.ts.map +1 -1
  24. package/dist/observation.d.ts +33 -3
  25. package/dist/observation.d.ts.map +1 -1
  26. package/dist/reconcile.d.ts +5 -5
  27. package/dist/reconcile.d.ts.map +1 -1
  28. package/dist/terraform/aws-resources.d.ts.map +1 -1
  29. package/dist/terraform/graph.d.ts.map +1 -1
  30. package/dist/terraform/tier-map.d.ts +4 -3
  31. package/dist/terraform/tier-map.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/src/audit/rules-doc.ts +1 -1
  34. package/src/build.test.ts +95 -0
  35. package/src/build.ts +46 -1
  36. package/src/cli/commands/build.ts +9 -1
  37. package/src/cli/commands/lint.ts +14 -3
  38. package/src/cli/handlers/components.ts +1 -1
  39. package/src/cli/handlers/graph.ts +32 -7
  40. package/src/cli/handlers/lifecycle.ts +15 -4
  41. package/src/cli/plugins.ts +17 -0
  42. package/src/codegen/publish-order.test.ts +1 -1
  43. package/src/codegen/release-wiring.test.ts +3 -4
  44. package/src/components/cli-support.test.ts +52 -0
  45. package/src/components/cli-support.ts +13 -2
  46. package/src/components/deploy-units.test.ts +13 -0
  47. package/src/components/deploy-units.ts +5 -0
  48. package/src/governance.test.ts +1 -1
  49. package/src/governance.ts +1 -1
  50. package/src/graph-detail.test.ts +117 -6
  51. package/src/graph-detail.ts +76 -18
  52. package/src/lexicon.ts +47 -0
  53. package/src/lifecycle/change-set.test.ts +26 -0
  54. package/src/lifecycle/change-set.ts +13 -0
  55. package/src/lifecycle/live-diff.test.ts +35 -0
  56. package/src/lifecycle/live-diff.ts +21 -0
  57. package/src/lifecycle/observe.ts +2 -1
  58. package/src/lint/component-checks.ts +8 -1
  59. package/src/observation.test.ts +54 -7
  60. package/src/observation.ts +53 -13
  61. package/src/reconcile.ts +7 -7
  62. package/src/terraform/aws-resources.test.ts +52 -2
  63. package/src/terraform/aws-resources.ts +95 -4
  64. package/src/terraform/graph.test.ts +17 -0
  65. package/src/terraform/graph.ts +12 -2
  66. package/src/terraform/tier-map.ts +60 -8
@@ -20,12 +20,52 @@ export interface TierInfo {
20
20
  mapsTo: string;
21
21
  }
22
22
 
23
+ /**
24
+ * Kubernetes provider types with a native k8s-lexicon target. `kubernetes_manifest`
25
+ * IS the manifest (tier 1). The typed provider resources (`kubernetes_deployment`,
26
+ * ...) reshape their HCL schema back into a manifest, so they rank tier 2; the
27
+ * common `_v1` aliases share their base type's entry.
28
+ */
29
+ const K8S_TIER_BASE: Record<string, TierInfo> = {
30
+ kubernetes_manifest: { tier: 1, mapsTo: "k8s:manifest" },
31
+ kubernetes_namespace: { tier: 2, mapsTo: "k8s:Namespace" },
32
+ kubernetes_config_map: { tier: 2, mapsTo: "k8s:ConfigMap" },
33
+ kubernetes_secret: { tier: 2, mapsTo: "k8s:Secret" },
34
+ kubernetes_service: { tier: 2, mapsTo: "k8s:Service" },
35
+ kubernetes_service_account: { tier: 2, mapsTo: "k8s:ServiceAccount" },
36
+ kubernetes_deployment: { tier: 2, mapsTo: "k8s:Deployment" },
37
+ kubernetes_stateful_set: { tier: 2, mapsTo: "k8s:StatefulSet" },
38
+ kubernetes_daemon_set: { tier: 2, mapsTo: "k8s:DaemonSet" },
39
+ kubernetes_job: { tier: 2, mapsTo: "k8s:Job" },
40
+ kubernetes_cron_job: { tier: 2, mapsTo: "k8s:CronJob" },
41
+ kubernetes_ingress: { tier: 2, mapsTo: "k8s:Ingress" },
42
+ kubernetes_network_policy: { tier: 2, mapsTo: "k8s:NetworkPolicy" },
43
+ kubernetes_persistent_volume_claim: { tier: 2, mapsTo: "k8s:PersistentVolumeClaim" },
44
+ kubernetes_role: { tier: 2, mapsTo: "k8s:Role" },
45
+ kubernetes_role_binding: { tier: 2, mapsTo: "k8s:RoleBinding" },
46
+ kubernetes_cluster_role: { tier: 2, mapsTo: "k8s:ClusterRole" },
47
+ kubernetes_cluster_role_binding: { tier: 2, mapsTo: "k8s:ClusterRoleBinding" },
48
+ kubernetes_resource_quota: { tier: 2, mapsTo: "k8s:ResourceQuota" },
49
+ kubernetes_limit_range: { tier: 2, mapsTo: "k8s:LimitRange" },
50
+ kubernetes_priority_class: { tier: 2, mapsTo: "k8s:PriorityClass" },
51
+ kubernetes_pod_disruption_budget: { tier: 2, mapsTo: "k8s:PodDisruptionBudget" },
52
+ kubernetes_horizontal_pod_autoscaler: { tier: 2, mapsTo: "k8s:HorizontalPodAutoscaler" },
53
+ };
54
+
55
+ const K8S_TIER: Record<string, TierInfo> = Object.fromEntries(
56
+ Object.entries(K8S_TIER_BASE).flatMap(([type, info]) =>
57
+ type === "kubernetes_manifest" ? [[type, info]] : [[type, info], [`${type}_v1`, info]],
58
+ ),
59
+ );
60
+ // The one provider type whose current alias is _v2, not _v1.
61
+ K8S_TIER.kubernetes_horizontal_pod_autoscaler_v2 = K8S_TIER_BASE.kubernetes_horizontal_pod_autoscaler;
62
+
23
63
  /** TF resource type → native tier. Absent = unsupported (score 0). */
24
64
  export const TIER_MAP: Record<string, TierInfo> = {
25
65
  // AWS: derived from the carve-out table so advise and emit stay in lockstep.
26
66
  ...Object.fromEntries(AWS_CARVE_TYPES.map((t) => [t.tfType, { tier: t.tier, mapsTo: t.nativeType }])),
27
- // Kubernetes — near-1:1 manifest. Ranked by advise; emit support is a separate target.
28
- kubernetes_manifest: { tier: 1, mapsTo: "k8s:manifest" },
67
+ // Kubernetes — ranked by advise; emit support is a separate target.
68
+ ...K8S_TIER,
29
69
  };
30
70
 
31
71
  /**
@@ -44,16 +84,28 @@ export const FOLDS_INTO: Record<string, string> = {
44
84
  aws_s3_bucket_public_access_block: "aws_s3_bucket",
45
85
  aws_s3_bucket_server_side_encryption_configuration: "aws_s3_bucket",
46
86
  aws_s3_bucket_lifecycle_configuration: "aws_s3_bucket",
87
+ aws_s3_bucket_website_configuration: "aws_s3_bucket",
88
+ aws_s3_bucket_cors_configuration: "aws_s3_bucket",
89
+ aws_s3_bucket_logging: "aws_s3_bucket",
90
+ aws_s3_bucket_ownership_controls: "aws_s3_bucket",
91
+ aws_s3_bucket_notification: "aws_s3_bucket",
92
+ aws_s3_bucket_accelerate_configuration: "aws_s3_bucket",
93
+ aws_s3_bucket_request_payment_configuration: "aws_s3_bucket",
94
+ aws_s3_bucket_intelligent_tiering_configuration: "aws_s3_bucket",
95
+ aws_ecr_lifecycle_policy: "aws_ecr_repository",
96
+ aws_ecr_repository_policy: "aws_ecr_repository",
47
97
  };
48
98
 
49
99
  /**
50
- * The HCL attribute carrying a resource's physical name, per type — derived
51
- * from the AWS carve-out table. Used for the graph's identity and the
52
- * live-import hint. Absent fall back to the TF logical name.
100
+ * The HCL attribute carrying a resource's physical name, per type — AWS entries
101
+ * derived from the carve-out table, non-AWS listed directly. A dotted entry is
102
+ * a path into nested blocks (`manifest.metadata.name`). Used for the graph's
103
+ * identity and the live-import hint. Absent → fall back to the TF logical name.
53
104
  */
54
- export const IDENTITY_ATTR: Record<string, string> = Object.fromEntries(
55
- AWS_CARVE_TYPES.filter((t) => t.identityAttr).map((t) => [t.tfType, t.identityAttr!]),
56
- );
105
+ export const IDENTITY_ATTR: Record<string, string> = {
106
+ ...Object.fromEntries(AWS_CARVE_TYPES.filter((t) => t.identityAttr).map((t) => [t.tfType, t.identityAttr!])),
107
+ kubernetes_manifest: "manifest.metadata.name",
108
+ };
57
109
 
58
110
  export function resolveTier(tfType: string): TierInfo | null {
59
111
  return TIER_MAP[tfType] ?? null;