@twin.org/cli-core 0.0.1 → 0.0.2-next.11
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/cjs/index.cjs +28 -2
- package/dist/esm/index.mjs +28 -2
- package/dist/types/cliDisplay.d.ts +5 -0
- package/dist/types/cliParam.d.ts +10 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/models/ICliOptions.d.ts +4 -0
- package/docs/changelog.md +236 -0
- package/docs/reference/classes/CLIBase.md +1 -1
- package/docs/reference/classes/CLIDisplay.md +20 -0
- package/docs/reference/classes/CLIParam.md +50 -0
- package/docs/reference/interfaces/ICliOptions.md +8 -0
- package/locales/en.json +5 -0
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -136,9 +136,18 @@ class CLIDisplay {
|
|
|
136
136
|
* @param obj The object to display.
|
|
137
137
|
*/
|
|
138
138
|
static json(obj) {
|
|
139
|
-
CLIDisplay.write(node_util.inspect(obj, false,
|
|
139
|
+
CLIDisplay.write(node_util.inspect(obj, false, null, true));
|
|
140
140
|
CLIDisplay.write("\n");
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Display a warning.
|
|
144
|
+
* @param label The label for the warning.
|
|
145
|
+
*/
|
|
146
|
+
static warning(label) {
|
|
147
|
+
CLIDisplay.write("⚠️ ");
|
|
148
|
+
CLIDisplay.write(chalk.hex("#FFA500").bold(label));
|
|
149
|
+
CLIDisplay.write("\n\n");
|
|
150
|
+
}
|
|
142
151
|
/**
|
|
143
152
|
* Display the processing is done.
|
|
144
153
|
*/
|
|
@@ -443,7 +452,7 @@ function handleGlobalOptions(command) {
|
|
|
443
452
|
const resolvedEnv = loadEnv.map(e => path.resolve(e));
|
|
444
453
|
CLIDisplay.task(core.I18n.formatMessage("cli.progress.loadingEnvFiles"), resolvedEnv.join(", "));
|
|
445
454
|
CLIDisplay.break();
|
|
446
|
-
dotenv__namespace.config({ path: resolvedEnv });
|
|
455
|
+
dotenv__namespace.config({ path: resolvedEnv, quiet: true });
|
|
447
456
|
}
|
|
448
457
|
}
|
|
449
458
|
/**
|
|
@@ -510,6 +519,9 @@ class CLIBase {
|
|
|
510
519
|
// eslint-disable-next-line no-restricted-syntax
|
|
511
520
|
throw new Error(err.code === "commander.help" ? "0" : err.exitCode.toString());
|
|
512
521
|
});
|
|
522
|
+
if (options.showDevToolWarning ?? false) {
|
|
523
|
+
program.hook("preAction", () => CLIDisplay.warning(core.I18n.formatMessage("warn.common.devOnlyTool")));
|
|
524
|
+
}
|
|
513
525
|
this.configureRoot(program);
|
|
514
526
|
addGlobalOptions(program, options.supportsLang ?? true, options.supportsEnvFiles ?? false);
|
|
515
527
|
// We parse the options before building the command
|
|
@@ -649,6 +661,20 @@ class CLIParam {
|
|
|
649
661
|
core.Guards.stringValue("commands", optionName, optionValue);
|
|
650
662
|
return optionValue;
|
|
651
663
|
}
|
|
664
|
+
/**
|
|
665
|
+
* Check the option to see if the value exists in the specific array.
|
|
666
|
+
* @param optionName The name of the option.
|
|
667
|
+
* @param optionValue The option value.
|
|
668
|
+
* @param validValues The valid values.
|
|
669
|
+
* @param allowEnvVar Allow the option to be read from an env var.
|
|
670
|
+
* @returns The final option value.
|
|
671
|
+
* @throws An error if the option is invalid.
|
|
672
|
+
*/
|
|
673
|
+
static arrayOneOf(optionName, optionValue, validValues, allowEnvVar = true) {
|
|
674
|
+
optionValue = CLIParam.env(optionName, optionValue, allowEnvVar);
|
|
675
|
+
core.Guards.arrayOneOf("commands", optionName, optionValue, validValues);
|
|
676
|
+
return optionValue;
|
|
677
|
+
}
|
|
652
678
|
/**
|
|
653
679
|
* Check the option to see if it is a url.
|
|
654
680
|
* @param optionName The name of the option.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -115,9 +115,18 @@ class CLIDisplay {
|
|
|
115
115
|
* @param obj The object to display.
|
|
116
116
|
*/
|
|
117
117
|
static json(obj) {
|
|
118
|
-
CLIDisplay.write(inspect(obj, false,
|
|
118
|
+
CLIDisplay.write(inspect(obj, false, null, true));
|
|
119
119
|
CLIDisplay.write("\n");
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Display a warning.
|
|
123
|
+
* @param label The label for the warning.
|
|
124
|
+
*/
|
|
125
|
+
static warning(label) {
|
|
126
|
+
CLIDisplay.write("⚠️ ");
|
|
127
|
+
CLIDisplay.write(chalk.hex("#FFA500").bold(label));
|
|
128
|
+
CLIDisplay.write("\n\n");
|
|
129
|
+
}
|
|
121
130
|
/**
|
|
122
131
|
* Display the processing is done.
|
|
123
132
|
*/
|
|
@@ -422,7 +431,7 @@ function handleGlobalOptions(command) {
|
|
|
422
431
|
const resolvedEnv = loadEnv.map(e => path.resolve(e));
|
|
423
432
|
CLIDisplay.task(I18n.formatMessage("cli.progress.loadingEnvFiles"), resolvedEnv.join(", "));
|
|
424
433
|
CLIDisplay.break();
|
|
425
|
-
dotenv.config({ path: resolvedEnv });
|
|
434
|
+
dotenv.config({ path: resolvedEnv, quiet: true });
|
|
426
435
|
}
|
|
427
436
|
}
|
|
428
437
|
/**
|
|
@@ -489,6 +498,9 @@ class CLIBase {
|
|
|
489
498
|
// eslint-disable-next-line no-restricted-syntax
|
|
490
499
|
throw new Error(err.code === "commander.help" ? "0" : err.exitCode.toString());
|
|
491
500
|
});
|
|
501
|
+
if (options.showDevToolWarning ?? false) {
|
|
502
|
+
program.hook("preAction", () => CLIDisplay.warning(I18n.formatMessage("warn.common.devOnlyTool")));
|
|
503
|
+
}
|
|
492
504
|
this.configureRoot(program);
|
|
493
505
|
addGlobalOptions(program, options.supportsLang ?? true, options.supportsEnvFiles ?? false);
|
|
494
506
|
// We parse the options before building the command
|
|
@@ -628,6 +640,20 @@ class CLIParam {
|
|
|
628
640
|
Guards.stringValue("commands", optionName, optionValue);
|
|
629
641
|
return optionValue;
|
|
630
642
|
}
|
|
643
|
+
/**
|
|
644
|
+
* Check the option to see if the value exists in the specific array.
|
|
645
|
+
* @param optionName The name of the option.
|
|
646
|
+
* @param optionValue The option value.
|
|
647
|
+
* @param validValues The valid values.
|
|
648
|
+
* @param allowEnvVar Allow the option to be read from an env var.
|
|
649
|
+
* @returns The final option value.
|
|
650
|
+
* @throws An error if the option is invalid.
|
|
651
|
+
*/
|
|
652
|
+
static arrayOneOf(optionName, optionValue, validValues, allowEnvVar = true) {
|
|
653
|
+
optionValue = CLIParam.env(optionName, optionValue, allowEnvVar);
|
|
654
|
+
Guards.arrayOneOf("commands", optionName, optionValue, validValues);
|
|
655
|
+
return optionValue;
|
|
656
|
+
}
|
|
631
657
|
/**
|
|
632
658
|
* Check the option to see if it is a url.
|
|
633
659
|
* @param optionName The name of the option.
|
|
@@ -56,6 +56,11 @@ export declare class CLIDisplay {
|
|
|
56
56
|
* @param obj The object to display.
|
|
57
57
|
*/
|
|
58
58
|
static json(obj: unknown): void;
|
|
59
|
+
/**
|
|
60
|
+
* Display a warning.
|
|
61
|
+
* @param label The label for the warning.
|
|
62
|
+
*/
|
|
63
|
+
static warning(label: string): void;
|
|
59
64
|
/**
|
|
60
65
|
* Display the processing is done.
|
|
61
66
|
*/
|
package/dist/types/cliParam.d.ts
CHANGED
|
@@ -20,6 +20,16 @@ export declare class CLIParam {
|
|
|
20
20
|
* @throws An error if the option is invalid.
|
|
21
21
|
*/
|
|
22
22
|
static stringValue(optionName: string, optionValue: string | undefined, allowEnvVar?: boolean): string;
|
|
23
|
+
/**
|
|
24
|
+
* Check the option to see if the value exists in the specific array.
|
|
25
|
+
* @param optionName The name of the option.
|
|
26
|
+
* @param optionValue The option value.
|
|
27
|
+
* @param validValues The valid values.
|
|
28
|
+
* @param allowEnvVar Allow the option to be read from an env var.
|
|
29
|
+
* @returns The final option value.
|
|
30
|
+
* @throws An error if the option is invalid.
|
|
31
|
+
*/
|
|
32
|
+
static arrayOneOf<T = string>(optionName: string, optionValue: string | undefined, validValues: T[], allowEnvVar?: boolean): T;
|
|
23
33
|
/**
|
|
24
34
|
* Check the option to see if it is a url.
|
|
25
35
|
* @param optionName The name of the option.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export * from "./cliOptions";
|
|
|
4
4
|
export * from "./cliParam";
|
|
5
5
|
export * from "./cliUtils";
|
|
6
6
|
export * from "./commands/global";
|
|
7
|
+
export * from "./models/cliOutputOptions";
|
|
7
8
|
export * from "./models/ICliOptions";
|
|
8
9
|
export * from "./models/ICliOutputOptionsConsole";
|
|
9
10
|
export * from "./models/ICliOutputOptionsEnv";
|
|
10
11
|
export * from "./models/ICliOutputOptionsJson";
|
|
11
|
-
export * from "./models/cliOutputOptions";
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,241 @@
|
|
|
1
1
|
# @twin.org/cli-core - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* cli display output for JSON to allow infinite depth ([2a06f52](https://github.com/twinfoundation/framework/commit/2a06f52c92dbc51a4969d651486a0c3548529929))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/core bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
16
|
+
* @twin.org/crypto bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
17
|
+
* @twin.org/nameof bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
18
|
+
* devDependencies
|
|
19
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
20
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.10 to 0.0.2-next.11
|
|
21
|
+
|
|
22
|
+
## [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)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* add CLIParam.arrayOneOf ([18f0815](https://github.com/twinfoundation/framework/commit/18f08157e5305cddf65d09b36a51a91a0873e396))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* The following workspace dependencies were updated
|
|
33
|
+
* dependencies
|
|
34
|
+
* @twin.org/core bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
35
|
+
* @twin.org/crypto bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
36
|
+
* @twin.org/nameof bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
37
|
+
* devDependencies
|
|
38
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
39
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
40
|
+
|
|
41
|
+
## [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)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Miscellaneous Chores
|
|
45
|
+
|
|
46
|
+
* **cli-core:** Synchronize repo versions
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Dependencies
|
|
50
|
+
|
|
51
|
+
* The following workspace dependencies were updated
|
|
52
|
+
* dependencies
|
|
53
|
+
* @twin.org/core bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
54
|
+
* @twin.org/crypto bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
55
|
+
* @twin.org/nameof bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
56
|
+
* devDependencies
|
|
57
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
58
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
59
|
+
|
|
60
|
+
## [0.0.2-next.8](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.7...cli-core-v0.0.2-next.8) (2025-09-05)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Miscellaneous Chores
|
|
64
|
+
|
|
65
|
+
* **cli-core:** Synchronize repo versions
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Dependencies
|
|
69
|
+
|
|
70
|
+
* The following workspace dependencies were updated
|
|
71
|
+
* dependencies
|
|
72
|
+
* @twin.org/core bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
73
|
+
* @twin.org/crypto bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
74
|
+
* @twin.org/nameof bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
75
|
+
* devDependencies
|
|
76
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
77
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
78
|
+
|
|
79
|
+
## [0.0.2-next.7](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.6...cli-core-v0.0.2-next.7) (2025-08-29)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Features
|
|
83
|
+
|
|
84
|
+
* eslint migration to flat config ([74427d7](https://github.com/twinfoundation/framework/commit/74427d78d342167f7850e49ab87269326355befe))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Dependencies
|
|
88
|
+
|
|
89
|
+
* The following workspace dependencies were updated
|
|
90
|
+
* dependencies
|
|
91
|
+
* @twin.org/core bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
92
|
+
* @twin.org/crypto bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
93
|
+
* @twin.org/nameof bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
94
|
+
* devDependencies
|
|
95
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
96
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
97
|
+
|
|
98
|
+
## [0.0.2-next.6](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.5...cli-core-v0.0.2-next.6) (2025-08-27)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Miscellaneous Chores
|
|
102
|
+
|
|
103
|
+
* **cli-core:** Synchronize repo versions
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Dependencies
|
|
107
|
+
|
|
108
|
+
* The following workspace dependencies were updated
|
|
109
|
+
* dependencies
|
|
110
|
+
* @twin.org/core bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
111
|
+
* @twin.org/crypto bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
112
|
+
* @twin.org/nameof bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
113
|
+
* devDependencies
|
|
114
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
115
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
116
|
+
|
|
117
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.4...cli-core-v0.0.2-next.5) (2025-08-19)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Features
|
|
121
|
+
|
|
122
|
+
* use cause instead of inner for errors ([1f4acc4](https://github.com/twinfoundation/framework/commit/1f4acc4d7a6b71a134d9547da9bf40de1e1e49da))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Dependencies
|
|
126
|
+
|
|
127
|
+
* The following workspace dependencies were updated
|
|
128
|
+
* dependencies
|
|
129
|
+
* @twin.org/core bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
130
|
+
* @twin.org/crypto bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
131
|
+
* @twin.org/nameof bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
132
|
+
* devDependencies
|
|
133
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
134
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
135
|
+
|
|
136
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.3...cli-core-v0.0.2-next.4) (2025-08-15)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Miscellaneous Chores
|
|
140
|
+
|
|
141
|
+
* **cli-core:** Synchronize repo versions
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### Dependencies
|
|
145
|
+
|
|
146
|
+
* The following workspace dependencies were updated
|
|
147
|
+
* dependencies
|
|
148
|
+
* @twin.org/core bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
149
|
+
* @twin.org/crypto bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
150
|
+
* @twin.org/nameof bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
151
|
+
* devDependencies
|
|
152
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
153
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
154
|
+
|
|
155
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.2...cli-core-v0.0.2-next.3) (2025-08-06)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Features
|
|
159
|
+
|
|
160
|
+
* add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
|
|
161
|
+
* improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
|
|
162
|
+
* relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
|
|
163
|
+
* update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
|
|
164
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
### Bug Fixes
|
|
168
|
+
|
|
169
|
+
* framework pr naming convention ([#142](https://github.com/twinfoundation/framework/issues/142)) ([e29acee](https://github.com/twinfoundation/framework/commit/e29acee2fbec42506091956d6ba8b8ce25a90008))
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Dependencies
|
|
173
|
+
|
|
174
|
+
* The following workspace dependencies were updated
|
|
175
|
+
* dependencies
|
|
176
|
+
* @twin.org/core bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
177
|
+
* @twin.org/crypto bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
178
|
+
* @twin.org/nameof bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
179
|
+
* devDependencies
|
|
180
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
181
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
182
|
+
|
|
183
|
+
## [0.0.2-next.2](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.1...cli-core-v0.0.2-next.2) (2025-08-06)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Features
|
|
187
|
+
|
|
188
|
+
* add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
|
|
189
|
+
* improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
|
|
190
|
+
* relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
|
|
191
|
+
* update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
|
|
192
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### Bug Fixes
|
|
196
|
+
|
|
197
|
+
* framework pr naming convention ([#142](https://github.com/twinfoundation/framework/issues/142)) ([e29acee](https://github.com/twinfoundation/framework/commit/e29acee2fbec42506091956d6ba8b8ce25a90008))
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
### Dependencies
|
|
201
|
+
|
|
202
|
+
* The following workspace dependencies were updated
|
|
203
|
+
* dependencies
|
|
204
|
+
* @twin.org/core bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
205
|
+
* @twin.org/crypto bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
206
|
+
* @twin.org/nameof bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
207
|
+
* devDependencies
|
|
208
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
209
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
210
|
+
|
|
211
|
+
## [0.0.2-next.1](https://github.com/twinfoundation/framework/compare/cli-core-v0.0.2-next.0...cli-core-v0.0.2-next.1) (2025-08-06)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
### Features
|
|
215
|
+
|
|
216
|
+
* add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
|
|
217
|
+
* improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
|
|
218
|
+
* relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
|
|
219
|
+
* update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
|
|
220
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
### Bug Fixes
|
|
224
|
+
|
|
225
|
+
* framework pr naming convention ([#142](https://github.com/twinfoundation/framework/issues/142)) ([e29acee](https://github.com/twinfoundation/framework/commit/e29acee2fbec42506091956d6ba8b8ce25a90008))
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
### Dependencies
|
|
229
|
+
|
|
230
|
+
* The following workspace dependencies were updated
|
|
231
|
+
* dependencies
|
|
232
|
+
* @twin.org/core bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
233
|
+
* @twin.org/crypto bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
234
|
+
* @twin.org/nameof bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
235
|
+
* devDependencies
|
|
236
|
+
* @twin.org/nameof-transformer bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
237
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
238
|
+
|
|
3
239
|
## 0.0.1 (2025-07-03)
|
|
4
240
|
|
|
5
241
|
|
|
@@ -234,6 +234,26 @@ The object to display.
|
|
|
234
234
|
|
|
235
235
|
***
|
|
236
236
|
|
|
237
|
+
### warning()
|
|
238
|
+
|
|
239
|
+
> `static` **warning**(`label`): `void`
|
|
240
|
+
|
|
241
|
+
Display a warning.
|
|
242
|
+
|
|
243
|
+
#### Parameters
|
|
244
|
+
|
|
245
|
+
##### label
|
|
246
|
+
|
|
247
|
+
`string`
|
|
248
|
+
|
|
249
|
+
The label for the warning.
|
|
250
|
+
|
|
251
|
+
#### Returns
|
|
252
|
+
|
|
253
|
+
`void`
|
|
254
|
+
|
|
255
|
+
***
|
|
256
|
+
|
|
237
257
|
### done()
|
|
238
258
|
|
|
239
259
|
> `static` **done**(): `void`
|
|
@@ -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
|
+
`undefined` | `string`
|
|
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`
|
|
@@ -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.
|
package/locales/en.json
CHANGED
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.2-next.11",
|
|
4
4
|
"description": "Core classes for building a CLI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/core": "
|
|
18
|
-
"@twin.org/crypto": "
|
|
19
|
-
"@twin.org/nameof": "
|
|
20
|
-
"chalk": "5.
|
|
17
|
+
"@twin.org/core": "0.0.2-next.11",
|
|
18
|
+
"@twin.org/crypto": "0.0.2-next.11",
|
|
19
|
+
"@twin.org/nameof": "0.0.2-next.11",
|
|
20
|
+
"chalk": "5.6.0",
|
|
21
21
|
"commander": "14.0.0",
|
|
22
|
-
"dotenv": "
|
|
22
|
+
"dotenv": "17.2.1"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/cjs/index.cjs",
|
|
25
25
|
"module": "./dist/esm/index.mjs",
|