@twin.org/cli-core 0.0.2-next.9 → 0.0.3-next.2

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 (38) hide show
  1. package/dist/es/cliBase.js +122 -0
  2. package/dist/es/cliBase.js.map +1 -0
  3. package/dist/es/cliDisplay.js +166 -0
  4. package/dist/es/cliDisplay.js.map +1 -0
  5. package/dist/es/cliOptions.js +36 -0
  6. package/dist/es/cliOptions.js.map +1 -0
  7. package/dist/es/cliParam.js +248 -0
  8. package/dist/es/cliParam.js.map +1 -0
  9. package/dist/es/cliUtils.js +235 -0
  10. package/dist/es/cliUtils.js.map +1 -0
  11. package/dist/es/commands/global.js +61 -0
  12. package/dist/es/commands/global.js.map +1 -0
  13. package/dist/es/index.js +14 -0
  14. package/dist/es/index.js.map +1 -0
  15. package/dist/es/models/ICliOptions.js +2 -0
  16. package/dist/es/models/ICliOptions.js.map +1 -0
  17. package/dist/es/models/ICliOutputOptionsConsole.js +2 -0
  18. package/dist/es/models/ICliOutputOptionsConsole.js.map +1 -0
  19. package/dist/es/models/ICliOutputOptionsEnv.js +2 -0
  20. package/dist/es/models/ICliOutputOptionsEnv.js.map +1 -0
  21. package/dist/es/models/ICliOutputOptionsJson.js +2 -0
  22. package/dist/es/models/ICliOutputOptionsJson.js.map +1 -0
  23. package/dist/es/models/cliOutputOptions.js +2 -0
  24. package/dist/es/models/cliOutputOptions.js.map +1 -0
  25. package/dist/types/cliBase.d.ts +1 -1
  26. package/dist/types/cliDisplay.d.ts +5 -0
  27. package/dist/types/cliParam.d.ts +10 -9
  28. package/dist/types/index.d.ts +11 -11
  29. package/dist/types/models/cliOutputOptions.d.ts +3 -3
  30. package/docs/changelog.md +296 -0
  31. package/docs/reference/classes/CLIDisplay.md +20 -0
  32. package/docs/reference/classes/CLIParam.md +62 -50
  33. package/docs/reference/classes/CLIUtils.md +10 -10
  34. package/locales/.validate-ignore +1 -0
  35. package/locales/en.json +0 -1
  36. package/package.json +25 -14
  37. package/dist/cjs/index.cjs +0 -878
  38. package/dist/esm/index.mjs +0 -849
package/docs/changelog.md CHANGED
@@ -1,5 +1,301 @@
1
1
  # @twin.org/cli-core - Changelog
2
2
 
3
+ ## [0.0.3-next.2](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.3-next.1...cli-core-v0.0.3-next.2) (2025-11-12)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **cli-core:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/core bumped from 0.0.3-next.1 to 0.0.3-next.2
16
+ * @twin.org/nameof bumped from 0.0.3-next.1 to 0.0.3-next.2
17
+ * devDependencies
18
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.1 to 0.0.3-next.2
19
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.1 to 0.0.3-next.2
20
+
21
+ ## [0.0.3-next.1](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.3-next.0...cli-core-v0.0.3-next.1) (2025-11-10)
22
+
23
+
24
+ ### Features
25
+
26
+ * add CLIParam.arrayOneOf ([18f0815](https://github.com/twinfoundation/framework/commit/18f08157e5305cddf65d09b36a51a91a0873e396))
27
+ * add context id features ([#206](https://github.com/twinfoundation/framework/issues/206)) ([ef0d4ee](https://github.com/twinfoundation/framework/commit/ef0d4ee11a4f5fc6cc6f52a4958ce905c04ee13b))
28
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
29
+ * eslint migration to flat config ([74427d7](https://github.com/twinfoundation/framework/commit/74427d78d342167f7850e49ab87269326355befe))
30
+ * improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
31
+ * locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
32
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
33
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
34
+ * use cause instead of inner for errors ([1f4acc4](https://github.com/twinfoundation/framework/commit/1f4acc4d7a6b71a134d9547da9bf40de1e1e49da))
35
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * cli display output for JSON to allow infinite depth ([2a06f52](https://github.com/twinfoundation/framework/commit/2a06f52c92dbc51a4969d651486a0c3548529929))
41
+ * framework pr naming convention ([#142](https://github.com/twinfoundation/framework/issues/142)) ([e29acee](https://github.com/twinfoundation/framework/commit/e29acee2fbec42506091956d6ba8b8ce25a90008))
42
+
43
+
44
+ ### Dependencies
45
+
46
+ * The following workspace dependencies were updated
47
+ * dependencies
48
+ * @twin.org/core bumped from 0.0.3-next.0 to 0.0.3-next.1
49
+ * @twin.org/nameof bumped from 0.0.3-next.0 to 0.0.3-next.1
50
+ * devDependencies
51
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.0 to 0.0.3-next.1
52
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.0 to 0.0.3-next.1
53
+
54
+ ## [0.0.2-next.22](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.21...cli-core-v0.0.2-next.22) (2025-10-10)
55
+
56
+
57
+ ### Miscellaneous Chores
58
+
59
+ * **cli-core:** Synchronize repo versions
60
+
61
+
62
+ ### Dependencies
63
+
64
+ * The following workspace dependencies were updated
65
+ * dependencies
66
+ * @twin.org/core bumped from 0.0.2-next.21 to 0.0.2-next.22
67
+ * @twin.org/nameof bumped from 0.0.2-next.21 to 0.0.2-next.22
68
+ * devDependencies
69
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.21 to 0.0.2-next.22
70
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.21 to 0.0.2-next.22
71
+
72
+ ## [0.0.2-next.21](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.20...cli-core-v0.0.2-next.21) (2025-10-09)
73
+
74
+
75
+ ### Features
76
+
77
+ * locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
78
+
79
+
80
+ ### Dependencies
81
+
82
+ * The following workspace dependencies were updated
83
+ * dependencies
84
+ * @twin.org/core bumped from 0.0.2-next.20 to 0.0.2-next.21
85
+ * @twin.org/nameof bumped from 0.0.2-next.20 to 0.0.2-next.21
86
+ * devDependencies
87
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.20 to 0.0.2-next.21
88
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.20 to 0.0.2-next.21
89
+
90
+ ## [0.0.2-next.20](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.19...cli-core-v0.0.2-next.20) (2025-10-02)
91
+
92
+
93
+ ### Miscellaneous Chores
94
+
95
+ * **cli-core:** Synchronize repo versions
96
+
97
+
98
+ ### Dependencies
99
+
100
+ * The following workspace dependencies were updated
101
+ * dependencies
102
+ * @twin.org/core bumped from 0.0.2-next.19 to 0.0.2-next.20
103
+ * @twin.org/crypto bumped from 0.0.2-next.19 to 0.0.2-next.20
104
+ * @twin.org/nameof bumped from 0.0.2-next.19 to 0.0.2-next.20
105
+ * devDependencies
106
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.19 to 0.0.2-next.20
107
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.19 to 0.0.2-next.20
108
+
109
+ ## [0.0.2-next.19](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.18...cli-core-v0.0.2-next.19) (2025-09-30)
110
+
111
+
112
+ ### Miscellaneous Chores
113
+
114
+ * **cli-core:** Synchronize repo versions
115
+
116
+
117
+ ### Dependencies
118
+
119
+ * The following workspace dependencies were updated
120
+ * dependencies
121
+ * @twin.org/core bumped from 0.0.2-next.18 to 0.0.2-next.19
122
+ * @twin.org/crypto bumped from 0.0.2-next.18 to 0.0.2-next.19
123
+ * @twin.org/nameof bumped from 0.0.2-next.18 to 0.0.2-next.19
124
+ * devDependencies
125
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.18 to 0.0.2-next.19
126
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.18 to 0.0.2-next.19
127
+
128
+ ## [0.0.2-next.18](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.17...cli-core-v0.0.2-next.18) (2025-09-29)
129
+
130
+
131
+ ### Miscellaneous Chores
132
+
133
+ * **cli-core:** Synchronize repo versions
134
+
135
+
136
+ ### Dependencies
137
+
138
+ * The following workspace dependencies were updated
139
+ * dependencies
140
+ * @twin.org/core bumped from 0.0.2-next.17 to 0.0.2-next.18
141
+ * @twin.org/crypto bumped from 0.0.2-next.17 to 0.0.2-next.18
142
+ * @twin.org/nameof bumped from 0.0.2-next.17 to 0.0.2-next.18
143
+ * devDependencies
144
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.17 to 0.0.2-next.18
145
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.17 to 0.0.2-next.18
146
+
147
+ ## [0.0.2-next.17](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.16...cli-core-v0.0.2-next.17) (2025-09-29)
148
+
149
+
150
+ ### Miscellaneous Chores
151
+
152
+ * **cli-core:** Synchronize repo versions
153
+
154
+
155
+ ### Dependencies
156
+
157
+ * The following workspace dependencies were updated
158
+ * dependencies
159
+ * @twin.org/core bumped from 0.0.2-next.16 to 0.0.2-next.17
160
+ * @twin.org/crypto bumped from 0.0.2-next.16 to 0.0.2-next.17
161
+ * @twin.org/nameof bumped from 0.0.2-next.16 to 0.0.2-next.17
162
+ * devDependencies
163
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.16 to 0.0.2-next.17
164
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.16 to 0.0.2-next.17
165
+
166
+ ## [0.0.2-next.16](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.15...cli-core-v0.0.2-next.16) (2025-09-28)
167
+
168
+
169
+ ### Miscellaneous Chores
170
+
171
+ * **cli-core:** Synchronize repo versions
172
+
173
+
174
+ ### Dependencies
175
+
176
+ * The following workspace dependencies were updated
177
+ * dependencies
178
+ * @twin.org/core bumped from 0.0.2-next.15 to 0.0.2-next.16
179
+ * @twin.org/crypto bumped from 0.0.2-next.15 to 0.0.2-next.16
180
+ * @twin.org/nameof bumped from 0.0.2-next.15 to 0.0.2-next.16
181
+ * devDependencies
182
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.15 to 0.0.2-next.16
183
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.15 to 0.0.2-next.16
184
+
185
+ ## [0.0.2-next.15](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.14...cli-core-v0.0.2-next.15) (2025-09-22)
186
+
187
+
188
+ ### Miscellaneous Chores
189
+
190
+ * **cli-core:** Synchronize repo versions
191
+
192
+
193
+ ### Dependencies
194
+
195
+ * The following workspace dependencies were updated
196
+ * dependencies
197
+ * @twin.org/core bumped from 0.0.2-next.14 to 0.0.2-next.15
198
+ * @twin.org/crypto bumped from 0.0.2-next.14 to 0.0.2-next.15
199
+ * @twin.org/nameof bumped from 0.0.2-next.14 to 0.0.2-next.15
200
+ * devDependencies
201
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.14 to 0.0.2-next.15
202
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.14 to 0.0.2-next.15
203
+
204
+ ## [0.0.2-next.14](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.13...cli-core-v0.0.2-next.14) (2025-09-22)
205
+
206
+
207
+ ### Miscellaneous Chores
208
+
209
+ * **cli-core:** Synchronize repo versions
210
+
211
+
212
+ ### Dependencies
213
+
214
+ * The following workspace dependencies were updated
215
+ * dependencies
216
+ * @twin.org/core bumped from 0.0.2-next.13 to 0.0.2-next.14
217
+ * @twin.org/crypto bumped from 0.0.2-next.13 to 0.0.2-next.14
218
+ * @twin.org/nameof bumped from 0.0.2-next.13 to 0.0.2-next.14
219
+ * devDependencies
220
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.13 to 0.0.2-next.14
221
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.13 to 0.0.2-next.14
222
+
223
+ ## [0.0.2-next.13](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.12...cli-core-v0.0.2-next.13) (2025-09-22)
224
+
225
+
226
+ ### Miscellaneous Chores
227
+
228
+ * **cli-core:** Synchronize repo versions
229
+
230
+
231
+ ### Dependencies
232
+
233
+ * The following workspace dependencies were updated
234
+ * dependencies
235
+ * @twin.org/core bumped from 0.0.2-next.12 to 0.0.2-next.13
236
+ * @twin.org/crypto bumped from 0.0.2-next.12 to 0.0.2-next.13
237
+ * @twin.org/nameof bumped from 0.0.2-next.12 to 0.0.2-next.13
238
+ * devDependencies
239
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.12 to 0.0.2-next.13
240
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.12 to 0.0.2-next.13
241
+
242
+ ## [0.0.2-next.12](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.11...cli-core-v0.0.2-next.12) (2025-09-15)
243
+
244
+
245
+ ### Miscellaneous Chores
246
+
247
+ * **cli-core:** Synchronize repo versions
248
+
249
+
250
+ ### Dependencies
251
+
252
+ * The following workspace dependencies were updated
253
+ * dependencies
254
+ * @twin.org/core bumped from 0.0.2-next.11 to 0.0.2-next.12
255
+ * @twin.org/crypto bumped from 0.0.2-next.11 to 0.0.2-next.12
256
+ * @twin.org/nameof bumped from 0.0.2-next.11 to 0.0.2-next.12
257
+ * devDependencies
258
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.11 to 0.0.2-next.12
259
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.11 to 0.0.2-next.12
260
+
261
+ ## [0.0.2-next.11](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.10...cli-core-v0.0.2-next.11) (2025-09-15)
262
+
263
+
264
+ ### Bug Fixes
265
+
266
+ * cli display output for JSON to allow infinite depth ([2a06f52](https://github.com/twinfoundation/framework/commit/2a06f52c92dbc51a4969d651486a0c3548529929))
267
+
268
+
269
+ ### Dependencies
270
+
271
+ * The following workspace dependencies were updated
272
+ * dependencies
273
+ * @twin.org/core bumped from 0.0.2-next.10 to 0.0.2-next.11
274
+ * @twin.org/crypto bumped from 0.0.2-next.10 to 0.0.2-next.11
275
+ * @twin.org/nameof bumped from 0.0.2-next.10 to 0.0.2-next.11
276
+ * devDependencies
277
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.10 to 0.0.2-next.11
278
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.10 to 0.0.2-next.11
279
+
280
+ ## [0.0.2-next.10](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.9...cli-core-v0.0.2-next.10) (2025-09-11)
281
+
282
+
283
+ ### Features
284
+
285
+ * add CLIParam.arrayOneOf ([18f0815](https://github.com/twinfoundation/framework/commit/18f08157e5305cddf65d09b36a51a91a0873e396))
286
+
287
+
288
+ ### Dependencies
289
+
290
+ * The following workspace dependencies were updated
291
+ * dependencies
292
+ * @twin.org/core bumped from 0.0.2-next.9 to 0.0.2-next.10
293
+ * @twin.org/crypto bumped from 0.0.2-next.9 to 0.0.2-next.10
294
+ * @twin.org/nameof bumped from 0.0.2-next.9 to 0.0.2-next.10
295
+ * devDependencies
296
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.9 to 0.0.2-next.10
297
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.9 to 0.0.2-next.10
298
+
3
299
  ## [0.0.2-next.9](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.8...cli-core-v0.0.2-next.9) (2025-09-08)
4
300
 
5
301
 
@@ -124,6 +124,26 @@ Whether to add a line break after the error.
124
124
 
125
125
  ***
126
126
 
127
+ ### errorMessage()
128
+
129
+ > `static` **errorMessage**(`error`): `void`
130
+
131
+ Display an error message in simple form.
132
+
133
+ #### Parameters
134
+
135
+ ##### error
136
+
137
+ `string`
138
+
139
+ The error to display.
140
+
141
+ #### Returns
142
+
143
+ `void`
144
+
145
+ ***
146
+
127
147
  ### section()
128
148
 
129
149
  > `static` **section**(`label`): `void`
@@ -16,7 +16,7 @@ Parameter utilities for the CLI.
16
16
 
17
17
  ### env()
18
18
 
19
- > `static` **env**(`optionName`, `optionValue`, `allowEnvVar`): `undefined` \| `string`
19
+ > `static` **env**(`optionName`, `optionValue`, `allowEnvVar`): `string` \| `undefined`
20
20
 
21
21
  Check the option to see if it exists.
22
22
 
@@ -32,7 +32,7 @@ The name of the option.
32
32
 
33
33
  The option value.
34
34
 
35
- `undefined` | `string`
35
+ `string` | `undefined`
36
36
 
37
37
  ##### allowEnvVar
38
38
 
@@ -42,7 +42,7 @@ Allow the option to be read from an env var.
42
42
 
43
43
  #### Returns
44
44
 
45
- `undefined` \| `string`
45
+ `string` \| `undefined`
46
46
 
47
47
  The final option value.
48
48
 
@@ -70,7 +70,7 @@ The name of the option.
70
70
 
71
71
  The option value.
72
72
 
73
- `undefined` | `string`
73
+ `string` | `undefined`
74
74
 
75
75
  ##### allowEnvVar
76
76
 
@@ -90,6 +90,56 @@ An error if the option is invalid.
90
90
 
91
91
  ***
92
92
 
93
+ ### arrayOneOf()
94
+
95
+ > `static` **arrayOneOf**\<`T`\>(`optionName`, `optionValue`, `validValues`, `allowEnvVar`): `T`
96
+
97
+ Check the option to see if the value exists in the specific array.
98
+
99
+ #### Type Parameters
100
+
101
+ ##### T
102
+
103
+ `T` = `string`
104
+
105
+ #### Parameters
106
+
107
+ ##### optionName
108
+
109
+ `string`
110
+
111
+ The name of the option.
112
+
113
+ ##### optionValue
114
+
115
+ The option value.
116
+
117
+ `string` | `undefined`
118
+
119
+ ##### validValues
120
+
121
+ `T`[]
122
+
123
+ The valid values.
124
+
125
+ ##### allowEnvVar
126
+
127
+ `boolean` = `true`
128
+
129
+ Allow the option to be read from an env var.
130
+
131
+ #### Returns
132
+
133
+ `T`
134
+
135
+ The final option value.
136
+
137
+ #### Throws
138
+
139
+ An error if the option is invalid.
140
+
141
+ ***
142
+
93
143
  ### url()
94
144
 
95
145
  > `static` **url**(`optionName`, `optionValue`, `allowEnvVar`): `string`
@@ -108,7 +158,7 @@ The name of the option.
108
158
 
109
159
  The option value.
110
160
 
111
- `undefined` | `string`
161
+ `string` | `undefined`
112
162
 
113
163
  ##### allowEnvVar
114
164
 
@@ -146,7 +196,7 @@ The name of the option.
146
196
 
147
197
  The option value.
148
198
 
149
- `undefined` | `string`
199
+ `string` | `undefined`
150
200
 
151
201
  ##### allowEnvVar
152
202
 
@@ -196,7 +246,7 @@ The name of the option.
196
246
 
197
247
  The option value.
198
248
 
199
- `undefined` | `string`
249
+ `string` | `undefined`
200
250
 
201
251
  ##### allowEnvVar
202
252
 
@@ -246,7 +296,7 @@ The name of the option.
246
296
 
247
297
  The option value.
248
298
 
249
- `undefined` | `string`
299
+ `string` | `undefined`
250
300
 
251
301
  ##### allowEnvVar
252
302
 
@@ -296,7 +346,7 @@ The name of the option.
296
346
 
297
347
  The option value.
298
348
 
299
- `undefined` | `string`
349
+ `string` | `undefined`
300
350
 
301
351
  ##### allowEnvVar
302
352
 
@@ -334,7 +384,7 @@ The name of the option.
334
384
 
335
385
  The option value.
336
386
 
337
- `undefined` | `string`
387
+ `string` | `undefined`
338
388
 
339
389
  ##### allowEnvVar
340
390
 
@@ -372,7 +422,7 @@ The name of the option.
372
422
 
373
423
  The option value.
374
424
 
375
- `undefined` | `string`
425
+ `string` | `undefined`
376
426
 
377
427
  ##### allowEnvVar
378
428
 
@@ -410,7 +460,7 @@ The name of the option.
410
460
 
411
461
  The option value.
412
462
 
413
- `undefined` | `string`
463
+ `string` | `undefined`
414
464
 
415
465
  ##### allowEnvVar
416
466
 
@@ -427,41 +477,3 @@ The final option value.
427
477
  #### Throws
428
478
 
429
479
  An error if the option is invalid.
430
-
431
- ***
432
-
433
- ### bech32()
434
-
435
- > `static` **bech32**(`optionName`, `optionValue`, `allowEnvVar`): `string`
436
-
437
- Check the option to see if it exists and is bech32.
438
-
439
- #### Parameters
440
-
441
- ##### optionName
442
-
443
- `string`
444
-
445
- The name of the option.
446
-
447
- ##### optionValue
448
-
449
- The option value.
450
-
451
- `undefined` | `string`
452
-
453
- ##### allowEnvVar
454
-
455
- `boolean` = `true`
456
-
457
- Allow the option to be read from an env var.
458
-
459
- #### Returns
460
-
461
- `string`
462
-
463
- The final option value.
464
-
465
- #### Throws
466
-
467
- An error if the option is invalid.
@@ -104,7 +104,7 @@ True if the dir exists.
104
104
 
105
105
  ### readJsonFile()
106
106
 
107
- > `static` **readJsonFile**\<`T`\>(`filename`): `Promise`\<`undefined` \| `T`\>
107
+ > `static` **readJsonFile**\<`T`\>(`filename`): `Promise`\<`T` \| `undefined`\>
108
108
 
109
109
  Read a JSON file and parse it.
110
110
 
@@ -124,7 +124,7 @@ The filename to read.
124
124
 
125
125
  #### Returns
126
126
 
127
- `Promise`\<`undefined` \| `T`\>
127
+ `Promise`\<`T` \| `undefined`\>
128
128
 
129
129
  The parsed JSON.
130
130
 
@@ -132,7 +132,7 @@ The parsed JSON.
132
132
 
133
133
  ### readJsonFileSync()
134
134
 
135
- > `static` **readJsonFileSync**\<`T`\>(`filename`): `undefined` \| `T`
135
+ > `static` **readJsonFileSync**\<`T`\>(`filename`): `T` \| `undefined`
136
136
 
137
137
  Read a JSON file and parse it, synchronously.
138
138
 
@@ -152,7 +152,7 @@ The filename to read.
152
152
 
153
153
  #### Returns
154
154
 
155
- `undefined` \| `T`
155
+ `T` \| `undefined`
156
156
 
157
157
  The parsed JSON.
158
158
 
@@ -160,7 +160,7 @@ The parsed JSON.
160
160
 
161
161
  ### readLinesFile()
162
162
 
163
- > `static` **readLinesFile**(`filename`): `Promise`\<`undefined` \| `string`[]\>
163
+ > `static` **readLinesFile**(`filename`): `Promise`\<`string`[] \| `undefined`\>
164
164
 
165
165
  Read a file as lines.
166
166
 
@@ -174,7 +174,7 @@ The filename to read.
174
174
 
175
175
  #### Returns
176
176
 
177
- `Promise`\<`undefined` \| `string`[]\>
177
+ `Promise`\<`string`[] \| `undefined`\>
178
178
 
179
179
  The lines.
180
180
 
@@ -182,7 +182,7 @@ The lines.
182
182
 
183
183
  ### readLinesFileSync()
184
184
 
185
- > `static` **readLinesFileSync**(`filename`): `undefined` \| `string`[]
185
+ > `static` **readLinesFileSync**(`filename`): `string`[] \| `undefined`
186
186
 
187
187
  Read a file as lines, synchronously.
188
188
 
@@ -196,7 +196,7 @@ The filename to read.
196
196
 
197
197
  #### Returns
198
198
 
199
- `undefined` \| `string`[]
199
+ `string`[] \| `undefined`
200
200
 
201
201
  The lines.
202
202
 
@@ -310,7 +310,7 @@ Write a JSON file.
310
310
 
311
311
  The filename to write.
312
312
 
313
- `undefined` | `string`
313
+ `string` | `undefined`
314
314
 
315
315
  ##### data
316
316
 
@@ -342,7 +342,7 @@ Write an env file.
342
342
 
343
343
  The filename to write.
344
344
 
345
- `undefined` | `string`
345
+ `string` | `undefined`
346
346
 
347
347
  ##### data
348
348
 
@@ -0,0 +1 @@
1
+ ^commander.help$
package/locales/en.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
7
7
  "optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
8
8
  "optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
9
- "optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
10
9
  "optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
11
10
  "optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
12
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/cli-core",
3
- "version": "0.0.2-next.9",
3
+ "version": "0.0.3-next.2",
4
4
  "description": "Core classes for building a CLI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,28 +14,39 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.2-next.9",
18
- "@twin.org/crypto": "0.0.2-next.9",
19
- "@twin.org/nameof": "0.0.2-next.9",
20
- "chalk": "5.6.0",
21
- "commander": "14.0.0",
22
- "dotenv": "17.2.1"
17
+ "@twin.org/core": "0.0.3-next.2",
18
+ "@twin.org/nameof": "0.0.3-next.2",
19
+ "chalk": "5.6.2",
20
+ "commander": "14.0.2",
21
+ "dotenv": "17.2.3"
23
22
  },
24
- "main": "./dist/cjs/index.cjs",
25
- "module": "./dist/esm/index.mjs",
23
+ "main": "./dist/es/index.js",
26
24
  "types": "./dist/types/index.d.ts",
27
25
  "exports": {
28
26
  ".": {
29
27
  "types": "./dist/types/index.d.ts",
30
- "require": "./dist/cjs/index.cjs",
31
- "import": "./dist/esm/index.mjs"
28
+ "import": "./dist/es/index.js",
29
+ "default": "./dist/es/index.js"
32
30
  }
33
31
  },
34
32
  "files": [
35
- "dist/cjs",
36
- "dist/esm",
33
+ "dist/es",
37
34
  "dist/types",
38
35
  "locales",
39
36
  "docs"
40
- ]
37
+ ],
38
+ "keywords": [
39
+ "twin",
40
+ "trade",
41
+ "iota",
42
+ "framework",
43
+ "blockchain",
44
+ "core",
45
+ "foundation",
46
+ "utilities"
47
+ ],
48
+ "bugs": {
49
+ "url": "git+https://github.com/twinfoundation/framework/issues"
50
+ },
51
+ "homepage": "https://twindev.org"
41
52
  }