@intentius/chant-lexicon-terraform 0.93.0 → 0.95.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/behaviour/predict.d.ts.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/hcl/descend.d.ts +7 -0
- package/dist/hcl/descend.d.ts.map +1 -1
- package/dist/hcl/roots.d.ts +6 -0
- package/dist/hcl/roots.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/behaviour/predict.ts +1 -0
- package/src/config.ts +13 -0
- package/src/hcl/descend.test.ts +40 -0
- package/src/hcl/descend.ts +15 -2
- package/src/hcl/roots.ts +7 -0
- package/src/plugin.ts +1 -0
- package/workspace-kinds.json +24 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.d.ts","sourceRoot":"","sources":["../../src/behaviour/predict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE7B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAA6B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK1F,OAAO,EAEL,KAAK,wBAAwB,EAE9B,MAAM,WAAW,CAAC;AAEnB,oDAAoD;AACpD,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,wFAAwF;AACxF,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpC,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACxC;;;;OAIG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CACzE;AAED;;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,EAAE,UAAU,GAAG,OAAO,GAAG,cAAc,CAAC;IAC5E,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACxD,iGAAiG;IACjG,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;;;OAeG;IACH,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B;AAmBD,6FAA6F;AAC7F,MAAM,MAAM,0BAA0B,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;AAElH;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,0BA0BtC,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,uBAAuB,EAChC,SAAS,GAAE,0BAAqD,GAC/D,OAAO,CAAC,uBAAuB,CAAC,CA+ClC;AAED,sGAAsG;AACtG,wBAAgB,WAAW,CACzB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,wBAAwB,CAAC,GACtD,MAAM,EAAE,CAQV;AAQD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,uBAAuB,EAChC,IAAI,GAAE,sBAAkC,GACvC,OAAO,CAAC,eAAe,CAAC,CA4E1B"}
|
package/dist/config.d.ts
CHANGED
|
@@ -118,6 +118,19 @@ export declare const terraformConfigSchema: z.ZodObject<{
|
|
|
118
118
|
none: "none";
|
|
119
119
|
all: "all";
|
|
120
120
|
}>>;
|
|
121
|
+
/**
|
|
122
|
+
* The directory a root's local module sources may resolve within (#2874),
|
|
123
|
+
* absolute or relative to the project root. Unset, it is the project root,
|
|
124
|
+
* or a root's own directory when its `dir` lies outside the project. A
|
|
125
|
+
* source that resolves outside it is refused with a warning, as before.
|
|
126
|
+
*
|
|
127
|
+
* `chant workspace graph` sets it to the workspace root when it reads a
|
|
128
|
+
* `terraform` or `choudoufu` member through a reader project of its own,
|
|
129
|
+
* so a member that calls `../modules/x` keeps its modules. A project
|
|
130
|
+
* rarely needs it: widening the boundary means reading modules the
|
|
131
|
+
* project does not own.
|
|
132
|
+
*/
|
|
133
|
+
moduleRoot: z.ZodOptional<z.ZodString>;
|
|
121
134
|
/** Named root modules. The name is the entity-key prefix, so keep it stable. */
|
|
122
135
|
roots: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
123
136
|
/** Root module directory, relative to the project root (where `chant.config.*` lives). */
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB;;;;EAA2C,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;IAC9B,0FAA0F;;IAE1F,4EAA4E;;IAE5E,0DAA0D;;IAE1D,0DAA0D;;IAE1D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;;IAEH,+EAA+E;;;;;;kBAE/E,CAAC;AAEH,eAAO,MAAM,qBAAqB;IAChC;;;;;;;OAOG;;;;;;IAEH;;;;;;;OAOG;;;;;;IAEH,gFAAgF;;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB;;;;EAA2C,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;IAC9B,0FAA0F;;IAE1F,4EAA4E;;IAE5E,0DAA0D;;IAE1D,0DAA0D;;IAE1D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;;IAEH,+EAA+E;;;;;;kBAE/E,CAAC;AAEH,eAAO,MAAM,qBAAqB;IAChC;;;;;;;OAOG;;;;;;IAEH;;;;;;;OAOG;;;;;;IAEH;;;;;;;;;;;OAWG;;IAEH,gFAAgF;;QAtEhF,0FAA0F;;QAE1F,4EAA4E;;QAE5E,0DAA0D;;QAE1D,0DAA0D;;QAE1D;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;;QAEH,+EAA+E;;;;;;;kBAsC/E,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,OAAO,QAAQ,yBAAyB,CAAC;IACvC,UAAU,WAAW;QACnB,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC"}
|
package/dist/hcl/descend.d.ts
CHANGED
|
@@ -71,6 +71,13 @@ export interface DescendOptions {
|
|
|
71
71
|
root: string;
|
|
72
72
|
/** Boundary: a source resolving outside this directory is refused. */
|
|
73
73
|
projectRoot: string;
|
|
74
|
+
/**
|
|
75
|
+
* `terraform.moduleRoot`, absolute: when set, the boundary in place of
|
|
76
|
+
* {@link projectRoot} (#2874). A workspace reads a member's root from a
|
|
77
|
+
* reader project outside the workspace, and names the workspace root here,
|
|
78
|
+
* so `../modules/x` stays readable.
|
|
79
|
+
*/
|
|
80
|
+
moduleRoot?: string;
|
|
74
81
|
/** Resolved mode. `"none"` returns immediately with nothing. */
|
|
75
82
|
callModuleType?: "local" | "none";
|
|
76
83
|
/** Injectable parser (tests); defaults to core's lazy-loaded `@cdktn/hcl2json`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descend.d.ts","sourceRoot":"","sources":["../../src/hcl/descend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGjE,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,SAAS,CAAC;AAEjB,sFAAsF;AACtF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEtD,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,2DAA2D;IAC3D,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,sBAAsB,CAYpF;AAED,0CAA0C;AAC1C,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,mFAAmF;IACnF,Q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IACb,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,gEAAgE;IAChE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAuDD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAC9B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,aAAa,CAAC,CAiGxB"}
|
package/dist/hcl/roots.d.ts
CHANGED
|
@@ -49,6 +49,12 @@ export interface RenderTerraformRootsOptions {
|
|
|
49
49
|
* `../` is parsed as a child scope of the root that calls it.
|
|
50
50
|
*/
|
|
51
51
|
callModuleType?: CallModuleType;
|
|
52
|
+
/**
|
|
53
|
+
* `terraform.moduleRoot` (#2874): the directory module sources may resolve
|
|
54
|
+
* within, absolute or relative to {@link projectRoot}. Unset, the project
|
|
55
|
+
* root is the boundary, as it always was.
|
|
56
|
+
*/
|
|
57
|
+
moduleRoot?: string;
|
|
52
58
|
/** Injectable parser (tests); defaults to core's lazy-loaded `@cdktn/hcl2json`. */
|
|
53
59
|
hcl2json?: Hcl2Json;
|
|
54
60
|
}
|
package/dist/hcl/roots.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roots.d.ts","sourceRoot":"","sources":["../../src/hcl/roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;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E,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;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,oBAAoB,CAAC,CAiE/B"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "e6bf54b52851b75554a3ef43cd50c93c32e81bfaf829d615315b04e24239476d",
|
|
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": "
|
|
41
|
+
"composite": "82eca81971e77d283a8f8f5cf743b1cd0dfb1d4d377537fc90638ceea52bcf32"
|
|
42
42
|
}
|
package/dist/manifest.json
CHANGED
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAgElF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAgElF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,aAiQ7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-terraform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@intentius/chant": "^0.
|
|
60
|
+
"@intentius/chant": "^0.95.0",
|
|
61
61
|
"typescript": "^5.9.3",
|
|
62
62
|
"zod": "^4.3.6"
|
|
63
63
|
},
|
package/src/behaviour/predict.ts
CHANGED
|
@@ -169,6 +169,7 @@ export const readTerraformDeclaration: TerraformDeclarationReader = async (cwd)
|
|
|
169
169
|
roots: namespace.roots,
|
|
170
170
|
binary: namespace.binary,
|
|
171
171
|
callModuleType: namespace.callModuleType,
|
|
172
|
+
moduleRoot: namespace.moduleRoot,
|
|
172
173
|
});
|
|
173
174
|
for (const [name, entity] of rendered.entities) {
|
|
174
175
|
const e = entity as unknown as TerraformBehaviourEntity;
|
package/src/config.ts
CHANGED
|
@@ -106,6 +106,19 @@ export const terraformConfigSchema = z.strictObject({
|
|
|
106
106
|
* nothing. See `hcl/descend.ts`.
|
|
107
107
|
*/
|
|
108
108
|
callModuleType: z.enum(["local", "none", "all"]).optional(),
|
|
109
|
+
/**
|
|
110
|
+
* The directory a root's local module sources may resolve within (#2874),
|
|
111
|
+
* absolute or relative to the project root. Unset, it is the project root,
|
|
112
|
+
* or a root's own directory when its `dir` lies outside the project. A
|
|
113
|
+
* source that resolves outside it is refused with a warning, as before.
|
|
114
|
+
*
|
|
115
|
+
* `chant workspace graph` sets it to the workspace root when it reads a
|
|
116
|
+
* `terraform` or `choudoufu` member through a reader project of its own,
|
|
117
|
+
* so a member that calls `../modules/x` keeps its modules. A project
|
|
118
|
+
* rarely needs it: widening the boundary means reading modules the
|
|
119
|
+
* project does not own.
|
|
120
|
+
*/
|
|
121
|
+
moduleRoot: z.string().optional(),
|
|
109
122
|
/** Named root modules. The name is the entity-key prefix, so keep it stable. */
|
|
110
123
|
roots: z.record(z.string(), terraformRootSchema),
|
|
111
124
|
});
|
package/src/hcl/descend.test.ts
CHANGED
|
@@ -105,6 +105,46 @@ describe("descending into local modules", () => {
|
|
|
105
105
|
expect(refused).toContain("../../shared");
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
+
it("reads past the project root when moduleRoot names a wider directory (#2874)", async () => {
|
|
109
|
+
const { entities, warnings } = await renderTerraformRoots({
|
|
110
|
+
projectRoot: join(TREE, "outside"),
|
|
111
|
+
moduleRoot: TREE,
|
|
112
|
+
roots: { app: { dir: "./root" } },
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
expect([...entities.keys()].some((k) => k.includes("/module.shared/"))).toBe(true);
|
|
116
|
+
expect(warnings.some((w) => w.includes("outside the project"))).toBe(false);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("gives an absolute root dir the moduleRoot as its boundary, not its own directory (#2874)", async () => {
|
|
120
|
+
const outside = await renderTerraformRoots({
|
|
121
|
+
projectRoot: join(TREE, "cycle"),
|
|
122
|
+
roots: { app: { dir: join(TREE, "outside", "root") } },
|
|
123
|
+
});
|
|
124
|
+
expect([...outside.entities.keys()].some((k) => k.includes("/module.shared/"))).toBe(false);
|
|
125
|
+
|
|
126
|
+
const widened = await renderTerraformRoots({
|
|
127
|
+
projectRoot: join(TREE, "cycle"),
|
|
128
|
+
moduleRoot: TREE,
|
|
129
|
+
roots: { app: { dir: join(TREE, "outside", "root") } },
|
|
130
|
+
});
|
|
131
|
+
expect([...widened.entities.keys()].some((k) => k.includes("/module.shared/"))).toBe(true);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("refuses a source outside a moduleRoot narrower than the project (#2874)", async () => {
|
|
135
|
+
const wide = await renderTerraformRoots({ projectRoot: TREE, roots: { app: { dir: "./outside/root" } } });
|
|
136
|
+
expect([...wide.entities.keys()].some((k) => k.includes("/module.shared/"))).toBe(true);
|
|
137
|
+
|
|
138
|
+
const { entities, warnings } = await renderTerraformRoots({
|
|
139
|
+
projectRoot: TREE,
|
|
140
|
+
moduleRoot: "./outside",
|
|
141
|
+
roots: { app: { dir: "./outside/root" } },
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
expect([...entities.keys()].some((k) => k.includes("/module.shared/"))).toBe(false);
|
|
145
|
+
expect(warnings.some((w) => w.includes("module.shared") && w.includes("outside the project"))).toBe(true);
|
|
146
|
+
});
|
|
147
|
+
|
|
108
148
|
it("stops on a cycle rather than recursing forever", async () => {
|
|
109
149
|
const { entities, warnings } = await renderTerraformRoots({
|
|
110
150
|
projectRoot: TREE,
|
package/src/hcl/descend.ts
CHANGED
|
@@ -98,6 +98,13 @@ export interface DescendOptions {
|
|
|
98
98
|
root: string;
|
|
99
99
|
/** Boundary: a source resolving outside this directory is refused. */
|
|
100
100
|
projectRoot: string;
|
|
101
|
+
/**
|
|
102
|
+
* `terraform.moduleRoot`, absolute: when set, the boundary in place of
|
|
103
|
+
* {@link projectRoot} (#2874). A workspace reads a member's root from a
|
|
104
|
+
* reader project outside the workspace, and names the workspace root here,
|
|
105
|
+
* so `../modules/x` stays readable.
|
|
106
|
+
*/
|
|
107
|
+
moduleRoot?: string;
|
|
101
108
|
/** Resolved mode. `"none"` returns immediately with nothing. */
|
|
102
109
|
callModuleType?: "local" | "none";
|
|
103
110
|
/** Injectable parser (tests); defaults to core's lazy-loaded `@cdktn/hcl2json`. */
|
|
@@ -190,8 +197,14 @@ export async function descendModules(
|
|
|
190
197
|
// The project root is the boundary, except for a root module configured
|
|
191
198
|
// with a `dir` outside the project entirely (an absolute path to an estate
|
|
192
199
|
// kept elsewhere): there the root's own directory is the boundary, since
|
|
193
|
-
// the project root would refuse every module the root has.
|
|
194
|
-
|
|
200
|
+
// the project root would refuse every module the root has. A declared
|
|
201
|
+
// `moduleRoot` (#2874) replaces both.
|
|
202
|
+
const boundary =
|
|
203
|
+
opts.moduleRoot !== undefined
|
|
204
|
+
? resolve(opts.moduleRoot)
|
|
205
|
+
: isInside(opts.projectRoot, opts.dir)
|
|
206
|
+
? resolve(opts.projectRoot)
|
|
207
|
+
: resolve(opts.dir);
|
|
195
208
|
|
|
196
209
|
/** One scope's calls, with the chain that reached it and the paths already on that chain. */
|
|
197
210
|
const walk = async (
|
package/src/hcl/roots.ts
CHANGED
|
@@ -56,6 +56,12 @@ export interface RenderTerraformRootsOptions {
|
|
|
56
56
|
* `../` is parsed as a child scope of the root that calls it.
|
|
57
57
|
*/
|
|
58
58
|
callModuleType?: CallModuleType;
|
|
59
|
+
/**
|
|
60
|
+
* `terraform.moduleRoot` (#2874): the directory module sources may resolve
|
|
61
|
+
* within, absolute or relative to {@link projectRoot}. Unset, the project
|
|
62
|
+
* root is the boundary, as it always was.
|
|
63
|
+
*/
|
|
64
|
+
moduleRoot?: string;
|
|
59
65
|
/** Injectable parser (tests); defaults to core's lazy-loaded `@cdktn/hcl2json`. */
|
|
60
66
|
hcl2json?: Hcl2Json;
|
|
61
67
|
}
|
|
@@ -97,6 +103,7 @@ export async function renderTerraformRoots(
|
|
|
97
103
|
dir,
|
|
98
104
|
root: name,
|
|
99
105
|
projectRoot: opts.projectRoot,
|
|
106
|
+
...(opts.moduleRoot !== undefined ? { moduleRoot: isAbsolute(opts.moduleRoot) ? opts.moduleRoot : resolve(opts.projectRoot, opts.moduleRoot) } : {}),
|
|
100
107
|
callModuleType: callModuleType.effective,
|
|
101
108
|
hcl2json: opts.hcl2json,
|
|
102
109
|
modeOptions,
|
package/src/plugin.ts
CHANGED
package/workspace-kinds.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Member kinds this lexicon supplies to a chant workspace (#2545). chant reads this file as data and never imports the lexicon. Both probes are behold's, narrowed to the member's own directory: a choudoufu estate is a Terraform root with an estate.chdf.hcl sidecar or a live block, and the lexicon's choudoufu mode (#2103) reads it, so the kind lives here.",
|
|
2
|
+
"$comment": "Member kinds this lexicon supplies to a chant workspace (#2545). chant reads this file as data and never imports the lexicon. Both probes are behold's, narrowed to the member's own directory: a choudoufu estate is a Terraform root with an estate.chdf.hcl sidecar or a live block, and the lexicon's choudoufu mode (#2103) reads it, so the kind lives here. Each kind's graph block is how chant workspace graph reads a member (#2874): a reader project with this lexicon and one root named for the member, with moduleRoot at the workspace root so a member's ../modules calls stay readable.",
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"kinds": [
|
|
5
5
|
{
|
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
"anyFile": [
|
|
11
11
|
"*.tf"
|
|
12
12
|
]
|
|
13
|
+
},
|
|
14
|
+
"graph": {
|
|
15
|
+
"lexicon": "terraform",
|
|
16
|
+
"config": {
|
|
17
|
+
"moduleRoot": "{workspace}",
|
|
18
|
+
"roots": {
|
|
19
|
+
"{member}": {
|
|
20
|
+
"dir": "{dir}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
25
|
},
|
|
15
26
|
{
|
|
@@ -28,6 +39,18 @@
|
|
|
28
39
|
"live"
|
|
29
40
|
]
|
|
30
41
|
}
|
|
42
|
+
},
|
|
43
|
+
"graph": {
|
|
44
|
+
"lexicon": "terraform",
|
|
45
|
+
"config": {
|
|
46
|
+
"binary": "choudoufu",
|
|
47
|
+
"moduleRoot": "{workspace}",
|
|
48
|
+
"roots": {
|
|
49
|
+
"{member}": {
|
|
50
|
+
"dir": "{dir}"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
31
54
|
}
|
|
32
55
|
}
|
|
33
56
|
]
|