@clerc/core 1.0.0-beta.18 → 1.0.0-beta.19
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.d.ts +1 -2
- package/dist/index.js +3 -3
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { n as __reExport, t as __export } from "./chunk-CYeTv9WL.js";
|
|
2
|
-
import { ErrorHandler as ErrorHandler$1 } from "lite-emit";
|
|
3
2
|
import { Clerc as Clerc$1, CreateOptions as CreateOptions$1, Plugin as Plugin$1 } from "@clerc/core";
|
|
4
3
|
|
|
5
4
|
//#region ../parser/src/errors.d.ts
|
|
@@ -318,7 +317,7 @@ declare class Clerc<Commands extends CommandsRecord = {}, GlobalFlags extends Cl
|
|
|
318
317
|
description(description: string): this;
|
|
319
318
|
version(version: string): this;
|
|
320
319
|
use(plugin: Plugin): this;
|
|
321
|
-
errorHandler(handler: ErrorHandler
|
|
320
|
+
errorHandler(handler: ErrorHandler): this;
|
|
322
321
|
command<Name$1 extends string, const Parameters extends readonly Parameter[], Flags extends ClercFlagsDefinition = {}>(command: CommandWithHandler<Name$1, Parameters, Flags>): Clerc<Commands & Record<string, CommandWithHandler<Name$1, Parameters, Flags>>, GlobalFlags>;
|
|
323
322
|
command<Name$1 extends string, const Parameters extends readonly Parameter[], Flags extends ClercFlagsDefinition = {}>(name: Name$1 extends keyof Commands ? ["COMMAND ALREADY EXISTS"] : Name$1, options?: CommandOptions<Parameters, Flags>): Clerc<Commands & Record<Name$1, Command<Name$1, Parameters, Flags>>, GlobalFlags>;
|
|
324
323
|
command<Name$1 extends string, const Parameters extends readonly Parameter[], Flags extends ClercFlagsDefinition = {}>(name: Name$1 extends keyof Commands ? ["COMMAND ALREADY EXISTS"] : Name$1, description: string, options?: CommandOptions<Parameters, Flags>): Clerc<Commands & Record<Name$1, Command<Name$1, Parameters, Flags>>, GlobalFlags>;
|
package/dist/index.js
CHANGED
|
@@ -161,7 +161,7 @@ const platformArgv = IS_NODE ? process.argv.slice(IS_ELECTRON ? 1 : 2) : IS_DENO
|
|
|
161
161
|
var Clerc = class Clerc {
|
|
162
162
|
#argv = [];
|
|
163
163
|
#commands = /* @__PURE__ */ new Map();
|
|
164
|
-
#emitter = new LiteEmit(
|
|
164
|
+
#emitter = new LiteEmit();
|
|
165
165
|
#globalFlags = {};
|
|
166
166
|
#store = {};
|
|
167
167
|
#interceptors = [];
|
|
@@ -316,9 +316,9 @@ var Clerc = class Clerc {
|
|
|
316
316
|
};
|
|
317
317
|
const emitInterceptor = {
|
|
318
318
|
enforce: "post",
|
|
319
|
-
handler: (ctx) => {
|
|
319
|
+
handler: async (ctx) => {
|
|
320
320
|
if (parametersError) throw parametersError;
|
|
321
|
-
if (command) this.#emitter.emit(command.name, ctx);
|
|
321
|
+
if (command) await this.#emitter.emit(command.name, ctx);
|
|
322
322
|
else throw parametersToResolve.length > 0 ? new NoSuchCommandError(parametersToResolve.join(" ")) : new NoCommandSpecifiedError();
|
|
323
323
|
}
|
|
324
324
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.19",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Clerc core",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"lite-emit": "^
|
|
48
|
-
"@clerc/parser": "^1.0.0-beta.
|
|
47
|
+
"lite-emit": "^4.0.0",
|
|
48
|
+
"@clerc/parser": "^1.0.0-beta.19"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"is-platform": "^1.0.0",
|
|
52
|
-
"@clerc/utils": "1.0.0-beta.
|
|
52
|
+
"@clerc/utils": "1.0.0-beta.19"
|
|
53
53
|
}
|
|
54
54
|
}
|