@highstate/pulumi 0.4.3 → 0.4.5
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.ts +81 -33
- package/dist/index.mjs +176 -52
- package/package.json +7 -5
package/dist/index.d.ts
CHANGED
@@ -16,7 +16,7 @@ type InputMap<T> = Input<Readonly<Record<string, Input<T>>>>;
|
|
16
16
|
/**
|
17
17
|
* The input or input array type for a value.
|
18
18
|
*/
|
19
|
-
type InputOrArray<T> = Input<T> | InputArray<T
|
19
|
+
type InputOrArray<T> = Input<T> | InputArray<T>;
|
20
20
|
/**
|
21
21
|
* The input of inputs of inputs of inputs, so you got the idea.
|
22
22
|
*/
|
@@ -31,14 +31,7 @@ type DeepInput<T> = [T] extends [Record<string, unknown> | undefined] ? [T] exte
|
|
31
31
|
* @param values The values to merge.
|
32
32
|
* @returns The merged output array.
|
33
33
|
*/
|
34
|
-
declare function
|
35
|
-
/**
|
36
|
-
* Flattens an array of input arrays into a single output array.
|
37
|
-
*
|
38
|
-
* @param array The input array.
|
39
|
-
* @returns The output array.
|
40
|
-
*/
|
41
|
-
declare function flattenInputs<T>(array: InputArray<InputArray<T>>): Output<T[]>;
|
34
|
+
declare function flattenInputs<T>(...values: (InputOrArray<T> | undefined)[]): Output<T[]>;
|
42
35
|
/**
|
43
36
|
* Maps each element of an input array to a new value.
|
44
37
|
* Produces an output array with the same length.
|
@@ -48,8 +41,8 @@ declare function flattenInputs<T>(array: InputArray<InputArray<T>>): Output<T[]>
|
|
48
41
|
* @returns The output array.
|
49
42
|
*/
|
50
43
|
declare function mapInputs<T, U>(array: InputArray<T>, fn: (v: Unwrap<T>, index: number, all: Unwrap<T>[]) => U): Output<U[]>;
|
51
|
-
declare function
|
52
|
-
declare function
|
44
|
+
declare function flatMapInput<T, U>(v1: InputOrArray<T>, v2: InputOrArray<T>, fn: (v: Unwrap<T>, index: number, all: Unwrap<T>[]) => U): Output<U[]>;
|
45
|
+
declare function flatMapInput<T, U>(v1: InputOrArray<T>, v2: InputOrArray<T>, v3: InputOrArray<T>, fn: (v: Unwrap<T>, index: number, all: Unwrap<T>[]) => U): Output<U[]>;
|
53
46
|
/**
|
54
47
|
* Map an optional value to another optional value.
|
55
48
|
*
|
@@ -58,40 +51,92 @@ declare function mergeMapInputs<T, U>(v1: InputOrArray<T>, v2: InputOrArray<T>,
|
|
58
51
|
* @returns The output value, or `undefined` if the input value is `undefined`.
|
59
52
|
*/
|
60
53
|
declare function mapOptional<T, U>(input: T | undefined, func: (value: T) => U): U | undefined;
|
61
|
-
declare function toPromise<T>(
|
54
|
+
declare function toPromise<T>(input: Input<T>): Promise<Unwrap<T>>;
|
62
55
|
declare function singleton<T>(factory: () => T): () => T;
|
63
|
-
declare function
|
56
|
+
declare function providerFactory<TInput>(factory: (name: string) => TInput): (name: string) => TInput;
|
57
|
+
declare function mergeInputObjects<T1 extends Record<string, unknown>, T2 extends Record<string, unknown>>(obj1: Input<T1 | undefined> | undefined, obj2: Input<T2 | undefined> | undefined): Output<T1 & T2>;
|
58
|
+
declare function mergeInputObjects<T1 extends Record<string, unknown>, T2 extends Record<string, unknown>, T3 extends Record<string, unknown>>(obj1: Input<T1 | undefined> | undefined, obj2: Input<T2 | undefined> | undefined, obj3: Input<T3 | undefined> | undefined): Output<T1 & T2 & T3>;
|
59
|
+
declare function normalize<T>(item: T | undefined, collection: T[] | undefined): T[];
|
60
|
+
declare function apply<T, U>(fn: (value: Unwrap<T>) => U): (input: Input<T>) => Output<U>;
|
64
61
|
|
65
|
-
type
|
66
|
-
content: string
|
67
|
-
|
68
|
-
showQRCode?: boolean;
|
69
|
-
fileName?: string;
|
62
|
+
type InstanceTerminalFile = {
|
63
|
+
content: Input<string | undefined>;
|
64
|
+
isBinary?: Input<boolean>;
|
70
65
|
};
|
71
|
-
type
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
66
|
+
type InstanceTerminal = {
|
67
|
+
name: Input<string>;
|
68
|
+
title: Input<string>;
|
69
|
+
description?: Input<string>;
|
70
|
+
image: Input<string>;
|
71
|
+
command: InputArray<string>;
|
72
|
+
cwd?: Input<string | undefined>;
|
73
|
+
env?: InputMap<string | undefined>;
|
74
|
+
files?: InputMap<InstanceTerminalFile | string | undefined>;
|
77
75
|
};
|
78
76
|
type StatusField = {
|
79
|
-
|
80
|
-
|
77
|
+
name: Input<string>;
|
78
|
+
value?: Input<string | undefined>;
|
79
|
+
displayName?: Input<string | undefined>;
|
80
|
+
sensitive?: Input<boolean | undefined>;
|
81
|
+
url?: Input<string | undefined>;
|
82
|
+
};
|
83
|
+
type InstanceFile = {
|
84
|
+
name: Input<string>;
|
85
|
+
contentType: Input<string>;
|
86
|
+
content: Input<string>;
|
87
|
+
};
|
88
|
+
type InstancePageBlock = {
|
89
|
+
type: "markdown";
|
90
|
+
content: Input<string>;
|
91
|
+
} | {
|
92
|
+
type: "qr";
|
93
|
+
content: Input<string>;
|
94
|
+
showContent?: boolean;
|
95
|
+
language?: string;
|
96
|
+
} | {
|
97
|
+
type: "file";
|
98
|
+
fileMeta: Omit<InstanceFile, "content">;
|
99
|
+
};
|
100
|
+
type InstancePage = {
|
101
|
+
name: Input<string>;
|
102
|
+
title: Input<string>;
|
103
|
+
content: InputArray<InstancePageBlock>;
|
104
|
+
};
|
105
|
+
type InstanceTriggerSpec = {
|
106
|
+
type: "before-destroy";
|
107
|
+
} | {
|
108
|
+
type: "schedule";
|
109
|
+
schedule: string;
|
110
|
+
};
|
111
|
+
type InstanceTrigger = {
|
112
|
+
name: Input<string>;
|
113
|
+
title: Input<string>;
|
114
|
+
description?: Input<string>;
|
115
|
+
spec: Input<InstanceTriggerSpec>;
|
81
116
|
};
|
82
117
|
type ExtraOutputs = {
|
83
|
-
$status?:
|
84
|
-
$
|
85
|
-
$
|
118
|
+
$status?: InputMap<Omit<StatusField, "name"> | string | undefined> | InputArray<StatusField | undefined>;
|
119
|
+
$terminals?: InputMap<Omit<InstanceTerminal, "name"> | undefined> | InputArray<InstanceTerminal | undefined>;
|
120
|
+
$pages?: InputMap<Omit<InstancePage, "name"> | undefined> | InputArray<InstancePage | undefined>;
|
121
|
+
$files?: InputMap<Omit<InstanceFile, "name"> | undefined> | InputArray<InstanceFile | undefined>;
|
122
|
+
$triggers?: InputMap<Omit<InstanceTrigger, "name"> | undefined> | InputArray<InstanceTrigger | undefined>;
|
86
123
|
};
|
87
|
-
type
|
124
|
+
type InstanceTriggerInvocation = {
|
125
|
+
name: string;
|
126
|
+
};
|
127
|
+
type OutputMapToDeepInputMap<T extends Record<string, unknown>> = T extends Record<string, never> ? ExtraOutputs : {
|
88
128
|
[K in keyof T]: DeepInput<T[K]>;
|
89
|
-
} &
|
129
|
+
} & ExtraOutputs;
|
90
130
|
interface UnitContext<TArgs extends Record<string, ArgumentValue>, TInputs extends Record<string, unknown>, TOutputs extends Record<string, unknown>, TSecrets extends Record<string, ArgumentValue>> {
|
91
131
|
args: TArgs;
|
132
|
+
instanceId: string;
|
133
|
+
type: string;
|
92
134
|
name: string;
|
93
135
|
secrets: Output<TSecrets>;
|
94
|
-
inputs:
|
136
|
+
inputs: {
|
137
|
+
[K in keyof TInputs]: undefined extends TInputs[K] ? Output<NonNullable<TInputs[K]>> | undefined : Output<TInputs[K]>;
|
138
|
+
};
|
139
|
+
invokedTriggers: InstanceTriggerInvocation[];
|
95
140
|
outputs(this: void, outputs: OutputMapToDeepInputMap<TOutputs>): Promise<unknown>;
|
96
141
|
}
|
97
142
|
type InputSpecToValue<T extends ComponentInputSpec> = T[2] extends true ? Static<T[0]["schema"]>[] : T[1] extends true ? Static<T[0]["schema"]> : Static<T[0]["schema"]> | undefined;
|
@@ -104,4 +149,7 @@ type EntityInput<T extends Entity> = Output<EntityValue<T>>;
|
|
104
149
|
|
105
150
|
declare function getOrCreateSecret<TSecrets extends Record<string, unknown>, TResult extends TSecrets[keyof TSecrets]>(secrets: Output<TSecrets>, key: keyof TSecrets, create: () => Input<TResult>): Output<TResult>;
|
106
151
|
|
107
|
-
|
152
|
+
declare function resolvePackagePath(packageName: string, path: string, parent: string): string;
|
153
|
+
declare function readResolvedPackageFileSync(packageName: string, path: string, parent: string): string;
|
154
|
+
|
155
|
+
export { type DeepInput, type EntityInput, type EntityValue, type ExtraOutputs, type InputArray, type InputMap, type InputOrArray, type InstanceFile, type InstancePage, type InstancePageBlock, type InstanceTerminal, type InstanceTerminalFile, type InstanceTrigger, type InstanceTriggerInvocation, type InstanceTriggerSpec, type StatusField, type UnitContext, apply, flatMapInput, flattenInputs, forUnit, getOrCreateSecret, mapInputs, mapOptional, mergeInputObjects, normalize, providerFactory, readResolvedPackageFileSync, resolvePackagePath, singleton, toPromise };
|
package/dist/index.mjs
CHANGED
@@ -1,19 +1,18 @@
|
|
1
|
-
import { secret, Config, output, getStack,
|
1
|
+
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { secret, Config, output, getStack, StackReference, all } from '@pulumi/pulumi';
|
2
2
|
export * from '@pulumi/pulumi';
|
3
|
-
import { parseInstanceId } from '@highstate/contract';
|
3
|
+
import { getInstanceId, parseInstanceId } from '@highstate/contract';
|
4
4
|
import { Type } from '@sinclair/typebox';
|
5
|
+
import { mapValues, pipe, pickBy } from 'remeda';
|
5
6
|
import { Ajv } from 'ajv';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
function i(...e){return u(o,e)}function o(e,r){let a={};for(let[n,u]of Object.entries(e)){let l=r(u,n,e);a[n]=l;}return a}
|
7
|
+
import { fileURLToPath } from 'node:url';
|
8
|
+
import { readFileSync } from 'node:fs';
|
9
|
+
import { resolve as resolve$1 } from 'node:path';
|
10
|
+
import { resolve } from 'import-meta-resolve';
|
12
11
|
|
13
12
|
const createdSecrets = {};
|
14
13
|
function getOrCreateSecret(secrets, key, create) {
|
15
14
|
return secrets[key].apply((value) => {
|
16
|
-
if (value !==
|
15
|
+
if (value !== void 0) {
|
17
16
|
createdSecrets[key] = value;
|
18
17
|
return value;
|
19
18
|
}
|
@@ -33,7 +32,7 @@ function getStackRef(input) {
|
|
33
32
|
}
|
34
33
|
return stackRefMap.get(key);
|
35
34
|
}
|
36
|
-
function getOutput(unit, input,
|
35
|
+
function getOutput(unit, input, refs) {
|
37
36
|
const entity = unit.entities.get(input.type);
|
38
37
|
if (!entity) {
|
39
38
|
throw new Error(`Entity '${input.type}' not found in the unit '${unit.model.type}'.`);
|
@@ -54,10 +53,11 @@ function getOutput(unit, input, refOrRefs) {
|
|
54
53
|
return input.multiple ? [value2] : value2;
|
55
54
|
});
|
56
55
|
};
|
57
|
-
|
58
|
-
|
56
|
+
const values = output(refs.map((ref) => _getOutput(ref))).apply((values2) => values2.flat());
|
57
|
+
if (!input.multiple) {
|
58
|
+
return values.apply((values2) => values2[0]);
|
59
59
|
}
|
60
|
-
return
|
60
|
+
return values;
|
61
61
|
}
|
62
62
|
function isAnyOfSchema(schema, itemType) {
|
63
63
|
if (schema.anyOf) {
|
@@ -96,7 +96,7 @@ function isBooleanSchema(schema) {
|
|
96
96
|
}
|
97
97
|
function forUnit(unit) {
|
98
98
|
const config = new Config();
|
99
|
-
const args =
|
99
|
+
const args = mapValues(unit.model.args, (arg, argName) => {
|
100
100
|
switch (true) {
|
101
101
|
case isStringSchema(arg.schema): {
|
102
102
|
return arg.required ? config.require(argName) : config.get(argName);
|
@@ -109,7 +109,7 @@ function forUnit(unit) {
|
|
109
109
|
}
|
110
110
|
default: {
|
111
111
|
const value = arg.required ? config.requireObject(argName) : config.getObject(argName);
|
112
|
-
if (value ===
|
112
|
+
if (value === void 0) return void 0;
|
113
113
|
if (!ajv.validate(arg.schema, value)) {
|
114
114
|
throw new Error(`Invalid config for '${argName}': ${ajv.errorsText()}`);
|
115
115
|
}
|
@@ -118,7 +118,7 @@ function forUnit(unit) {
|
|
118
118
|
}
|
119
119
|
});
|
120
120
|
const secrets = output(
|
121
|
-
|
121
|
+
mapValues(unit.model.secrets, (secret, secretName) => {
|
122
122
|
switch (true) {
|
123
123
|
case isStringSchema(secret.schema): {
|
124
124
|
return secret.required ? config.requireSecret(secretName) : config.getSecret(secretName);
|
@@ -139,33 +139,45 @@ function forUnit(unit) {
|
|
139
139
|
}
|
140
140
|
})
|
141
141
|
);
|
142
|
-
const inputs =
|
143
|
-
|
144
|
-
|
145
|
-
if (
|
146
|
-
|
147
|
-
return output([]);
|
148
|
-
}
|
149
|
-
return output(undefined);
|
142
|
+
const inputs = mapValues(unit.model.inputs, (input, inputName) => {
|
143
|
+
const value = input.required ? config.requireObject(`input.${inputName}`) : config.getObject(`input.${inputName}`);
|
144
|
+
if (!value) {
|
145
|
+
if (input.multiple) {
|
146
|
+
return output([]);
|
150
147
|
}
|
151
|
-
return
|
152
|
-
}
|
153
|
-
|
148
|
+
return void 0;
|
149
|
+
}
|
150
|
+
return getOutput(unit, input, value);
|
151
|
+
});
|
152
|
+
const type = unit.model.type;
|
153
|
+
const name = getStack();
|
154
154
|
return {
|
155
155
|
args,
|
156
|
-
|
156
|
+
instanceId: getInstanceId(type, name),
|
157
|
+
type,
|
158
|
+
name,
|
157
159
|
secrets,
|
158
160
|
inputs,
|
161
|
+
invokedTriggers: config.getObject("$invokedTriggers") ?? [],
|
159
162
|
outputs: async (outputs) => {
|
160
|
-
const result =
|
163
|
+
const result = mapValues(outputs, (outputValue, outputName) => {
|
164
|
+
if (outputName === "$status") {
|
165
|
+
return output(outputValue).apply(mapStatus);
|
166
|
+
}
|
167
|
+
if (outputName === "$pages") {
|
168
|
+
return output(outputValue).apply(mapPages);
|
169
|
+
}
|
170
|
+
if (outputName === "$files") {
|
171
|
+
return output(outputValue).apply(mapFiles);
|
172
|
+
}
|
173
|
+
if (outputName === "$terminals") {
|
174
|
+
return output(outputValue).apply(mapTerminals);
|
175
|
+
}
|
176
|
+
if (outputName === "$triggers") {
|
177
|
+
return output(outputValue).apply(mapTriggers);
|
178
|
+
}
|
161
179
|
if (outputName.startsWith("$")) {
|
162
|
-
|
163
|
-
return output(outputValue);
|
164
|
-
}
|
165
|
-
for (const key of Object.keys(outputValue)) {
|
166
|
-
outputValue[key] = output(outputValue[key]);
|
167
|
-
}
|
168
|
-
return outputValue;
|
180
|
+
throw new Error(`Unknown extra output '${outputName}'.`);
|
169
181
|
}
|
170
182
|
const outputModel = unit.model.outputs[outputName];
|
171
183
|
if (!outputModel) {
|
@@ -195,8 +207,83 @@ function forUnit(unit) {
|
|
195
207
|
function outputToPromise(o) {
|
196
208
|
return new Promise((resolve) => output(o).apply(resolve));
|
197
209
|
}
|
210
|
+
function mapStatus(status) {
|
211
|
+
if (!status) {
|
212
|
+
return [];
|
213
|
+
}
|
214
|
+
if (Array.isArray(status)) {
|
215
|
+
return status.filter((field) => !!field?.value);
|
216
|
+
}
|
217
|
+
return Object.entries(status).map(([name, field]) => {
|
218
|
+
if (!field) {
|
219
|
+
return void 0;
|
220
|
+
}
|
221
|
+
if (typeof field === "string") {
|
222
|
+
return { name, value: field };
|
223
|
+
}
|
224
|
+
return { ...field, name };
|
225
|
+
}).filter((field) => !!field?.value);
|
226
|
+
}
|
227
|
+
function mapPages(pages) {
|
228
|
+
if (!pages) {
|
229
|
+
return [];
|
230
|
+
}
|
231
|
+
if (Array.isArray(pages)) {
|
232
|
+
return pages.filter((page) => !!page);
|
233
|
+
}
|
234
|
+
return Object.entries(pages).filter(([, page]) => !!page).map(([name, page]) => ({ ...page, name }));
|
235
|
+
}
|
236
|
+
function mapFiles(files) {
|
237
|
+
if (!files) {
|
238
|
+
return [];
|
239
|
+
}
|
240
|
+
if (Array.isArray(files)) {
|
241
|
+
return files.filter((file) => !!file);
|
242
|
+
}
|
243
|
+
return Object.entries(files).filter(([, file]) => !!file).map(([name, file]) => ({ ...file, name }));
|
244
|
+
}
|
245
|
+
function mapTerminals(terminals) {
|
246
|
+
if (!terminals) {
|
247
|
+
return [];
|
248
|
+
}
|
249
|
+
if (!Array.isArray(terminals)) {
|
250
|
+
terminals = Object.entries(terminals).map(([name, terminal]) => {
|
251
|
+
if (!terminal) {
|
252
|
+
return void 0;
|
253
|
+
}
|
254
|
+
return { ...terminal, name };
|
255
|
+
});
|
256
|
+
}
|
257
|
+
return terminals.filter((terminal) => !!terminal).map((terminal) => {
|
258
|
+
if (!terminal.files) {
|
259
|
+
return terminal;
|
260
|
+
}
|
261
|
+
return {
|
262
|
+
...terminal,
|
263
|
+
files: pipe(
|
264
|
+
terminal.files,
|
265
|
+
mapValues((file) => {
|
266
|
+
if (typeof file === "string") {
|
267
|
+
return { content: file };
|
268
|
+
}
|
269
|
+
return file;
|
270
|
+
}),
|
271
|
+
pickBy((value) => !!value?.content)
|
272
|
+
)
|
273
|
+
};
|
274
|
+
});
|
275
|
+
}
|
276
|
+
function mapTriggers(triggers) {
|
277
|
+
if (!triggers) {
|
278
|
+
return [];
|
279
|
+
}
|
280
|
+
if (Array.isArray(triggers)) {
|
281
|
+
return triggers.filter((trigger) => !!trigger);
|
282
|
+
}
|
283
|
+
return Object.entries(triggers).filter(([, trigger]) => !!trigger).map(([name, trigger]) => ({ ...trigger, name }));
|
284
|
+
}
|
198
285
|
|
199
|
-
function
|
286
|
+
function flattenInputs(...values) {
|
200
287
|
return all(values).apply((allValues) => {
|
201
288
|
const result = [];
|
202
289
|
for (const value of allValues) {
|
@@ -209,38 +296,35 @@ function mergeInputs(...values) {
|
|
209
296
|
return result;
|
210
297
|
});
|
211
298
|
}
|
212
|
-
function flattenInputs(array) {
|
213
|
-
return output(array).apply((array2) => array2.flat());
|
214
|
-
}
|
215
299
|
function mapInputs(array, fn) {
|
216
|
-
return output(array).apply(
|
217
|
-
|
218
|
-
);
|
300
|
+
return output(array).apply((array2) => {
|
301
|
+
return array2?.map((v, index) => fn(v, index, array2)) ?? [];
|
302
|
+
});
|
219
303
|
}
|
220
|
-
function
|
304
|
+
function flatMapInput(...args) {
|
221
305
|
const fn = args.pop();
|
222
306
|
const values = args;
|
223
|
-
return mapInputs(
|
307
|
+
return mapInputs(flattenInputs(...values), fn);
|
224
308
|
}
|
225
309
|
function mapOptional(input, func) {
|
226
|
-
if (input ===
|
227
|
-
return
|
310
|
+
if (input === void 0) {
|
311
|
+
return void 0;
|
228
312
|
}
|
229
313
|
return func(input);
|
230
314
|
}
|
231
|
-
function toPromise(
|
232
|
-
return new Promise((resolve) =>
|
315
|
+
function toPromise(input) {
|
316
|
+
return new Promise((resolve) => output(input).apply(resolve));
|
233
317
|
}
|
234
318
|
function singleton(factory) {
|
235
319
|
let instance;
|
236
320
|
return () => {
|
237
|
-
if (instance ===
|
321
|
+
if (instance === void 0) {
|
238
322
|
instance = factory();
|
239
323
|
}
|
240
324
|
return instance;
|
241
325
|
};
|
242
326
|
}
|
243
|
-
function
|
327
|
+
function providerFactory(factory) {
|
244
328
|
const instances = /* @__PURE__ */ new Map();
|
245
329
|
return (name) => {
|
246
330
|
if (!instances.has(name)) {
|
@@ -249,5 +333,45 @@ function namedSingleton(factory) {
|
|
249
333
|
return instances.get(name);
|
250
334
|
};
|
251
335
|
}
|
336
|
+
function mergeInputObjects(...objects) {
|
337
|
+
return output(objects).apply((array) => {
|
338
|
+
return Object.assign({}, ...array);
|
339
|
+
});
|
340
|
+
}
|
341
|
+
function normalize(item, collection) {
|
342
|
+
if (item && collection) {
|
343
|
+
return [item, ...collection];
|
344
|
+
}
|
345
|
+
if (item) {
|
346
|
+
return [item];
|
347
|
+
}
|
348
|
+
return collection ?? [];
|
349
|
+
}
|
350
|
+
function apply(fn) {
|
351
|
+
return (input) => output(input).apply(fn);
|
352
|
+
}
|
353
|
+
|
354
|
+
function resolvePackagePath(packageName, path, parent) {
|
355
|
+
let resolved = fileURLToPath(resolve(packageName, parent));
|
356
|
+
let singlePackageName = packageName;
|
357
|
+
if (packageName.startsWith("@")) {
|
358
|
+
singlePackageName = packageName.split("/")[1];
|
359
|
+
} else {
|
360
|
+
singlePackageName = packageName.split("/")[0];
|
361
|
+
}
|
362
|
+
if (!singlePackageName) {
|
363
|
+
throw new Error(`Invalid package name: ${packageName}`);
|
364
|
+
}
|
365
|
+
while (!resolved.endsWith(singlePackageName)) {
|
366
|
+
if (resolved === "/") {
|
367
|
+
throw new Error(`Could not find package root of "${packageName}" in resolved path`);
|
368
|
+
}
|
369
|
+
resolved = resolve$1(resolved, "..");
|
370
|
+
}
|
371
|
+
return resolve$1(resolved, path);
|
372
|
+
}
|
373
|
+
function readResolvedPackageFileSync(packageName, path, parent) {
|
374
|
+
return readFileSync(resolvePackagePath(packageName, path, parent), "utf-8");
|
375
|
+
}
|
252
376
|
|
253
|
-
export { flattenInputs, forUnit, getOrCreateSecret, mapInputs, mapOptional,
|
377
|
+
export { apply, flatMapInput, flattenInputs, forUnit, getOrCreateSecret, mapInputs, mapOptional, mergeInputObjects, normalize, providerFactory, readResolvedPackageFileSync, resolvePackagePath, singleton, toPromise };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/pulumi",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.5",
|
4
4
|
"type": "module",
|
5
5
|
"module": "dist/index.mjs",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -20,13 +20,15 @@
|
|
20
20
|
"build": "pkgroll --tsconfig=tsconfig.build.json"
|
21
21
|
},
|
22
22
|
"dependencies": {
|
23
|
-
"@highstate/contract": "^0.4.
|
24
|
-
"@pulumi/pulumi": "^3.
|
23
|
+
"@highstate/contract": "^0.4.5",
|
24
|
+
"@pulumi/pulumi": "^3.152.0",
|
25
25
|
"@sinclair/typebox": "^0.34.11",
|
26
|
-
"ajv": "^8.17.1"
|
26
|
+
"ajv": "^8.17.1",
|
27
|
+
"import-meta-resolve": "^4.1.0",
|
28
|
+
"remeda": "^2.21.0"
|
27
29
|
},
|
28
30
|
"devDependencies": {
|
29
31
|
"pkgroll": "^2.5.1"
|
30
32
|
},
|
31
|
-
"gitHead": "
|
33
|
+
"gitHead": "61f6f1b0ff3f97bd7ed5e37c26302f094b892392"
|
32
34
|
}
|