@twin.org/cli-core 0.0.2-next.9 → 0.0.3-next.1
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.
- package/dist/es/cliBase.js +122 -0
- package/dist/es/cliBase.js.map +1 -0
- package/dist/es/cliDisplay.js +166 -0
- package/dist/es/cliDisplay.js.map +1 -0
- package/dist/es/cliOptions.js +36 -0
- package/dist/es/cliOptions.js.map +1 -0
- package/dist/es/cliParam.js +248 -0
- package/dist/es/cliParam.js.map +1 -0
- package/dist/es/cliUtils.js +235 -0
- package/dist/es/cliUtils.js.map +1 -0
- package/dist/es/commands/global.js +61 -0
- package/dist/es/commands/global.js.map +1 -0
- package/dist/es/index.js +14 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/ICliOptions.js +2 -0
- package/dist/es/models/ICliOptions.js.map +1 -0
- package/dist/es/models/ICliOutputOptionsConsole.js +2 -0
- package/dist/es/models/ICliOutputOptionsConsole.js.map +1 -0
- package/dist/es/models/ICliOutputOptionsEnv.js +2 -0
- package/dist/es/models/ICliOutputOptionsEnv.js.map +1 -0
- package/dist/es/models/ICliOutputOptionsJson.js +2 -0
- package/dist/es/models/ICliOutputOptionsJson.js.map +1 -0
- package/dist/es/models/cliOutputOptions.js +2 -0
- package/dist/es/models/cliOutputOptions.js.map +1 -0
- package/dist/types/cliBase.d.ts +1 -1
- package/dist/types/cliDisplay.d.ts +5 -0
- package/dist/types/cliParam.d.ts +10 -9
- package/dist/types/index.d.ts +11 -11
- package/dist/types/models/cliOutputOptions.d.ts +3 -3
- package/docs/changelog.md +278 -0
- package/docs/reference/classes/CLIDisplay.md +20 -0
- package/docs/reference/classes/CLIParam.md +62 -50
- package/docs/reference/classes/CLIUtils.md +10 -10
- package/locales/.validate-ignore +1 -0
- package/locales/en.json +0 -1
- package/package.json +25 -14
- package/dist/cjs/index.cjs +0 -878
- package/dist/esm/index.mjs +0 -849
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,283 @@
|
|
|
1
1
|
# @twin.org/cli-core - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add CLIParam.arrayOneOf ([18f0815](https://github.com/twinfoundation/framework/commit/18f08157e5305cddf65d09b36a51a91a0873e396))
|
|
9
|
+
* add context id features ([#206](https://github.com/twinfoundation/framework/issues/206)) ([ef0d4ee](https://github.com/twinfoundation/framework/commit/ef0d4ee11a4f5fc6cc6f52a4958ce905c04ee13b))
|
|
10
|
+
* add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
|
|
11
|
+
* eslint migration to flat config ([74427d7](https://github.com/twinfoundation/framework/commit/74427d78d342167f7850e49ab87269326355befe))
|
|
12
|
+
* improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
|
|
13
|
+
* locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
|
|
14
|
+
* relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
|
|
15
|
+
* update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
|
|
16
|
+
* use cause instead of inner for errors ([1f4acc4](https://github.com/twinfoundation/framework/commit/1f4acc4d7a6b71a134d9547da9bf40de1e1e49da))
|
|
17
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* cli display output for JSON to allow infinite depth ([2a06f52](https://github.com/twinfoundation/framework/commit/2a06f52c92dbc51a4969d651486a0c3548529929))
|
|
23
|
+
* framework pr naming convention ([#142](https://github.com/twinfoundation/framework/issues/142)) ([e29acee](https://github.com/twinfoundation/framework/commit/e29acee2fbec42506091956d6ba8b8ce25a90008))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/core bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
31
|
+
* @twin.org/nameof bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
32
|
+
* devDependencies
|
|
33
|
+
* @twin.org/nameof-transformer bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
34
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
35
|
+
|
|
36
|
+
## [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)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Miscellaneous Chores
|
|
40
|
+
|
|
41
|
+
* **cli-core:** Synchronize repo versions
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
* The following workspace dependencies were updated
|
|
47
|
+
* dependencies
|
|
48
|
+
* @twin.org/core bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
49
|
+
* @twin.org/nameof bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
50
|
+
* devDependencies
|
|
51
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
52
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.21 to 0.0.2-next.22
|
|
53
|
+
|
|
54
|
+
## [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)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
|
|
59
|
+
* locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Dependencies
|
|
63
|
+
|
|
64
|
+
* The following workspace dependencies were updated
|
|
65
|
+
* dependencies
|
|
66
|
+
* @twin.org/core bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
67
|
+
* @twin.org/nameof bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
68
|
+
* devDependencies
|
|
69
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
70
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.20 to 0.0.2-next.21
|
|
71
|
+
|
|
72
|
+
## [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)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Miscellaneous Chores
|
|
76
|
+
|
|
77
|
+
* **cli-core:** Synchronize repo versions
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Dependencies
|
|
81
|
+
|
|
82
|
+
* The following workspace dependencies were updated
|
|
83
|
+
* dependencies
|
|
84
|
+
* @twin.org/core bumped from 0.0.2-next.19 to 0.0.2-next.20
|
|
85
|
+
* @twin.org/crypto bumped from 0.0.2-next.19 to 0.0.2-next.20
|
|
86
|
+
* @twin.org/nameof bumped from 0.0.2-next.19 to 0.0.2-next.20
|
|
87
|
+
* devDependencies
|
|
88
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.19 to 0.0.2-next.20
|
|
89
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.19 to 0.0.2-next.20
|
|
90
|
+
|
|
91
|
+
## [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)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Miscellaneous Chores
|
|
95
|
+
|
|
96
|
+
* **cli-core:** Synchronize repo versions
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Dependencies
|
|
100
|
+
|
|
101
|
+
* The following workspace dependencies were updated
|
|
102
|
+
* dependencies
|
|
103
|
+
* @twin.org/core bumped from 0.0.2-next.18 to 0.0.2-next.19
|
|
104
|
+
* @twin.org/crypto bumped from 0.0.2-next.18 to 0.0.2-next.19
|
|
105
|
+
* @twin.org/nameof bumped from 0.0.2-next.18 to 0.0.2-next.19
|
|
106
|
+
* devDependencies
|
|
107
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.18 to 0.0.2-next.19
|
|
108
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.18 to 0.0.2-next.19
|
|
109
|
+
|
|
110
|
+
## [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)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### Miscellaneous Chores
|
|
114
|
+
|
|
115
|
+
* **cli-core:** Synchronize repo versions
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Dependencies
|
|
119
|
+
|
|
120
|
+
* The following workspace dependencies were updated
|
|
121
|
+
* dependencies
|
|
122
|
+
* @twin.org/core bumped from 0.0.2-next.17 to 0.0.2-next.18
|
|
123
|
+
* @twin.org/crypto bumped from 0.0.2-next.17 to 0.0.2-next.18
|
|
124
|
+
* @twin.org/nameof bumped from 0.0.2-next.17 to 0.0.2-next.18
|
|
125
|
+
* devDependencies
|
|
126
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.17 to 0.0.2-next.18
|
|
127
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.17 to 0.0.2-next.18
|
|
128
|
+
|
|
129
|
+
## [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)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Miscellaneous Chores
|
|
133
|
+
|
|
134
|
+
* **cli-core:** Synchronize repo versions
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
### Dependencies
|
|
138
|
+
|
|
139
|
+
* The following workspace dependencies were updated
|
|
140
|
+
* dependencies
|
|
141
|
+
* @twin.org/core bumped from 0.0.2-next.16 to 0.0.2-next.17
|
|
142
|
+
* @twin.org/crypto bumped from 0.0.2-next.16 to 0.0.2-next.17
|
|
143
|
+
* @twin.org/nameof bumped from 0.0.2-next.16 to 0.0.2-next.17
|
|
144
|
+
* devDependencies
|
|
145
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.16 to 0.0.2-next.17
|
|
146
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.16 to 0.0.2-next.17
|
|
147
|
+
|
|
148
|
+
## [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)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Miscellaneous Chores
|
|
152
|
+
|
|
153
|
+
* **cli-core:** Synchronize repo versions
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### Dependencies
|
|
157
|
+
|
|
158
|
+
* The following workspace dependencies were updated
|
|
159
|
+
* dependencies
|
|
160
|
+
* @twin.org/core bumped from 0.0.2-next.15 to 0.0.2-next.16
|
|
161
|
+
* @twin.org/crypto bumped from 0.0.2-next.15 to 0.0.2-next.16
|
|
162
|
+
* @twin.org/nameof bumped from 0.0.2-next.15 to 0.0.2-next.16
|
|
163
|
+
* devDependencies
|
|
164
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.15 to 0.0.2-next.16
|
|
165
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.15 to 0.0.2-next.16
|
|
166
|
+
|
|
167
|
+
## [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)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Miscellaneous Chores
|
|
171
|
+
|
|
172
|
+
* **cli-core:** Synchronize repo versions
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
### Dependencies
|
|
176
|
+
|
|
177
|
+
* The following workspace dependencies were updated
|
|
178
|
+
* dependencies
|
|
179
|
+
* @twin.org/core bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
180
|
+
* @twin.org/crypto bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
181
|
+
* @twin.org/nameof bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
182
|
+
* devDependencies
|
|
183
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
184
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.14 to 0.0.2-next.15
|
|
185
|
+
|
|
186
|
+
## [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)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
### Miscellaneous Chores
|
|
190
|
+
|
|
191
|
+
* **cli-core:** Synchronize repo versions
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Dependencies
|
|
195
|
+
|
|
196
|
+
* The following workspace dependencies were updated
|
|
197
|
+
* dependencies
|
|
198
|
+
* @twin.org/core bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
199
|
+
* @twin.org/crypto bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
200
|
+
* @twin.org/nameof bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
201
|
+
* devDependencies
|
|
202
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
203
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.13 to 0.0.2-next.14
|
|
204
|
+
|
|
205
|
+
## [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)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Miscellaneous Chores
|
|
209
|
+
|
|
210
|
+
* **cli-core:** Synchronize repo versions
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Dependencies
|
|
214
|
+
|
|
215
|
+
* The following workspace dependencies were updated
|
|
216
|
+
* dependencies
|
|
217
|
+
* @twin.org/core bumped from 0.0.2-next.12 to 0.0.2-next.13
|
|
218
|
+
* @twin.org/crypto bumped from 0.0.2-next.12 to 0.0.2-next.13
|
|
219
|
+
* @twin.org/nameof bumped from 0.0.2-next.12 to 0.0.2-next.13
|
|
220
|
+
* devDependencies
|
|
221
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.12 to 0.0.2-next.13
|
|
222
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.12 to 0.0.2-next.13
|
|
223
|
+
|
|
224
|
+
## [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)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### Miscellaneous Chores
|
|
228
|
+
|
|
229
|
+
* **cli-core:** Synchronize repo versions
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
### Dependencies
|
|
233
|
+
|
|
234
|
+
* The following workspace dependencies were updated
|
|
235
|
+
* dependencies
|
|
236
|
+
* @twin.org/core bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
237
|
+
* @twin.org/crypto bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
238
|
+
* @twin.org/nameof bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
239
|
+
* devDependencies
|
|
240
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
241
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
242
|
+
|
|
243
|
+
## [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)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
### Bug Fixes
|
|
247
|
+
|
|
248
|
+
* cli display output for JSON to allow infinite depth ([2a06f52](https://github.com/twinfoundation/framework/commit/2a06f52c92dbc51a4969d651486a0c3548529929))
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
### Dependencies
|
|
252
|
+
|
|
253
|
+
* The following workspace dependencies were updated
|
|
254
|
+
* dependencies
|
|
255
|
+
* @twin.org/core bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
256
|
+
* @twin.org/crypto bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
257
|
+
* @twin.org/nameof bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
258
|
+
* devDependencies
|
|
259
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
260
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
261
|
+
|
|
262
|
+
## [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)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
### Features
|
|
266
|
+
|
|
267
|
+
* add CLIParam.arrayOneOf ([18f0815](https://github.com/twinfoundation/framework/commit/18f08157e5305cddf65d09b36a51a91a0873e396))
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
### Dependencies
|
|
271
|
+
|
|
272
|
+
* The following workspace dependencies were updated
|
|
273
|
+
* dependencies
|
|
274
|
+
* @twin.org/core bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
275
|
+
* @twin.org/crypto bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
276
|
+
* @twin.org/nameof bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
277
|
+
* devDependencies
|
|
278
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
279
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
280
|
+
|
|
3
281
|
## [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
282
|
|
|
5
283
|
|
|
@@ -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`): `
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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`\<`
|
|
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`\<`
|
|
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`): `
|
|
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
|
-
`
|
|
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`\<`
|
|
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`\<`
|
|
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`): `
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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
|
-
`
|
|
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.
|
|
3
|
+
"version": "0.0.3-next.1",
|
|
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.
|
|
18
|
-
"@twin.org/
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"dotenv": "17.2.1"
|
|
17
|
+
"@twin.org/core": "0.0.3-next.1",
|
|
18
|
+
"@twin.org/nameof": "0.0.3-next.1",
|
|
19
|
+
"chalk": "5.6.2",
|
|
20
|
+
"commander": "14.0.2",
|
|
21
|
+
"dotenv": "17.2.3"
|
|
23
22
|
},
|
|
24
|
-
"main": "./dist/
|
|
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
|
-
"
|
|
31
|
-
"
|
|
28
|
+
"import": "./dist/es/index.js",
|
|
29
|
+
"default": "./dist/es/index.js"
|
|
32
30
|
}
|
|
33
31
|
},
|
|
34
32
|
"files": [
|
|
35
|
-
"dist/
|
|
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
|
}
|