@intentius/chant-lexicon-terraform 0.79.0 → 0.81.0

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/dist/config.d.ts CHANGED
@@ -101,9 +101,9 @@ export declare const terraformConfigSchema: z.ZodObject<{
101
101
  * binary alone runs the root stock, exactly as `terraform`/`tofu` do.
102
102
  */
103
103
  binary: z.ZodOptional<z.ZodEnum<{
104
- choudoufu: "choudoufu";
105
104
  terraform: "terraform";
106
105
  tofu: "tofu";
106
+ choudoufu: "choudoufu";
107
107
  }>>;
108
108
  /**
109
109
  * How far a root's parse follows its `module` calls (#2112), spelled the
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "8dbc229e1cede4598f7b72276319272b57124d91e69652d141b2c3ec45b7e95b",
4
+ "manifest.json": "835f44ef66fca6500c71223d188a003cfe16f686ccd987ee5e324db5f5aa5749",
5
5
  "meta.json": "ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356",
6
6
  "types/index.d.ts": "022927e6a7b351cc4cf52d5f973f60ccd140e5810e17b32fb8868965aa1db161",
7
7
  "rules/plan-before-apply.ts": "31b1b3176799fd365b2583fe3947edd187c2a863e3dc0094ed9e91ece2464c99",
@@ -38,5 +38,5 @@
38
38
  "rules/tf029.ts": "52e02b4921a64f3f928836896b8b80682400adb50bd7a0645f3fe2e8819433c2",
39
39
  "skills/chant-terraform.md": "d9ca7b7c28aed0038ce775a3491150298492eed2858fd3651ed9bfca0e577ae8"
40
40
  },
41
- "composite": "f6e19c1a717b8ba79ffcd8eea9bb8c4e908b37c8b171138f466076e3fa19aa38"
41
+ "composite": "cd7f9cdbeb0503dc0af51fd69c48a299dd6bda865bcbc3a2701adc11aaed5b68"
42
42
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terraform",
3
- "version": "0.79.0",
3
+ "version": "0.81.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Terraform"
6
6
  }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-terraform",
3
- "version": "0.79.0",
3
+ "version": "0.81.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/",
7
- "dist/"
7
+ "dist/",
8
+ "workspace-kinds.json"
8
9
  ],
9
10
  "exports": {
10
11
  ".": {
@@ -12,6 +13,7 @@
12
13
  "types": "./dist/index.d.ts",
13
14
  "default": "./src/index.ts"
14
15
  },
16
+ "./workspace-kinds": "./workspace-kinds.json",
15
17
  "./*": {
16
18
  "development": "./src/*.ts",
17
19
  "types": "./dist/*.d.ts",
@@ -55,7 +57,7 @@
55
57
  "access": "public"
56
58
  },
57
59
  "peerDependencies": {
58
- "@intentius/chant": "^0.79.0",
60
+ "@intentius/chant": "^0.81.0",
59
61
  "typescript": "^5.9.3",
60
62
  "zod": "^4.3.6"
61
63
  },
@@ -8,6 +8,8 @@ import type { ChantConfig } from "@intentius/chant/config";
8
8
  import { isDeclarable, isResourceDeclarable, type Declarable } from "@intentius/chant/declarable";
9
9
  import { terraformPlugin } from "./plugin";
10
10
  import { terraformConfigSchema } from "./config";
11
+ import { RESERVED_COMMAND_NAMES } from "@intentius/chant/cli/command-group";
12
+ import { checkConflicts } from "@intentius/chant/cli/conflict-check";
11
13
  import {
12
14
  DATA_TYPE,
13
15
  LIVE_TYPE,
@@ -117,6 +119,17 @@ describe("terraform config schema", () => {
117
119
  expect(parsed.roots.app.workspace).toBe("prod");
118
120
  });
119
121
 
122
+ // #2529 — core reserves `workspace` as a command name. That reserves a
123
+ // top-level command word, not the word itself: this lexicon's root field
124
+ // keeps its meaning, and the plugin loads with no conflict.
125
+ it("keeps its workspace field while core reserves the workspace command", () => {
126
+ expect(RESERVED_COMMAND_NAMES.has("workspace")).toBe(true);
127
+ expect(checkConflicts([terraformPlugin]).conflicts).toEqual([]);
128
+ expect(terraformConfigSchema.parse({ roots: { app: { dir: ".", workspace: "workspace" } } }).roots.app.workspace).toBe(
129
+ "workspace",
130
+ );
131
+ });
132
+
120
133
  it("rejects an unknown key at the namespace level", () => {
121
134
  expect(() => terraformConfigSchema.parse({ roots: {}, binaries: "tofu" })).toThrow();
122
135
  });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The terraform member kind this lexicon supplies to a chant workspace
3
+ * (#2545). The kind is data in `workspace-kinds.json` at the package root,
4
+ * exported at `./workspace-kinds`; chant reads it without importing the
5
+ * lexicon.
6
+ */
7
+ import { join } from "node:path";
8
+ import { describeWorkspaceKindConformance } from "@intentius/chant-test-utils";
9
+
10
+ const main = `terraform {\n required_version = ">= 1.5.0"\n}\n\nresource "null_resource" "x" {}\n`;
11
+
12
+ describeWorkspaceKindConformance({
13
+ packageDir: join(import.meta.dirname, ".."),
14
+ scenarios: [
15
+ { name: "a root with main.tf", kind: "terraform", files: { "main.tf": main }, claims: true },
16
+ { name: "a root whose files are not named main.tf", kind: "terraform", files: { "network.tf": main, "versions.tf": "" }, claims: true },
17
+ { name: "a root that has only been planned, lock file and all", kind: "terraform", files: { "main.tf": main, ".terraform.lock.hcl": "" }, claims: true },
18
+ // chant's own precedence (500) outranks terraform's (400): no tie.
19
+ { name: "a chant project beside its .tf files", kind: "terraform", files: { "main.tf": main, "chant.config.ts": "" }, claims: true },
20
+ { name: "a directory whose modules sit one level down", kind: "terraform", files: { "modules/net/main.tf": main }, claims: false },
21
+ { name: "variable and backend files alone", kind: "terraform", files: { "terraform.tfvars": "", "backend.tfbackend": "" }, claims: false },
22
+ ],
23
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "$comment": "Member kinds this lexicon supplies to a chant workspace (#2545). chant reads this file as data and never imports the lexicon. The probe is behold's terraform member probe, narrowed to the member's own directory.",
3
+ "schema": 1,
4
+ "kinds": [
5
+ {
6
+ "name": "terraform",
7
+ "description": "a Terraform root module, with a .tf file directly in its directory",
8
+ "precedence": 400,
9
+ "probe": { "anyFile": ["*.tf"] }
10
+ }
11
+ ]
12
+ }