@moostjs/event-cli 0.7.3 → 0.7.5
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 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +4 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -155,6 +155,7 @@ const LOGGER_TITLE = "moost-cli";
|
|
|
155
155
|
}
|
|
156
156
|
onInit(moost$1) {
|
|
157
157
|
this.moost = moost$1;
|
|
158
|
+
(0, moost.claimWooks)(moost$1, this.cliApp.getWooks(), this.name, { created: this.createdApp });
|
|
158
159
|
const boolean = Object.entries(this.optionTypes).filter(([_key, val]) => val.length === 1 && val[0] === Boolean).map(([key, _val]) => key);
|
|
159
160
|
this.cliApp.run(void 0, { boolean });
|
|
160
161
|
}
|
|
@@ -224,12 +225,14 @@ const LOGGER_TITLE = "moost-cli";
|
|
|
224
225
|
_define_property$1(this, "opts", void 0);
|
|
225
226
|
_define_property$1(this, "name", void 0);
|
|
226
227
|
_define_property$1(this, "cliApp", void 0);
|
|
228
|
+
/** No `WooksCli` was passed in: the one created routes through the global Wooks. */ _define_property$1(this, "createdApp", void 0);
|
|
227
229
|
_define_property$1(this, "optionTypes", void 0);
|
|
228
230
|
_define_property$1(this, "moost", void 0);
|
|
229
231
|
this.opts = opts;
|
|
230
232
|
this.name = "cli";
|
|
231
233
|
this.optionTypes = {};
|
|
232
234
|
const cliAppOpts = opts?.wooksCli;
|
|
235
|
+
this.createdApp = !(cliAppOpts instanceof _wooksjs_event_cli.WooksCli);
|
|
233
236
|
if (cliAppOpts && cliAppOpts instanceof _wooksjs_event_cli.WooksCli) this.cliApp = cliAppOpts;
|
|
234
237
|
else if (cliAppOpts) this.cliApp = (0, _wooksjs_event_cli.createCliApp)({
|
|
235
238
|
...cliAppOpts,
|
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,8 @@ declare class MoostCli implements TMoostAdapter<TCliHandlerMeta> {
|
|
|
133
133
|
static readonly [MOOST_ADAPTER_BRAND] = "@moostjs/event-cli/MoostCli";
|
|
134
134
|
readonly name = "cli";
|
|
135
135
|
protected cliApp: WooksCli;
|
|
136
|
+
/** No `WooksCli` was passed in: the one created routes through the global Wooks. */
|
|
137
|
+
private readonly createdApp;
|
|
136
138
|
protected optionTypes: Record<string, TFunction[]>;
|
|
137
139
|
constructor(opts?: TMoostCliOpts | undefined);
|
|
138
140
|
onNotFound(): Promise<unknown>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Controller, Description, Intercept, Intercept as Intercept$1, MOOST_ADAPTER_BRAND, Moost, Optional, Param, Resolve, TInterceptorPriority, defineAfterInterceptor, defineBeforeInterceptor, defineBeforeInterceptor as defineBeforeInterceptor$1, defineInterceptor, defineMoostEventHandler, getMoostMate, setInfactLoggingOptions, useControllerContext } from "moost";
|
|
1
|
+
import { Controller, Description, Intercept, Intercept as Intercept$1, MOOST_ADAPTER_BRAND, Moost, Optional, Param, Resolve, TInterceptorPriority, claimWooks, defineAfterInterceptor, defineBeforeInterceptor, defineBeforeInterceptor as defineBeforeInterceptor$1, defineInterceptor, defineMoostEventHandler, getMoostMate, setInfactLoggingOptions, useControllerContext } from "moost";
|
|
2
2
|
import { WooksCli, cliKind, cliKind as cliKind$1, createCliApp, useAutoHelp, useCliOption, useCommandLookupHelp } from "@wooksjs/event-cli";
|
|
3
3
|
import { current } from "@wooksjs/event-core";
|
|
4
4
|
|
|
@@ -154,6 +154,7 @@ const LOGGER_TITLE = "moost-cli";
|
|
|
154
154
|
}
|
|
155
155
|
onInit(moost) {
|
|
156
156
|
this.moost = moost;
|
|
157
|
+
claimWooks(moost, this.cliApp.getWooks(), this.name, { created: this.createdApp });
|
|
157
158
|
const boolean = Object.entries(this.optionTypes).filter(([_key, val]) => val.length === 1 && val[0] === Boolean).map(([key, _val]) => key);
|
|
158
159
|
this.cliApp.run(void 0, { boolean });
|
|
159
160
|
}
|
|
@@ -223,12 +224,14 @@ const LOGGER_TITLE = "moost-cli";
|
|
|
223
224
|
_define_property$1(this, "opts", void 0);
|
|
224
225
|
_define_property$1(this, "name", void 0);
|
|
225
226
|
_define_property$1(this, "cliApp", void 0);
|
|
227
|
+
/** No `WooksCli` was passed in: the one created routes through the global Wooks. */ _define_property$1(this, "createdApp", void 0);
|
|
226
228
|
_define_property$1(this, "optionTypes", void 0);
|
|
227
229
|
_define_property$1(this, "moost", void 0);
|
|
228
230
|
this.opts = opts;
|
|
229
231
|
this.name = "cli";
|
|
230
232
|
this.optionTypes = {};
|
|
231
233
|
const cliAppOpts = opts?.wooksCli;
|
|
234
|
+
this.createdApp = !(cliAppOpts instanceof WooksCli);
|
|
232
235
|
if (cliAppOpts && cliAppOpts instanceof WooksCli) this.cliApp = cliAppOpts;
|
|
233
236
|
else if (cliAppOpts) this.cliApp = createCliApp({
|
|
234
237
|
...cliAppOpts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moostjs/event-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "@moostjs/event-cli",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"composables",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@wooksjs/event-cli": "^0.8.
|
|
41
|
+
"@wooksjs/event-cli": "^0.8.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vitest": "4.1.12"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@wooksjs/event-core": "^0.8.
|
|
48
|
-
"wooks": "^0.8.
|
|
49
|
-
"moost": "^0.7.
|
|
47
|
+
"@wooksjs/event-core": "^0.8.2",
|
|
48
|
+
"wooks": "^0.8.2",
|
|
49
|
+
"moost": "^0.7.5"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"pub": "pnpm publish --access public",
|