@storm-software/terraform-tools 0.57.1 → 0.58.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 (43) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-QWYUK6DV.js → chunk-MPUCOKKN.js} +1 -4
  4. package/dist/{chunk-67CRAPR7.mjs → chunk-UZBBNDBT.mjs} +14 -17
  5. package/dist/generators.js +2 -2
  6. package/dist/generators.mjs +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/src/generators/init/init.js +2 -2
  10. package/dist/src/generators/init/init.mjs +1 -1
  11. package/package.json +10 -30
  12. package/.eslintrc.json +0 -35
  13. package/executors.ts +0 -8
  14. package/generators.ts +0 -2
  15. package/index.ts +0 -3
  16. package/project.json +0 -57
  17. package/src/base/base-terraform-executor.untyped.ts +0 -90
  18. package/src/base/index.ts +0 -2
  19. package/src/base/terraform-executor.ts +0 -101
  20. package/src/executors/apply/executor.spec.ts +0 -18
  21. package/src/executors/apply/executor.ts +0 -4
  22. package/src/executors/destroy/executor.spec.ts +0 -18
  23. package/src/executors/destroy/executor.ts +0 -4
  24. package/src/executors/output/executor.spec.ts +0 -18
  25. package/src/executors/output/executor.ts +0 -4
  26. package/src/executors/plan/executor.spec.ts +0 -18
  27. package/src/executors/plan/executor.ts +0 -4
  28. package/src/generators/init/init.ts +0 -15
  29. package/tsconfig.json +0 -31
  30. package/tsup.config.ts +0 -29
  31. /package/{src → dist/src}/base/base-terraform-executor.schema.d.ts +0 -0
  32. /package/{src → dist/src}/base/base-terraform-executor.schema.json +0 -0
  33. /package/{src → dist/src}/executors/apply/schema.d.ts +0 -0
  34. /package/{src → dist/src}/executors/apply/schema.json +0 -0
  35. /package/{src → dist/src}/executors/destroy/schema.d.ts +0 -0
  36. /package/{src → dist/src}/executors/destroy/schema.json +0 -0
  37. /package/{src → dist/src}/executors/output/schema.d.ts +0 -0
  38. /package/{src → dist/src}/executors/output/schema.json +0 -0
  39. /package/{src → dist/src}/executors/plan/schema.d.ts +0 -0
  40. /package/{src → dist/src}/executors/plan/schema.json +0 -0
  41. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  42. /package/{src → dist/src}/generators/init/schema.json +0 -0
  43. /package/{src → docs/api}/base/base-terraform-executor.schema.md +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  # Changelog for Storm Ops - Terraform Tools
4
4
 
5
+ ## [0.58.0](https://github.com/storm-software/storm-ops/releases/tag/terraform-tools%400.58.0) (2025-05-06)
6
+
7
+ ### Features
8
+
9
+ - **workspace-tools:** Update the release executor to replace workspace
10
+ configurations
11
+ ([7d2aa456c](https://github.com/storm-software/storm-ops/commit/7d2aa456c))
12
+
13
+ ### Miscellaneous
14
+
15
+ - **monorepo:** Regenerate README markdown files
16
+ ([96f241a4d](https://github.com/storm-software/storm-ops/commit/96f241a4d))
17
+ - **monorepo:** Regenerate README markdown files
18
+ ([17bbe7e16](https://github.com/storm-software/storm-ops/commit/17bbe7e16))
19
+
20
+ ## [0.57.2](https://github.com/storm-software/storm-ops/releases/tag/terraform-tools%400.57.2) (2025-05-06)
21
+
22
+ ### Bug Fixes
23
+
24
+ - **workspace-tools:** Resolve issue with import path in executor
25
+ ([ddad2fdc8](https://github.com/storm-software/storm-ops/commit/ddad2fdc8))
26
+
27
+ ### Miscellaneous
28
+
29
+ - **monorepo:** Regenerate README markdown files
30
+ ([7e0751c3d](https://github.com/storm-software/storm-ops/commit/7e0751c3d))
31
+
5
32
  ## [0.57.1](https://github.com/storm-software/storm-ops/releases/tag/terraform-tools%400.57.1) (2025-05-06)
6
33
 
7
34
  ### Bug Fixes
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.56.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.57.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -1061,14 +1061,11 @@ var executor_default6 = _chunkA4RDGLKCjs.withRunExecutor.call(void 0,
1061
1061
 
1062
1062
 
1063
1063
 
1064
-
1065
- var _columnify = require('columnify'); var columnify = _interopRequireWildcard(_columnify);
1064
+ // ../workspace-tools/src/utils/pnpm-deps-update.ts
1066
1065
 
1067
1066
 
1068
1067
 
1069
- var _npmrunpath = require('npm-run-path');
1070
1068
 
1071
- // ../workspace-tools/src/utils/pnpm-deps-update.ts
1072
1069
 
1073
1070
 
1074
1071
  var _prettier = require('prettier');
@@ -1059,17 +1059,14 @@ var executor_default6 = withRunExecutor(
1059
1059
  );
1060
1060
 
1061
1061
  // ../workspace-tools/src/executors/npm-publish/executor.ts
1062
- import {
1063
- detectPackageManager,
1064
- readJsonFile
1065
- } from "@nx/devkit";
1066
- import * as columnify from "columnify";
1067
- import { exec, execSync as execSync3 } from "node:child_process";
1068
- import { existsSync as existsSync6 } from "node:fs";
1069
- import { relative as relative3 } from "node:path";
1070
- import { env as appendLocalEnv } from "npm-run-path";
1062
+ import { execSync as execSync3 } from "node:child_process";
1063
+ import { readFile as readFile5 } from "node:fs/promises";
1071
1064
 
1072
1065
  // ../workspace-tools/src/utils/pnpm-deps-update.ts
1066
+ import {
1067
+ createProjectGraphAsync as createProjectGraphAsync3,
1068
+ readCachedProjectGraph as readCachedProjectGraph2
1069
+ } from "@nx/devkit";
1073
1070
  import { existsSync as existsSync5 } from "node:fs";
1074
1071
  import { readFile as readFile4, writeFile as writeFile2 } from "node:fs/promises";
1075
1072
  import { format } from "prettier";
@@ -2435,8 +2432,8 @@ var DEFAULT_COMMIT_QUESTIONS = {
2435
2432
  };
2436
2433
 
2437
2434
  // ../workspace-tools/src/generators/release-version/generator.ts
2438
- import { exec as exec2, execSync as execSync4 } from "node:child_process";
2439
- import { relative as relative4 } from "node:path";
2435
+ import { exec, execSync as execSync4 } from "node:child_process";
2436
+ import { relative as relative3 } from "node:path";
2440
2437
  import { IMPLICIT_DEFAULT_RELEASE_GROUP } from "nx/src/command-line/release/config/config";
2441
2438
  import {
2442
2439
  getFirstGitCommit,
@@ -2827,10 +2824,10 @@ import { retrieveProjectConfigurationsWithoutPluginInference } from "nx/src/proj
2827
2824
  // ../workspace-tools/src/utils/lock-file.ts
2828
2825
  import {
2829
2826
  output as output2,
2830
- readJsonFile as readJsonFile2,
2827
+ readJsonFile,
2831
2828
  workspaceRoot as workspaceRoot2
2832
2829
  } from "@nx/devkit";
2833
- import { existsSync as existsSync7 } from "node:fs";
2830
+ import { existsSync as existsSync6 } from "node:fs";
2834
2831
  import { join as join2 } from "node:path";
2835
2832
  import {
2836
2833
  getNpmLockfileDependencies,
@@ -2854,14 +2851,14 @@ var PNPM_LOCK_PATH = join2(workspaceRoot2, PNPM_LOCK_FILE);
2854
2851
  // ../workspace-tools/src/utils/package-helpers.ts
2855
2852
  import {
2856
2853
  joinPathFragments as joinPathFragments6,
2857
- readJsonFile as readJsonFile3
2854
+ readJsonFile as readJsonFile2
2858
2855
  } from "@nx/devkit";
2859
- import { existsSync as existsSync8 } from "node:fs";
2856
+ import { existsSync as existsSync7 } from "node:fs";
2860
2857
 
2861
2858
  // ../workspace-tools/src/utils/plugin-helpers.ts
2862
- import { readJsonFile as readJsonFile4 } from "@nx/devkit";
2859
+ import { readJsonFile as readJsonFile3 } from "@nx/devkit";
2863
2860
  import defu3 from "defu";
2864
- import { existsSync as existsSync9 } from "node:fs";
2861
+ import { existsSync as existsSync8 } from "node:fs";
2865
2862
  import { dirname, join as join3 } from "node:path";
2866
2863
 
2867
2864
  // ../workspace-tools/src/utils/typia-transform.ts
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-N2YKXZ5R.js');
2
2
 
3
3
 
4
- var _chunkQWYUK6DVjs = require('./chunk-QWYUK6DV.js');
4
+ var _chunkMPUCOKKNjs = require('./chunk-MPUCOKKN.js');
5
5
  require('./chunk-A4RDGLKC.js');
6
6
  require('./chunk-3RG5ZIWI.js');
7
7
 
8
8
 
9
- exports.initGenerator = _chunkQWYUK6DVjs.initGenerator;
9
+ exports.initGenerator = _chunkMPUCOKKNjs.initGenerator;
@@ -1,7 +1,7 @@
1
1
  import "./chunk-23KFTIT2.mjs";
2
2
  import {
3
3
  initGenerator
4
- } from "./chunk-67CRAPR7.mjs";
4
+ } from "./chunk-UZBBNDBT.mjs";
5
5
  import "./chunk-DIXFQWYR.mjs";
6
6
  import "./chunk-IEZKYJSF.mjs";
7
7
  export {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ require('./chunk-WJV4GOSN.js');
5
5
  require('./chunk-N2YKXZ5R.js');
6
6
 
7
7
 
8
- var _chunkQWYUK6DVjs = require('./chunk-QWYUK6DV.js');
8
+ var _chunkMPUCOKKNjs = require('./chunk-MPUCOKKN.js');
9
9
  require('./chunk-GUQOEBFW.js');
10
10
 
11
11
 
@@ -20,4 +20,4 @@ require('./chunk-3RG5ZIWI.js');
20
20
 
21
21
 
22
22
 
23
- exports.baseTerraformExecutorSchema = _chunkILC773N2js.base_terraform_executor_untyped_default; exports.initGenerator = _chunkQWYUK6DVjs.initGenerator; exports.withTerraformExecutor = _chunkZLPOE4VZjs.withTerraformExecutor;
23
+ exports.baseTerraformExecutorSchema = _chunkILC773N2js.base_terraform_executor_untyped_default; exports.initGenerator = _chunkMPUCOKKNjs.initGenerator; exports.withTerraformExecutor = _chunkZLPOE4VZjs.withTerraformExecutor;
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import "./chunk-ONGG25RY.mjs";
5
5
  import "./chunk-23KFTIT2.mjs";
6
6
  import {
7
7
  initGenerator
8
- } from "./chunk-67CRAPR7.mjs";
8
+ } from "./chunk-UZBBNDBT.mjs";
9
9
  import "./chunk-CA7S5MOH.mjs";
10
10
  import {
11
11
  base_terraform_executor_untyped_default
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkQWYUK6DVjs = require('../../../chunk-QWYUK6DV.js');
4
+ var _chunkMPUCOKKNjs = require('../../../chunk-MPUCOKKN.js');
5
5
  require('../../../chunk-A4RDGLKC.js');
6
6
  require('../../../chunk-3RG5ZIWI.js');
7
7
 
8
8
 
9
9
 
10
- exports.default = _chunkQWYUK6DVjs.init_default; exports.initGenerator = _chunkQWYUK6DVjs.initGenerator;
10
+ exports.default = _chunkMPUCOKKNjs.init_default; exports.initGenerator = _chunkMPUCOKKNjs.initGenerator;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  initGenerator,
3
3
  init_default
4
- } from "../../../chunk-67CRAPR7.mjs";
4
+ } from "../../../chunk-UZBBNDBT.mjs";
5
5
  import "../../../chunk-DIXFQWYR.mjs";
6
6
  import "../../../chunk-IEZKYJSF.mjs";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/terraform-tools",
3
- "version": "0.57.1",
3
+ "version": "0.58.0",
4
4
  "description": "Tools for managing Terraform infrastructure within a Nx workspace.",
5
5
  "repository": {
6
6
  "type": "github",
@@ -31,28 +31,16 @@
31
31
  "types": "./dist/index.d.mts",
32
32
  "default": "./dist/index.mjs"
33
33
  },
34
- "require": {
35
- "types": "./dist/index.d.ts",
36
- "default": "./dist/index.js"
37
- },
38
- "default": {
39
- "types": "./dist/index.d.ts",
40
- "default": "./dist/index.js"
41
- }
34
+ "require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
35
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
42
36
  },
43
37
  "./index": {
44
38
  "import": {
45
39
  "types": "./dist/index.d.mts",
46
40
  "default": "./dist/index.mjs"
47
41
  },
48
- "require": {
49
- "types": "./dist/index.d.ts",
50
- "default": "./dist/index.js"
51
- },
52
- "default": {
53
- "types": "./dist/index.d.ts",
54
- "default": "./dist/index.js"
55
- }
42
+ "require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
43
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
56
44
  },
57
45
  "./executors": {
58
46
  "import": {
@@ -133,16 +121,10 @@
133
121
  "untyped": "1.5.2"
134
122
  },
135
123
  "peerDependenciesMeta": {
136
- "@nx/devkit": {
137
- "optional": false
138
- },
139
- "nx": {
140
- "optional": false
141
- }
142
- },
143
- "dependencies": {
144
- "shelljs": "^0.8.5"
124
+ "@nx/devkit": { "optional": false },
125
+ "nx": { "optional": false }
145
126
  },
127
+ "dependencies": { "shelljs": "^0.8.5" },
146
128
  "devDependencies": {
147
129
  "@nx/devkit": "20.8.0",
148
130
  "@types/node": "^22.10.2",
@@ -150,9 +132,7 @@
150
132
  "tsup": "8.4.0",
151
133
  "untyped": "^1.5.2"
152
134
  },
153
- "publishConfig": {
154
- "access": "public"
155
- },
135
+ "publishConfig": { "access": "public" },
156
136
  "executors": "./executors.json",
157
137
  "generators": "./generators.json"
158
- }
138
+ }
package/.eslintrc.json DELETED
@@ -1,35 +0,0 @@
1
- {
2
- "extends": ["../../.eslintrc.json"],
3
- "ignorePatterns": ["!**/*"],
4
- "overrides": [
5
- {
6
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7
- "parserOptions": {
8
- "project": ["packages/terraform-tools/tsconfig.*?.json"]
9
- },
10
- "rules": {}
11
- },
12
- {
13
- "files": ["*.ts", "*.tsx"],
14
- "rules": {}
15
- },
16
- {
17
- "files": ["*.js", "*.jsx"],
18
- "rules": {}
19
- },
20
- {
21
- "files": ["*.json"],
22
- "parser": "jsonc-eslint-parser",
23
- "rules": {
24
- "@nx/dependency-checks": "error"
25
- }
26
- },
27
- {
28
- "files": ["./package.json"],
29
- "parser": "jsonc-eslint-parser",
30
- "rules": {
31
- "@nx/nx-plugin-checks": "error"
32
- }
33
- }
34
- ]
35
- }
package/executors.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from "./src/executors/apply/executor";
2
- export { type ApplyExecutorSchema } from "./src/executors/apply/schema.d";
3
- export * from "./src/executors/destroy/executor";
4
- export { type DestroyExecutorSchema } from "./src/executors/destroy/schema.d";
5
- export * from "./src/executors/output/executor";
6
- export { type OutputExecutorSchema } from "./src/executors/output/schema.d";
7
- export * from "./src/executors/plan/executor";
8
- export { type PlanExecutorSchema } from "./src/executors/plan/schema.d";
package/generators.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./src/generators/init/init";
2
- export { type InitGeneratorSchema } from "./src/generators/init/schema.d";
package/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./executors";
2
- export * from "./generators";
3
- export * from "./src/base";
package/project.json DELETED
@@ -1,57 +0,0 @@
1
- {
2
- "name": "terraform-tools",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/terraform-tools/src",
5
- "projectType": "library",
6
- "implicitDependencies": ["workspace-tools", "untyped"],
7
- "targets": {
8
- "build-untyped": {
9
- "executor": "nx:run-commands",
10
- "dependsOn": ["clean", "^build"],
11
- "inputs": [
12
- "{projectRoot}/src/**/untyped.ts",
13
- "{projectRoot}/src/**/*.untyped.ts"
14
- ],
15
- "outputs": [
16
- "{projectRoot}/src/**/schema.d.ts",
17
- "{projectRoot}/src/**/*.schema.d.ts",
18
- "{projectRoot}/src/**/schema.md",
19
- "{projectRoot}/src/**/*.schema.md",
20
- "{projectRoot}/src/**/schema.json",
21
- "{projectRoot}/src/**/*.schema.json"
22
- ],
23
- "options": {
24
- "commands": [
25
- "node dist/packages/untyped/bin/untyped.cjs generate --entry=\"packages/terraform-tools/**/{untyped.ts,*.untyped.ts}\" "
26
- ]
27
- }
28
- },
29
- "build-base": {
30
- "executor": "nx:run-commands",
31
- "dependsOn": ["build-untyped", "clean", "^build"],
32
- "options": {
33
- "command": "tsup-node --config=tsup.config.ts",
34
- "cwd": "{projectRoot}"
35
- }
36
- },
37
- "build": {
38
- "executor": "nx:run-commands",
39
- "dependsOn": ["build-base", "build-untyped"],
40
- "options": {
41
- "commands": [
42
- "pnpm copyfiles LICENSE dist/packages/terraform-tools",
43
- "pnpm copyfiles --up=2 ./packages/terraform-tools/*.md ./packages/terraform-tools/executors.json ./packages/terraform-tools/generators.json ./packages/terraform-tools/package.json dist/packages/terraform-tools",
44
- "pnpm copyfiles --up=3 \"./packages/terraform-tools/dist/**/*\" dist/packages/terraform-tools/dist",
45
- "pnpm copyfiles --up=3 \"./packages/terraform-tools/src/**/*schema.d.ts\" dist/packages/terraform-tools/dist/src",
46
- "pnpm copyfiles --up=3 \"./packages/terraform-tools/src/**/*schema.json\" dist/packages/terraform-tools/dist/src",
47
- "pnpm copyfiles --up=3 \"./packages/terraform-tools/src/**/*.md\" dist/packages/terraform-tools/docs/api",
48
- "pnpm copyfiles --up=4 \"./packages/terraform-tools/src/generators/*/files/**/*\" dist/packages/terraform-tools/dist/src/generators"
49
- ]
50
- }
51
- },
52
-
53
- "nx-release-publish": {
54
- "executor": "@storm-software/workspace-tools:npm-publish"
55
- }
56
- }
57
- }
@@ -1,90 +0,0 @@
1
- // import baseExecutorSchema from "@storm-software/workspace-tools/base/base-executor.schema";
2
- import { defineUntypedSchema } from "untyped";
3
-
4
- export default defineUntypedSchema({
5
- $schema: {
6
- title: "Base Terraform Executor",
7
- description: "A base type definition for a Terraform executor schema",
8
- },
9
- backendConfig: {
10
- $schema: {
11
- title: "Backend Config",
12
- type: "array",
13
- description: "The backend configuration",
14
- },
15
- $default: [],
16
- },
17
- autoApproval: {
18
- $schema: {
19
- title: "Auto Approval",
20
- type: "boolean",
21
- description: "Whether to auto-approve the plan",
22
- },
23
- $default: false,
24
- },
25
- planFile: {
26
- $schema: {
27
- title: "Plan File",
28
- format: "path",
29
- description: "The plan file",
30
- type: "string",
31
- },
32
- $default: "plan.out",
33
- },
34
- formatWrite: {
35
- $schema: {
36
- title: "Format Write",
37
- type: "boolean",
38
- description: "Whether to format the files before writing",
39
- },
40
- $default: false,
41
- },
42
- upgrade: {
43
- $schema: {
44
- title: "Upgrade",
45
- type: "boolean",
46
- description: "Whether to upgrade the modules",
47
- },
48
- $default: false,
49
- },
50
- migrateState: {
51
- $schema: {
52
- title: "Migrate State",
53
- type: "boolean",
54
- description: "Whether to migrate the state",
55
- },
56
- $default: false,
57
- },
58
- lock: {
59
- $schema: {
60
- title: "Lock",
61
- type: "boolean",
62
- description: "Whether to lock the state",
63
- },
64
- $default: false,
65
- },
66
- varFile: {
67
- $schema: {
68
- title: "Var File",
69
- format: "path",
70
- type: "string",
71
- description: "The variable file",
72
- },
73
- $default: "variables.tf",
74
- },
75
- varString: {
76
- $schema: {
77
- title: "Var String",
78
- type: "string",
79
- description: "The variable string",
80
- },
81
- },
82
- reconfigure: {
83
- $schema: {
84
- title: "Reconfigure",
85
- type: "boolean",
86
- description: "Whether to reconfigure the state",
87
- },
88
- $default: false,
89
- },
90
- });
package/src/base/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as baseTerraformExecutorSchema } from "./base-terraform-executor.untyped";
2
- export * from "./terraform-executor";
@@ -1,101 +0,0 @@
1
- import type { ExecutorContext } from "@nx/devkit";
2
- import { StormWorkspaceConfig } from "@storm-software/config";
3
- import { ProjectTokenizerOptions, run } from "@storm-software/config-tools";
4
- import { withRunExecutor } from "@storm-software/workspace-tools/base/base-executor";
5
- import type { BaseExecutorSchema } from "@storm-software/workspace-tools/base/base-executor.schema.d";
6
- import type { BaseExecutorOptions } from "@storm-software/workspace-tools/types";
7
- import { which } from "shelljs";
8
- import type { BaseTerraformExecutorSchema } from "./base-terraform-executor.schema.d";
9
-
10
- export type TerraformExecutorSchema = BaseExecutorSchema &
11
- Partial<BaseTerraformExecutorSchema>;
12
-
13
- export type NormalizedTerraformExecutorOptions = ProjectTokenizerOptions &
14
- TerraformExecutorSchema;
15
-
16
- export const withTerraformExecutor =
17
- <TExecutorSchema extends TerraformExecutorSchema = TerraformExecutorSchema>(
18
- command: string,
19
- executorOptions: BaseExecutorOptions<TExecutorSchema> = {}
20
- ) =>
21
- async (
22
- _options: TExecutorSchema,
23
- context: ExecutorContext
24
- ): Promise<{ success: boolean }> => {
25
- return withRunExecutor<TExecutorSchema>(
26
- `Terraform \`${command}\` Command Executor`,
27
- async (
28
- options: NormalizedTerraformExecutorOptions,
29
- context: ExecutorContext,
30
- config: StormWorkspaceConfig
31
- ) => {
32
- if (!which("tofu") || !which("terraform")) {
33
- throw new Error(
34
- "Both OpenTofu and Terraform are not installed. Please install one of the two before running this executor."
35
- );
36
- }
37
- if (!which("terragrunt")) {
38
- throw new Error(
39
- "Terragrunt is not installed. Please install them before running this executor."
40
- );
41
- }
42
-
43
- const {
44
- backendConfig = [],
45
- planFile,
46
- autoApproval,
47
- formatWrite,
48
- upgrade,
49
- migrateState,
50
- lock,
51
- varFile,
52
- varString,
53
- reconfigure
54
- } = options;
55
-
56
- let jsonBackendConfig = backendConfig;
57
- if (typeof jsonBackendConfig === "string") {
58
- jsonBackendConfig = JSON.parse(jsonBackendConfig);
59
- }
60
-
61
- run(
62
- config,
63
- [
64
- "terragrunt",
65
- command,
66
- ...jsonBackendConfig.map(
67
- config => `-backend-config="${config.key}=${config.name}"`
68
- ),
69
- command === "plan" && planFile && `-out ${planFile}`,
70
- command === "plan" && varFile && `--var-file ${varFile}`,
71
- command === "plan" && varString && `--var ${varString}`,
72
- command === "destroy" && autoApproval && "-auto-approve",
73
- command === "apply" && autoApproval && "-auto-approve",
74
- command === "apply" && planFile,
75
- command === "apply" && varString && `--var ${varString}`,
76
- command === "fmt" && "--recursive",
77
- command === "fmt" && !formatWrite && "--check --list",
78
- command === "init" && upgrade && "-upgrade",
79
- command === "init" && migrateState && "-migrate-state",
80
- command === "init" && reconfigure && "-reconfigure",
81
- command === "providers" && lock && "lock",
82
- command === "test" && varFile && `--var-file ${varFile}`,
83
- command === "test" && varString && `--var ${varString}`
84
- ]
85
- .filter(Boolean)
86
- .join(" "),
87
- options.sourceRoot,
88
- "inherit",
89
- process.env.CI
90
- ? {
91
- TF_IN_AUTOMATION: "true",
92
- TF_INPUT: "0"
93
- }
94
- : {}
95
- );
96
-
97
- return null;
98
- },
99
- executorOptions
100
- )(_options, context);
101
- };
@@ -1,18 +0,0 @@
1
- import { ExecutorContext } from "@nx/devkit";
2
-
3
- import executor from "./executor";
4
- import { ApplyExecutorSchema } from "./schema";
5
-
6
- const options: ApplyExecutorSchema = {};
7
- const context: ExecutorContext = {
8
- root: "",
9
- cwd: process.cwd(),
10
- isVerbose: false,
11
- };
12
-
13
- describe("Apply Executor", () => {
14
- it("can run", async () => {
15
- const output = await executor(options, context);
16
- expect(output.success).toBe(true);
17
- });
18
- });
@@ -1,4 +0,0 @@
1
- import { withTerraformExecutor } from "../../base/terraform-executor";
2
- import { ApplyExecutorSchema } from "./schema.d";
3
-
4
- export default withTerraformExecutor<ApplyExecutorSchema>("apply");
@@ -1,18 +0,0 @@
1
- import { ExecutorContext } from "@nx/devkit";
2
-
3
- import executor from "./executor";
4
- import { DestroyExecutorSchema } from "./schema";
5
-
6
- const options: DestroyExecutorSchema = {};
7
- const context: ExecutorContext = {
8
- root: "",
9
- cwd: process.cwd(),
10
- isVerbose: false,
11
- };
12
-
13
- describe("Destroy Executor", () => {
14
- it("can run", async () => {
15
- const output = await executor(options, context);
16
- expect(output.success).toBe(true);
17
- });
18
- });
@@ -1,4 +0,0 @@
1
- import { withTerraformExecutor } from "../../base/terraform-executor";
2
- import { DestroyExecutorSchema } from "./schema.d";
3
-
4
- export default withTerraformExecutor<DestroyExecutorSchema>("destroy");
@@ -1,18 +0,0 @@
1
- import { ExecutorContext } from "@nx/devkit";
2
-
3
- import executor from "./executor";
4
- import { FmtExecutorSchema } from "./schema";
5
-
6
- const options: FmtExecutorSchema = {};
7
- const context: ExecutorContext = {
8
- root: "",
9
- cwd: process.cwd(),
10
- isVerbose: false,
11
- };
12
-
13
- describe("Fmt Executor", () => {
14
- it("can run", async () => {
15
- const output = await executor(options, context);
16
- expect(output.success).toBe(true);
17
- });
18
- });
@@ -1,4 +0,0 @@
1
- import { withTerraformExecutor } from "../../base/terraform-executor";
2
- import { OutputExecutorSchema } from "./schema.d";
3
-
4
- export default withTerraformExecutor<OutputExecutorSchema>("output");
@@ -1,18 +0,0 @@
1
- import { ExecutorContext } from "@nx/devkit";
2
-
3
- import executor from "./executor";
4
- import { PlanExecutorSchema } from "./schema";
5
-
6
- const options: PlanExecutorSchema = {};
7
- const context: ExecutorContext = {
8
- root: "",
9
- cwd: process.cwd(),
10
- isVerbose: false,
11
- };
12
-
13
- describe("Plan Executor", () => {
14
- it("can run", async () => {
15
- const output = await executor(options, context);
16
- expect(output.success).toBe(true);
17
- });
18
- });
@@ -1,4 +0,0 @@
1
- import { withTerraformExecutor } from "../../base/terraform-executor";
2
- import { PlanExecutorSchema } from "./schema.d";
3
-
4
- export default withTerraformExecutor<PlanExecutorSchema>("plan");
@@ -1,15 +0,0 @@
1
- import { formatFiles, type Tree } from "@nx/devkit";
2
- import { initGenerator as baseInitGenerator } from "@storm-software/workspace-tools";
3
- import type { InitGeneratorSchema } from "./schema";
4
-
5
- export async function initGenerator(tree: Tree, schema: InitGeneratorSchema) {
6
- const task = baseInitGenerator(tree, { skipFormat: !!schema.skipFormat });
7
-
8
- if (!schema.skipFormat) {
9
- await formatFiles(tree);
10
- }
11
-
12
- return task;
13
- }
14
-
15
- export default initGenerator;
package/tsconfig.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "rootDir": "../..",
6
- "target": "ESNext",
7
- "module": "ESNext",
8
- "lib": ["ESNext"],
9
- "skipLibCheck": true,
10
- "skipDefaultLibCheck": true,
11
- "moduleResolution": "Bundler",
12
- "moduleDetection": "force",
13
- "types": ["node"]
14
- },
15
- "include": [
16
- "executors.ts",
17
- "generators.ts",
18
- "index.ts",
19
- "src/**/*.ts",
20
- "src/**/*.d.ts",
21
- "src/**/*.json",
22
- "tsup.config.ts"
23
- ],
24
- "exclude": [
25
- "jest.config.ts",
26
- "src/generators/**/files/**/*",
27
- "src/**/untyped.ts",
28
- "src/**/*.spec.ts",
29
- "src/**/*.test.ts"
30
- ]
31
- }
package/tsup.config.ts DELETED
@@ -1,29 +0,0 @@
1
- import { defineConfig } from "tsup";
2
-
3
- export default defineConfig([
4
- {
5
- name: "terraform-tools",
6
- target: "node22",
7
- entryPoints: [
8
- "./*.ts",
9
- "./src/base/index.ts",
10
- "./src/base/terraform-executor.ts",
11
- "./src/base/*.untyped.ts",
12
- "./src/executors/*/executor.ts",
13
- "./src/executors/*/untyped.ts",
14
- "./src/generators/*/generator.ts",
15
- "./src/generators/*/untyped.ts",
16
- "./src/generators/init/init.ts",
17
- ],
18
- outDir: "dist",
19
- format: ["cjs", "esm"],
20
- platform: "node",
21
- splitting: true,
22
- clean: true,
23
- dts: true,
24
- sourcemap: false,
25
- shims: true,
26
- tsconfig: "./tsconfig.json",
27
- external: ["@storm-software/workspace-tools"],
28
- },
29
- ]);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes