@wooksjs/event-cli 0.4.27 → 0.4.29
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/index.cjs +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -179,7 +179,7 @@ function useCliOptions() {
|
|
|
179
179
|
const flags = store('flags');
|
|
180
180
|
if (!flags.value) {
|
|
181
181
|
const event = store('event');
|
|
182
|
-
flags.value = minimist(event.
|
|
182
|
+
flags.value = minimist(event.get('argv'), event.get('opts'));
|
|
183
183
|
}
|
|
184
184
|
return flags.value;
|
|
185
185
|
}
|
|
@@ -225,7 +225,7 @@ function useCommandLookupHelp(lookupDepth = 3) {
|
|
|
225
225
|
const parts = useCliContext()
|
|
226
226
|
.store('event')
|
|
227
227
|
.get('pathParams')
|
|
228
|
-
|
|
228
|
+
?.flatMap(p => `${p} `.split(':').map((s, i) => (i ? `:${s}` : s))) || [];
|
|
229
229
|
const cliHelp = useCliHelp().getCliHelp();
|
|
230
230
|
const cmd = cliHelp.getCliName();
|
|
231
231
|
let data;
|
|
@@ -255,7 +255,7 @@ function useCommandLookupHelp(lookupDepth = 3) {
|
|
|
255
255
|
.map(l => `<${l}>`)
|
|
256
256
|
.join(', ')}`);
|
|
257
257
|
}
|
|
258
|
-
else if (children
|
|
258
|
+
else if (children?.length > 0) {
|
|
259
259
|
throw new Error(`Wrong command, did you mean:\n${children
|
|
260
260
|
.slice(0, 7)
|
|
261
261
|
.map(c => ` $ ${cmd} ${c.command}`)
|
package/dist/index.d.ts
CHANGED
|
@@ -216,14 +216,14 @@ declare function createCliContext(data: Omit<TCliEventData, 'type'>, options: TE
|
|
|
216
216
|
restoreCtx: () => _wooksjs_event_core.TGenericContextStore<TEmpty>;
|
|
217
217
|
clearCtx: () => null;
|
|
218
218
|
store: <K extends "flags" | keyof _wooksjs_event_core.TGenericContextStore<TCliEventData>>(key: K) => {
|
|
219
|
-
value: (TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]
|
|
219
|
+
value: (TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K];
|
|
220
220
|
hook: <K2 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2) => {
|
|
221
221
|
value: Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2];
|
|
222
222
|
isDefined: boolean;
|
|
223
223
|
};
|
|
224
224
|
init: <K2_1 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_1, getter: () => Required<Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>[K2_1]) => Required<Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>[K2_1];
|
|
225
225
|
set: <K2_2 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_2, v: Required<(TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]>[K2_2]) => Required<(TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]>[K2_2];
|
|
226
|
-
get: <K2_3 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_3) => Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2_3];
|
|
226
|
+
get: <K2_3 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_3) => Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2_3] | undefined;
|
|
227
227
|
has: <K2_4 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_4) => boolean;
|
|
228
228
|
del: <K2_5 extends keyof Required<TCliContextStore & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_5) => void;
|
|
229
229
|
entries: () => [string, unknown][];
|
|
@@ -242,14 +242,14 @@ declare function useCliContext<T extends TEmpty>(): {
|
|
|
242
242
|
restoreCtx: () => _wooksjs_event_core.TGenericContextStore<TEmpty>;
|
|
243
243
|
clearCtx: () => null;
|
|
244
244
|
store: <K extends "flags" | keyof _wooksjs_event_core.TGenericContextStore<TCliEventData> | keyof T>(key: K) => {
|
|
245
|
-
value: (TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]
|
|
245
|
+
value: (TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K];
|
|
246
246
|
hook: <K2 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2) => {
|
|
247
247
|
value: Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2];
|
|
248
248
|
isDefined: boolean;
|
|
249
249
|
};
|
|
250
250
|
init: <K2_1 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_1, getter: () => Required<Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>[K2_1]) => Required<Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>[K2_1];
|
|
251
251
|
set: <K2_2 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_2, v: Required<(TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]>[K2_2]) => Required<(TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]>[K2_2];
|
|
252
|
-
get: <K2_3 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_3) => Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2_3];
|
|
252
|
+
get: <K2_3 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_3) => Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2_3] | undefined;
|
|
253
253
|
has: <K2_4 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_4) => boolean;
|
|
254
254
|
del: <K2_5 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_5) => void;
|
|
255
255
|
entries: () => [string, unknown][];
|
package/dist/index.mjs
CHANGED
|
@@ -177,7 +177,7 @@ function useCliOptions() {
|
|
|
177
177
|
const flags = store('flags');
|
|
178
178
|
if (!flags.value) {
|
|
179
179
|
const event = store('event');
|
|
180
|
-
flags.value = minimist(event.
|
|
180
|
+
flags.value = minimist(event.get('argv'), event.get('opts'));
|
|
181
181
|
}
|
|
182
182
|
return flags.value;
|
|
183
183
|
}
|
|
@@ -223,7 +223,7 @@ function useCommandLookupHelp(lookupDepth = 3) {
|
|
|
223
223
|
const parts = useCliContext()
|
|
224
224
|
.store('event')
|
|
225
225
|
.get('pathParams')
|
|
226
|
-
|
|
226
|
+
?.flatMap(p => `${p} `.split(':').map((s, i) => (i ? `:${s}` : s))) || [];
|
|
227
227
|
const cliHelp = useCliHelp().getCliHelp();
|
|
228
228
|
const cmd = cliHelp.getCliName();
|
|
229
229
|
let data;
|
|
@@ -253,7 +253,7 @@ function useCommandLookupHelp(lookupDepth = 3) {
|
|
|
253
253
|
.map(l => `<${l}>`)
|
|
254
254
|
.join(', ')}`);
|
|
255
255
|
}
|
|
256
|
-
else if (children
|
|
256
|
+
else if (children?.length > 0) {
|
|
257
257
|
throw new Error(`Wrong command, did you mean:\n${children
|
|
258
258
|
.slice(0, 7)
|
|
259
259
|
.map(c => ` $ ${cmd} ${c.command}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/event-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.29",
|
|
4
4
|
"description": "@wooksjs/event-cli",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"url": "https://github.com/wooksjs/wooksjs/issues"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"wooks": "0.4.
|
|
43
|
-
"@wooksjs/event-core": "0.4.
|
|
42
|
+
"wooks": "0.4.29",
|
|
43
|
+
"@wooksjs/event-core": "0.4.29"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"minimist": "^1.2.6",
|