@terraforge/terraform 0.0.11 → 0.0.13
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/index.d.mts +1 -2
- package/dist/index.mjs +15 -6
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -107,7 +107,6 @@ declare class Stack extends Group {
|
|
|
107
107
|
readonly app: App;
|
|
108
108
|
readonly dependencies: Set<Stack>;
|
|
109
109
|
constructor(app: App, name: string);
|
|
110
|
-
dependsOn(...stacks: Stack[]): this;
|
|
111
110
|
}
|
|
112
111
|
//#endregion
|
|
113
112
|
//#region ../core/src/meta.d.ts
|
|
@@ -115,7 +114,7 @@ type Tag = 'resource' | 'data';
|
|
|
115
114
|
type State = Record<string, any>;
|
|
116
115
|
type Config = {
|
|
117
116
|
/** Specify additional explicit dependencies in addition to the ones in the dependency graph. */
|
|
118
|
-
dependsOn?: Resource
|
|
117
|
+
dependsOn?: Array<Resource | DataSource>;
|
|
119
118
|
/** Pass an ID of an explicitly configured provider, instead of using the default provider. */
|
|
120
119
|
provider?: string;
|
|
121
120
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -301,12 +301,17 @@ var TerraformProvider = class {
|
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/plugin/diagnostic.ts
|
|
303
303
|
var DiagnosticsError = class extends Error {
|
|
304
|
-
diagnostics;
|
|
305
304
|
constructor(diagnostics) {
|
|
306
|
-
super(diagnostics
|
|
305
|
+
super(formatDiagnosticErrorMessage(diagnostics));
|
|
307
306
|
this.diagnostics = diagnostics;
|
|
308
307
|
}
|
|
309
308
|
};
|
|
309
|
+
const formatDiagnosticErrorMessage = (diagnostics) => {
|
|
310
|
+
if (diagnostics.length === 0) return "Unknown diagnostic error";
|
|
311
|
+
const diagnostic = diagnostics[0];
|
|
312
|
+
if (diagnostic.detail) return `${diagnostic.summary}\n\n${diagnostic.detail}`;
|
|
313
|
+
return diagnostic.summary;
|
|
314
|
+
};
|
|
310
315
|
const throwDiagnosticError = (response) => {
|
|
311
316
|
return new DiagnosticsError(response.diagnostics.map((item) => ({
|
|
312
317
|
severity: item.severity === 1 ? "error" : "warning",
|
|
@@ -2344,8 +2349,10 @@ const createTerraformProxy = (props) => {
|
|
|
2344
2349
|
const type = snakeCase([props.namespace, ...ns].join("_"));
|
|
2345
2350
|
const meta = createMeta("resource", `terraform:${props.namespace}:${config?.provider ?? "default"}`, parent, type, id, input, config);
|
|
2346
2351
|
const resource = createResourceProxy((key) => {
|
|
2347
|
-
if (typeof key === "string")
|
|
2348
|
-
|
|
2352
|
+
if (typeof key === "string") {
|
|
2353
|
+
if (key === "urn") return meta.urn;
|
|
2354
|
+
return meta.output((data) => data[key]);
|
|
2355
|
+
} else if (key === nodeMetaSymbol) return meta;
|
|
2349
2356
|
});
|
|
2350
2357
|
parent.add(resource);
|
|
2351
2358
|
return resource;
|
|
@@ -2354,8 +2361,10 @@ const createTerraformProxy = (props) => {
|
|
|
2354
2361
|
const type = snakeCase([props.namespace, ...ns].join("_"));
|
|
2355
2362
|
const meta = createMeta("data", `terraform:${props.namespace}:${config?.provider ?? "default"}`, parent, type, id, input, config);
|
|
2356
2363
|
const dataSource = createResourceProxy((key) => {
|
|
2357
|
-
if (typeof key === "string")
|
|
2358
|
-
|
|
2364
|
+
if (typeof key === "string") {
|
|
2365
|
+
if (key === "urn") return meta.urn;
|
|
2366
|
+
return meta.output((data) => data[key]);
|
|
2367
|
+
} else if (key === nodeMetaSymbol) return meta;
|
|
2359
2368
|
});
|
|
2360
2369
|
parent.add(dataSource);
|
|
2361
2370
|
return dataSource;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terraforge/terraform",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "bun test"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@terraforge/core": "0.0.
|
|
29
|
+
"@terraforge/core": "0.0.11"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@grpc/grpc-js": "1.12.6",
|