@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
@@ -1,4 +1,4 @@
1
- import "./chunk-L2DHGVS5.mjs";
1
+ import "./chunk-IEZKYJSF.mjs";
2
2
 
3
3
  // tsup.config.ts
4
4
  import { defineConfig } from "tsup";
@@ -13,10 +13,7 @@ var tsup_config_default = defineConfig([
13
13
  "./src/generators/*/generator.ts"
14
14
  ],
15
15
  outDir: "dist",
16
- format: [
17
- "cjs",
18
- "esm"
19
- ],
16
+ format: ["cjs", "esm"],
20
17
  platform: "node",
21
18
  splitting: true,
22
19
  clean: true,
@@ -24,9 +21,7 @@ var tsup_config_default = defineConfig([
24
21
  sourcemap: false,
25
22
  shims: true,
26
23
  tsconfig: "./tsconfig.json",
27
- external: [
28
- "@storm-software/workspace-tools"
29
- ]
24
+ external: ["@storm-software/workspace-tools"]
30
25
  }
31
26
  ]);
32
27
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/pulumi-tools",
3
- "version": "0.7.79",
3
+ "version": "0.7.81",
4
4
  "type": "commonjs",
5
5
  "description": "Tools for managing Pulumi infrastructure within a Nx workspace.",
6
6
  "repository": {
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkP47FZNOXjs = require('./chunk-P47FZNOX.js');
4
-
5
- // src/executors/refresh/executor.ts
6
- var executor_default = _chunkP47FZNOXjs.withPulumiExecutor.call(void 0, "refresh", (options) => [
7
- "--suppress-progress",
8
- options.stack && `--stack=${options.stack}`,
9
- options.skipPreview && "--skip-preview",
10
- options.yes && "--yes"
11
- ]);
12
-
13
-
14
-
15
- exports.executor_default = executor_default;
@@ -1,13 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});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
-
11
-
12
-
13
- exports.__name = __name; exports.__require = __require;
@@ -1,109 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkDBLK3NPEjs = require('./chunk-DBLK3NPE.js');
4
-
5
-
6
-
7
-
8
- var _chunkAKO3NFBSjs = require('./chunk-AKO3NFBS.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 = _chunkAKO3NFBSjs.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 = _chunkAKO3NFBSjs.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
- _chunkAKO3NFBSjs.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
- _chunkAKO3NFBSjs.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;
@@ -1,13 +0,0 @@
1
- import {
2
- withPulumiExecutor
3
- } from "./chunk-WEKJLMNL.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
- };
@@ -1,35 +0,0 @@
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 _chunkAKO3NFBSjs = require('./chunk-AKO3NFBS.js');
5
-
6
-
7
- var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
8
-
9
- // src/base/base-executor.ts
10
- var _path = require('path');
11
- var _shelljs = require('shelljs');
12
- var withPulumiExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (command, argsMapper, executorOptions = {}) => async (_options, context) => {
13
- return _chunkAKO3NFBSjs.withRunExecutor.call(void 0, `Pulumi \`${command}\` Command Executor`, async (options, context2, config) => {
14
- if (!_shelljs.which.call(void 0, "pulumi")) {
15
- throw new Error("Pulumi is not installed. Please install it before running this executor.");
16
- }
17
- if (!_optionalChain([context2, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.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
- _chunkAKO3NFBSjs.run.call(void 0, config, [
22
- "pulumi",
23
- command,
24
- ...argsMapper(options)
25
- ].filter(Boolean).join(" "), _path.join.call(void 0, 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
-
34
-
35
- exports.withPulumiExecutor = withPulumiExecutor;
@@ -1,109 +0,0 @@
1
- import {
2
- getCloudTemplateName
3
- } from "./chunk-FOZFHF2O.mjs";
4
- import {
5
- initGenerator,
6
- run,
7
- withRunGenerator
8
- } from "./chunk-DD4EVDG7.mjs";
9
- import {
10
- __name
11
- } from "./chunk-L2DHGVS5.mjs";
12
-
13
- // src/generators/init/generator.ts
14
- import { addDependenciesToPackageJson, addProjectConfiguration, formatFiles, readJsonFile, runTasksInSerial } from "@nx/devkit";
15
- import { readFileSync, unlinkSync } from "node:fs";
16
- import { join } from "node:path";
17
- async function initGeneratorFn(tree, options, config) {
18
- const task = initGenerator(tree, options);
19
- addProjectConfiguration(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 runTasksInSerial(generateNewPulumiProject(tree, options, config), loginToPulumi(tree, options, config), addPulumiDeps(tree, options), cleanupProject(tree, options))();
46
- if (!options.skipFormat) {
47
- await formatFiles(tree);
48
- }
49
- return task;
50
- }
51
- __name(initGeneratorFn, "initGeneratorFn");
52
- var generator_default = withRunGenerator("Initialize Storm Pulumi workspace", initGeneratorFn);
53
- function generateNewPulumiProject(tree, options, config) {
54
- return () => {
55
- const template = getCloudTemplateName(options.provider);
56
- run(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(" "), join(config.workspaceRoot, options.directory || "./deployment"), "inherit");
65
- };
66
- }
67
- __name(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
- run(config, [
77
- "pulumi login",
78
- options.login
79
- ].filter(Boolean).join(" "), join(config.workspaceRoot, options.directory || "./deployment"), "inherit", {
80
- ...process.env,
81
- PULUMI_EXPERIMENTAL: "true"
82
- });
83
- };
84
- }
85
- __name(loginToPulumi, "loginToPulumi");
86
- function addPulumiDeps(tree, options) {
87
- return () => {
88
- const packageJson = readJsonFile(`${options.directory}/package.json`);
89
- if (packageJson) {
90
- addDependenciesToPackageJson(tree, {}, packageJson.dependencies || {})();
91
- }
92
- };
93
- }
94
- __name(addPulumiDeps, "addPulumiDeps");
95
- function cleanupProject(tree, options) {
96
- return () => {
97
- const indexTsLocation = join(tree.root, `${options.directory || "./deployment"}/index.ts`);
98
- tree.write(`${options.directory}/pulumi.ts`, readFileSync(indexTsLocation).toString());
99
- unlinkSync(join(tree.root, `${options.directory || "./deployment"}/.gitignore`));
100
- unlinkSync(join(tree.root, `${options.directory || "./deployment"}/package.json`));
101
- unlinkSync(join(tree.root, `${options.directory || "./deployment"}/tsconfig.json`));
102
- };
103
- }
104
- __name(cleanupProject, "cleanupProject");
105
-
106
- export {
107
- initGeneratorFn,
108
- generator_default
109
- };
@@ -1,13 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkP47FZNOXjs = require('./chunk-P47FZNOX.js');
4
-
5
- // src/executors/preview/executor.ts
6
- var executor_default = _chunkP47FZNOXjs.withPulumiExecutor.call(void 0, "preview", (options) => [
7
- options.stack && `--stack=${options.stack}`,
8
- options.expectNoChanges && "--expect-no-changes"
9
- ]);
10
-
11
-
12
-
13
- exports.executor_default = executor_default;
@@ -1,35 +0,0 @@
1
- import {
2
- run,
3
- withRunExecutor
4
- } from "./chunk-DD4EVDG7.mjs";
5
- import {
6
- __name
7
- } from "./chunk-L2DHGVS5.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
- };
@@ -1,15 +0,0 @@
1
- import {
2
- withPulumiExecutor
3
- } from "./chunk-WEKJLMNL.mjs";
4
-
5
- // src/executors/refresh/executor.ts
6
- var executor_default = withPulumiExecutor("refresh", (options) => [
7
- "--suppress-progress",
8
- options.stack && `--stack=${options.stack}`,
9
- options.skipPreview && "--skip-preview",
10
- options.yes && "--yes"
11
- ]);
12
-
13
- export {
14
- executor_default
15
- };