@storm-software/pulumi-tools 0.7.79 → 0.7.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-DD4EVDG7.mjs → chunk-2MM34QNY.mjs} +1189 -769
  4. package/dist/chunk-2QAZEBOG.js +42 -0
  5. package/dist/chunk-3RG5ZIWI.js +10 -0
  6. package/dist/chunk-5ZBO7GC6.js +16 -0
  7. package/dist/chunk-C6HV3VOH.mjs +16 -0
  8. package/dist/{chunk-AJICSYTL.mjs → chunk-ESHAP37L.mjs} +1 -1
  9. package/dist/{chunk-DBLK3NPE.js → chunk-HUKXHFCA.js} +4 -9
  10. package/dist/chunk-IBJKPAXV.mjs +42 -0
  11. package/dist/{chunk-L2DHGVS5.mjs → chunk-IEZKYJSF.mjs} +3 -6
  12. package/dist/{chunk-GZGV3XVE.js → chunk-J5NVVVHZ.js} +2 -2
  13. package/dist/{chunk-KXK6HK7Z.mjs → chunk-JWQAUSXZ.mjs} +1 -1
  14. package/dist/{chunk-FOZFHF2O.mjs → chunk-KPFHCT4A.mjs} +3 -8
  15. package/dist/{chunk-U7IKOXSI.mjs → chunk-LVBND7MN.mjs} +1 -1
  16. package/dist/chunk-MHBRG7UB.js +18 -0
  17. package/dist/chunk-QW6YGFF7.js +133 -0
  18. package/dist/{chunk-AKO3NFBS.js → chunk-S3CLNYH2.js} +1171 -751
  19. package/dist/chunk-TCPQS3FC.mjs +133 -0
  20. package/dist/{chunk-I3FRKBMS.js → chunk-TRMMILFW.js} +2 -2
  21. package/dist/{chunk-QNQZE4KJ.js → chunk-XOH426DW.js} +2 -2
  22. package/dist/chunk-YTI55E4Z.mjs +18 -0
  23. package/dist/executors.js +8 -8
  24. package/dist/executors.mjs +8 -8
  25. package/dist/generators.js +5 -5
  26. package/dist/generators.mjs +4 -4
  27. package/dist/index.js +11 -11
  28. package/dist/index.mjs +10 -10
  29. package/dist/src/base/base-executor.js +4 -4
  30. package/dist/src/base/base-executor.mjs +3 -3
  31. package/dist/src/base/index.js +5 -5
  32. package/dist/src/base/index.mjs +4 -4
  33. package/dist/src/base/providers.js +3 -3
  34. package/dist/src/base/providers.mjs +2 -2
  35. package/dist/src/executors/config/executor.js +5 -5
  36. package/dist/src/executors/config/executor.mjs +4 -4
  37. package/dist/src/executors/import/executor.js +5 -5
  38. package/dist/src/executors/import/executor.mjs +4 -4
  39. package/dist/src/executors/preview/executor.js +5 -5
  40. package/dist/src/executors/preview/executor.mjs +4 -4
  41. package/dist/src/executors/refresh/executor.js +5 -5
  42. package/dist/src/executors/refresh/executor.mjs +4 -4
  43. package/dist/src/executors/up/executor.js +5 -5
  44. package/dist/src/executors/up/executor.mjs +4 -4
  45. package/dist/src/generators/init/generator.js +5 -5
  46. package/dist/src/generators/init/generator.mjs +4 -4
  47. package/dist/tsup.config.js +3 -8
  48. package/dist/tsup.config.mjs +3 -8
  49. package/package.json +1 -1
  50. package/dist/chunk-2FBBYFXH.js +0 -15
  51. package/dist/chunk-3GQAWCBQ.js +0 -13
  52. package/dist/chunk-A6G6LISR.js +0 -109
  53. package/dist/chunk-DFGQICYB.mjs +0 -13
  54. package/dist/chunk-P47FZNOX.js +0 -35
  55. package/dist/chunk-Q5MONGV7.mjs +0 -109
  56. package/dist/chunk-UV2ERO6Z.js +0 -13
  57. package/dist/chunk-WEKJLMNL.mjs +0 -35
  58. package/dist/chunk-ZNKCM4HA.mjs +0 -15
@@ -0,0 +1,42 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+ var _chunkS3CLNYH2js = require('./chunk-S3CLNYH2.js');
5
+
6
+ // src/base/base-executor.ts
7
+ var _path = require('path');
8
+ var _shelljs = require('shelljs');
9
+ var withPulumiExecutor = (command, argsMapper, executorOptions = {}) => async (_options, context) => {
10
+ return _chunkS3CLNYH2js.withRunExecutor.call(void 0,
11
+ `Pulumi \`${command}\` Command Executor`,
12
+ async (options, context2, config) => {
13
+ if (!_shelljs.which.call(void 0, "pulumi")) {
14
+ throw new Error(
15
+ "Pulumi is not installed. Please install it before running this executor."
16
+ );
17
+ }
18
+ if (!_optionalChain([context2, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
19
+ throw new Error(
20
+ "The Build process failed because the context is not valid. Please run this command from a workspace."
21
+ );
22
+ }
23
+ const { sourceRoot } = context2.projectsConfigurations.projects[context2.projectName];
24
+ _chunkS3CLNYH2js.run.call(void 0,
25
+ config,
26
+ ["pulumi", command, ...argsMapper(options)].filter(Boolean).join(" "),
27
+ _path.join.call(void 0, config.workspaceRoot, options.root || sourceRoot),
28
+ "inherit",
29
+ {
30
+ ...process.env,
31
+ PULUMI_EXPERIMENTAL: "true"
32
+ }
33
+ );
34
+ return null;
35
+ },
36
+ executorOptions
37
+ )(_options, context);
38
+ };
39
+
40
+
41
+
42
+ exports.withPulumiExecutor = withPulumiExecutor;
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+
9
+
10
+ exports.__require = __require;
@@ -0,0 +1,16 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk2QAZEBOGjs = require('./chunk-2QAZEBOG.js');
4
+
5
+ // src/executors/preview/executor.ts
6
+ var executor_default = _chunk2QAZEBOGjs.withPulumiExecutor.call(void 0,
7
+ "preview",
8
+ (options) => [
9
+ options.stack && `--stack=${options.stack}`,
10
+ options.expectNoChanges && "--expect-no-changes"
11
+ ]
12
+ );
13
+
14
+
15
+
16
+ exports.executor_default = executor_default;
@@ -0,0 +1,16 @@
1
+ import {
2
+ withPulumiExecutor
3
+ } from "./chunk-IBJKPAXV.mjs";
4
+
5
+ // src/executors/preview/executor.ts
6
+ var executor_default = withPulumiExecutor(
7
+ "preview",
8
+ (options) => [
9
+ options.stack && `--stack=${options.stack}`,
10
+ options.expectNoChanges && "--expect-no-changes"
11
+ ]
12
+ );
13
+
14
+ export {
15
+ executor_default
16
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withPulumiExecutor
3
- } from "./chunk-WEKJLMNL.mjs";
3
+ } from "./chunk-IBJKPAXV.mjs";
4
4
 
5
5
  // src/executors/config/executor.ts
6
6
  var executor_default = withPulumiExecutor("config", (options) => [
@@ -1,18 +1,13 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
4
-
5
- // src/base/providers.ts
6
- var Provider;
7
- (function(Provider2) {
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/base/providers.ts
2
+ var Provider = /* @__PURE__ */ ((Provider2) => {
8
3
  Provider2["AWS"] = "aws";
9
4
  Provider2["AZURE"] = "azure";
10
5
  Provider2["GOOGLE_CLOUD_PLATFORM"] = "gcp";
11
- })(Provider || (Provider = exports.Provider = {}));
6
+ return Provider2;
7
+ })(Provider || {});
12
8
  function getCloudTemplateName(cloudProvider) {
13
9
  return `${cloudProvider}-typescript`;
14
10
  }
15
- _chunk3GQAWCBQjs.__name.call(void 0, getCloudTemplateName, "getCloudTemplateName");
16
11
 
17
12
 
18
13
 
@@ -0,0 +1,42 @@
1
+ import {
2
+ run,
3
+ withRunExecutor
4
+ } from "./chunk-2MM34QNY.mjs";
5
+
6
+ // src/base/base-executor.ts
7
+ import { join } from "node:path";
8
+ import { which } from "shelljs";
9
+ var withPulumiExecutor = (command, argsMapper, executorOptions = {}) => async (_options, context) => {
10
+ return withRunExecutor(
11
+ `Pulumi \`${command}\` Command Executor`,
12
+ async (options, context2, config) => {
13
+ if (!which("pulumi")) {
14
+ throw new Error(
15
+ "Pulumi is not installed. Please install it before running this executor."
16
+ );
17
+ }
18
+ if (!context2.projectsConfigurations?.projects || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
19
+ throw new Error(
20
+ "The Build process failed because the context is not valid. Please run this command from a workspace."
21
+ );
22
+ }
23
+ const { sourceRoot } = context2.projectsConfigurations.projects[context2.projectName];
24
+ run(
25
+ config,
26
+ ["pulumi", command, ...argsMapper(options)].filter(Boolean).join(" "),
27
+ join(config.workspaceRoot, options.root || sourceRoot),
28
+ "inherit",
29
+ {
30
+ ...process.env,
31
+ PULUMI_EXPERIMENTAL: "true"
32
+ }
33
+ );
34
+ return null;
35
+ },
36
+ executorOptions
37
+ )(_options, context);
38
+ };
39
+
40
+ export {
41
+ withPulumiExecutor
42
+ };
@@ -1,5 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
1
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
2
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
3
  }) : x)(function(x) {
@@ -7,15 +5,14 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
7
5
  throw Error('Dynamic require of "' + x + '" is not supported');
8
6
  });
9
7
 
10
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=03667209a675e5896d66bd6058c9830fe9adb022e07ce6b04adc2eb927ede5fd__f9deff99d28cedac02de9c72719d1b4e/node_modules/tsup/assets/esm_shims.js
8
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=616d4d8468728c5caa25e7b97fe871f667b5342103b43bda8e891020bc6b674a__e7bfd10e92d28211ce978b182e37e925/node_modules/tsup/assets/esm_shims.js
11
9
  import { fileURLToPath } from "url";
12
10
  import path from "path";
13
- var getFilename = /* @__PURE__ */ __name(() => fileURLToPath(import.meta.url), "getFilename");
14
- var getDirname = /* @__PURE__ */ __name(() => path.dirname(getFilename()), "getDirname");
11
+ var getFilename = () => fileURLToPath(import.meta.url);
12
+ var getDirname = () => path.dirname(getFilename());
15
13
  var __dirname = /* @__PURE__ */ getDirname();
16
14
 
17
15
  export {
18
- __name,
19
16
  __require,
20
17
  __dirname
21
18
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkP47FZNOXjs = require('./chunk-P47FZNOX.js');
3
+ var _chunk2QAZEBOGjs = require('./chunk-2QAZEBOG.js');
4
4
 
5
5
  // src/executors/up/executor.ts
6
- var executor_default = _chunkP47FZNOXjs.withPulumiExecutor.call(void 0, "up", (options) => [
6
+ var executor_default = _chunk2QAZEBOGjs.withPulumiExecutor.call(void 0, "up", (options) => [
7
7
  "--suppress-progress",
8
8
  options.stack && `--stack=${options.stack}`,
9
9
  options.skipPreview && "--skip-preview",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withPulumiExecutor
3
- } from "./chunk-WEKJLMNL.mjs";
3
+ } from "./chunk-IBJKPAXV.mjs";
4
4
 
5
5
  // src/executors/import/executor.ts
6
6
  var executor_default = withPulumiExecutor("import", (options) => [
@@ -1,18 +1,13 @@
1
- import {
2
- __name
3
- } from "./chunk-L2DHGVS5.mjs";
4
-
5
1
  // src/base/providers.ts
6
- var Provider;
7
- (function(Provider2) {
2
+ var Provider = /* @__PURE__ */ ((Provider2) => {
8
3
  Provider2["AWS"] = "aws";
9
4
  Provider2["AZURE"] = "azure";
10
5
  Provider2["GOOGLE_CLOUD_PLATFORM"] = "gcp";
11
- })(Provider || (Provider = {}));
6
+ return Provider2;
7
+ })(Provider || {});
12
8
  function getCloudTemplateName(cloudProvider) {
13
9
  return `${cloudProvider}-typescript`;
14
10
  }
15
- __name(getCloudTemplateName, "getCloudTemplateName");
16
11
 
17
12
  export {
18
13
  Provider,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withPulumiExecutor
3
- } from "./chunk-WEKJLMNL.mjs";
3
+ } from "./chunk-IBJKPAXV.mjs";
4
4
 
5
5
  // src/executors/up/executor.ts
6
6
  var executor_default = withPulumiExecutor("up", (options) => [
@@ -0,0 +1,18 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk2QAZEBOGjs = require('./chunk-2QAZEBOG.js');
4
+
5
+ // src/executors/refresh/executor.ts
6
+ var executor_default = _chunk2QAZEBOGjs.withPulumiExecutor.call(void 0,
7
+ "refresh",
8
+ (options) => [
9
+ "--suppress-progress",
10
+ options.stack && `--stack=${options.stack}`,
11
+ options.skipPreview && "--skip-preview",
12
+ options.yes && "--yes"
13
+ ]
14
+ );
15
+
16
+
17
+
18
+ exports.executor_default = executor_default;
@@ -0,0 +1,133 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkHUKXHFCAjs = require('./chunk-HUKXHFCA.js');
4
+
5
+
6
+
7
+
8
+ var _chunkS3CLNYH2js = require('./chunk-S3CLNYH2.js');
9
+
10
+ // src/generators/init/generator.ts
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _devkit = require('@nx/devkit');
18
+ var _fs = require('fs');
19
+ var _path = require('path');
20
+ async function initGeneratorFn(tree, options, config) {
21
+ const task = _chunkS3CLNYH2js.initGenerator.call(void 0, tree, options);
22
+ _devkit.addProjectConfiguration.call(void 0, tree, options.name || "deployment", {
23
+ root: options.directory || "./deployment",
24
+ projectType: "application",
25
+ sourceRoot: options.directory || "./deployment",
26
+ targets: {
27
+ up: {
28
+ executor: "@nx-extend/pulumi:up",
29
+ options: {}
30
+ },
31
+ preview: {
32
+ executor: "@nx-extend/pulumi:preview",
33
+ options: {}
34
+ },
35
+ refresh: {
36
+ executor: "@nx-extend/pulumi:refresh",
37
+ options: {}
38
+ },
39
+ import: {
40
+ executor: "@nx-extend/pulumi:import",
41
+ options: {}
42
+ }
43
+ },
44
+ tags: ["infra:pulumi"]
45
+ });
46
+ await _devkit.runTasksInSerial.call(void 0,
47
+ generateNewPulumiProject(tree, options, config),
48
+ loginToPulumi(tree, options, config),
49
+ addPulumiDeps(tree, options),
50
+ cleanupProject(tree, options)
51
+ )();
52
+ if (!options.skipFormat) {
53
+ await _devkit.formatFiles.call(void 0, tree);
54
+ }
55
+ return task;
56
+ }
57
+ var generator_default = _chunkS3CLNYH2js.withRunGenerator.call(void 0,
58
+ "Initialize Storm Pulumi workspace",
59
+ initGeneratorFn
60
+ );
61
+ function generateNewPulumiProject(tree, options, config) {
62
+ return () => {
63
+ const template = _chunkHUKXHFCAjs.getCloudTemplateName.call(void 0, options.provider);
64
+ _chunkS3CLNYH2js.run.call(void 0,
65
+ config,
66
+ [
67
+ `pulumi new ${template}`,
68
+ `--name=${options.name || "deployment"}`,
69
+ `--dir=${options.directory || "./deployment"}`,
70
+ options.secretsProvider && `--secrets-provider=${options.secretsProvider}`,
71
+ "--generate-only",
72
+ "--yes",
73
+ "--force"
74
+ ].filter(Boolean).join(" "),
75
+ _path.join.call(void 0, config.workspaceRoot, options.directory || "./deployment"),
76
+ "inherit"
77
+ );
78
+ };
79
+ }
80
+ function loginToPulumi(tree, options, config) {
81
+ return () => {
82
+ if (!options.login) {
83
+ return;
84
+ }
85
+ if (options.login.startsWith("file://")) {
86
+ options.login = `file://${tree.root}/${options.directory || "./deployment"}/${options.login.replace("file://", "")}`;
87
+ }
88
+ _chunkS3CLNYH2js.run.call(void 0,
89
+ config,
90
+ ["pulumi login", options.login].filter(Boolean).join(" "),
91
+ _path.join.call(void 0, config.workspaceRoot, options.directory || "./deployment"),
92
+ "inherit",
93
+ {
94
+ ...process.env,
95
+ PULUMI_EXPERIMENTAL: "true"
96
+ }
97
+ );
98
+ };
99
+ }
100
+ function addPulumiDeps(tree, options) {
101
+ return () => {
102
+ const packageJson = _devkit.readJsonFile.call(void 0, `${options.directory}/package.json`);
103
+ if (packageJson) {
104
+ _devkit.addDependenciesToPackageJson.call(void 0, tree, {}, packageJson.dependencies || {})();
105
+ }
106
+ };
107
+ }
108
+ function cleanupProject(tree, options) {
109
+ return () => {
110
+ const indexTsLocation = _path.join.call(void 0,
111
+ tree.root,
112
+ `${options.directory || "./deployment"}/index.ts`
113
+ );
114
+ tree.write(
115
+ `${options.directory}/pulumi.ts`,
116
+ _fs.readFileSync.call(void 0, indexTsLocation).toString()
117
+ );
118
+ _fs.unlinkSync.call(void 0,
119
+ _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/.gitignore`)
120
+ );
121
+ _fs.unlinkSync.call(void 0,
122
+ _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/package.json`)
123
+ );
124
+ _fs.unlinkSync.call(void 0,
125
+ _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/tsconfig.json`)
126
+ );
127
+ };
128
+ }
129
+
130
+
131
+
132
+
133
+ exports.initGeneratorFn = initGeneratorFn; exports.generator_default = generator_default;