@powerlines/plugin-pulumi 0.1.8 → 0.2.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.
@@ -1,4 +1,4 @@
1
- import { LocalWorkspaceOptions, Stack } from '@pulumi/pulumi/automation';
1
+ import { StackSettings, Stack, LocalWorkspaceOptions, PulumiFn } from '@pulumi/pulumi/automation';
2
2
  import { Format } from '@storm-software/build-tools/types';
3
3
  import { LogLevelLabel } from '@storm-software/config-tools/types';
4
4
  import { StormWorkspaceConfig } from '@storm-software/config/types';
@@ -9,13 +9,11 @@ import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
9
9
  import { EnvPaths } from '@stryke/env/get-env-paths';
10
10
  import { PackageJson } from '@stryke/types/package-json';
11
11
  import { Jiti } from 'jiti';
12
- import { ParserOptions, ParseResult } from 'oxc-parser';
13
12
  import { Range } from 'semver';
14
13
  import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult, ExternalIdResult, HookFilter, UnpluginOptions } from 'unplugin';
14
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
15
15
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
16
16
  import ts from 'typescript';
17
- import { PrimitiveJsonValue } from '@stryke/json/types';
18
- import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
19
17
  import { ArrayValues } from '@stryke/types/array';
20
18
 
21
19
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
@@ -154,87 +152,20 @@ interface BuildConfig {
154
152
  }
155
153
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
156
154
 
157
- type ReflectionMode = "default" | "explicit" | "never";
158
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
159
- /**
160
- * Defines the level of reflection to be used during the transpilation process.
161
- *
162
- * @remarks
163
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
164
- * - `minimal` - Only the essential type information is captured.
165
- * - `normal` - Additional type information is captured, including some contextual data.
166
- * - `verbose` - All available type information is captured, including detailed contextual data.
167
- */
168
- type ReflectionLevel = "minimal" | "normal" | "verbose";
169
- interface DeepkitOptions {
170
- /**
171
- * Either true to activate reflection for all files compiled using this tsconfig,
172
- * or a list of globs/file paths relative to this tsconfig.json.
173
- * Globs/file paths can be prefixed with a ! to exclude them.
174
- */
175
- reflection?: RawReflectionMode;
176
- /**
177
- * Defines the level of reflection to be used during the transpilation process.
178
- *
179
- * @remarks
180
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
181
- * - `minimal` - Only the essential type information is captured.
182
- * - `normal` - Additional type information is captured, including some contextual data.
183
- * - `verbose` - All available type information is captured, including detailed contextual data.
184
- */
185
- reflectionLevel?: ReflectionLevel;
186
- }
187
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
188
- /**
189
- * The TypeScript compiler configuration.
190
- *
191
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
192
- */
193
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
194
- /**
195
- * Either true to activate reflection for all files compiled using this tsconfig,
196
- * or a list of globs/file paths relative to this tsconfig.json.
197
- * Globs/file paths can be prefixed with a ! to exclude them.
198
- */
199
- reflection?: RawReflectionMode;
200
- /**
201
- * Defines the level of reflection to be used during the transpilation process.
202
- *
203
- * @remarks
204
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
205
- * - `minimal` - Only the essential type information is captured.
206
- * - `normal` - Additional type information is captured, including some contextual data.
207
- * - `verbose` - All available type information is captured, including detailed contextual data.
208
- */
209
- reflectionLevel?: ReflectionLevel;
210
- /**
211
- * Instructs the TypeScript compiler how to compile `.ts` files.
212
- */
213
- compilerOptions?: TSCompilerOptions;
214
- }
215
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
216
- originalTsconfigJson: TsConfigJson;
217
- tsconfigJson: TSConfig;
218
- tsconfigFilePath: string;
219
- };
220
-
221
155
  declare const __VFS_PATCH__ = "__VFS_PATCH__";
222
156
  declare const __VFS_REVERT__ = "__VFS_REVERT__";
223
157
  type OutputModeType = "fs" | "virtual";
224
- interface VirtualFile {
158
+ interface VirtualFileMetadata {
225
159
  /**
226
- * The unique identifier for the virtual file.
227
- *
228
- * @remarks
229
- * If no specific id is provided, it defaults to the file's {@link path}.
160
+ * The identifier for the file data.
230
161
  */
231
162
  id: string;
232
163
  /**
233
- * Additional metadata associated with the virtual file.
164
+ * The timestamp of the virtual file.
234
165
  */
235
- details: Record<string, PrimitiveJsonValue>;
166
+ timestamp: number;
236
167
  /**
237
- * The variant of the file.
168
+ * The type of the file.
238
169
  *
239
170
  * @remarks
240
171
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
@@ -242,52 +173,72 @@ interface VirtualFile {
242
173
  * - `entry`: Indicates that the file is an entry point for execution.
243
174
  * - `normal`: Indicates that the file is a standard file without any special role.
244
175
  */
245
- variant: string;
176
+ type: string;
246
177
  /**
247
178
  * The output mode of the file.
248
- *
249
- * @remarks
250
- * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
251
- */
252
- mode: OutputModeType;
253
- /**
254
- * A virtual (or actual) path to the file in the file system.
255
179
  */
256
- path: string;
180
+ mode: string;
257
181
  /**
258
- * The contents of the file.
182
+ * Additional metadata associated with the file.
259
183
  */
260
- code: string | NodeJS.ArrayBufferView;
184
+ properties: Record<string, string>;
261
185
  }
262
- interface VirtualFileMetadata {
186
+ interface VirtualFileData {
263
187
  /**
264
188
  * The identifier for the file data.
265
189
  */
266
- id: string;
190
+ id?: string;
267
191
  /**
268
- * The variant of the file.
192
+ * The contents of the virtual file.
269
193
  */
270
- variant: string;
194
+ code: string;
195
+ /**
196
+ * The type of the file.
197
+ *
198
+ * @remarks
199
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
200
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
201
+ * - `entry`: Indicates that the file is an entry point for execution.
202
+ * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
203
+ * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
204
+ * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
205
+ * - `normal`: Indicates that the file is a standard file without any special role.
206
+ */
207
+ type?: string;
271
208
  /**
272
209
  * The output mode of the file.
273
210
  */
274
- mode: string;
211
+ mode?: string;
275
212
  /**
276
213
  * Additional metadata associated with the file.
277
214
  */
278
- properties: Record<string, string>;
215
+ properties?: Record<string, string>;
216
+ }
217
+ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
218
+ /**
219
+ * An additional name for the file.
220
+ */
221
+ path: string;
222
+ /**
223
+ * The timestamp of the virtual file.
224
+ */
225
+ timestamp: number;
279
226
  }
280
227
  interface ResolveFSOptions {
281
228
  mode?: OutputModeType;
282
229
  }
283
230
  type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
284
231
  interface PowerlinesWriteFileOptions extends ResolveFSOptions {
232
+ /**
233
+ * Should the file skip formatting before being written?
234
+ *
235
+ * @defaultValue false
236
+ */
285
237
  skipFormat?: boolean;
286
238
  }
287
239
  type NodeWriteFileOptions = WriteFileOptions$1;
288
240
  type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
289
- type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
290
- type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
241
+ type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
291
242
  interface ResolvePathOptions extends ResolveFSOptions {
292
243
  /**
293
244
  * Should the resolved path include the file extension?
@@ -302,7 +253,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
302
253
  /**
303
254
  * The type of the path to resolve.
304
255
  */
305
- type?: "file" | "directory";
256
+ pathType?: "file" | "directory";
306
257
  }
307
258
  interface VirtualFileSystemInterface {
308
259
  /**
@@ -591,6 +542,70 @@ interface VirtualFileSystemInterface {
591
542
  dispose: () => Promise<void>;
592
543
  }
593
544
 
545
+ type ReflectionMode = "default" | "explicit" | "never";
546
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
547
+ /**
548
+ * Defines the level of reflection to be used during the transpilation process.
549
+ *
550
+ * @remarks
551
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
552
+ * - `minimal` - Only the essential type information is captured.
553
+ * - `normal` - Additional type information is captured, including some contextual data.
554
+ * - `verbose` - All available type information is captured, including detailed contextual data.
555
+ */
556
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
557
+ interface DeepkitOptions {
558
+ /**
559
+ * Either true to activate reflection for all files compiled using this tsconfig,
560
+ * or a list of globs/file paths relative to this tsconfig.json.
561
+ * Globs/file paths can be prefixed with a ! to exclude them.
562
+ */
563
+ reflection?: RawReflectionMode;
564
+ /**
565
+ * Defines the level of reflection to be used during the transpilation process.
566
+ *
567
+ * @remarks
568
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
569
+ * - `minimal` - Only the essential type information is captured.
570
+ * - `normal` - Additional type information is captured, including some contextual data.
571
+ * - `verbose` - All available type information is captured, including detailed contextual data.
572
+ */
573
+ reflectionLevel?: ReflectionLevel;
574
+ }
575
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
576
+ /**
577
+ * The TypeScript compiler configuration.
578
+ *
579
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
580
+ */
581
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
582
+ /**
583
+ * Either true to activate reflection for all files compiled using this tsconfig,
584
+ * or a list of globs/file paths relative to this tsconfig.json.
585
+ * Globs/file paths can be prefixed with a ! to exclude them.
586
+ */
587
+ reflection?: RawReflectionMode;
588
+ /**
589
+ * Defines the level of reflection to be used during the transpilation process.
590
+ *
591
+ * @remarks
592
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
593
+ * - `minimal` - Only the essential type information is captured.
594
+ * - `normal` - Additional type information is captured, including some contextual data.
595
+ * - `verbose` - All available type information is captured, including detailed contextual data.
596
+ */
597
+ reflectionLevel?: ReflectionLevel;
598
+ /**
599
+ * Instructs the TypeScript compiler how to compile `.ts` files.
600
+ */
601
+ compilerOptions?: TSCompilerOptions;
602
+ }
603
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
604
+ originalTsconfigJson: TsConfigJson;
605
+ tsconfigJson: TSConfig;
606
+ tsconfigFilePath: string;
607
+ };
608
+
594
609
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
595
610
  /**
596
611
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1138,7 +1153,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1138
1153
  * @param path - An optional path to write the builtin file to
1139
1154
  * @param options - Options for writing the file
1140
1155
  */
1141
- writeBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1156
+ emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1142
1157
  /**
1143
1158
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1144
1159
  *
@@ -1146,11 +1161,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1146
1161
  * @param path - An optional path to write the entry file to
1147
1162
  * @param options - Options for writing the file
1148
1163
  */
1149
- writeEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1150
- /**
1151
- * Parses the source code and returns a {@link ParseResult} object.
1152
- */
1153
- parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
1164
+ emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1154
1165
  /**
1155
1166
  * A function to update the context fields using a new user configuration options
1156
1167
  */
@@ -1372,6 +1383,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
1372
1383
  resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
1373
1384
  isEntry: boolean;
1374
1385
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
1386
+ /**
1387
+ * An API object that can be used for inter-plugin communication.
1388
+ *
1389
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
1390
+ */
1391
+ api?: Record<string, any>;
1375
1392
  };
1376
1393
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
1377
1394
  [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
@@ -1421,28 +1438,60 @@ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginC
1421
1438
  applyToEnvironment?: (environment: EnvironmentResolvedConfig) => MaybePromise<boolean | Plugin<any>>;
1422
1439
  }
1423
1440
 
1424
- interface PulumiPluginOptions {
1425
- /**
1426
- * The associated stack name.
1427
- */
1428
- stackName?: string;
1429
- /**
1430
- * The working directory of the program.
1431
- *
1432
- * @defaultValue "\{artifactsPath\}/infrastructure"
1433
- */
1434
- workDir?: string;
1441
+ interface PulumiPluginBaseOptions {
1435
1442
  /**
1436
1443
  * Whether to destroy the stack during the `destroy` lifecycle phase.
1437
1444
  *
1438
1445
  * @defaultValue false
1439
1446
  */
1440
1447
  destroy?: boolean;
1448
+ /**
1449
+ * Additional stack settings.
1450
+ */
1451
+ settings?: StackSettings;
1452
+ }
1453
+ interface PulumiPluginCreateStackOptions extends PulumiPluginBaseOptions {
1454
+ /**
1455
+ * The associated stack name.
1456
+ */
1457
+ stackName?: string;
1441
1458
  /**
1442
1459
  * Additional options for the Pulumi Workspace.
1443
1460
  */
1444
1461
  options?: LocalWorkspaceOptions;
1445
1462
  }
1463
+ interface PulumiPluginExistingStackOptions extends PulumiPluginBaseOptions {
1464
+ /**
1465
+ * The Pulumi Stack instance to use for deployment operations.
1466
+ */
1467
+ stack?: Stack;
1468
+ }
1469
+ interface PulumiPluginExistingStackOptions {
1470
+ /**
1471
+ * The Pulumi Stack instance to use for deployment operations.
1472
+ */
1473
+ stack?: Stack;
1474
+ }
1475
+ interface PulumiPluginCreateStackInlineOptions extends PulumiPluginCreateStackOptions {
1476
+ /**
1477
+ * The associated project name.
1478
+ */
1479
+ projectName?: string;
1480
+ /**
1481
+ * The inline (in-process) Pulumi program to use with update and preview operations.
1482
+ */
1483
+ program?: PulumiFn;
1484
+ }
1485
+ interface PulumiPluginCreateStackLocalOptions extends PulumiPluginCreateStackOptions {
1486
+ /**
1487
+ * The working directory of the program.
1488
+ *
1489
+ * @defaultValue "\{artifactsPath\}/infrastructure"
1490
+ */
1491
+ workDir?: string;
1492
+ }
1493
+ type PulumiPluginOptions = PulumiPluginExistingStackOptions | PulumiPluginCreateStackInlineOptions | PulumiPluginCreateStackLocalOptions;
1494
+ type PulumiPluginResolvedOptions = (Omit<PulumiPluginExistingStackOptions, "stack"> & Required<Pick<PulumiPluginExistingStackOptions, "stack">>) | (Omit<PulumiPluginCreateStackInlineOptions, "stackName" | "projectName" | "program"> & Required<Pick<PulumiPluginCreateStackInlineOptions, "stackName" | "projectName" | "program">>) | (Omit<PulumiPluginCreateStackLocalOptions, "stackName" | "workDir"> & Required<Pick<PulumiPluginCreateStackLocalOptions, "stackName" | "workDir">>);
1446
1495
  interface PulumiPluginUserConfig extends UserConfig {
1447
1496
  deploy: {
1448
1497
  pulumi: PulumiPluginOptions;
@@ -1450,15 +1499,19 @@ interface PulumiPluginUserConfig extends UserConfig {
1450
1499
  }
1451
1500
  interface PulumiPluginResolvedConfig extends ResolvedConfig {
1452
1501
  deploy: {
1453
- pulumi: Omit<PulumiPluginOptions, "stackName" | "workDir"> & Required<Pick<PulumiPluginOptions, "stackName" | "workDir">>;
1502
+ pulumi: PulumiPluginResolvedOptions;
1454
1503
  };
1455
1504
  }
1456
- type PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
1457
- pulumi: Stack;
1458
- };
1505
+ type PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PluginContext<TResolvedConfig>;
1506
+ declare type __ΩPulumiPluginBaseOptions = any[];
1507
+ declare type __ΩPulumiPluginExistingStackOptions = any[];
1508
+ declare type __ΩPulumiPluginCreateStackOptions = any[];
1509
+ declare type __ΩPulumiPluginCreateStackInlineOptions = any[];
1510
+ declare type __ΩPulumiPluginCreateStackLocalOptions = any[];
1459
1511
  declare type __ΩPulumiPluginOptions = any[];
1512
+ declare type __ΩPulumiPluginResolvedOptions = any[];
1460
1513
  declare type __ΩPulumiPluginUserConfig = any[];
1461
1514
  declare type __ΩPulumiPluginResolvedConfig = any[];
1462
1515
  declare type __ΩPulumiPluginContext = any[];
1463
1516
 
1464
- export type { PulumiPluginContext as P, __ΩPulumiPluginOptions as _, PulumiPluginOptions as a, Plugin as b, PulumiPluginUserConfig as c, PulumiPluginResolvedConfig as d, __ΩPulumiPluginUserConfig as e, __ΩPulumiPluginResolvedConfig as f, __ΩPulumiPluginContext as g };
1517
+ export type { PulumiPluginContext as P, __ΩPulumiPluginBaseOptions as _, PulumiPluginOptions as a, Plugin as b, PulumiPluginBaseOptions as c, PulumiPluginExistingStackOptions as d, PulumiPluginCreateStackOptions as e, PulumiPluginCreateStackInlineOptions as f, PulumiPluginCreateStackLocalOptions as g, PulumiPluginResolvedOptions as h, PulumiPluginUserConfig as i, PulumiPluginResolvedConfig as j, __ΩPulumiPluginExistingStackOptions as k, __ΩPulumiPluginCreateStackOptions as l, __ΩPulumiPluginCreateStackInlineOptions as m, __ΩPulumiPluginCreateStackLocalOptions as n, __ΩPulumiPluginOptions as o, __ΩPulumiPluginResolvedOptions as p, __ΩPulumiPluginUserConfig as q, __ΩPulumiPluginResolvedConfig as r, __ΩPulumiPluginContext as s };
@@ -1,4 +1,4 @@
1
- import { LocalWorkspaceOptions, Stack } from '@pulumi/pulumi/automation';
1
+ import { StackSettings, Stack, LocalWorkspaceOptions, PulumiFn } from '@pulumi/pulumi/automation';
2
2
  import { Format } from '@storm-software/build-tools/types';
3
3
  import { LogLevelLabel } from '@storm-software/config-tools/types';
4
4
  import { StormWorkspaceConfig } from '@storm-software/config/types';
@@ -9,13 +9,11 @@ import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
9
9
  import { EnvPaths } from '@stryke/env/get-env-paths';
10
10
  import { PackageJson } from '@stryke/types/package-json';
11
11
  import { Jiti } from 'jiti';
12
- import { ParserOptions, ParseResult } from 'oxc-parser';
13
12
  import { Range } from 'semver';
14
13
  import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult, ExternalIdResult, HookFilter, UnpluginOptions } from 'unplugin';
14
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
15
15
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
16
16
  import ts from 'typescript';
17
- import { PrimitiveJsonValue } from '@stryke/json/types';
18
- import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
19
17
  import { ArrayValues } from '@stryke/types/array';
20
18
 
21
19
  type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
@@ -154,87 +152,20 @@ interface BuildConfig {
154
152
  }
155
153
  type BuildResolvedConfig = Omit<BuildConfig, "override">;
156
154
 
157
- type ReflectionMode = "default" | "explicit" | "never";
158
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
159
- /**
160
- * Defines the level of reflection to be used during the transpilation process.
161
- *
162
- * @remarks
163
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
164
- * - `minimal` - Only the essential type information is captured.
165
- * - `normal` - Additional type information is captured, including some contextual data.
166
- * - `verbose` - All available type information is captured, including detailed contextual data.
167
- */
168
- type ReflectionLevel = "minimal" | "normal" | "verbose";
169
- interface DeepkitOptions {
170
- /**
171
- * Either true to activate reflection for all files compiled using this tsconfig,
172
- * or a list of globs/file paths relative to this tsconfig.json.
173
- * Globs/file paths can be prefixed with a ! to exclude them.
174
- */
175
- reflection?: RawReflectionMode;
176
- /**
177
- * Defines the level of reflection to be used during the transpilation process.
178
- *
179
- * @remarks
180
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
181
- * - `minimal` - Only the essential type information is captured.
182
- * - `normal` - Additional type information is captured, including some contextual data.
183
- * - `verbose` - All available type information is captured, including detailed contextual data.
184
- */
185
- reflectionLevel?: ReflectionLevel;
186
- }
187
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
188
- /**
189
- * The TypeScript compiler configuration.
190
- *
191
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
192
- */
193
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
194
- /**
195
- * Either true to activate reflection for all files compiled using this tsconfig,
196
- * or a list of globs/file paths relative to this tsconfig.json.
197
- * Globs/file paths can be prefixed with a ! to exclude them.
198
- */
199
- reflection?: RawReflectionMode;
200
- /**
201
- * Defines the level of reflection to be used during the transpilation process.
202
- *
203
- * @remarks
204
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
205
- * - `minimal` - Only the essential type information is captured.
206
- * - `normal` - Additional type information is captured, including some contextual data.
207
- * - `verbose` - All available type information is captured, including detailed contextual data.
208
- */
209
- reflectionLevel?: ReflectionLevel;
210
- /**
211
- * Instructs the TypeScript compiler how to compile `.ts` files.
212
- */
213
- compilerOptions?: TSCompilerOptions;
214
- }
215
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
216
- originalTsconfigJson: TsConfigJson;
217
- tsconfigJson: TSConfig;
218
- tsconfigFilePath: string;
219
- };
220
-
221
155
  declare const __VFS_PATCH__ = "__VFS_PATCH__";
222
156
  declare const __VFS_REVERT__ = "__VFS_REVERT__";
223
157
  type OutputModeType = "fs" | "virtual";
224
- interface VirtualFile {
158
+ interface VirtualFileMetadata {
225
159
  /**
226
- * The unique identifier for the virtual file.
227
- *
228
- * @remarks
229
- * If no specific id is provided, it defaults to the file's {@link path}.
160
+ * The identifier for the file data.
230
161
  */
231
162
  id: string;
232
163
  /**
233
- * Additional metadata associated with the virtual file.
164
+ * The timestamp of the virtual file.
234
165
  */
235
- details: Record<string, PrimitiveJsonValue>;
166
+ timestamp: number;
236
167
  /**
237
- * The variant of the file.
168
+ * The type of the file.
238
169
  *
239
170
  * @remarks
240
171
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
@@ -242,52 +173,72 @@ interface VirtualFile {
242
173
  * - `entry`: Indicates that the file is an entry point for execution.
243
174
  * - `normal`: Indicates that the file is a standard file without any special role.
244
175
  */
245
- variant: string;
176
+ type: string;
246
177
  /**
247
178
  * The output mode of the file.
248
- *
249
- * @remarks
250
- * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
251
- */
252
- mode: OutputModeType;
253
- /**
254
- * A virtual (or actual) path to the file in the file system.
255
179
  */
256
- path: string;
180
+ mode: string;
257
181
  /**
258
- * The contents of the file.
182
+ * Additional metadata associated with the file.
259
183
  */
260
- code: string | NodeJS.ArrayBufferView;
184
+ properties: Record<string, string>;
261
185
  }
262
- interface VirtualFileMetadata {
186
+ interface VirtualFileData {
263
187
  /**
264
188
  * The identifier for the file data.
265
189
  */
266
- id: string;
190
+ id?: string;
267
191
  /**
268
- * The variant of the file.
192
+ * The contents of the virtual file.
269
193
  */
270
- variant: string;
194
+ code: string;
195
+ /**
196
+ * The type of the file.
197
+ *
198
+ * @remarks
199
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
200
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
201
+ * - `entry`: Indicates that the file is an entry point for execution.
202
+ * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
203
+ * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
204
+ * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
205
+ * - `normal`: Indicates that the file is a standard file without any special role.
206
+ */
207
+ type?: string;
271
208
  /**
272
209
  * The output mode of the file.
273
210
  */
274
- mode: string;
211
+ mode?: string;
275
212
  /**
276
213
  * Additional metadata associated with the file.
277
214
  */
278
- properties: Record<string, string>;
215
+ properties?: Record<string, string>;
216
+ }
217
+ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
218
+ /**
219
+ * An additional name for the file.
220
+ */
221
+ path: string;
222
+ /**
223
+ * The timestamp of the virtual file.
224
+ */
225
+ timestamp: number;
279
226
  }
280
227
  interface ResolveFSOptions {
281
228
  mode?: OutputModeType;
282
229
  }
283
230
  type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
284
231
  interface PowerlinesWriteFileOptions extends ResolveFSOptions {
232
+ /**
233
+ * Should the file skip formatting before being written?
234
+ *
235
+ * @defaultValue false
236
+ */
285
237
  skipFormat?: boolean;
286
238
  }
287
239
  type NodeWriteFileOptions = WriteFileOptions$1;
288
240
  type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
289
- type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
290
- type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
241
+ type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
291
242
  interface ResolvePathOptions extends ResolveFSOptions {
292
243
  /**
293
244
  * Should the resolved path include the file extension?
@@ -302,7 +253,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
302
253
  /**
303
254
  * The type of the path to resolve.
304
255
  */
305
- type?: "file" | "directory";
256
+ pathType?: "file" | "directory";
306
257
  }
307
258
  interface VirtualFileSystemInterface {
308
259
  /**
@@ -591,6 +542,70 @@ interface VirtualFileSystemInterface {
591
542
  dispose: () => Promise<void>;
592
543
  }
593
544
 
545
+ type ReflectionMode = "default" | "explicit" | "never";
546
+ type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
547
+ /**
548
+ * Defines the level of reflection to be used during the transpilation process.
549
+ *
550
+ * @remarks
551
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
552
+ * - `minimal` - Only the essential type information is captured.
553
+ * - `normal` - Additional type information is captured, including some contextual data.
554
+ * - `verbose` - All available type information is captured, including detailed contextual data.
555
+ */
556
+ type ReflectionLevel = "minimal" | "normal" | "verbose";
557
+ interface DeepkitOptions {
558
+ /**
559
+ * Either true to activate reflection for all files compiled using this tsconfig,
560
+ * or a list of globs/file paths relative to this tsconfig.json.
561
+ * Globs/file paths can be prefixed with a ! to exclude them.
562
+ */
563
+ reflection?: RawReflectionMode;
564
+ /**
565
+ * Defines the level of reflection to be used during the transpilation process.
566
+ *
567
+ * @remarks
568
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
569
+ * - `minimal` - Only the essential type information is captured.
570
+ * - `normal` - Additional type information is captured, including some contextual data.
571
+ * - `verbose` - All available type information is captured, including detailed contextual data.
572
+ */
573
+ reflectionLevel?: ReflectionLevel;
574
+ }
575
+ type TSCompilerOptions = CompilerOptions & DeepkitOptions;
576
+ /**
577
+ * The TypeScript compiler configuration.
578
+ *
579
+ * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
580
+ */
581
+ interface TSConfig extends Omit<TsConfigJson, "reflection"> {
582
+ /**
583
+ * Either true to activate reflection for all files compiled using this tsconfig,
584
+ * or a list of globs/file paths relative to this tsconfig.json.
585
+ * Globs/file paths can be prefixed with a ! to exclude them.
586
+ */
587
+ reflection?: RawReflectionMode;
588
+ /**
589
+ * Defines the level of reflection to be used during the transpilation process.
590
+ *
591
+ * @remarks
592
+ * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
593
+ * - `minimal` - Only the essential type information is captured.
594
+ * - `normal` - Additional type information is captured, including some contextual data.
595
+ * - `verbose` - All available type information is captured, including detailed contextual data.
596
+ */
597
+ reflectionLevel?: ReflectionLevel;
598
+ /**
599
+ * Instructs the TypeScript compiler how to compile `.ts` files.
600
+ */
601
+ compilerOptions?: TSCompilerOptions;
602
+ }
603
+ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
604
+ originalTsconfigJson: TsConfigJson;
605
+ tsconfigJson: TSConfig;
606
+ tsconfigFilePath: string;
607
+ };
608
+
594
609
  type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
595
610
  /**
596
611
  * The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
@@ -1138,7 +1153,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1138
1153
  * @param path - An optional path to write the builtin file to
1139
1154
  * @param options - Options for writing the file
1140
1155
  */
1141
- writeBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1156
+ emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1142
1157
  /**
1143
1158
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1144
1159
  *
@@ -1146,11 +1161,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1146
1161
  * @param path - An optional path to write the entry file to
1147
1162
  * @param options - Options for writing the file
1148
1163
  */
1149
- writeEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1150
- /**
1151
- * Parses the source code and returns a {@link ParseResult} object.
1152
- */
1153
- parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
1164
+ emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1154
1165
  /**
1155
1166
  * A function to update the context fields using a new user configuration options
1156
1167
  */
@@ -1372,6 +1383,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
1372
1383
  resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
1373
1384
  isEntry: boolean;
1374
1385
  }) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
1386
+ /**
1387
+ * An API object that can be used for inter-plugin communication.
1388
+ *
1389
+ * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
1390
+ */
1391
+ api?: Record<string, any>;
1375
1392
  };
1376
1393
  type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
1377
1394
  [TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
@@ -1421,28 +1438,60 @@ interface Plugin<in out TContext extends PluginContext<ResolvedConfig> = PluginC
1421
1438
  applyToEnvironment?: (environment: EnvironmentResolvedConfig) => MaybePromise<boolean | Plugin<any>>;
1422
1439
  }
1423
1440
 
1424
- interface PulumiPluginOptions {
1425
- /**
1426
- * The associated stack name.
1427
- */
1428
- stackName?: string;
1429
- /**
1430
- * The working directory of the program.
1431
- *
1432
- * @defaultValue "\{artifactsPath\}/infrastructure"
1433
- */
1434
- workDir?: string;
1441
+ interface PulumiPluginBaseOptions {
1435
1442
  /**
1436
1443
  * Whether to destroy the stack during the `destroy` lifecycle phase.
1437
1444
  *
1438
1445
  * @defaultValue false
1439
1446
  */
1440
1447
  destroy?: boolean;
1448
+ /**
1449
+ * Additional stack settings.
1450
+ */
1451
+ settings?: StackSettings;
1452
+ }
1453
+ interface PulumiPluginCreateStackOptions extends PulumiPluginBaseOptions {
1454
+ /**
1455
+ * The associated stack name.
1456
+ */
1457
+ stackName?: string;
1441
1458
  /**
1442
1459
  * Additional options for the Pulumi Workspace.
1443
1460
  */
1444
1461
  options?: LocalWorkspaceOptions;
1445
1462
  }
1463
+ interface PulumiPluginExistingStackOptions extends PulumiPluginBaseOptions {
1464
+ /**
1465
+ * The Pulumi Stack instance to use for deployment operations.
1466
+ */
1467
+ stack?: Stack;
1468
+ }
1469
+ interface PulumiPluginExistingStackOptions {
1470
+ /**
1471
+ * The Pulumi Stack instance to use for deployment operations.
1472
+ */
1473
+ stack?: Stack;
1474
+ }
1475
+ interface PulumiPluginCreateStackInlineOptions extends PulumiPluginCreateStackOptions {
1476
+ /**
1477
+ * The associated project name.
1478
+ */
1479
+ projectName?: string;
1480
+ /**
1481
+ * The inline (in-process) Pulumi program to use with update and preview operations.
1482
+ */
1483
+ program?: PulumiFn;
1484
+ }
1485
+ interface PulumiPluginCreateStackLocalOptions extends PulumiPluginCreateStackOptions {
1486
+ /**
1487
+ * The working directory of the program.
1488
+ *
1489
+ * @defaultValue "\{artifactsPath\}/infrastructure"
1490
+ */
1491
+ workDir?: string;
1492
+ }
1493
+ type PulumiPluginOptions = PulumiPluginExistingStackOptions | PulumiPluginCreateStackInlineOptions | PulumiPluginCreateStackLocalOptions;
1494
+ type PulumiPluginResolvedOptions = (Omit<PulumiPluginExistingStackOptions, "stack"> & Required<Pick<PulumiPluginExistingStackOptions, "stack">>) | (Omit<PulumiPluginCreateStackInlineOptions, "stackName" | "projectName" | "program"> & Required<Pick<PulumiPluginCreateStackInlineOptions, "stackName" | "projectName" | "program">>) | (Omit<PulumiPluginCreateStackLocalOptions, "stackName" | "workDir"> & Required<Pick<PulumiPluginCreateStackLocalOptions, "stackName" | "workDir">>);
1446
1495
  interface PulumiPluginUserConfig extends UserConfig {
1447
1496
  deploy: {
1448
1497
  pulumi: PulumiPluginOptions;
@@ -1450,15 +1499,19 @@ interface PulumiPluginUserConfig extends UserConfig {
1450
1499
  }
1451
1500
  interface PulumiPluginResolvedConfig extends ResolvedConfig {
1452
1501
  deploy: {
1453
- pulumi: Omit<PulumiPluginOptions, "stackName" | "workDir"> & Required<Pick<PulumiPluginOptions, "stackName" | "workDir">>;
1502
+ pulumi: PulumiPluginResolvedOptions;
1454
1503
  };
1455
1504
  }
1456
- type PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PluginContext<TResolvedConfig> & {
1457
- pulumi: Stack;
1458
- };
1505
+ type PulumiPluginContext<TResolvedConfig extends PulumiPluginResolvedConfig = PulumiPluginResolvedConfig> = PluginContext<TResolvedConfig>;
1506
+ declare type __ΩPulumiPluginBaseOptions = any[];
1507
+ declare type __ΩPulumiPluginExistingStackOptions = any[];
1508
+ declare type __ΩPulumiPluginCreateStackOptions = any[];
1509
+ declare type __ΩPulumiPluginCreateStackInlineOptions = any[];
1510
+ declare type __ΩPulumiPluginCreateStackLocalOptions = any[];
1459
1511
  declare type __ΩPulumiPluginOptions = any[];
1512
+ declare type __ΩPulumiPluginResolvedOptions = any[];
1460
1513
  declare type __ΩPulumiPluginUserConfig = any[];
1461
1514
  declare type __ΩPulumiPluginResolvedConfig = any[];
1462
1515
  declare type __ΩPulumiPluginContext = any[];
1463
1516
 
1464
- export type { PulumiPluginContext as P, __ΩPulumiPluginOptions as _, PulumiPluginOptions as a, Plugin as b, PulumiPluginUserConfig as c, PulumiPluginResolvedConfig as d, __ΩPulumiPluginUserConfig as e, __ΩPulumiPluginResolvedConfig as f, __ΩPulumiPluginContext as g };
1517
+ export type { PulumiPluginContext as P, __ΩPulumiPluginBaseOptions as _, PulumiPluginOptions as a, Plugin as b, PulumiPluginBaseOptions as c, PulumiPluginExistingStackOptions as d, PulumiPluginCreateStackOptions as e, PulumiPluginCreateStackInlineOptions as f, PulumiPluginCreateStackLocalOptions as g, PulumiPluginResolvedOptions as h, PulumiPluginUserConfig as i, PulumiPluginResolvedConfig as j, __ΩPulumiPluginExistingStackOptions as k, __ΩPulumiPluginCreateStackOptions as l, __ΩPulumiPluginCreateStackInlineOptions as m, __ΩPulumiPluginCreateStackLocalOptions as n, __ΩPulumiPluginOptions as o, __ΩPulumiPluginResolvedOptions as p, __ΩPulumiPluginUserConfig as q, __ΩPulumiPluginResolvedConfig as r, __ΩPulumiPluginContext as s };
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var automation=require('@pulumi/pulumi/automation'),index=require('@stryke/helpers/index'),join=require('@stryke/path/join'),kebabCase=require('@stryke/string-format/kebab-case'),a=require('defu'),contextHelpers=require('powerlines/plugin-utils/context-helpers'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);/*****************************************
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var automation=require('@pulumi/pulumi/automation'),index=require('@stryke/helpers/index'),join=require('@stryke/path/join'),kebabCase=require('@stryke/string-format/kebab-case'),c=require('defu'),contextHelpers=require('powerlines/plugin-utils/context-helpers'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var c__default=/*#__PURE__*/_interopDefault(c);/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var s=Object.defineProperty;var u=(t,i)=>s(t,"name",{value:i,configurable:true});const f=u((t={})=>({name:"pulumi",async config(){return {deploy:{pulumi:a__default.default(t,{workDir:join.joinPaths(this.artifactsPath,"infrastructure")})}}},async configResolved(){this.config.deploy.pulumi.stackName??=automation.fullyQualifiedStackName(kebabCase.kebabCase(contextHelpers.getOrganizationName(this)||"default"),`${contextHelpers.getWorkspaceName(this)?`${kebabCase.kebabCase(contextHelpers.getWorkspaceName(this))}-`:""}${kebabCase.kebabCase(this.config.name)}`,this.config.mode),this.pulumi=await automation.LocalWorkspace.createOrSelectStack(index.omit(this.config.deploy.pulumi,["options"]),this.config.deploy.pulumi.options);},deploy:{order:"post",async handler(){await this.pulumi.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await this.pulumi.destroy({onOutput:this.debug.bind(this)});const i=await this.pulumi.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${this.config.deploy.pulumi.stackName} (v${i.summary.version}): ${i.summary.message}`);}}}),"plugin");var N=f;exports.default=N;exports.plugin=f;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
7
+ var s=Object.defineProperty;var a=(i,t)=>s(i,"name",{value:t,configurable:true});const g=a((i={})=>({name:"pulumi",async config(){return {deploy:{pulumi:c__default.default(i,{projectName:this.config.name,workDir:join.joinPaths(this.artifactsPath,"infrastructure"),settings:{}})}}},async configResolved(){i.stack||(this.config.deploy.pulumi.stackName??=automation.fullyQualifiedStackName(kebabCase.kebabCase(contextHelpers.getOrganizationName(this)||"default"),`${contextHelpers.getWorkspaceName(this)?`${kebabCase.kebabCase(contextHelpers.getWorkspaceName(this))}-`:""}${kebabCase.kebabCase(this.config.name)}`,this.config.mode));},deploy:{order:"post",async handler(){if(this.info(`Deploying Pulumi stack: ${this.config.deploy.pulumi.stack?.name||this.config.deploy.pulumi.stackName}`),!i.stack&&!i.program&&!i.projectName||!i.workDir)throw new Error("Pulumi plugin requires either an inline program or a working directory to be specified.");let t=i.stack;t??=await automation.LocalWorkspace.createOrSelectStack(index.omit(this.config.deploy.pulumi,["options","settings"])),this.config.deploy.pulumi.settings&&Object.keys(this.config.deploy.pulumi.settings).length>0&&await t.workspace.saveStackSettings(t.name,this.config.deploy.pulumi.settings),await t.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await t.destroy({onOutput:this.debug.bind(this)});const u=await t.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${t.name} (v${u.summary.version}): ${u.summary.message}`);}}}),"plugin");var L=g;exports.default=L;exports.plugin=g;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PulumiPluginContext, a as PulumiPluginOptions, b as Plugin } from './index-Cb_0-d4Z.cjs';
2
- export { d as PulumiPluginResolvedConfig, c as PulumiPluginUserConfig, g as __ΩPulumiPluginContext, _ as __ΩPulumiPluginOptions, f as __ΩPulumiPluginResolvedConfig, e as __ΩPulumiPluginUserConfig } from './index-Cb_0-d4Z.cjs';
1
+ import { P as PulumiPluginContext, a as PulumiPluginOptions, b as Plugin } from './index-CekpTrDh.cjs';
2
+ export { c as PulumiPluginBaseOptions, f as PulumiPluginCreateStackInlineOptions, g as PulumiPluginCreateStackLocalOptions, e as PulumiPluginCreateStackOptions, d as PulumiPluginExistingStackOptions, j as PulumiPluginResolvedConfig, h as PulumiPluginResolvedOptions, i as PulumiPluginUserConfig, _ as __ΩPulumiPluginBaseOptions, s as __ΩPulumiPluginContext, m as __ΩPulumiPluginCreateStackInlineOptions, n as __ΩPulumiPluginCreateStackLocalOptions, l as __ΩPulumiPluginCreateStackOptions, k as __ΩPulumiPluginExistingStackOptions, o as __ΩPulumiPluginOptions, r as __ΩPulumiPluginResolvedConfig, p as __ΩPulumiPluginResolvedOptions, q as __ΩPulumiPluginUserConfig } from './index-CekpTrDh.cjs';
3
3
  import '@pulumi/pulumi/automation';
4
4
  import '@storm-software/build-tools/types';
5
5
  import '@storm-software/config-tools/types';
@@ -11,13 +11,11 @@ import 'vite';
11
11
  import '@stryke/env/get-env-paths';
12
12
  import '@stryke/types/package-json';
13
13
  import 'jiti';
14
- import 'oxc-parser';
15
14
  import 'semver';
16
15
  import 'unplugin';
16
+ import 'node:fs';
17
17
  import '@stryke/types/tsconfig';
18
18
  import 'typescript';
19
- import '@stryke/json/types';
20
- import 'node:fs';
21
19
  import '@stryke/types/array';
22
20
 
23
21
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PulumiPluginContext, a as PulumiPluginOptions, b as Plugin } from './index-Cb_0-d4Z.js';
2
- export { d as PulumiPluginResolvedConfig, c as PulumiPluginUserConfig, g as __ΩPulumiPluginContext, _ as __ΩPulumiPluginOptions, f as __ΩPulumiPluginResolvedConfig, e as __ΩPulumiPluginUserConfig } from './index-Cb_0-d4Z.js';
1
+ import { P as PulumiPluginContext, a as PulumiPluginOptions, b as Plugin } from './index-CekpTrDh.js';
2
+ export { c as PulumiPluginBaseOptions, f as PulumiPluginCreateStackInlineOptions, g as PulumiPluginCreateStackLocalOptions, e as PulumiPluginCreateStackOptions, d as PulumiPluginExistingStackOptions, j as PulumiPluginResolvedConfig, h as PulumiPluginResolvedOptions, i as PulumiPluginUserConfig, _ as __ΩPulumiPluginBaseOptions, s as __ΩPulumiPluginContext, m as __ΩPulumiPluginCreateStackInlineOptions, n as __ΩPulumiPluginCreateStackLocalOptions, l as __ΩPulumiPluginCreateStackOptions, k as __ΩPulumiPluginExistingStackOptions, o as __ΩPulumiPluginOptions, r as __ΩPulumiPluginResolvedConfig, p as __ΩPulumiPluginResolvedOptions, q as __ΩPulumiPluginUserConfig } from './index-CekpTrDh.js';
3
3
  import '@pulumi/pulumi/automation';
4
4
  import '@storm-software/build-tools/types';
5
5
  import '@storm-software/config-tools/types';
@@ -11,13 +11,11 @@ import 'vite';
11
11
  import '@stryke/env/get-env-paths';
12
12
  import '@stryke/types/package-json';
13
13
  import 'jiti';
14
- import 'oxc-parser';
15
14
  import 'semver';
16
15
  import 'unplugin';
16
+ import 'node:fs';
17
17
  import '@stryke/types/tsconfig';
18
18
  import 'typescript';
19
- import '@stryke/json/types';
20
- import 'node:fs';
21
19
  import '@stryke/types/array';
22
20
 
23
21
  /**
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import {fullyQualifiedStackName,LocalWorkspace}from'@pulumi/pulumi/automation';import {omit}from'@stryke/helpers/index';import {joinPaths}from'@stryke/path/join';import {kebabCase}from'@stryke/string-format/kebab-case';import a from'defu';import {getOrganizationName,getWorkspaceName}from'powerlines/plugin-utils/context-helpers';export*from'./types';/*****************************************
1
+ import {LocalWorkspace,fullyQualifiedStackName}from'@pulumi/pulumi/automation';import {omit}from'@stryke/helpers/index';import {joinPaths}from'@stryke/path/join';import {kebabCase}from'@stryke/string-format/kebab-case';import c from'defu';import {getOrganizationName,getWorkspaceName}from'powerlines/plugin-utils/context-helpers';export*from'./types';/*****************************************
2
2
  *
3
3
  * ⚡ Built by Storm Software
4
4
  *
5
5
  *****************************************/
6
6
 
7
- var s=Object.defineProperty;var u=(t,i)=>s(t,"name",{value:i,configurable:true});const f=u((t={})=>({name:"pulumi",async config(){return {deploy:{pulumi:a(t,{workDir:joinPaths(this.artifactsPath,"infrastructure")})}}},async configResolved(){this.config.deploy.pulumi.stackName??=fullyQualifiedStackName(kebabCase(getOrganizationName(this)||"default"),`${getWorkspaceName(this)?`${kebabCase(getWorkspaceName(this))}-`:""}${kebabCase(this.config.name)}`,this.config.mode),this.pulumi=await LocalWorkspace.createOrSelectStack(omit(this.config.deploy.pulumi,["options"]),this.config.deploy.pulumi.options);},deploy:{order:"post",async handler(){await this.pulumi.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await this.pulumi.destroy({onOutput:this.debug.bind(this)});const i=await this.pulumi.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${this.config.deploy.pulumi.stackName} (v${i.summary.version}): ${i.summary.message}`);}}}),"plugin");var S=f;export{S as default,f as plugin};
7
+ var s=Object.defineProperty;var a=(i,t)=>s(i,"name",{value:t,configurable:true});const g=a((i={})=>({name:"pulumi",async config(){return {deploy:{pulumi:c(i,{projectName:this.config.name,workDir:joinPaths(this.artifactsPath,"infrastructure"),settings:{}})}}},async configResolved(){i.stack||(this.config.deploy.pulumi.stackName??=fullyQualifiedStackName(kebabCase(getOrganizationName(this)||"default"),`${getWorkspaceName(this)?`${kebabCase(getWorkspaceName(this))}-`:""}${kebabCase(this.config.name)}`,this.config.mode));},deploy:{order:"post",async handler(){if(this.info(`Deploying Pulumi stack: ${this.config.deploy.pulumi.stack?.name||this.config.deploy.pulumi.stackName}`),!i.stack&&!i.program&&!i.projectName||!i.workDir)throw new Error("Pulumi plugin requires either an inline program or a working directory to be specified.");let t=i.stack;t??=await LocalWorkspace.createOrSelectStack(omit(this.config.deploy.pulumi,["options","settings"])),this.config.deploy.pulumi.settings&&Object.keys(this.config.deploy.pulumi.settings).length>0&&await t.workspace.saveStackSettings(t.name,this.config.deploy.pulumi.settings),await t.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await t.destroy({onOutput:this.debug.bind(this)});const u=await t.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${t.name} (v${u.summary.version}): ${u.summary.message}`);}}}),"plugin");var D=g;export{D as default,g as plugin};
@@ -1,4 +1,4 @@
1
- export { P as PulumiPluginContext, a as PulumiPluginOptions, d as PulumiPluginResolvedConfig, c as PulumiPluginUserConfig, g as __ΩPulumiPluginContext, _ as __ΩPulumiPluginOptions, f as __ΩPulumiPluginResolvedConfig, e as __ΩPulumiPluginUserConfig } from '../index-Cb_0-d4Z.cjs';
1
+ export { c as PulumiPluginBaseOptions, P as PulumiPluginContext, f as PulumiPluginCreateStackInlineOptions, g as PulumiPluginCreateStackLocalOptions, e as PulumiPluginCreateStackOptions, d as PulumiPluginExistingStackOptions, a as PulumiPluginOptions, j as PulumiPluginResolvedConfig, h as PulumiPluginResolvedOptions, i as PulumiPluginUserConfig, _ as __ΩPulumiPluginBaseOptions, s as __ΩPulumiPluginContext, m as __ΩPulumiPluginCreateStackInlineOptions, n as __ΩPulumiPluginCreateStackLocalOptions, l as __ΩPulumiPluginCreateStackOptions, k as __ΩPulumiPluginExistingStackOptions, o as __ΩPulumiPluginOptions, r as __ΩPulumiPluginResolvedConfig, p as __ΩPulumiPluginResolvedOptions, q as __ΩPulumiPluginUserConfig } from '../index-CekpTrDh.cjs';
2
2
  import '@pulumi/pulumi/automation';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
@@ -10,11 +10,9 @@ import 'vite';
10
10
  import '@stryke/env/get-env-paths';
11
11
  import '@stryke/types/package-json';
12
12
  import 'jiti';
13
- import 'oxc-parser';
14
13
  import 'semver';
15
14
  import 'unplugin';
15
+ import 'node:fs';
16
16
  import '@stryke/types/tsconfig';
17
17
  import 'typescript';
18
- import '@stryke/json/types';
19
- import 'node:fs';
20
18
  import '@stryke/types/array';
@@ -1,4 +1,4 @@
1
- export { P as PulumiPluginContext, a as PulumiPluginOptions, d as PulumiPluginResolvedConfig, c as PulumiPluginUserConfig, g as __ΩPulumiPluginContext, _ as __ΩPulumiPluginOptions, f as __ΩPulumiPluginResolvedConfig, e as __ΩPulumiPluginUserConfig } from '../index-Cb_0-d4Z.js';
1
+ export { c as PulumiPluginBaseOptions, P as PulumiPluginContext, f as PulumiPluginCreateStackInlineOptions, g as PulumiPluginCreateStackLocalOptions, e as PulumiPluginCreateStackOptions, d as PulumiPluginExistingStackOptions, a as PulumiPluginOptions, j as PulumiPluginResolvedConfig, h as PulumiPluginResolvedOptions, i as PulumiPluginUserConfig, _ as __ΩPulumiPluginBaseOptions, s as __ΩPulumiPluginContext, m as __ΩPulumiPluginCreateStackInlineOptions, n as __ΩPulumiPluginCreateStackLocalOptions, l as __ΩPulumiPluginCreateStackOptions, k as __ΩPulumiPluginExistingStackOptions, o as __ΩPulumiPluginOptions, r as __ΩPulumiPluginResolvedConfig, p as __ΩPulumiPluginResolvedOptions, q as __ΩPulumiPluginUserConfig } from '../index-CekpTrDh.js';
2
2
  import '@pulumi/pulumi/automation';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
@@ -10,11 +10,9 @@ import 'vite';
10
10
  import '@stryke/env/get-env-paths';
11
11
  import '@stryke/types/package-json';
12
12
  import 'jiti';
13
- import 'oxc-parser';
14
13
  import 'semver';
15
14
  import 'unplugin';
15
+ import 'node:fs';
16
16
  import '@stryke/types/tsconfig';
17
17
  import 'typescript';
18
- import '@stryke/json/types';
19
- import 'node:fs';
20
18
  import '@stryke/types/array';
@@ -1,5 +1,5 @@
1
1
  import '@pulumi/pulumi/automation';
2
- export { P as PulumiPluginContext, a as PulumiPluginOptions, d as PulumiPluginResolvedConfig, c as PulumiPluginUserConfig, g as __ΩPulumiPluginContext, _ as __ΩPulumiPluginOptions, f as __ΩPulumiPluginResolvedConfig, e as __ΩPulumiPluginUserConfig } from '../index-Cb_0-d4Z.cjs';
2
+ export { c as PulumiPluginBaseOptions, P as PulumiPluginContext, f as PulumiPluginCreateStackInlineOptions, g as PulumiPluginCreateStackLocalOptions, e as PulumiPluginCreateStackOptions, d as PulumiPluginExistingStackOptions, a as PulumiPluginOptions, j as PulumiPluginResolvedConfig, h as PulumiPluginResolvedOptions, i as PulumiPluginUserConfig, _ as __ΩPulumiPluginBaseOptions, s as __ΩPulumiPluginContext, m as __ΩPulumiPluginCreateStackInlineOptions, n as __ΩPulumiPluginCreateStackLocalOptions, l as __ΩPulumiPluginCreateStackOptions, k as __ΩPulumiPluginExistingStackOptions, o as __ΩPulumiPluginOptions, r as __ΩPulumiPluginResolvedConfig, p as __ΩPulumiPluginResolvedOptions, q as __ΩPulumiPluginUserConfig } from '../index-CekpTrDh.cjs';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -10,11 +10,9 @@ import 'vite';
10
10
  import '@stryke/env/get-env-paths';
11
11
  import '@stryke/types/package-json';
12
12
  import 'jiti';
13
- import 'oxc-parser';
14
13
  import 'semver';
15
14
  import 'unplugin';
15
+ import 'node:fs';
16
16
  import '@stryke/types/tsconfig';
17
17
  import 'typescript';
18
- import '@stryke/json/types';
19
- import 'node:fs';
20
18
  import '@stryke/types/array';
@@ -1,5 +1,5 @@
1
1
  import '@pulumi/pulumi/automation';
2
- export { P as PulumiPluginContext, a as PulumiPluginOptions, d as PulumiPluginResolvedConfig, c as PulumiPluginUserConfig, g as __ΩPulumiPluginContext, _ as __ΩPulumiPluginOptions, f as __ΩPulumiPluginResolvedConfig, e as __ΩPulumiPluginUserConfig } from '../index-Cb_0-d4Z.js';
2
+ export { c as PulumiPluginBaseOptions, P as PulumiPluginContext, f as PulumiPluginCreateStackInlineOptions, g as PulumiPluginCreateStackLocalOptions, e as PulumiPluginCreateStackOptions, d as PulumiPluginExistingStackOptions, a as PulumiPluginOptions, j as PulumiPluginResolvedConfig, h as PulumiPluginResolvedOptions, i as PulumiPluginUserConfig, _ as __ΩPulumiPluginBaseOptions, s as __ΩPulumiPluginContext, m as __ΩPulumiPluginCreateStackInlineOptions, n as __ΩPulumiPluginCreateStackLocalOptions, l as __ΩPulumiPluginCreateStackOptions, k as __ΩPulumiPluginExistingStackOptions, o as __ΩPulumiPluginOptions, r as __ΩPulumiPluginResolvedConfig, p as __ΩPulumiPluginResolvedOptions, q as __ΩPulumiPluginUserConfig } from '../index-CekpTrDh.js';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -10,11 +10,9 @@ import 'vite';
10
10
  import '@stryke/env/get-env-paths';
11
11
  import '@stryke/types/package-json';
12
12
  import 'jiti';
13
- import 'oxc-parser';
14
13
  import 'semver';
15
14
  import 'unplugin';
15
+ import 'node:fs';
16
16
  import '@stryke/types/tsconfig';
17
17
  import 'typescript';
18
- import '@stryke/json/types';
19
- import 'node:fs';
20
18
  import '@stryke/types/array';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-pulumi",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to transform source code to be platform agnostic using pulumi.",
6
6
  "repository": {
@@ -103,16 +103,17 @@
103
103
  "@stryke/path": "^0.19.2",
104
104
  "@stryke/fs": "^0.32.13",
105
105
  "@stryke/helpers": "^0.9.4",
106
+ "@stryke/types": "^0.10.2",
106
107
  "@stryke/string-format": "^0.12.2",
107
108
  "@pulumi/pulumi": "^3.207.0",
108
109
  "defu": "^6.1.4",
109
- "powerlines": "^0.23.3",
110
+ "powerlines": "^0.23.4",
110
111
  "typescript": "^5.9.3"
111
112
  },
112
113
  "devDependencies": {
113
- "@powerlines/nx": "^0.10.20",
114
+ "@powerlines/nx": "^0.10.21",
114
115
  "@types/node": "^24.10.1"
115
116
  },
116
117
  "publishConfig": { "access": "public" },
117
- "gitHead": "6e43200541ace2946694195c092642e7ac2f3098"
118
+ "gitHead": "3075c08893a66a4e8d359e37f8d0344b0a80322b"
118
119
  }