@bemoje/cli 3.1.1 → 3.1.3
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.cjs +75 -6192
- package/lib/index.d.cts +2658 -6
- package/lib/index.d.ts +2658 -6
- package/lib/index.js +71 -6190
- package/package.json +41 -113
- package/lib/lib/Command.cjs +0 -7626
- package/lib/lib/Command.d.cts +0 -1
- package/lib/lib/Command.d.ts +0 -1
- package/lib/lib/Command.js +0 -7620
- package/lib/lib/Help.cjs +0 -5201
- package/lib/lib/Help.d.cts +0 -1
- package/lib/lib/Help.d.ts +0 -1
- package/lib/lib/Help.js +0 -5195
- package/lib/lib/helpers/findCommand.cjs +0 -20
- package/lib/lib/helpers/findCommand.d.cts +0 -8
- package/lib/lib/helpers/findCommand.d.ts +0 -8
- package/lib/lib/helpers/findCommand.js +0 -18
- package/lib/lib/helpers/findOption.cjs +0 -18
- package/lib/lib/helpers/findOption.d.cts +0 -8
- package/lib/lib/helpers/findOption.d.ts +0 -8
- package/lib/lib/helpers/findOption.js +0 -16
- package/lib/lib/helpers/getCommandAncestors.cjs +0 -23
- package/lib/lib/helpers/getCommandAncestors.d.cts +0 -8
- package/lib/lib/helpers/getCommandAncestors.d.ts +0 -8
- package/lib/lib/helpers/getCommandAncestors.js +0 -21
- package/lib/lib/helpers/getCommandAndAncestors.cjs +0 -17
- package/lib/lib/helpers/getCommandAndAncestors.d.cts +0 -8
- package/lib/lib/helpers/getCommandAndAncestors.d.ts +0 -8
- package/lib/lib/helpers/getCommandAndAncestors.js +0 -15
- package/lib/lib/helpers/parseOptionFlags.cjs +0 -30
- package/lib/lib/helpers/parseOptionFlags.d.cts +0 -13
- package/lib/lib/helpers/parseOptionFlags.d.ts +0 -13
- package/lib/lib/helpers/parseOptionFlags.js +0 -28
- package/lib/lib/types.cjs +0 -2
- package/lib/lib/types.d.cts +0 -1
- package/lib/lib/types.d.ts +0 -1
- package/lib/lib/types.js +0 -1
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// ../object/src/valuesOf.ts
|
|
7
|
-
function valuesOf(obj) {
|
|
8
|
-
return Object.values(obj);
|
|
9
|
-
}
|
|
10
|
-
__name(valuesOf, "valuesOf");
|
|
11
|
-
|
|
12
|
-
// src/lib/helpers/findCommand.ts
|
|
13
|
-
function findCommand(cmd, nameOrAlias) {
|
|
14
|
-
return cmd.commands[nameOrAlias] ?? valuesOf(cmd.commands).find((c) => {
|
|
15
|
-
return c.aliases.includes(nameOrAlias);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
__name(findCommand, "findCommand");
|
|
19
|
-
|
|
20
|
-
exports.findCommand = findCommand;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// ../object/src/valuesOf.ts
|
|
5
|
-
function valuesOf(obj) {
|
|
6
|
-
return Object.values(obj);
|
|
7
|
-
}
|
|
8
|
-
__name(valuesOf, "valuesOf");
|
|
9
|
-
|
|
10
|
-
// src/lib/helpers/findCommand.ts
|
|
11
|
-
function findCommand(cmd, nameOrAlias) {
|
|
12
|
-
return cmd.commands[nameOrAlias] ?? valuesOf(cmd.commands).find((c) => {
|
|
13
|
-
return c.aliases.includes(nameOrAlias);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
__name(findCommand, "findCommand");
|
|
17
|
-
|
|
18
|
-
export { findCommand };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/lib/helpers/findOption.ts
|
|
7
|
-
function findOption(cmd, nameOrShortOrLong) {
|
|
8
|
-
return nameOrShortOrLong.startsWith("--") ? cmd.options.find((o) => {
|
|
9
|
-
return o.long === nameOrShortOrLong.slice(2);
|
|
10
|
-
}) : nameOrShortOrLong.startsWith("-") ? cmd.options.find((o) => {
|
|
11
|
-
return o.short === nameOrShortOrLong.slice(1);
|
|
12
|
-
}) : cmd.options.find((o) => {
|
|
13
|
-
return o.name === nameOrShortOrLong;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
__name(findOption, "findOption");
|
|
17
|
-
|
|
18
|
-
exports.findOption = findOption;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as ICommand, O as Option } from '../../Command--Ojy3KHE.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Finds option by name, short name or long name
|
|
5
|
-
*/
|
|
6
|
-
declare function findOption<C extends ICommand>(cmd: C, nameOrShortOrLong: string): Option | undefined;
|
|
7
|
-
|
|
8
|
-
export { findOption };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as ICommand, O as Option } from '../../Command--Ojy3KHE.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Finds option by name, short name or long name
|
|
5
|
-
*/
|
|
6
|
-
declare function findOption<C extends ICommand>(cmd: C, nameOrShortOrLong: string): Option | undefined;
|
|
7
|
-
|
|
8
|
-
export { findOption };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/lib/helpers/findOption.ts
|
|
5
|
-
function findOption(cmd, nameOrShortOrLong) {
|
|
6
|
-
return nameOrShortOrLong.startsWith("--") ? cmd.options.find((o) => {
|
|
7
|
-
return o.long === nameOrShortOrLong.slice(2);
|
|
8
|
-
}) : nameOrShortOrLong.startsWith("-") ? cmd.options.find((o) => {
|
|
9
|
-
return o.short === nameOrShortOrLong.slice(1);
|
|
10
|
-
}) : cmd.options.find((o) => {
|
|
11
|
-
return o.name === nameOrShortOrLong;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
__name(findOption, "findOption");
|
|
15
|
-
|
|
16
|
-
export { findOption };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/lib/helpers/getCommandAndAncestors.ts
|
|
7
|
-
function getCommandAndAncestors(cmd) {
|
|
8
|
-
const result = [];
|
|
9
|
-
let command = cmd;
|
|
10
|
-
for (; command; command = command.parent) {
|
|
11
|
-
result.push(command);
|
|
12
|
-
}
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
__name(getCommandAndAncestors, "getCommandAndAncestors");
|
|
16
|
-
|
|
17
|
-
// src/lib/helpers/getCommandAncestors.ts
|
|
18
|
-
function getCommandAncestors(cmd) {
|
|
19
|
-
return getCommandAndAncestors(cmd).slice(1);
|
|
20
|
-
}
|
|
21
|
-
__name(getCommandAncestors, "getCommandAncestors");
|
|
22
|
-
|
|
23
|
-
exports.getCommandAncestors = getCommandAncestors;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/lib/helpers/getCommandAndAncestors.ts
|
|
5
|
-
function getCommandAndAncestors(cmd) {
|
|
6
|
-
const result = [];
|
|
7
|
-
let command = cmd;
|
|
8
|
-
for (; command; command = command.parent) {
|
|
9
|
-
result.push(command);
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
__name(getCommandAndAncestors, "getCommandAndAncestors");
|
|
14
|
-
|
|
15
|
-
// src/lib/helpers/getCommandAncestors.ts
|
|
16
|
-
function getCommandAncestors(cmd) {
|
|
17
|
-
return getCommandAndAncestors(cmd).slice(1);
|
|
18
|
-
}
|
|
19
|
-
__name(getCommandAncestors, "getCommandAncestors");
|
|
20
|
-
|
|
21
|
-
export { getCommandAncestors };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/lib/helpers/getCommandAndAncestors.ts
|
|
7
|
-
function getCommandAndAncestors(cmd) {
|
|
8
|
-
const result = [];
|
|
9
|
-
let command = cmd;
|
|
10
|
-
for (; command; command = command.parent) {
|
|
11
|
-
result.push(command);
|
|
12
|
-
}
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
__name(getCommandAndAncestors, "getCommandAndAncestors");
|
|
16
|
-
|
|
17
|
-
exports.getCommandAndAncestors = getCommandAndAncestors;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as ICommand } from '../../Command--Ojy3KHE.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns command and all ancestor commands in hierarchy
|
|
5
|
-
*/
|
|
6
|
-
declare function getCommandAndAncestors<C extends ICommand>(cmd: C): [typeof cmd, ...ICommand[]];
|
|
7
|
-
|
|
8
|
-
export { getCommandAndAncestors };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as ICommand } from '../../Command--Ojy3KHE.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns command and all ancestor commands in hierarchy
|
|
5
|
-
*/
|
|
6
|
-
declare function getCommandAndAncestors<C extends ICommand>(cmd: C): [typeof cmd, ...ICommand[]];
|
|
7
|
-
|
|
8
|
-
export { getCommandAndAncestors };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/lib/helpers/getCommandAndAncestors.ts
|
|
5
|
-
function getCommandAndAncestors(cmd) {
|
|
6
|
-
const result = [];
|
|
7
|
-
let command = cmd;
|
|
8
|
-
for (; command; command = command.parent) {
|
|
9
|
-
result.push(command);
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
__name(getCommandAndAncestors, "getCommandAndAncestors");
|
|
14
|
-
|
|
15
|
-
export { getCommandAndAncestors };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/lib/helpers/parseOptionFlags.ts
|
|
7
|
-
function parseOptionFlags(flags) {
|
|
8
|
-
const match = flags.match(/^-(.+?), --([A-Za-z][\w-]*)(?:\s*(<(.+?)>|\[(.+?)]))?$/);
|
|
9
|
-
if (!match) {
|
|
10
|
-
throw new Error(`Invalid option format: ${flags}`);
|
|
11
|
-
}
|
|
12
|
-
const short = match[1];
|
|
13
|
-
if (short.length !== 1) {
|
|
14
|
-
throw new Error(`Expected short name to be a single character. Got: -${short}`);
|
|
15
|
-
}
|
|
16
|
-
const long = match[2];
|
|
17
|
-
const argName = (match[4] || match[5])?.replace(/\.{3}$/, "") || void 0;
|
|
18
|
-
const name = long.split("-").reduce((str, word) => {
|
|
19
|
-
return str + word[0].toUpperCase() + word.slice(1);
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
short,
|
|
23
|
-
long,
|
|
24
|
-
name,
|
|
25
|
-
argName
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
__name(parseOptionFlags, "parseOptionFlags");
|
|
29
|
-
|
|
30
|
-
exports.parseOptionFlags = parseOptionFlags;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { m as OptionUsage, D as CamelCase } from '../../Command--Ojy3KHE.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Parses option flags string into its components
|
|
5
|
-
*/
|
|
6
|
-
declare function parseOptionFlags<Long extends string>(flags: OptionUsage<Long>): {
|
|
7
|
-
short: string;
|
|
8
|
-
long: Long;
|
|
9
|
-
name: CamelCase<Long>;
|
|
10
|
-
argName: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { parseOptionFlags };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { m as OptionUsage, D as CamelCase } from '../../Command--Ojy3KHE.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Parses option flags string into its components
|
|
5
|
-
*/
|
|
6
|
-
declare function parseOptionFlags<Long extends string>(flags: OptionUsage<Long>): {
|
|
7
|
-
short: string;
|
|
8
|
-
long: Long;
|
|
9
|
-
name: CamelCase<Long>;
|
|
10
|
-
argName: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { parseOptionFlags };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/lib/helpers/parseOptionFlags.ts
|
|
5
|
-
function parseOptionFlags(flags) {
|
|
6
|
-
const match = flags.match(/^-(.+?), --([A-Za-z][\w-]*)(?:\s*(<(.+?)>|\[(.+?)]))?$/);
|
|
7
|
-
if (!match) {
|
|
8
|
-
throw new Error(`Invalid option format: ${flags}`);
|
|
9
|
-
}
|
|
10
|
-
const short = match[1];
|
|
11
|
-
if (short.length !== 1) {
|
|
12
|
-
throw new Error(`Expected short name to be a single character. Got: -${short}`);
|
|
13
|
-
}
|
|
14
|
-
const long = match[2];
|
|
15
|
-
const argName = (match[4] || match[5])?.replace(/\.{3}$/, "") || void 0;
|
|
16
|
-
const name = long.split("-").reduce((str, word) => {
|
|
17
|
-
return str + word[0].toUpperCase() + word.slice(1);
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
short,
|
|
21
|
-
long,
|
|
22
|
-
name,
|
|
23
|
-
argName
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
__name(parseOptionFlags, "parseOptionFlags");
|
|
27
|
-
|
|
28
|
-
export { parseOptionFlags };
|
package/lib/lib/types.cjs
DELETED
package/lib/lib/types.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { A as ActionHandler, a as AllowedArgumentUsage, b as Argument, c as ArgumentOptions, d as ArgumentUsage, e as Arguments, B as BooleanOptionOptions, f as HookActionHandler, g as HookDefinition, h as HookPredicate, I as ICommand, i as IHelp, j as InferAddOptionResult, k as InferAddedArgumentType, L as Logger, O as Option, l as OptionOptions, m as OptionUsage, n as OptionalArgumentOptions, o as OptionalArgumentOptionsWithDefaultValue, p as OptionalArgumentUsage, q as OptionalOptionOptions, r as OptionalVariadicArgumentOptions, s as OptionalVariadicArgumentUsage, t as OptionalVariadicOptionOptions, u as Options, P as ParseArgvResult, R as RequiredArgumentOptions, v as RequiredArgumentUsage, w as RequiredOptionOptions, x as RequiredVariadicArgumentOptions, y as RequiredVariadicArgumentUsage, z as RequiredVariadicOptionOptions, S as SubCommands } from '../Command--Ojy3KHE.cjs';
|
package/lib/lib/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { A as ActionHandler, a as AllowedArgumentUsage, b as Argument, c as ArgumentOptions, d as ArgumentUsage, e as Arguments, B as BooleanOptionOptions, f as HookActionHandler, g as HookDefinition, h as HookPredicate, I as ICommand, i as IHelp, j as InferAddOptionResult, k as InferAddedArgumentType, L as Logger, O as Option, l as OptionOptions, m as OptionUsage, n as OptionalArgumentOptions, o as OptionalArgumentOptionsWithDefaultValue, p as OptionalArgumentUsage, q as OptionalOptionOptions, r as OptionalVariadicArgumentOptions, s as OptionalVariadicArgumentUsage, t as OptionalVariadicOptionOptions, u as Options, P as ParseArgvResult, R as RequiredArgumentOptions, v as RequiredArgumentUsage, w as RequiredOptionOptions, x as RequiredVariadicArgumentOptions, y as RequiredVariadicArgumentUsage, z as RequiredVariadicOptionOptions, S as SubCommands } from '../Command--Ojy3KHE.js';
|
package/lib/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|