@storm-software/pulumi-tools 0.5.1 → 0.7.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/chunk-23KFTIT2.mjs +0 -0
  3. package/dist/chunk-3GQAWCBQ.js +13 -0
  4. package/dist/chunk-3I666OI5.js +17 -0
  5. package/dist/chunk-4BDVESFO.mjs +109 -0
  6. package/dist/chunk-53MF6VMZ.js +18 -0
  7. package/dist/chunk-A6SQY5H3.js +16 -0
  8. package/dist/chunk-AJZ5SHGR.js +15 -0
  9. package/dist/chunk-ANLNSAGB.mjs +16 -0
  10. package/dist/chunk-CA7S5MOH.mjs +0 -0
  11. package/dist/chunk-CFSEZM76.js +13 -0
  12. package/dist/chunk-DBLK3NPE.js +20 -0
  13. package/dist/chunk-DFO7BOCT.js +35 -0
  14. package/dist/chunk-F6BX5YBK.mjs +15 -0
  15. package/dist/chunk-FLIBLJZ5.mjs +4586 -0
  16. package/dist/chunk-GTCRGRK2.mjs +20 -0
  17. package/dist/chunk-GUQOEBFW.js +1 -0
  18. package/dist/chunk-LZVNTYR3.js +109 -0
  19. package/dist/chunk-N2YKXZ5R.js +1 -0
  20. package/dist/chunk-QWZKKPML.mjs +18 -0
  21. package/dist/chunk-U64WWLJ7.mjs +35 -0
  22. package/dist/chunk-UV4HQO3Y.mjs +0 -0
  23. package/dist/chunk-XO62WWX4.js +1 -0
  24. package/dist/chunk-XUV4U54K.mjs +21 -0
  25. package/dist/chunk-XVKT7UGE.mjs +13 -0
  26. package/dist/chunk-Z2BSLIJ7.js +4585 -0
  27. package/dist/chunk-Z7XF6QIZ.mjs +17 -0
  28. package/dist/executors.d.mts +10 -0
  29. package/dist/executors.d.ts +10 -0
  30. package/dist/executors.js +9 -0
  31. package/dist/executors.mjs +9 -0
  32. package/dist/generators-Bk-gnn2s.d.ts +30 -0
  33. package/dist/generators-kdwvS-eX.d.mts +30 -0
  34. package/dist/generators.d.mts +5 -0
  35. package/dist/generators.d.ts +5 -0
  36. package/dist/generators.js +10 -0
  37. package/dist/generators.mjs +10 -0
  38. package/dist/index.d.mts +12 -0
  39. package/dist/index.d.ts +12 -0
  40. package/dist/index.js +26 -0
  41. package/dist/index.mjs +26 -0
  42. package/dist/schema.d-0Y4jyHfI.d.ts +11 -0
  43. package/dist/schema.d-BBpw11tM.d.ts +8 -0
  44. package/dist/schema.d-BCkJFwHO.d.mts +11 -0
  45. package/dist/schema.d-BTpgEb0Q.d.mts +8 -0
  46. package/dist/schema.d-C3zluSfr.d.mts +7 -0
  47. package/dist/schema.d-CWp7y_9i.d.mts +8 -0
  48. package/dist/schema.d-D2EQU5UL.d.mts +11 -0
  49. package/dist/schema.d-DhkOAnzb.d.ts +8 -0
  50. package/dist/schema.d-Dri9rCeV.d.ts +11 -0
  51. package/dist/schema.d-i8onVGak.d.ts +7 -0
  52. package/dist/src/base/base-executor.d.mts +44 -0
  53. package/dist/src/base/base-executor.d.ts +44 -0
  54. package/dist/src/base/base-executor.js +8 -0
  55. package/dist/src/base/base-executor.mjs +8 -0
  56. package/dist/src/base/index.d.mts +6 -0
  57. package/dist/src/base/index.d.ts +6 -0
  58. package/dist/src/base/index.js +15 -0
  59. package/dist/src/base/index.mjs +15 -0
  60. package/dist/src/base/providers.d.mts +8 -0
  61. package/dist/src/base/providers.d.ts +8 -0
  62. package/dist/src/base/providers.js +9 -0
  63. package/dist/src/base/providers.mjs +9 -0
  64. package/dist/src/executors/config/executor.d.mts +12 -0
  65. package/dist/src/executors/config/executor.d.ts +12 -0
  66. package/dist/src/executors/config/executor.js +9 -0
  67. package/dist/src/executors/config/executor.mjs +9 -0
  68. package/dist/src/executors/import/executor.d.mts +12 -0
  69. package/dist/src/executors/import/executor.d.ts +12 -0
  70. package/dist/src/executors/import/executor.js +9 -0
  71. package/dist/src/executors/import/executor.mjs +9 -0
  72. package/dist/src/executors/preview/executor.d.mts +12 -0
  73. package/dist/src/executors/preview/executor.d.ts +12 -0
  74. package/dist/src/executors/preview/executor.js +9 -0
  75. package/dist/src/executors/preview/executor.mjs +9 -0
  76. package/dist/src/executors/refresh/executor.d.mts +12 -0
  77. package/dist/src/executors/refresh/executor.d.ts +12 -0
  78. package/dist/src/executors/refresh/executor.js +9 -0
  79. package/dist/src/executors/refresh/executor.mjs +9 -0
  80. package/dist/src/executors/up/executor.d.mts +12 -0
  81. package/dist/src/executors/up/executor.d.ts +12 -0
  82. package/dist/src/executors/up/executor.js +9 -0
  83. package/dist/src/executors/up/executor.mjs +9 -0
  84. package/{src → dist/src}/executors/up/schema.d.ts +1 -0
  85. package/dist/src/generators/init/generator.d.mts +5 -0
  86. package/dist/src/generators/init/generator.d.ts +5 -0
  87. package/dist/src/generators/init/generator.js +11 -0
  88. package/dist/src/generators/init/generator.mjs +11 -0
  89. package/{src → dist/src}/generators/init/schema.d.ts +1 -1
  90. package/dist/tsup.config.d.mts +5 -0
  91. package/dist/tsup.config.d.ts +5 -0
  92. package/dist/tsup.config.js +34 -0
  93. package/dist/tsup.config.mjs +34 -0
  94. package/dist/types-CIJRaFHD.d.mts +1185 -0
  95. package/dist/types-CIJRaFHD.d.ts +1185 -0
  96. package/package.json +1 -1
  97. package/executors/config/executor.js +0 -4857
  98. package/executors/import/executor.js +0 -4856
  99. package/executors/preview/executor.js +0 -4853
  100. package/executors/refresh/executor.js +0 -4855
  101. package/executors/up/executor.js +0 -4858
  102. package/generators/init/generator.js +0 -150
  103. package/index.js +0 -5018
  104. package/meta.json +0 -3939
  105. package/src/base/base-executor.d.ts +0 -14
  106. package/src/base/index.d.ts +0 -2
  107. package/src/base/providers.d.ts +0 -6
  108. package/src/executors/config/executor.d.ts +0 -5
  109. package/src/executors/import/executor.d.ts +0 -5
  110. package/src/executors/index.d.ts +0 -5
  111. package/src/executors/preview/executor.d.ts +0 -5
  112. package/src/executors/refresh/executor.d.ts +0 -5
  113. package/src/executors/up/executor.d.ts +0 -5
  114. package/src/generators/index.d.ts +0 -1
  115. package/src/generators/init/generator.d.ts +0 -6
  116. package/src/index.d.ts +0 -2
  117. /package/{src → dist/src}/executors/config/schema.d.ts +0 -0
  118. /package/{src → dist/src}/executors/config/schema.json +0 -0
  119. /package/{src → dist/src}/executors/import/schema.d.ts +0 -0
  120. /package/{src → dist/src}/executors/import/schema.json +0 -0
  121. /package/{src → dist/src}/executors/preview/schema.d.ts +0 -0
  122. /package/{src → dist/src}/executors/preview/schema.json +0 -0
  123. /package/{src → dist/src}/executors/refresh/schema.d.ts +0 -0
  124. /package/{src → dist/src}/executors/refresh/schema.json +0 -0
  125. /package/{src → dist/src}/executors/up/schema.json +0 -0
  126. /package/{src → dist/src}/generators/init/files/src/index.ts.template +0 -0
  127. /package/{src → dist/src}/generators/init/schema.json +0 -0
@@ -0,0 +1,20 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-XUV4U54K.mjs";
4
+
5
+ // src/base/providers.ts
6
+ var Provider;
7
+ (function(Provider2) {
8
+ Provider2["AWS"] = "aws";
9
+ Provider2["AZURE"] = "azure";
10
+ Provider2["GOOGLE_CLOUD_PLATFORM"] = "gcp";
11
+ })(Provider || (Provider = {}));
12
+ function getCloudTemplateName(cloudProvider) {
13
+ return `${cloudProvider}-typescript`;
14
+ }
15
+ __name(getCloudTemplateName, "getCloudTemplateName");
16
+
17
+ export {
18
+ Provider,
19
+ getCloudTemplateName
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,109 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkDBLK3NPEjs = require('./chunk-DBLK3NPE.js');
4
+
5
+
6
+
7
+
8
+ var _chunkZ2BSLIJ7js = require('./chunk-Z2BSLIJ7.js');
9
+
10
+
11
+ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
12
+
13
+ // src/generators/init/generator.ts
14
+ var _devkit = require('@nx/devkit');
15
+ var _fs = require('fs');
16
+ var _path = require('path');
17
+ async function initGeneratorFn(tree, options, config) {
18
+ const task = _chunkZ2BSLIJ7js.initGenerator.call(void 0, tree, options);
19
+ _devkit.addProjectConfiguration.call(void 0, tree, options.name || "deployment", {
20
+ root: options.directory || "./deployment",
21
+ projectType: "application",
22
+ sourceRoot: options.directory || "./deployment",
23
+ targets: {
24
+ up: {
25
+ executor: "@nx-extend/pulumi:up",
26
+ options: {}
27
+ },
28
+ preview: {
29
+ executor: "@nx-extend/pulumi:preview",
30
+ options: {}
31
+ },
32
+ refresh: {
33
+ executor: "@nx-extend/pulumi:refresh",
34
+ options: {}
35
+ },
36
+ import: {
37
+ executor: "@nx-extend/pulumi:import",
38
+ options: {}
39
+ }
40
+ },
41
+ tags: [
42
+ "infra:pulumi"
43
+ ]
44
+ });
45
+ await _devkit.runTasksInSerial.call(void 0, generateNewPulumiProject(tree, options, config), loginToPulumi(tree, options, config), addPulumiDeps(tree, options), cleanupProject(tree, options))();
46
+ if (!options.skipFormat) {
47
+ await _devkit.formatFiles.call(void 0, tree);
48
+ }
49
+ return task;
50
+ }
51
+ _chunk3GQAWCBQjs.__name.call(void 0, initGeneratorFn, "initGeneratorFn");
52
+ var generator_default = _chunkZ2BSLIJ7js.withRunGenerator.call(void 0, "Initialize Storm Pulumi workspace", initGeneratorFn);
53
+ function generateNewPulumiProject(tree, options, config) {
54
+ return () => {
55
+ const template = _chunkDBLK3NPEjs.getCloudTemplateName.call(void 0, options.provider);
56
+ _chunkZ2BSLIJ7js.run.call(void 0, config, [
57
+ `pulumi new ${template}`,
58
+ `--name=${options.name || "deployment"}`,
59
+ `--dir=${options.directory || "./deployment"}`,
60
+ options.secretsProvider && `--secrets-provider=${options.secretsProvider}`,
61
+ "--generate-only",
62
+ "--yes",
63
+ "--force"
64
+ ].filter(Boolean).join(" "), _path.join.call(void 0, config.workspaceRoot, options.directory || "./deployment"), "inherit");
65
+ };
66
+ }
67
+ _chunk3GQAWCBQjs.__name.call(void 0, generateNewPulumiProject, "generateNewPulumiProject");
68
+ function loginToPulumi(tree, options, config) {
69
+ return () => {
70
+ if (!options.login) {
71
+ return;
72
+ }
73
+ if (options.login.startsWith("file://")) {
74
+ options.login = `file://${tree.root}/${options.directory || "./deployment"}/${options.login.replace("file://", "")}`;
75
+ }
76
+ _chunkZ2BSLIJ7js.run.call(void 0, config, [
77
+ "pulumi login",
78
+ options.login
79
+ ].filter(Boolean).join(" "), _path.join.call(void 0, config.workspaceRoot, options.directory || "./deployment"), "inherit", {
80
+ ...process.env,
81
+ PULUMI_EXPERIMENTAL: "true"
82
+ });
83
+ };
84
+ }
85
+ _chunk3GQAWCBQjs.__name.call(void 0, loginToPulumi, "loginToPulumi");
86
+ function addPulumiDeps(tree, options) {
87
+ return () => {
88
+ const packageJson = _devkit.readJsonFile.call(void 0, `${options.directory}/package.json`);
89
+ if (packageJson) {
90
+ _devkit.addDependenciesToPackageJson.call(void 0, tree, {}, packageJson.dependencies || {})();
91
+ }
92
+ };
93
+ }
94
+ _chunk3GQAWCBQjs.__name.call(void 0, addPulumiDeps, "addPulumiDeps");
95
+ function cleanupProject(tree, options) {
96
+ return () => {
97
+ const indexTsLocation = _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/index.ts`);
98
+ tree.write(`${options.directory}/pulumi.ts`, _fs.readFileSync.call(void 0, indexTsLocation).toString());
99
+ _fs.unlinkSync.call(void 0, _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/.gitignore`));
100
+ _fs.unlinkSync.call(void 0, _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/package.json`));
101
+ _fs.unlinkSync.call(void 0, _path.join.call(void 0, tree.root, `${options.directory || "./deployment"}/tsconfig.json`));
102
+ };
103
+ }
104
+ _chunk3GQAWCBQjs.__name.call(void 0, cleanupProject, "cleanupProject");
105
+
106
+
107
+
108
+
109
+ exports.initGeneratorFn = initGeneratorFn; exports.generator_default = generator_default;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,18 @@
1
+ import {
2
+ withPulumiExecutor
3
+ } from "./chunk-U64WWLJ7.mjs";
4
+
5
+ // src/executors/up/executor.ts
6
+ var executor_default = withPulumiExecutor("up", (options) => [
7
+ "--suppress-progress",
8
+ options.stack && `--stack=${options.stack}`,
9
+ options.skipPreview && "--skip-preview",
10
+ options.yes && "--yes",
11
+ options.suppressOutputs && "--suppress-outputs",
12
+ options.debug && "--debug",
13
+ options.json && "--json"
14
+ ]);
15
+
16
+ export {
17
+ executor_default
18
+ };
@@ -0,0 +1,35 @@
1
+ import {
2
+ run,
3
+ withRunExecutor
4
+ } from "./chunk-FLIBLJZ5.mjs";
5
+ import {
6
+ __name
7
+ } from "./chunk-XUV4U54K.mjs";
8
+
9
+ // src/base/base-executor.ts
10
+ import { join } from "node:path";
11
+ import { which } from "shelljs";
12
+ var withPulumiExecutor = /* @__PURE__ */ __name((command, argsMapper, executorOptions = {}) => async (_options, context) => {
13
+ return withRunExecutor(`Pulumi \`${command}\` Command Executor`, async (options, context2, config) => {
14
+ if (!which("pulumi")) {
15
+ throw new Error("Pulumi is not installed. Please install it before running this executor.");
16
+ }
17
+ if (!context2.projectsConfigurations?.projects || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
18
+ throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
19
+ }
20
+ const { sourceRoot } = context2.projectsConfigurations.projects[context2.projectName];
21
+ run(config, [
22
+ "pulumi",
23
+ command,
24
+ ...argsMapper(options)
25
+ ].filter(Boolean).join(" "), join(config.workspaceRoot, options.root || sourceRoot), "inherit", {
26
+ ...process.env,
27
+ PULUMI_EXPERIMENTAL: "true"
28
+ });
29
+ return null;
30
+ }, executorOptions)(_options, context);
31
+ }, "withPulumiExecutor");
32
+
33
+ export {
34
+ withPulumiExecutor
35
+ };
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,21 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+
10
+ // ../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.49.1_@types+node@22.10.7__@swc+core@1.7.26_@swc+helpers_ekim6y52mwpq6ssxiprcp44dam/node_modules/tsup/assets/esm_shims.js
11
+ import { fileURLToPath } from "url";
12
+ import path from "path";
13
+ var getFilename = /* @__PURE__ */ __name(() => fileURLToPath(import.meta.url), "getFilename");
14
+ var getDirname = /* @__PURE__ */ __name(() => path.dirname(getFilename()), "getDirname");
15
+ var __dirname = /* @__PURE__ */ getDirname();
16
+
17
+ export {
18
+ __name,
19
+ __require,
20
+ __dirname
21
+ };
@@ -0,0 +1,13 @@
1
+ import {
2
+ withPulumiExecutor
3
+ } from "./chunk-U64WWLJ7.mjs";
4
+
5
+ // src/executors/preview/executor.ts
6
+ var executor_default = withPulumiExecutor("preview", (options) => [
7
+ options.stack && `--stack=${options.stack}`,
8
+ options.expectNoChanges && "--expect-no-changes"
9
+ ]);
10
+
11
+ export {
12
+ executor_default
13
+ };