@storm-software/pulumi-tools 0.6.0 → 0.7.1

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 (95) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/chunk-23KFTIT2.mjs +0 -0
  3. package/dist/chunk-2XCPMHDR.js +16 -0
  4. package/dist/chunk-3GQAWCBQ.js +13 -0
  5. package/dist/chunk-CA7S5MOH.mjs +0 -0
  6. package/dist/chunk-CBUURZ5R.mjs +109 -0
  7. package/dist/chunk-DBLK3NPE.js +20 -0
  8. package/dist/chunk-F7LBNSGO.js +35 -0
  9. package/dist/chunk-GTCRGRK2.mjs +20 -0
  10. package/dist/chunk-GUQOEBFW.js +1 -0
  11. package/dist/chunk-GZTEXR7Q.mjs +16 -0
  12. package/dist/chunk-IVJCWDEC.js +15 -0
  13. package/dist/chunk-L3GQE7P7.js +5161 -0
  14. package/dist/chunk-MK5672IG.js +18 -0
  15. package/dist/chunk-N2YKXZ5R.js +1 -0
  16. package/dist/chunk-P37NP2DS.mjs +17 -0
  17. package/dist/chunk-SFVBFQZH.js +17 -0
  18. package/dist/chunk-SLTQXX2P.js +109 -0
  19. package/dist/chunk-UMOWC7KG.mjs +35 -0
  20. package/dist/chunk-UV4HQO3Y.mjs +0 -0
  21. package/dist/chunk-VZUKDJHC.mjs +5162 -0
  22. package/dist/chunk-W67Y7ZM5.mjs +18 -0
  23. package/dist/chunk-XJAQ2474.mjs +15 -0
  24. package/dist/chunk-XO62WWX4.js +1 -0
  25. package/dist/chunk-XUV4U54K.mjs +21 -0
  26. package/dist/chunk-YKA43YLP.mjs +13 -0
  27. package/dist/chunk-ZKKGELHG.js +13 -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/dist/src/generators/init/generator.d.mts +5 -0
  85. package/dist/src/generators/init/generator.d.ts +5 -0
  86. package/dist/src/generators/init/generator.js +11 -0
  87. package/dist/src/generators/init/generator.mjs +11 -0
  88. package/dist/src/generators/init/schema.d.ts +1 -1
  89. package/dist/tsup.config.d.mts +5 -0
  90. package/dist/tsup.config.d.ts +5 -0
  91. package/dist/tsup.config.js +34 -0
  92. package/dist/tsup.config.mjs +34 -0
  93. package/dist/types-CIJRaFHD.d.mts +1185 -0
  94. package/dist/types-CIJRaFHD.d.ts +1185 -0
  95. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkF7LBNSGOjs = require('./chunk-F7LBNSGO.js');
4
+
5
+ // src/executors/up/executor.ts
6
+ var executor_default = _chunkF7LBNSGOjs.withPulumiExecutor.call(void 0, "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
+
17
+
18
+ exports.executor_default = executor_default;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,17 @@
1
+ import {
2
+ withPulumiExecutor
3
+ } from "./chunk-UMOWC7KG.mjs";
4
+
5
+ // src/executors/config/executor.ts
6
+ var executor_default = withPulumiExecutor("config", (options) => [
7
+ options.action,
8
+ options.showSecrets && `--show-secrets`,
9
+ options.secret && `--secret`,
10
+ options.path && `--path`,
11
+ options.name && options.value && `"${options.name}" "${options.value}"`,
12
+ options.stack && `--stack=${options.stack}`
13
+ ]);
14
+
15
+ export {
16
+ executor_default
17
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkF7LBNSGOjs = require('./chunk-F7LBNSGO.js');
4
+
5
+ // src/executors/config/executor.ts
6
+ var executor_default = _chunkF7LBNSGOjs.withPulumiExecutor.call(void 0, "config", (options) => [
7
+ options.action,
8
+ options.showSecrets && `--show-secrets`,
9
+ options.secret && `--secret`,
10
+ options.path && `--path`,
11
+ options.name && options.value && `"${options.name}" "${options.value}"`,
12
+ options.stack && `--stack=${options.stack}`
13
+ ]);
14
+
15
+
16
+
17
+ exports.executor_default = executor_default;
@@ -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 _chunkL3GQE7P7js = require('./chunk-L3GQE7P7.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 = _chunkL3GQE7P7js.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 = _chunkL3GQE7P7js.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
+ _chunkL3GQE7P7js.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
+ _chunkL3GQE7P7js.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,35 @@
1
+ import {
2
+ run,
3
+ withRunExecutor
4
+ } from "./chunk-VZUKDJHC.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