@intentius/chant-lexicon-terraform 0.57.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.
Files changed (131) hide show
  1. package/README.md +53 -0
  2. package/dist/codegen/docs-cli.d.ts +3 -0
  3. package/dist/codegen/docs-cli.d.ts.map +1 -0
  4. package/dist/codegen/docs.d.ts +11 -0
  5. package/dist/codegen/docs.d.ts.map +1 -0
  6. package/dist/codegen/generate-cli.d.ts +3 -0
  7. package/dist/codegen/generate-cli.d.ts.map +1 -0
  8. package/dist/codegen/generate.d.ts +28 -0
  9. package/dist/codegen/generate.d.ts.map +1 -0
  10. package/dist/codegen/package.d.ts +17 -0
  11. package/dist/codegen/package.d.ts.map +1 -0
  12. package/dist/composites/terraform-apply-op.d.ts +88 -0
  13. package/dist/composites/terraform-apply-op.d.ts.map +1 -0
  14. package/dist/composites/terraform-watch-op.d.ts +124 -0
  15. package/dist/composites/terraform-watch-op.d.ts.map +1 -0
  16. package/dist/config.d.ts +83 -0
  17. package/dist/config.d.ts.map +1 -0
  18. package/dist/describe-resources.d.ts +127 -0
  19. package/dist/describe-resources.d.ts.map +1 -0
  20. package/dist/generated/index.d.ts +2 -0
  21. package/dist/generated/index.d.ts.map +1 -0
  22. package/dist/hcl/parse.d.ts +87 -0
  23. package/dist/hcl/parse.d.ts.map +1 -0
  24. package/dist/hcl/roots.d.ts +37 -0
  25. package/dist/hcl/roots.d.ts.map +1 -0
  26. package/dist/index.d.ts +12 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/integrity.json +12 -0
  29. package/dist/lint/audit-catalog.d.ts +12 -0
  30. package/dist/lint/audit-catalog.d.ts.map +1 -0
  31. package/dist/lint/audit-lineage.d.ts +21 -0
  32. package/dist/lint/audit-lineage.d.ts.map +1 -0
  33. package/dist/lint/post-synth/index.d.ts +3 -0
  34. package/dist/lint/post-synth/index.d.ts.map +1 -0
  35. package/dist/lint/post-synth/tf001.d.ts +17 -0
  36. package/dist/lint/post-synth/tf001.d.ts.map +1 -0
  37. package/dist/lint/rules/index.d.ts +5 -0
  38. package/dist/lint/rules/index.d.ts.map +1 -0
  39. package/dist/lint/rules/plan-before-apply.d.ts +30 -0
  40. package/dist/lint/rules/plan-before-apply.d.ts.map +1 -0
  41. package/dist/lsp/completions.d.ts +26 -0
  42. package/dist/lsp/completions.d.ts.map +1 -0
  43. package/dist/lsp/context.d.ts +70 -0
  44. package/dist/lsp/context.d.ts.map +1 -0
  45. package/dist/lsp/hover.d.ts +12 -0
  46. package/dist/lsp/hover.d.ts.map +1 -0
  47. package/dist/lsp/option-keys.d.ts +34 -0
  48. package/dist/lsp/option-keys.d.ts.map +1 -0
  49. package/dist/manifest.json +6 -0
  50. package/dist/meta.json +1 -0
  51. package/dist/okf/index.md +8 -0
  52. package/dist/okf/rules/TF001.md +11 -0
  53. package/dist/okf/rules/TF101.md +11 -0
  54. package/dist/op/activities/index.d.ts +22 -0
  55. package/dist/op/activities/index.d.ts.map +1 -0
  56. package/dist/op/activities/terraform.d.ts +213 -0
  57. package/dist/op/activities/terraform.d.ts.map +1 -0
  58. package/dist/op/builders.d.ts +56 -0
  59. package/dist/op/builders.d.ts.map +1 -0
  60. package/dist/package-cli.d.ts +3 -0
  61. package/dist/package-cli.d.ts.map +1 -0
  62. package/dist/plugin.d.ts +11 -0
  63. package/dist/plugin.d.ts.map +1 -0
  64. package/dist/rules/plan-before-apply.ts +143 -0
  65. package/dist/rules/tf001.ts +66 -0
  66. package/dist/serializer.d.ts +19 -0
  67. package/dist/serializer.d.ts.map +1 -0
  68. package/dist/skills/chant-terraform.md +92 -0
  69. package/dist/state-ownership.d.ts +27 -0
  70. package/dist/state-ownership.d.ts.map +1 -0
  71. package/dist/types/index.d.ts +2 -0
  72. package/dist/validate-cli.d.ts +3 -0
  73. package/dist/validate-cli.d.ts.map +1 -0
  74. package/dist/validate.d.ts +15 -0
  75. package/dist/validate.d.ts.map +1 -0
  76. package/package.json +75 -0
  77. package/src/__fixtures__/no-backend/main.tf +24 -0
  78. package/src/__fixtures__/show-state.json +68 -0
  79. package/src/__fixtures__/with-backend/main.tf +28 -0
  80. package/src/__fixtures__/with-module/main.tf +49 -0
  81. package/src/__fixtures__/with-module/modules/inner/main.tf +5 -0
  82. package/src/codegen/docs-cli.ts +4 -0
  83. package/src/codegen/docs.ts +50 -0
  84. package/src/codegen/generate-cli.ts +10 -0
  85. package/src/codegen/generate.ts +68 -0
  86. package/src/codegen/package.ts +50 -0
  87. package/src/composites/terraform-apply-op.acceptance.test.ts +138 -0
  88. package/src/composites/terraform-apply-op.test.ts +193 -0
  89. package/src/composites/terraform-apply-op.ts +166 -0
  90. package/src/composites/terraform-watch-op.test.ts +184 -0
  91. package/src/composites/terraform-watch-op.ts +204 -0
  92. package/src/config.ts +76 -0
  93. package/src/describe-resources.test.ts +342 -0
  94. package/src/describe-resources.ts +357 -0
  95. package/src/generated/index.d.ts +2 -0
  96. package/src/generated/index.ts +4 -0
  97. package/src/generated/lexicon-terraform.json +1 -0
  98. package/src/hcl/parse.ts +235 -0
  99. package/src/hcl/roots.ts +67 -0
  100. package/src/index.ts +65 -0
  101. package/src/lint/audit-catalog.ts +30 -0
  102. package/src/lint/audit-lineage.ts +21 -0
  103. package/src/lint/audit.test.ts +45 -0
  104. package/src/lint/post-synth/index.ts +7 -0
  105. package/src/lint/post-synth/post-synth.test.ts +95 -0
  106. package/src/lint/post-synth/tf001.ts +66 -0
  107. package/src/lint/rules/index.ts +7 -0
  108. package/src/lint/rules/plan-before-apply.test.ts +111 -0
  109. package/src/lint/rules/plan-before-apply.ts +143 -0
  110. package/src/lsp/completions.test.ts +120 -0
  111. package/src/lsp/completions.ts +101 -0
  112. package/src/lsp/context.test.ts +152 -0
  113. package/src/lsp/context.ts +349 -0
  114. package/src/lsp/hover.test.ts +82 -0
  115. package/src/lsp/hover.ts +44 -0
  116. package/src/lsp/option-keys.ts +106 -0
  117. package/src/op/activities/index.ts +48 -0
  118. package/src/op/activities/registry.test.ts +29 -0
  119. package/src/op/activities/terraform.test.ts +445 -0
  120. package/src/op/activities/terraform.ts +469 -0
  121. package/src/op/builders.test.ts +90 -0
  122. package/src/op/builders.ts +96 -0
  123. package/src/package-cli.ts +21 -0
  124. package/src/plugin.test.ts +271 -0
  125. package/src/plugin.ts +157 -0
  126. package/src/serializer.test.ts +26 -0
  127. package/src/serializer.ts +26 -0
  128. package/src/skills/chant-terraform.md +92 -0
  129. package/src/state-ownership.ts +32 -0
  130. package/src/validate-cli.ts +5 -0
  131. package/src/validate.ts +28 -0
@@ -0,0 +1,87 @@
1
+ /**
2
+ * The one shared HCL parse for the terraform lexicon.
3
+ *
4
+ * Two entry points, one entity shape. `parseTerraformRootDir` reads the `.tf`
5
+ * files of a directory (non-recursive, matching Terraform's own module
6
+ * scoping) and is what `buildRoots()` calls. `parseTerraformRootContent` takes
7
+ * the joined-file string `chant audit` hands a lexicon for a discovered root
8
+ * module: every `.tf` in filename order behind a `# file: <name>` line comment.
9
+ * Both funnel through `blocksToEntities`, so an entity the audit path sees is
10
+ * the entity the build path sees.
11
+ *
12
+ * Core owns the parser glue: `loadHcl2json()` lazy-loads `@cdktf/hcl2json`
13
+ * (a ~1.8 MB wasm blob) and raises a one-line install hint when it is absent.
14
+ * `parseTerraformDir()` next to it is NOT reused: it returns carve's `TfGraph`,
15
+ * a scoring-and-excision shape with no room for the per-block bodies a
16
+ * serializer and the post-synth checks read. The import path is the wildcard
17
+ * core's exports map already carries (`"./*"` to `./src/*.ts`), so nothing
18
+ * changed in `packages/core/package.json` for this.
19
+ */
20
+ import { type Hcl2Json } from "@intentius/chant/terraform/parse";
21
+ import { type Declarable } from "@intentius/chant/declarable";
22
+ /** A parsed HCL block body, as `@cdktf/hcl2json` encodes it. */
23
+ export type BlockBody = Record<string, unknown>;
24
+ /** The entity every block becomes. `props` is what post-synth checks read. */
25
+ export interface TerraformEntity extends Declarable {
26
+ readonly lexicon: "terraform";
27
+ readonly kind: "resource";
28
+ readonly props: {
29
+ /** Terraform address, e.g. `aws_s3_bucket.assets`, `var.region`, `module.cdn`. */
30
+ readonly address: string;
31
+ /** The block body, verbatim from hcl2json (interpolations survive as `"${...}"`). */
32
+ readonly body: BlockBody;
33
+ /** File the block came from, as named by the parse input. */
34
+ readonly file: string;
35
+ /** Configured root name this block belongs to. */
36
+ readonly root: string;
37
+ };
38
+ }
39
+ /** `entityType` per block kind. */
40
+ export declare const TERRAFORM_TYPE = "Terraform::Terraform";
41
+ export declare const PROVIDER_TYPE = "Terraform::Provider";
42
+ export declare const RESOURCE_TYPE = "Terraform::Resource";
43
+ export declare const DATA_TYPE = "Terraform::Data";
44
+ export declare const MODULE_TYPE = "Terraform::Module";
45
+ export declare const VARIABLE_TYPE = "Terraform::Variable";
46
+ export declare const OUTPUT_TYPE = "Terraform::Output";
47
+ export declare const LOCALS_TYPE = "Terraform::Locals";
48
+ /**
49
+ * Build one entity. Written out rather than run through `createResource`
50
+ * from `@intentius/chant/runtime`: that factory is for generated resource
51
+ * classes and hides `props` behind a non-enumerable descriptor plus an
52
+ * `attrMap` of `AttrRef`s this lexicon has nothing to put in. The literal
53
+ * carries the same marker, so `isDeclarable()` and `isResourceDeclarable()`
54
+ * both hold.
55
+ */
56
+ export declare function terraformEntity(entityType: string, address: string, body: BlockBody, file: string, root: string): TerraformEntity;
57
+ /** One `.tf` file's name and source. */
58
+ export interface TerraformFile {
59
+ name: string;
60
+ source: string;
61
+ }
62
+ /**
63
+ * Split the joined form back into files. A string with no marker at all is one
64
+ * anonymous file, so a caller that hands over a single `.tf` still parses.
65
+ */
66
+ export declare function splitBundleContent(content: string, fallbackName?: string): TerraformFile[];
67
+ /** Every `.tf` directly under `dir`, in filename order. Non-recursive. */
68
+ export declare function listTerraformFiles(dir: string): string[];
69
+ /**
70
+ * Parse a set of files into entities keyed `<root>/<address>`. Two blocks that
71
+ * genuinely share an address (two `locals` blocks, or the same address in two
72
+ * files of one root) are numbered `~2`, `~3` rather than overwriting.
73
+ */
74
+ export declare function blocksToEntities(files: readonly TerraformFile[], root: string, hcl2json?: Hcl2Json): Promise<Map<string, Declarable>>;
75
+ /**
76
+ * Parse a root module directory. Reads every `.tf` directly under `dir`.
77
+ * Throws whatever the parser throws for malformed HCL; `buildRoots()` is where
78
+ * that becomes a warning.
79
+ */
80
+ export declare function parseTerraformRootDir(dir: string, root: string, hcl2json?: Hcl2Json): Promise<Map<string, Declarable>>;
81
+ /**
82
+ * Parse the joined-file string form `chant audit` produces for a discovered
83
+ * root module (`AuditInput.content`). Unwired for now: #2085's
84
+ * `auditEntities()` is what calls it.
85
+ */
86
+ export declare function parseTerraformRootContent(content: string, root: string, hcl2json?: Hcl2Json): Promise<Map<string, Declarable>>;
87
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/hcl/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEjF,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD,8EAA8E;AAC9E,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE;QACd,kFAAkF;QAClF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,qFAAqF;QACrF,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;QACzB,6DAA6D;QAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,kDAAkD;QAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,mCAAmC;AACnC,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAC3C,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAC/C,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,eAAe,CAQjB;AAED,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,SAAY,GAAG,aAAa,EAAE,CAiB7F;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAIxD;AAYD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAoElC;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAMlC;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAElC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Terraform build roots.
3
+ *
4
+ * An estate that keeps its `.tf` tree has no typed chant source for it. What
5
+ * it can declare is the directory: each entry in `terraform.roots` names a
6
+ * root module that parses at build time into entities, so the blocks are
7
+ * serialized into the build output and seen by the post-synth checks. Same
8
+ * shape `lexicons/k8s/src/kustomize/root.ts` uses for kustomize overlays: the
9
+ * render lives here, the plugin's `buildRoots()` member stays thin.
10
+ *
11
+ * Unlike the kustomize renderer, a missing directory or a `.tf` the parser
12
+ * refuses is a warning and zero entities for that root, never a throw. Reading
13
+ * someone else's estate is the whole job here, and half of it parsing is more
14
+ * useful than none of it, especially when the audit path (#2085) walks
15
+ * repositories it did not write.
16
+ */
17
+ import type { Declarable } from "@intentius/chant/declarable";
18
+ import type { Hcl2Json } from "@intentius/chant/terraform/parse";
19
+ import type { TerraformRootConfig } from "../config.js";
20
+ export interface TerraformRootsResult {
21
+ entities: Map<string, Declarable>;
22
+ warnings: string[];
23
+ }
24
+ export interface RenderTerraformRootsOptions {
25
+ /** Directory the project config was loaded from; relative `dir` resolves against it. */
26
+ projectRoot: string;
27
+ /** `terraform.roots`: name to root-module config. */
28
+ roots: Readonly<Record<string, TerraformRootConfig>>;
29
+ /** Injectable parser (tests); defaults to core's lazy-loaded `@cdktf/hcl2json`. */
30
+ hcl2json?: Hcl2Json;
31
+ }
32
+ /**
33
+ * Parse each configured root into entities keyed `<root>/<address>`. Roots are
34
+ * visited in declaration order, and one root's failure never stops the next.
35
+ */
36
+ export declare function renderTerraformRoots(opts: RenderTerraformRootsOptions): Promise<TerraformRootsResult>;
37
+ //# sourceMappingURL=roots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roots.d.ts","sourceRoot":"","sources":["../../src/hcl/roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,wFAAwF;IACxF,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACrD,mFAAmF;IACnF,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,oBAAoB,CAAC,CAsB/B"}
@@ -0,0 +1,12 @@
1
+ export { terraformPlugin } from "./plugin.js";
2
+ export { terraformSerializer } from "./serializer.js";
3
+ export { terraformConfigSchema, terraformRootSchema, type TerraformConfig, type TerraformRootConfig, type TerraformConfigNamespace, } from "./config.js";
4
+ export { blocksToEntities, parseTerraformRootContent, parseTerraformRootDir, splitBundleContent, terraformEntity, DATA_TYPE, LOCALS_TYPE, MODULE_TYPE, OUTPUT_TYPE, PROVIDER_TYPE, RESOURCE_TYPE, TERRAFORM_TYPE, VARIABLE_TYPE, type BlockBody, type TerraformEntity, type TerraformFile, } from "./hcl/parse.js";
5
+ export { renderTerraformRoots, type TerraformRootsResult } from "./hcl/roots.js";
6
+ export { terraformInit, terraformPlan, terraformApply, terraformShow } from "./op/builders.js";
7
+ export { TerraformApplyOp } from "./composites/terraform-apply-op.js";
8
+ export type { TerraformApplyOpConfig, TerraformApplyOpResources, TerraformGateMode, } from "./composites/terraform-apply-op.js";
9
+ export { TerraformWatchOp } from "./composites/terraform-watch-op.js";
10
+ export type { TerraformWatchOpConfig, TerraformWatchOpResources, TerraformFindingMode, } from "./composites/terraform-watch-op.js";
11
+ export { TERRAFORM_STATE_OWNERSHIP_KEYS } from "./state-ownership.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAK9E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,12 @@
1
+ {
2
+ "algorithm": "sha256",
3
+ "artifacts": {
4
+ "manifest.json": "8f4e78f1493a0dce03ed3956c7e35bd59583b665839b1d854212ce492cf000de",
5
+ "meta.json": "ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356",
6
+ "types/index.d.ts": "022927e6a7b351cc4cf52d5f973f60ccd140e5810e17b32fb8868965aa1db161",
7
+ "rules/plan-before-apply.ts": "b902d738a9cd4596b569f66b404c8e0e8358e58749708e76eb2521c459fb2f47",
8
+ "rules/tf001.ts": "1000540a1d2958efbae3356b221934f4c7ee76e977704d0e793a9864fd2d2936",
9
+ "skills/chant-terraform.md": "37b719bc43242250d61b80a6ee5c91da8e0c67a959cc92e2c182e3951adb8912"
10
+ },
11
+ "composite": "a69f5327abd011e634c05a6b123cb9680268a127a7f07e29615204bf1277c319"
12
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The terraform lexicon's chant audit catalog: metadata for its post-synth
3
+ * checks, contributed through `terraformPlugin.auditCatalog()` (#687, #1346).
4
+ * Every post-synth check needs an entry or it contributes nothing to
5
+ * `chant audit`, silently, and `packages/core/src/audit/catalog.test.ts` fails.
6
+ *
7
+ * TF001 reads the chant model (`ctx.entities`), never emitted output, so
8
+ * `yamlBased` is false. Prior-art lineage lives in ./audit-lineage.ts.
9
+ */
10
+ import type { RuleMeta } from "@intentius/chant/audit/catalog";
11
+ export declare const terraformAuditCatalog: Record<string, RuleMeta>;
12
+ //# sourceMappingURL=audit-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI/D,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAY1D,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Prior art for the terraform lexicon's audit rules: the open-source tools
3
+ * whose checks cover the same condition, credited per rule. See
4
+ * packages/core/src/audit/prior-art.ts for the registry, the relation
5
+ * vocabulary, and why this is credit rather than authority. Kept by hand; the
6
+ * prior-art sweep (scripts/prior-art-sweep.ts) reports when a credited tool's
7
+ * index no longer lists a rule cited here.
8
+ *
9
+ * TF001 (no remote backend) has no entry here. Checkov's `CKV_TF_*` family
10
+ * (checkov.io) has no rule for a missing backend block, and
11
+ * tflint-ruleset-terraform's own rule index
12
+ * (github.com/terraform-linters/tflint-ruleset-terraform/blob/main/docs/rules/README.md)
13
+ * has none either: its closest neighbors are `terraform_required_providers`
14
+ * (unconstrained provider versions, TF002's territory, not TF001's) and
15
+ * `terraform_workspace_remote` (a `terraform.workspace` compatibility check
16
+ * against remote execution, a different condition than "no backend is
17
+ * configured at all"). Ship with no lineage rather than invent a credit.
18
+ */
19
+ import type { Lineage } from "@intentius/chant/audit/catalog";
20
+ export declare const terraformAuditLineage: Record<string, Lineage[]>;
21
+ //# sourceMappingURL=audit-lineage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-lineage.d.ts","sourceRoot":"","sources":["../../src/lint/audit-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
2
+ export declare const postSynthChecks: PostSynthCheck[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAE3C,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * TF001: a root module keeps its state on local disk.
3
+ *
4
+ * A `terraform` block with no `backend "<type>"` and no `cloud {}` falls back
5
+ * to the local backend, which puts `terraform.tfstate` in the working
6
+ * directory. That file holds every attribute of every managed resource,
7
+ * secrets included, and it is not shared, not locked, and not versioned. The
8
+ * first apply from a second machine or a CI runner starts from an empty state
9
+ * and proposes to create the estate again.
10
+ *
11
+ * One diagnostic per root, fired from the root's `terraform` block. A root
12
+ * with no `terraform` block at all is not flagged: it declares no version
13
+ * constraints either, and the missing block is a different finding.
14
+ */
15
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
16
+ export declare const tf001: PostSynthCheck;
17
+ //# sourceMappingURL=tf001.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tf001.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/tf001.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,kCAAkC,CAAC;AAY1C,eAAO,MAAM,KAAK,EAAE,cAkCnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { LintRule } from "@intentius/chant/lint/rule";
2
+ export { planBeforeApplyRule } from "./plan-before-apply.js";
3
+ /** All lint rules provided by this lexicon (imported by plugin.ts's lintRules()). */
4
+ export declare const rules: LintRule[];
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qFAAqF;AACrF,eAAO,MAAM,KAAK,EAAE,QAAQ,EAA0B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { LintRule } from "@intentius/chant/lint/rule";
2
+ /**
3
+ * TF101: terraformApply's planFile must reference a preceding terraformPlan step.
4
+ *
5
+ * Applying a plan file chosen by a string means the applied plan can be
6
+ * stale, hand-edited, or simply the wrong one — the entire point of the
7
+ * plan/apply split (review exactly what will change, then apply exactly
8
+ * that) is defeated the moment the path is spelled out in source instead of
9
+ * carried forward from the `terraformPlan` step that produced it.
10
+ *
11
+ * The two builders this rule is written against (`terraformPlan`,
12
+ * `terraformApply`) don't exist yet (#2086 ships them in parallel), so this
13
+ * matches purely on callee identifier name — same posture as
14
+ * `lexicons/k3s/src/lint/rules/token-literal.ts`.
15
+ *
16
+ * Accepts exactly the two authoring forms that produce a genuine step-output
17
+ * reference (`packages/core/src/op/step-output-ref.ts`):
18
+ * - `stepOutput(<ident>, "planFile")`
19
+ * - `<ident>.out.planFile`
20
+ * where `<ident>` is bound (`const <ident> = terraformPlan(...)`) in the same
21
+ * file. Flags a string literal, a template literal, or one of the two
22
+ * accepted reference forms pointing at an identifier that resolves to
23
+ * something other than a `terraformPlan` call. When `<ident>` cannot be
24
+ * resolved at all (not declared anywhere in the file), this rule stays
25
+ * silent — the same deliberately shallow "bail rather than guess" posture
26
+ * `validateStepOutputRefs` takes, since the runtime brand on a real
27
+ * `StepOutputRef` is invisible to a source-level AST match.
28
+ */
29
+ export declare const planBeforeApplyRule: LintRule;
30
+ //# sourceMappingURL=plan-before-apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-before-apply.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/plan-before-apply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAgHjC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * LSP completions for the terraform lexicon (#2088).
3
+ *
4
+ * k3s's shape (a generated `LexiconIndex` over typed resource classes) does
5
+ * not fit here: terraform's declarables are lightweight per-HCL-block
6
+ * entities `buildRoots()` produces at build time, not authored TypeScript
7
+ * types — there is nothing to generate a completion index from. What an
8
+ * ops-only lexicon can honestly complete is the surface an `*.op.ts` author
9
+ * actually types:
10
+ *
11
+ * - `terraform.roots` names, read from the reachable `chant.config.*` (see
12
+ * `./context.ts`) — completed inside a root-name position, e.g.
13
+ * `terraformPlan("` or `root: "`.
14
+ * - the composite/builder option keys (`./option-keys.ts`) — completed
15
+ * inside the relevant call's options object.
16
+ *
17
+ * Root names complete only when a `chant.config.*` is reachable from the
18
+ * document's own `uri` and declares at least one; there is no synchronous,
19
+ * safe way to evaluate `chant.config.ts` (project-authored code) from inside
20
+ * a completion request, so an unreachable config yields no root-name
21
+ * completions rather than a guessed one. Option keys need no config at all
22
+ * and complete unconditionally.
23
+ */
24
+ import type { CompletionContext, CompletionItem } from "@intentius/chant/lsp/types";
25
+ export declare function completions(ctx: CompletionContext): CompletionItem[];
26
+ //# sourceMappingURL=completions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/lsp/completions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA4CpF,wBAAgB,WAAW,CAAC,GAAG,EAAE,iBAAiB,GAAG,cAAc,EAAE,CAgCpE"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Shared parsing for the terraform LSP pair (#2088).
3
+ *
4
+ * There is no generated `LexiconIndex` here (see `completions.ts`'s module
5
+ * doc for why), so both providers work off two different sources instead:
6
+ *
7
+ * - `terraform.roots`, read out of the project's `chant.config.{ts,json}`.
8
+ * `chant.config.ts` is project-authored code (`config.ts`'s own doc:
9
+ * "where it is evaluated is a security question"), and evaluating it is
10
+ * an async, sandboxed operation — `loadChantConfigUpward` — while
11
+ * `completionProvider`/`hoverProvider` are synchronous. So this reads the
12
+ * file's *text* and extracts the `terraform.roots` object literal with a
13
+ * small brace-matching scanner, never `eval`/`import()`. A shape the
14
+ * scanner cannot follow (roots built by a loop, spread from a helper)
15
+ * yields no roots rather than a wrong guess — the same "reachable or
16
+ * nothing" rule the config-loading code documents elsewhere.
17
+ * - the option keys a `*.op.ts` author types: `TerraformApplyOpConfig`
18
+ * (`composites/terraform-apply-op.ts`) and the four builders' own opts
19
+ * (`op/builders.ts`, `op/activities/terraform.ts`). Those are a fixed
20
+ * table, not read from any file.
21
+ */
22
+ export interface ResolvedTerraformRoot {
23
+ dir?: string;
24
+ workspace?: string;
25
+ varFiles?: string[];
26
+ }
27
+ /**
28
+ * `terraform.roots`, extracted from a `chant.config.ts`/`.json`'s raw text.
29
+ * Never executes the file. `format` distinguishes the two because JSON's
30
+ * `roots` value is already a plain object — no brace-matching needed.
31
+ */
32
+ export declare function parseTerraformRoots(configText: string, format: "ts" | "json"): Record<string, ResolvedTerraformRoot> | undefined;
33
+ /**
34
+ * `terraform.roots`, resolved from the project config reachable from the
35
+ * document at `uri`. `undefined` when `uri` is not a `file://` URI, no
36
+ * `chant.config.*` is reachable by walking up from it, or the namespace
37
+ * declares no roots — every case where root-name completion has nothing
38
+ * honest to offer, so callers fall back to the option-key completions
39
+ * instead of fabricating a root list.
40
+ */
41
+ export declare function resolveRootsForUri(uri: string): Record<string, ResolvedTerraformRoot> | undefined;
42
+ /** Content of the open document up to (and a little past) the cursor line, mirroring core's `lexiconCompletions`. */
43
+ export declare function contentUpToCursor(content: string, line: number): string;
44
+ /**
45
+ * The name of the call whose parenthesized argument list holds the innermost
46
+ * unmatched `{` before the cursor — `TerraformApplyOp({ ↵ name: "x", ↵ <cursor>`
47
+ * and `terraformPlan("app", { ↵ <cursor>` both resolve to their call name,
48
+ * regardless of which positional argument the object is.
49
+ */
50
+ export declare function enclosingCallName(text: string): string | undefined;
51
+ /**
52
+ * The key of the innermost enclosing object literal, regardless of what
53
+ * encloses *that* — `compensate: { <cursor>` resolves to `"compensate"` even
54
+ * though the whole thing sits inside `TerraformApplyOp({ ... })`'s own
55
+ * argument object, which `enclosingKeyPath` would refuse to walk through (a
56
+ * call anywhere in the chain ends it there).
57
+ */
58
+ export declare function innermostObjectKey(text: string): string | undefined;
59
+ /**
60
+ * The chain of object-literal keys enclosing the cursor, outermost first —
61
+ * `["terraform", "roots", "app"]` inside `terraform: { roots: { app: { <cursor>` —
62
+ * for the plain-object contexts (`chant.config.ts`) that `enclosingCallName`
63
+ * does not cover, since there is no call there at all. A brace with no `key:`
64
+ * before it (the module's own `export default {`) contributes nothing to the
65
+ * path rather than ending it — only a `(` anywhere in the chain does, since
66
+ * `chant.config.ts` builds one object literal and calling anything
67
+ * mid-declaration is not a shape this needs to follow.
68
+ */
69
+ export declare function enclosingKeyPath(text: string): string[] | undefined;
70
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/lsp/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AA8JD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,IAAI,GAAG,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,SAAS,CAoCnD;AA0BD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,SAAS,CAWjG;AAID,qHAAqH;AACrH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYlE;AASD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKnE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CASnE"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * LSP hover for the terraform lexicon (#2088). See `./completions.ts`'s
3
+ * module doc for why this reads `chant.config.*` as text rather than a
4
+ * generated index, and completes/documents the same two things: a
5
+ * `terraform.roots` name (when the word under the cursor is quoted next to
6
+ * it, so an ordinary identifier never gets mistaken for a root) and one of
7
+ * the composite/builder option keys (`./option-keys.ts`), the latter needing
8
+ * no reachable config at all.
9
+ */
10
+ import type { HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
11
+ export declare function hover(ctx: HoverContext): HoverInfo | undefined;
12
+ //# sourceMappingURL=hover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AA6B1E,wBAAgB,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAI9D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The option keys a `*.op.ts` or `chant.config.ts` author types against this
3
+ * lexicon's config schema (`../config.ts`), its composite
4
+ * (`../composites/terraform-apply-op.ts`) and its four builders
5
+ * (`../op/builders.ts`, `../op/activities/terraform.ts`). A fixed table, not
6
+ * read from any generated registry — there is no upstream schema here (see
7
+ * `plugin.ts`'s module doc), so this is the same set of fields those files
8
+ * already document in their own TSDoc, restated once for the editor.
9
+ */
10
+ export interface OptionKey {
11
+ key: string;
12
+ detail: string;
13
+ }
14
+ /** `TerraformConfig`'s own top-level keys (`terraform: { <here> }`). */
15
+ export declare const CONFIG_NAMESPACE_KEYS: OptionKey[];
16
+ /** `TerraformRootConfig`'s keys — one entry of `terraform.roots.<name>: { <here> }`. */
17
+ export declare const ROOT_ENTRY_KEYS: OptionKey[];
18
+ /** `TerraformApplyOpConfig`'s keys (`TerraformApplyOp({ <here> })`). */
19
+ export declare const APPLY_OP_KEYS: OptionKey[];
20
+ /** `compensate`'s own shape when it is an object: `compensate: { <here> }`. */
21
+ export declare const COMPENSATE_KEYS: OptionKey[];
22
+ /** `terraformInit(root, { <here> })`'s opts — `TerraformInitArgs` minus `root`, plus step opts. */
23
+ export declare const INIT_OPTS_KEYS: OptionKey[];
24
+ /** `terraformPlan(root, { <here> })`'s opts — `TerraformPlanArgs` minus `root`, plus step opts. */
25
+ export declare const PLAN_OPTS_KEYS: OptionKey[];
26
+ /** `terraformApply(root, { <here> })`'s opts — `TerraformApplyArgs` minus `root`, plus step opts. */
27
+ export declare const APPLY_OPTS_KEYS: OptionKey[];
28
+ /** `terraformShow(root, { <here> })`'s opts — `TerraformShowArgs` minus `root`, plus step opts. */
29
+ export declare const SHOW_OPTS_KEYS: OptionKey[];
30
+ /** Every builder call name mapped to its opts table, for completion inside `(root, { <here> })`. */
31
+ export declare const BUILDER_OPTS_BY_CALL: Record<string, OptionKey[]>;
32
+ /** Every option key across every table, keyed by name, for hover lookup. Last writer wins on a name shared across tables (`cwd`, `planFile`) — the detail text is the same fact restated per activity, so any one of them is a correct hover. */
33
+ export declare const ALL_OPTION_KEYS: Map<string, string>;
34
+ //# sourceMappingURL=option-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option-keys.d.ts","sourceRoot":"","sources":["../../src/lsp/option-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAG5C,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,SAAS,EAKtC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE,SAAS,EAYpC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,SAAS,EAEtC,CAAC;AAQF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAKrC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,eAAe,EAAE,SAAS,EAItC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,cAAc,EAAE,SAAS,EAIrC,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAK5D,CAAC;AAEF,iPAAiP;AACjP,eAAO,MAAM,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAW/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "terraform",
3
+ "version": "0.57.0",
4
+ "chantVersion": ">=0.1.0",
5
+ "namespace": "Terraform"
6
+ }
package/dist/meta.json ADDED
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,8 @@
1
+ ---
2
+ okf_version: '0.2'
3
+ ---
4
+
5
+ # Rules
6
+
7
+ * [TF001](/rules/TF001.md) - Root module declares no remote backend
8
+ * [TF101](/rules/TF101.md) - terraformApply's planFile must reference a preceding terraformPlan step.
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: TF001
4
+ description: Root module declares no remote backend
5
+ id: TF001
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: terraform
9
+ docs: https://intentius.io/chant/lexicons/terraform/rules/
10
+ ---
11
+ Root module declares no remote backend
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: lint-rule
3
+ title: TF101
4
+ description: terraformApply's planFile must reference a preceding terraformPlan step.
5
+ id: TF101
6
+ severity: error
7
+ category: correctness
8
+ lexicon: terraform
9
+ docs: https://intentius.io/chant/lexicons/terraform/rules/
10
+ ---
11
+ terraformApply's planFile must reference a preceding terraformPlan step.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * terraform Op activities — resolved by the core activity registry when a
3
+ * project's `chant.config.ts` lists the `terraform` lexicon. `loadActivities`
4
+ * (`packages/core/src/op/activity-registry.ts`) imports
5
+ * `@intentius/chant-lexicon-terraform/op/activities` and keys every exported
6
+ * function by its name, so there is no plugin member to register:
7
+ *
8
+ * - terraformInit — `init` with the root's `backendConfig`.
9
+ * - terraformPlan — `plan -detailed-exitcode -out=<planFile>`, plus both
10
+ * `show` renders of the written plan.
11
+ * - terraformApply — `apply <planFile>`, a saved plan only.
12
+ * - terraformShow — state, or a saved plan, as JSON and as text.
13
+ *
14
+ * The module is dependency-light on purpose: it shells out to the configured
15
+ * binary and reads the `terraform` config namespace, and never touches the
16
+ * lexicon's HCL parse or serializer, so a Temporal worker loads it cheaply.
17
+ * The pure command and environment builders are exported alongside the
18
+ * activities because they are what the tests assert on.
19
+ */
20
+ export { terraformInit, terraformPlan, terraformApply, terraformShow, terraformInitCommand, terraformPlanCommand, terraformApplyCommand, terraformShowCommand, terraformEnvironment, terraformBinary, countPlanChanges, quoteArg, DEFAULT_PLAN_FILE, DEFAULT_TERRAFORM_BINARY, } from "./terraform.js";
21
+ export type { TerraformRootArgs, TerraformInitArgs, TerraformPlanArgs, TerraformApplyArgs, TerraformShowArgs, TerraformInitResult, TerraformPlanResult, TerraformApplyResult, TerraformShowResult, PlanChangeCounts, } from "./terraform.js";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}