terrafaker 0.0.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 (53) hide show
  1. package/README.md +171 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/generate/file.d.ts +13 -0
  7. package/dist/commands/generate/file.js +32 -0
  8. package/dist/commands/generate/index.d.ts +7 -0
  9. package/dist/commands/generate/index.js +9 -0
  10. package/dist/commands/generate/repo.d.ts +18 -0
  11. package/dist/commands/generate/repo.js +60 -0
  12. package/dist/commands/gh/clone-repos.d.ts +10 -0
  13. package/dist/commands/gh/clone-repos.js +46 -0
  14. package/dist/commands/gh/delete-repos.d.ts +9 -0
  15. package/dist/commands/gh/delete-repos.js +41 -0
  16. package/dist/commands/gh/index.d.ts +7 -0
  17. package/dist/commands/gh/index.js +10 -0
  18. package/dist/commands/util/format-psv.d.ts +10 -0
  19. package/dist/commands/util/format-psv.js +46 -0
  20. package/dist/commands/util/format-tsv.d.ts +13 -0
  21. package/dist/commands/util/format-tsv.js +33 -0
  22. package/dist/commands/util/index.d.ts +7 -0
  23. package/dist/commands/util/index.js +9 -0
  24. package/dist/constants/aws.d.ts +192 -0
  25. package/dist/constants/aws.js +201 -0
  26. package/dist/constants/gcp.d.ts +88 -0
  27. package/dist/constants/gcp.js +109 -0
  28. package/dist/constants/tags.d.ts +5 -0
  29. package/dist/constants/tags.js +17 -0
  30. package/dist/enums/help-messages.d.ts +4 -0
  31. package/dist/enums/help-messages.js +4 -0
  32. package/dist/enums/providers.d.ts +8 -0
  33. package/dist/enums/providers.js +5 -0
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +1 -0
  36. package/dist/types/object-values.d.ts +2 -0
  37. package/dist/types/object-values.js +1 -0
  38. package/dist/utilities/base-command.d.ts +5 -0
  39. package/dist/utilities/base-command.js +9 -0
  40. package/dist/utilities/flags.d.ts +5 -0
  41. package/dist/utilities/flags.js +21 -0
  42. package/dist/utilities/generators/aws-generators.d.ts +4 -0
  43. package/dist/utilities/generators/aws-generators.js +80 -0
  44. package/dist/utilities/generators/gcp-generators.d.ts +4 -0
  45. package/dist/utilities/generators/gcp-generators.js +69 -0
  46. package/dist/utilities/generators/generator-utils.d.ts +80 -0
  47. package/dist/utilities/generators/generator-utils.js +72 -0
  48. package/dist/utilities/github.d.ts +8 -0
  49. package/dist/utilities/github.js +4 -0
  50. package/dist/utilities/string-utils.d.ts +5 -0
  51. package/dist/utilities/string-utils.js +7 -0
  52. package/oclif.manifest.json +358 -0
  53. package/package.json +82 -0
@@ -0,0 +1,358 @@
1
+ {
2
+ "commands": {
3
+ "generate:file": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Generates a terraform file.",
7
+ "flags": {
8
+ "name": {
9
+ "description": "Name for the generated file, which must end in .tf",
10
+ "name": "name",
11
+ "hasDynamicHelp": false,
12
+ "multiple": false,
13
+ "type": "option"
14
+ },
15
+ "provider": {
16
+ "description": "Cloud provider to generate resources for",
17
+ "name": "provider",
18
+ "hasDynamicHelp": false,
19
+ "multiple": false,
20
+ "options": [
21
+ "aws",
22
+ "gcp"
23
+ ],
24
+ "type": "option"
25
+ },
26
+ "resource-count": {
27
+ "description": "Number of resources per file to generate",
28
+ "name": "resource-count",
29
+ "default": 3,
30
+ "hasDynamicHelp": false,
31
+ "multiple": false,
32
+ "type": "option"
33
+ },
34
+ "format": {
35
+ "char": "f",
36
+ "description": "Format the output terraform files. Requires `terraform` to be in your $PATH.",
37
+ "name": "format",
38
+ "allowNo": true,
39
+ "type": "boolean"
40
+ },
41
+ "quiet": {
42
+ "char": "q",
43
+ "description": "Suppress the logging output.",
44
+ "name": "quiet",
45
+ "allowNo": false,
46
+ "type": "boolean"
47
+ }
48
+ },
49
+ "hasDynamicHelp": false,
50
+ "hiddenAliases": [],
51
+ "id": "generate:file",
52
+ "pluginAlias": "terrafaker",
53
+ "pluginName": "terrafaker",
54
+ "pluginType": "core",
55
+ "strict": true,
56
+ "isESM": true,
57
+ "relativePath": [
58
+ "dist",
59
+ "commands",
60
+ "generate",
61
+ "file.js"
62
+ ]
63
+ },
64
+ "generate": {
65
+ "aliases": [],
66
+ "args": {},
67
+ "description": "Commands for generating terraform files.",
68
+ "flags": {},
69
+ "hasDynamicHelp": false,
70
+ "hidden": true,
71
+ "hiddenAliases": [],
72
+ "id": "generate",
73
+ "pluginAlias": "terrafaker",
74
+ "pluginName": "terrafaker",
75
+ "pluginType": "core",
76
+ "strict": true,
77
+ "isESM": true,
78
+ "relativePath": [
79
+ "dist",
80
+ "commands",
81
+ "generate",
82
+ "index.js"
83
+ ]
84
+ },
85
+ "generate:repo": {
86
+ "aliases": [],
87
+ "args": {},
88
+ "description": "Generates repo(s) with multiple terraform files.",
89
+ "flags": {
90
+ "directory": {
91
+ "description": "Directory to generate the repo(s) in",
92
+ "name": "directory",
93
+ "default": ".",
94
+ "hasDynamicHelp": false,
95
+ "multiple": false,
96
+ "type": "option"
97
+ },
98
+ "count": {
99
+ "description": "Number of repos to generate",
100
+ "name": "count",
101
+ "default": 1,
102
+ "hasDynamicHelp": false,
103
+ "multiple": false,
104
+ "type": "option"
105
+ },
106
+ "file-count": {
107
+ "description": "Number of files per repo to generate",
108
+ "name": "file-count",
109
+ "default": 3,
110
+ "hasDynamicHelp": false,
111
+ "multiple": false,
112
+ "type": "option"
113
+ },
114
+ "resource-count": {
115
+ "description": "Number of resources per file to generate",
116
+ "name": "resource-count",
117
+ "default": 3,
118
+ "hasDynamicHelp": false,
119
+ "multiple": false,
120
+ "type": "option"
121
+ },
122
+ "prefix": {
123
+ "description": "Prefix for repo names, useful for quickly identifying generated content",
124
+ "name": "prefix",
125
+ "default": "tf_",
126
+ "hasDynamicHelp": false,
127
+ "multiple": false,
128
+ "type": "option"
129
+ },
130
+ "provider": {
131
+ "description": "Cloud provider to generate resources for",
132
+ "name": "provider",
133
+ "hasDynamicHelp": false,
134
+ "multiple": false,
135
+ "options": [
136
+ "aws",
137
+ "gcp"
138
+ ],
139
+ "type": "option"
140
+ },
141
+ "format": {
142
+ "char": "f",
143
+ "description": "Format the output terraform files. Requires `terraform` to be in your $PATH.",
144
+ "name": "format",
145
+ "allowNo": true,
146
+ "type": "boolean"
147
+ },
148
+ "create-remote": {
149
+ "description": "Create and push a remote GitHub repo. Requires the `gh` CLI to be installed. To install, run `brew install gh`.",
150
+ "name": "create-remote",
151
+ "allowNo": false,
152
+ "type": "boolean"
153
+ },
154
+ "public": {
155
+ "description": "Whether the remote repo(s) created are public.",
156
+ "name": "public",
157
+ "allowNo": false,
158
+ "type": "boolean"
159
+ },
160
+ "quiet": {
161
+ "char": "q",
162
+ "description": "Suppress the logging output.",
163
+ "name": "quiet",
164
+ "allowNo": false,
165
+ "type": "boolean"
166
+ }
167
+ },
168
+ "hasDynamicHelp": false,
169
+ "hiddenAliases": [],
170
+ "id": "generate:repo",
171
+ "pluginAlias": "terrafaker",
172
+ "pluginName": "terrafaker",
173
+ "pluginType": "core",
174
+ "strict": true,
175
+ "isESM": true,
176
+ "relativePath": [
177
+ "dist",
178
+ "commands",
179
+ "generate",
180
+ "repo.js"
181
+ ]
182
+ },
183
+ "gh:clone-repos": {
184
+ "aliases": [],
185
+ "args": {},
186
+ "description": "Clones repos from your Github account, useful for pulling down generated repos for manual modifications. Requires the `gh` CLI to be installed. To install, run `brew install gh`.",
187
+ "flags": {
188
+ "directory": {
189
+ "description": "Directory to clone the repo(s) in",
190
+ "name": "directory",
191
+ "default": ".",
192
+ "hasDynamicHelp": false,
193
+ "multiple": false,
194
+ "type": "option"
195
+ },
196
+ "prefix": {
197
+ "description": "Prefix for the repos to clone, such as 'tf_'",
198
+ "name": "prefix",
199
+ "required": true,
200
+ "hasDynamicHelp": false,
201
+ "multiple": false,
202
+ "type": "option"
203
+ }
204
+ },
205
+ "hasDynamicHelp": false,
206
+ "hiddenAliases": [],
207
+ "id": "gh:clone-repos",
208
+ "pluginAlias": "terrafaker",
209
+ "pluginName": "terrafaker",
210
+ "pluginType": "core",
211
+ "strict": true,
212
+ "isESM": true,
213
+ "relativePath": [
214
+ "dist",
215
+ "commands",
216
+ "gh",
217
+ "clone-repos.js"
218
+ ]
219
+ },
220
+ "gh:delete-repos": {
221
+ "aliases": [],
222
+ "args": {},
223
+ "description": "Deletes repos from your Github account, useful for cleaning up generated test data. Requires the `gh` CLI to be installed. To install, run `brew install gh`.\n\nIf the deletion fails, you may need to refresh your CLI permissions with `gh auth refresh -s delete_repo`",
224
+ "flags": {
225
+ "prefix": {
226
+ "description": "Prefix for the repos to delete, such as 'tf_'",
227
+ "name": "prefix",
228
+ "required": true,
229
+ "hasDynamicHelp": false,
230
+ "multiple": false,
231
+ "type": "option"
232
+ }
233
+ },
234
+ "hasDynamicHelp": false,
235
+ "hiddenAliases": [],
236
+ "id": "gh:delete-repos",
237
+ "pluginAlias": "terrafaker",
238
+ "pluginName": "terrafaker",
239
+ "pluginType": "core",
240
+ "strict": true,
241
+ "enableJsonFlag": false,
242
+ "isESM": true,
243
+ "relativePath": [
244
+ "dist",
245
+ "commands",
246
+ "gh",
247
+ "delete-repos.js"
248
+ ]
249
+ },
250
+ "gh": {
251
+ "aliases": [],
252
+ "args": {},
253
+ "description": "Utility commands that wrap the `gh` CLI. Requires the `gh` CLI to be installed. To install, run `brew install gh`.",
254
+ "flags": {},
255
+ "hasDynamicHelp": false,
256
+ "hidden": true,
257
+ "hiddenAliases": [],
258
+ "id": "gh",
259
+ "pluginAlias": "terrafaker",
260
+ "pluginName": "terrafaker",
261
+ "pluginType": "core",
262
+ "strict": true,
263
+ "isESM": true,
264
+ "relativePath": [
265
+ "dist",
266
+ "commands",
267
+ "gh",
268
+ "index.js"
269
+ ]
270
+ },
271
+ "util:format-psv": {
272
+ "aliases": [],
273
+ "args": {
274
+ "psv": {
275
+ "description": "Pipe-separated value to format into a string array, i.e. 'm5.large | m5.xlarge | m5.2xlarge'.\nIf the string is multiple lines, it will be formatted into an object where the key is the first column before a tab, i.e. 'M5\tm5.large | m5.xlarge | m5.2xlarge'",
276
+ "name": "psv",
277
+ "required": true
278
+ }
279
+ },
280
+ "description": "Utility command for formatting a PSV (pipe-separated value) into an array or object with array values. Primarily used for parsing data from the AWS docs.",
281
+ "flags": {},
282
+ "hasDynamicHelp": false,
283
+ "hidden": true,
284
+ "hiddenAliases": [],
285
+ "id": "util:format-psv",
286
+ "pluginAlias": "terrafaker",
287
+ "pluginName": "terrafaker",
288
+ "pluginType": "core",
289
+ "strict": true,
290
+ "isESM": true,
291
+ "relativePath": [
292
+ "dist",
293
+ "commands",
294
+ "util",
295
+ "format-psv.js"
296
+ ]
297
+ },
298
+ "util:format-tsv": {
299
+ "aliases": [],
300
+ "args": {
301
+ "tsv": {
302
+ "description": "Tab-separated value to format into a string array, i.e. 'c4d-standard-2\t2\t7\tNo\tUp to 10\tN/A'.\nIf the string is multiple lines (which it generally is), the specified column index from each line will be placed in the array.",
303
+ "name": "tsv",
304
+ "required": true
305
+ }
306
+ },
307
+ "description": "Utility command for formatting a TSV (tab-separated value) into an array. Primarily used for parsing data from the GCP docs.",
308
+ "flags": {
309
+ "index": {
310
+ "char": "i",
311
+ "description": "Column index to pull from each line.",
312
+ "name": "index",
313
+ "default": 0,
314
+ "hasDynamicHelp": false,
315
+ "multiple": false,
316
+ "type": "option"
317
+ }
318
+ },
319
+ "hasDynamicHelp": false,
320
+ "hidden": true,
321
+ "hiddenAliases": [],
322
+ "id": "util:format-tsv",
323
+ "pluginAlias": "terrafaker",
324
+ "pluginName": "terrafaker",
325
+ "pluginType": "core",
326
+ "strict": true,
327
+ "isESM": true,
328
+ "relativePath": [
329
+ "dist",
330
+ "commands",
331
+ "util",
332
+ "format-tsv.js"
333
+ ]
334
+ },
335
+ "util": {
336
+ "aliases": [],
337
+ "args": {},
338
+ "description": "Miscellaneous utility commands.",
339
+ "flags": {},
340
+ "hasDynamicHelp": false,
341
+ "hidden": true,
342
+ "hiddenAliases": [],
343
+ "id": "util",
344
+ "pluginAlias": "terrafaker",
345
+ "pluginName": "terrafaker",
346
+ "pluginType": "core",
347
+ "strict": true,
348
+ "isESM": true,
349
+ "relativePath": [
350
+ "dist",
351
+ "commands",
352
+ "util",
353
+ "index.js"
354
+ ]
355
+ }
356
+ },
357
+ "version": "0.0.0"
358
+ }
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "author": "Brandon Scott",
3
+ "bin": {
4
+ "terrafaker": "./bin/run.js"
5
+ },
6
+ "bugs": "https://github.com/brandongregoryscott/terrafaker/issues",
7
+ "dependencies": {
8
+ "@faker-js/faker": "10.1.0",
9
+ "@inquirer/prompts": "8.0.2",
10
+ "@oclif/core": "4.8.0",
11
+ "@oclif/plugin-help": "6.2.36",
12
+ "lodash-es": "4.17.21",
13
+ "terraform-generator": "6.4.4",
14
+ "zx": "8.8.5"
15
+ },
16
+ "description": "CLI for easily generating fake terraform files and repos",
17
+ "devDependencies": {
18
+ "@eslint/compat": "1.4.1",
19
+ "@oclif/test": "4.1.15",
20
+ "@stylistic/eslint-plugin": "5.6.1",
21
+ "@types/chai": "4.3.20",
22
+ "@types/fs-extra": "11.0.4",
23
+ "@types/lodash-es": "4.17.12",
24
+ "@types/mocha": "10.0.10",
25
+ "@types/node": "24.10.3",
26
+ "chai": "4.5.0",
27
+ "eslint": "9.39.1",
28
+ "eslint-plugin-collation": "1.5.0",
29
+ "mocha": "10.8.2",
30
+ "oclif": "4.22.54",
31
+ "prettier": "3.6.1",
32
+ "shx": "0.3.4",
33
+ "ts-node": "10.9.2",
34
+ "typescript": "5.9.3",
35
+ "typescript-eslint": "8.49.0"
36
+ },
37
+ "engines": {
38
+ "node": ">=18.0.0"
39
+ },
40
+ "files": [
41
+ "./bin",
42
+ "./dist",
43
+ "./oclif.manifest.json"
44
+ ],
45
+ "homepage": "https://github.com/brandongregoryscott/terrafaker",
46
+ "keywords": [
47
+ "oclif"
48
+ ],
49
+ "license": "Apache-2.0",
50
+ "main": "dist/index.js",
51
+ "name": "terrafaker",
52
+ "oclif": {
53
+ "bin": "terrafaker",
54
+ "commands": "./dist/commands",
55
+ "dirname": "terrafaker",
56
+ "plugins": [
57
+ "@oclif/plugin-help"
58
+ ],
59
+ "topicSeparator": " "
60
+ },
61
+ "repository": "brandongregoryscott/terrafaker",
62
+ "scripts": {
63
+ "build": "npm run clean && tsc -b",
64
+ "build:watch": "npm run clean && tsc --watch",
65
+ "clean": "shx rm -rf dist tsconfig.tsbuildinfo",
66
+ "format": "prettier . --check",
67
+ "format:fix": "prettier . --write",
68
+ "generate:manifest": "oclif manifest",
69
+ "generate:readme": "oclif readme && prettier README.md --write",
70
+ "lint": "eslint",
71
+ "lint:fix": "eslint --fix",
72
+ "postbuild": "npm run generate:manifest",
73
+ "postpack": "shx rm -f oclif.manifest.json",
74
+ "posttest": "npm run lint",
75
+ "prepack": "npm run generate:manifest && npm run generate:readme",
76
+ "test": "mocha --forbid-only \"test/**/*.test.ts\"",
77
+ "version": "npm run generate:readme && git add README.md"
78
+ },
79
+ "type": "module",
80
+ "types": "dist/index.d.ts",
81
+ "version": "0.0.0"
82
+ }