@twin.org/cli-core 0.0.1-next.9 → 0.0.2-next.10

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.
@@ -4,13 +4,13 @@ Utilities function for helping in the CLI.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new CLIUtils()
7
+ ### Constructor
8
8
 
9
- > **new CLIUtils**(): [`CLIUtils`](CLIUtils.md)
9
+ > **new CLIUtils**(): `CLIUtils`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`CLIUtils`](CLIUtils.md)
13
+ `CLIUtils`
14
14
 
15
15
  ## Methods
16
16
 
@@ -22,7 +22,9 @@ Does the specified file exist.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **filename**: `string`
25
+ ##### filename
26
+
27
+ `string`
26
28
 
27
29
  The filename to check for existence.
28
30
 
@@ -42,7 +44,9 @@ Does the specified file exist, synchronously.
42
44
 
43
45
  #### Parameters
44
46
 
45
- **filename**: `string`
47
+ ##### filename
48
+
49
+ `string`
46
50
 
47
51
  The filename to check for existence.
48
52
 
@@ -62,7 +66,9 @@ Check if the dir exists.
62
66
 
63
67
  #### Parameters
64
68
 
65
- **dir**: `string`
69
+ ##### dir
70
+
71
+ `string`
66
72
 
67
73
  The directory to check.
68
74
 
@@ -82,7 +88,9 @@ Check if the dir exists, synchronously.
82
88
 
83
89
  #### Parameters
84
90
 
85
- **dir**: `string`
91
+ ##### dir
92
+
93
+ `string`
86
94
 
87
95
  The directory to check.
88
96
 
@@ -102,11 +110,15 @@ Read a JSON file and parse it.
102
110
 
103
111
  #### Type Parameters
104
112
 
105
- **T** = `unknown`
113
+ ##### T
114
+
115
+ `T` = `unknown`
106
116
 
107
117
  #### Parameters
108
118
 
109
- **filename**: `string`
119
+ ##### filename
120
+
121
+ `string`
110
122
 
111
123
  The filename to read.
112
124
 
@@ -126,11 +138,15 @@ Read a JSON file and parse it, synchronously.
126
138
 
127
139
  #### Type Parameters
128
140
 
129
- **T** = `unknown`
141
+ ##### T
142
+
143
+ `T` = `unknown`
130
144
 
131
145
  #### Parameters
132
146
 
133
- **filename**: `string`
147
+ ##### filename
148
+
149
+ `string`
134
150
 
135
151
  The filename to read.
136
152
 
@@ -150,7 +166,9 @@ Read a file as lines.
150
166
 
151
167
  #### Parameters
152
168
 
153
- **filename**: `string`
169
+ ##### filename
170
+
171
+ `string`
154
172
 
155
173
  The filename to read.
156
174
 
@@ -170,7 +188,9 @@ Read a file as lines, synchronously.
170
188
 
171
189
  #### Parameters
172
190
 
173
- **filename**: `string`
191
+ ##### filename
192
+
193
+ `string`
174
194
 
175
195
  The filename to read.
176
196
 
@@ -190,7 +210,9 @@ Find the NPM root based on a package.json path.
190
210
 
191
211
  #### Parameters
192
212
 
193
- **rootFolder**: `string`
213
+ ##### rootFolder
214
+
215
+ `string`
194
216
 
195
217
  The path to the package.json.
196
218
 
@@ -204,21 +226,61 @@ The root path.
204
226
 
205
227
  ### runShellCmd()
206
228
 
207
- > `static` **runShellCmd**(`app`, `args`, `cwd`): `Promise`\<`void`\>
229
+ > `static` **runShellCmd**(`command`, `args`, `cwd`): `Promise`\<`void`\>
230
+
231
+ Run a shell command.
232
+
233
+ #### Parameters
234
+
235
+ ##### command
236
+
237
+ `string`
238
+
239
+ The app to run in the shell.
240
+
241
+ ##### args
242
+
243
+ `string`[]
244
+
245
+ The args for the app.
246
+
247
+ ##### cwd
248
+
249
+ `string`
250
+
251
+ The working directory to execute the command in.
252
+
253
+ #### Returns
254
+
255
+ `Promise`\<`void`\>
256
+
257
+ Promise to wait for command execution to complete.
258
+
259
+ ***
260
+
261
+ ### runShellApp()
262
+
263
+ > `static` **runShellApp**(`app`, `args`, `cwd`): `Promise`\<`void`\>
208
264
 
209
265
  Run a shell app.
210
266
 
211
267
  #### Parameters
212
268
 
213
- **app**: `string`
269
+ ##### app
270
+
271
+ `string`
214
272
 
215
273
  The app to run in the shell.
216
274
 
217
- **args**: `string`[]
275
+ ##### args
276
+
277
+ `string`[]
218
278
 
219
279
  The args for the app.
220
280
 
221
- **cwd**: `string`
281
+ ##### cwd
282
+
283
+ `string`
222
284
 
223
285
  The working directory to execute the command in.
224
286
 
@@ -238,19 +300,27 @@ Write a JSON file.
238
300
 
239
301
  #### Type Parameters
240
302
 
241
- **T** = `unknown`
303
+ ##### T
304
+
305
+ `T` = `unknown`
242
306
 
243
307
  #### Parameters
244
308
 
245
- **jsonFilename**: `undefined` \| `string`
309
+ ##### jsonFilename
246
310
 
247
311
  The filename to write.
248
312
 
249
- **data**: `T`
313
+ `undefined` | `string`
314
+
315
+ ##### data
316
+
317
+ `T`
250
318
 
251
319
  The data to write.
252
320
 
253
- **append**: `boolean`
321
+ ##### append
322
+
323
+ `boolean`
254
324
 
255
325
  Append to the file.
256
326
 
@@ -268,15 +338,21 @@ Write an env file.
268
338
 
269
339
  #### Parameters
270
340
 
271
- **envFilename**: `undefined` \| `string`
341
+ ##### envFilename
272
342
 
273
343
  The filename to write.
274
344
 
275
- **data**: `string`[]
345
+ `undefined` | `string`
346
+
347
+ ##### data
348
+
349
+ `string`[]
276
350
 
277
351
  The data to write.
278
352
 
279
- **append**: `boolean`
353
+ ##### append
354
+
355
+ `boolean`
280
356
 
281
357
  Append to the file.
282
358
 
@@ -6,15 +6,21 @@ Add the global options.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **program**: `Command`
9
+ ### program
10
+
11
+ `Command`
10
12
 
11
13
  The program to add the options to.
12
14
 
13
- **supportsLang**: `boolean`
15
+ ### supportsLang
16
+
17
+ `boolean`
14
18
 
15
19
  Whether the CLI supports different languages.
16
20
 
17
- **supportsEnvFiles**: `boolean`
21
+ ### supportsEnvFiles
22
+
23
+ `boolean`
18
24
 
19
25
  Whether the CLI supports loading env files
20
26
 
@@ -6,7 +6,9 @@ Initialize the global options.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **localesDirectory**: `string`
9
+ ### localesDirectory
10
+
11
+ `string`
10
12
 
11
13
  The path to load the locales from.
12
14
 
@@ -57,3 +57,11 @@ Supports the loading of env files.
57
57
  > `optional` **overrideOutputWidth**: `number`
58
58
 
59
59
  Override the default output width.
60
+
61
+ ***
62
+
63
+ ### showDevToolWarning?
64
+
65
+ > `optional` **showDevToolWarning**: `boolean`
66
+
67
+ Show a warning that this is a dev tool and not for production use.
@@ -1,5 +1,5 @@
1
1
  # Type Alias: CliOutputOptions
2
2
 
3
- > **CliOutputOptions**: [`ICliOutputOptionsConsole`](../interfaces/ICliOutputOptionsConsole.md) & [`ICliOutputOptionsEnv`](../interfaces/ICliOutputOptionsEnv.md) & [`ICliOutputOptionsJson`](../interfaces/ICliOutputOptionsJson.md)
3
+ > **CliOutputOptions** = [`ICliOutputOptionsConsole`](../interfaces/ICliOutputOptionsConsole.md) & [`ICliOutputOptionsEnv`](../interfaces/ICliOutputOptionsEnv.md) & [`ICliOutputOptionsJson`](../interfaces/ICliOutputOptionsJson.md)
4
4
 
5
5
  Options for the CLI Output.
package/locales/en.json CHANGED
@@ -12,6 +12,11 @@
12
12
  }
13
13
  }
14
14
  },
15
+ "warn": {
16
+ "common": {
17
+ "devOnlyTool": "This tool is intended to be used for development purposes, it is not recommended for use in production scenarios."
18
+ }
19
+ },
15
20
  "cli": {
16
21
  "progress": {
17
22
  "done": "Done.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/cli-core",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.10",
4
4
  "description": "Core classes for building a CLI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,21 +14,21 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.1-next.9",
18
- "@twin.org/crypto": "0.0.1-next.9",
19
- "@twin.org/nameof": "next",
20
- "chalk": "5.3.0",
21
- "commander": "12.1.0",
22
- "dotenv": "16.4.5"
17
+ "@twin.org/core": "0.0.2-next.10",
18
+ "@twin.org/crypto": "0.0.2-next.10",
19
+ "@twin.org/nameof": "0.0.2-next.10",
20
+ "chalk": "5.6.0",
21
+ "commander": "14.0.0",
22
+ "dotenv": "17.2.1"
23
23
  },
24
24
  "main": "./dist/cjs/index.cjs",
25
25
  "module": "./dist/esm/index.mjs",
26
26
  "types": "./dist/types/index.d.ts",
27
27
  "exports": {
28
28
  ".": {
29
+ "types": "./dist/types/index.d.ts",
29
30
  "require": "./dist/cjs/index.cjs",
30
- "import": "./dist/esm/index.mjs",
31
- "types": "./dist/types/index.d.ts"
31
+ "import": "./dist/esm/index.mjs"
32
32
  }
33
33
  },
34
34
  "files": [