@lodestar/utils 1.17.0-dev.8959bda79b → 1.17.0-dev.c999e4a353
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/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -3
- package/lib/command.d.ts +0 -36
- package/lib/command.js +0 -26
- package/lib/command.js.map +0 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,KAAK,EAAoB,MAAM,YAAY,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAwB,OAAO,EAAC,MAAM,YAAY,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.17.0-dev.
|
|
14
|
+
"version": "1.17.0-dev.c999e4a353",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": "./lib/index.js",
|
|
17
17
|
"files": [
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/js-yaml": "^4.0.5",
|
|
51
51
|
"@types/triple-beam": "^1.3.2",
|
|
52
|
-
"@types/yargs": "^17.0.24",
|
|
53
52
|
"prom-client": "^15.1.0",
|
|
54
53
|
"triple-beam": "^1.3.0"
|
|
55
54
|
},
|
|
@@ -59,5 +58,5 @@
|
|
|
59
58
|
"beacon",
|
|
60
59
|
"blockchain"
|
|
61
60
|
],
|
|
62
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "aaa50b1c046b7c3a82430a22664e42788f75d145"
|
|
63
62
|
}
|
package/lib/command.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Options, Argv } from "yargs";
|
|
2
|
-
export interface CliExample {
|
|
3
|
-
command: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CliOptionDefinition<T = any> extends Options {
|
|
8
|
-
example?: Omit<CliExample, "title">;
|
|
9
|
-
type: T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T extends Array<unknown> ? "array" : never;
|
|
10
|
-
}
|
|
11
|
-
export type CliCommandOptions<OwnArgs> = Required<{
|
|
12
|
-
[K in keyof OwnArgs]: undefined extends OwnArgs[K] ? CliOptionDefinition<OwnArgs[K]> : // If arg cannot be undefined it must specify a default value or be provided by the user
|
|
13
|
-
CliOptionDefinition<OwnArgs[K]> & (Required<Pick<Options, "default">> | {
|
|
14
|
-
demandOption: true;
|
|
15
|
-
});
|
|
16
|
-
}>;
|
|
17
|
-
export interface CliCommand<OwnArgs = Record<never, never>, ParentArgs = Record<never, never>, R = any> {
|
|
18
|
-
command: string;
|
|
19
|
-
describe: string;
|
|
20
|
-
/**
|
|
21
|
-
* The folder in docs/pages that the cli.md should be placed in. If not provided no
|
|
22
|
-
* cli flags page will be generated for the command
|
|
23
|
-
*/
|
|
24
|
-
docsFolder?: string;
|
|
25
|
-
examples?: CliExample[];
|
|
26
|
-
options?: CliCommandOptions<OwnArgs>;
|
|
27
|
-
subcommands?: CliCommand<any, OwnArgs & ParentArgs>[];
|
|
28
|
-
handler?: (args: OwnArgs & ParentArgs) => Promise<R>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Register a CliCommand type to yargs. Recursively registers subcommands too.
|
|
32
|
-
* @param yargs
|
|
33
|
-
* @param cliCommand
|
|
34
|
-
*/
|
|
35
|
-
export declare function registerCommandToYargs(yargs: Argv, cliCommand: CliCommand<any, any>): void;
|
|
36
|
-
//# sourceMappingURL=command.d.ts.map
|
package/lib/command.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Register a CliCommand type to yargs. Recursively registers subcommands too.
|
|
3
|
-
* @param yargs
|
|
4
|
-
* @param cliCommand
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
-
export function registerCommandToYargs(yargs, cliCommand) {
|
|
8
|
-
yargs.command({
|
|
9
|
-
command: cliCommand.command,
|
|
10
|
-
describe: cliCommand.describe,
|
|
11
|
-
builder: (yargsBuilder) => {
|
|
12
|
-
yargsBuilder.options(cliCommand.options ?? {});
|
|
13
|
-
for (const subcommand of cliCommand.subcommands ?? []) {
|
|
14
|
-
registerCommandToYargs(yargsBuilder, subcommand);
|
|
15
|
-
}
|
|
16
|
-
if (cliCommand.examples) {
|
|
17
|
-
for (const example of cliCommand.examples) {
|
|
18
|
-
yargsBuilder.example(`$0 ${example.command}`, example.description ?? "");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return yargs;
|
|
22
|
-
},
|
|
23
|
-
handler: cliCommand.handler ?? function emptyHandler() { },
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=command.js.map
|
package/lib/command.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAgDA;;;;GAIG;AACH,8DAA8D;AAC9D,MAAM,UAAU,sBAAsB,CAAC,KAAW,EAAE,UAAgC;IAClF,KAAK,CAAC,OAAO,CAAC;QACZ,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,OAAO,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YAC/C,KAAK,MAAM,UAAU,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,EAAE;gBACrD,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;aAClD;YACD,IAAI,UAAU,CAAC,QAAQ,EAAE;gBACvB,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,QAAQ,EAAE;oBACzC,YAAY,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;iBAC1E;aACF;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,SAAS,YAAY,KAAU,CAAC;KAChE,CAAC,CAAC;AACL,CAAC"}
|