burgee 0.7.1 → 0.8.0
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/cli.d.ts +25 -3
- package/dist/cli.js +25 -7
- package/dist/commander/argument.js +0 -3
- package/dist/commander/command.d.ts +7 -3
- package/dist/commander/command.js +50 -186
- package/dist/commander/error.js +0 -2
- package/dist/commander/help.js +0 -17
- package/dist/commander/option.js +0 -14
- package/dist/compat.d.ts +30 -0
- package/dist/compat.js +4 -0
- package/dist/definition.d.ts +11 -2
- package/dist/definition.js +9 -11
- package/dist/execute.js +5 -1
- package/dist/mcp.d.ts +33 -13
- package/dist/mcp.js +4 -3
- package/dist/migrate.d.ts +142 -0
- package/dist/migrate.js +284 -0
- package/dist/yargs/burgee.js +0 -14
- package/dist/yargs/cliui.js +0 -53
- package/dist/yargs/command.js +0 -7
- package/dist/yargs/completion.js +0 -5
- package/dist/yargs/factory.js +0 -55
- package/dist/yargs/middleware.js +0 -5
- package/dist/yargs/shim.js +0 -20
- package/dist/yargs/usage.js +0 -8
- package/dist/yargs/utils.js +0 -11
- package/dist/yargs/validation.js +0 -6
- package/dist/yargs/y18n.js +0 -6
- package/package.json +3 -3
package/dist/yargs/shim.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* yargs' Node platform shim — the one object every yargs module reaches the platform
|
|
3
|
-
* through — built from burgee's own ports of its dependencies (J9). Anything that
|
|
4
|
-
* yargs 18 took from `cliui`, `escalade`, `get-caller-file`, `string-width`, `y18n`
|
|
5
|
-
* and `yargs-parser` is served from here.
|
|
6
|
-
*/
|
|
7
1
|
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
8
2
|
import { createRequire } from 'node:module';
|
|
9
3
|
import { basename, dirname, extname, join, relative, resolve } from 'node:path';
|
|
@@ -17,7 +11,6 @@ import { y18n } from './y18n.js';
|
|
|
17
11
|
const here = fileURLToPath(import.meta.url);
|
|
18
12
|
const mainFilename = here.substring(0, here.lastIndexOf('node_modules'));
|
|
19
13
|
const nodeRequire = createRequire(import.meta.url);
|
|
20
|
-
/** escalade/sync: walk up from `start`, asking `callback` at each directory. */
|
|
21
14
|
function findUp(start, callback) {
|
|
22
15
|
let dir = resolve('.', start);
|
|
23
16
|
let tmp;
|
|
@@ -35,7 +28,6 @@ function findUp(start, callback) {
|
|
|
35
28
|
}
|
|
36
29
|
return undefined;
|
|
37
30
|
}
|
|
38
|
-
/** get-caller-file: the file that called the function that called this (v8 stack). */
|
|
39
31
|
function getCallerFile(position = 2) {
|
|
40
32
|
if (position >= Error.stackTraceLimit) {
|
|
41
33
|
throw new TypeError(`getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: \`${position}\` and Error.stackTraceLimit was: \`${Error.stackTraceLimit}\``);
|
|
@@ -58,15 +50,6 @@ function strictEqual(actual, expected, message) {
|
|
|
58
50
|
if (actual !== expected)
|
|
59
51
|
throw new Error(message ?? `Expected values to be strictly equal:\n\n${inspect(actual)} !== ${inspect(expected)}\n`);
|
|
60
52
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Where the 29 locale files live: the package root, not beside this file.
|
|
63
|
-
*
|
|
64
|
-
* This was `resolve(dirname(here), '../locales')`, which was right only while this file sat
|
|
65
|
-
* directly in `dist/`. The first directory added under `src/` made it `dist/locales`, y18n
|
|
66
|
-
* returned the key for every string, and 14 of yargs' own 804 tests failed. Walking up to
|
|
67
|
-
* `package.json` resolves the same from `src/`, from `dist/`, and from
|
|
68
|
-
* `node_modules/burgee/dist/` once published — so a later move cannot repeat it.
|
|
69
|
-
*/
|
|
70
53
|
const locales = resolve(dirname(findUp(here, (_dir, names) => (names.includes('package.json') ? 'package.json' : undefined)) ?? here), 'locales');
|
|
71
54
|
export const shim = {
|
|
72
55
|
assert: { notStrictEqual, strictEqual },
|
|
@@ -91,8 +74,6 @@ export const shim = {
|
|
|
91
74
|
nextTick: (fn, ...args) => {
|
|
92
75
|
host.nextTick(fn, ...args);
|
|
93
76
|
},
|
|
94
|
-
// Captured, as it was before the seam: `stdColumns` is a value in `PlatformShim`, not
|
|
95
|
-
// a thunk, so yargs reads whatever this object was built with. Unchanged on purpose.
|
|
96
77
|
stdColumns: typeof host.stdout.columns !== 'undefined' ? host.stdout.columns : null,
|
|
97
78
|
stdin: () => host.stdin,
|
|
98
79
|
stdout: () => host.stdout,
|
|
@@ -107,4 +88,3 @@ export const shim = {
|
|
|
107
88
|
stringWidth,
|
|
108
89
|
y18n: y18n({ directory: locales, updateFiles: false }),
|
|
109
90
|
};
|
|
110
|
-
//# sourceMappingURL=shim.js.map
|
package/dist/yargs/usage.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* yargs' usage — the help screen, `fail`, examples, epilogues, descriptions and the
|
|
3
|
-
* version string — ported for `burgee/yargs`. Help is rendered through the cliui port,
|
|
4
|
-
* so yargs' usage tests compare whole screens byte for byte.
|
|
5
|
-
*/
|
|
6
1
|
import { objFilter, setBlocking, YError } from './utils.js';
|
|
7
2
|
function isBoolean(fail) {
|
|
8
3
|
return typeof fail === 'boolean';
|
|
@@ -60,8 +55,6 @@ export function usage(yargs, shim) {
|
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
57
|
err = err || new YError(msg);
|
|
63
|
-
// The error rides along so an injected exit (burgee's seam) can tell a usage failure
|
|
64
|
-
// from a handler's; without a seam yargs exits the process and it is unobservable.
|
|
65
58
|
if (yargs.getExitProcess())
|
|
66
59
|
return yargs.exit(1, err);
|
|
67
60
|
else if (yargs.getInternalMethods().hasParseCallback())
|
|
@@ -484,4 +477,3 @@ function getIndentation(text) {
|
|
|
484
477
|
function getText(text) {
|
|
485
478
|
return isIndentedText(text) ? text.text : text;
|
|
486
479
|
}
|
|
487
|
-
//# sourceMappingURL=usage.js.map
|
package/dist/yargs/utils.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* yargs' small internal modules — yerror, parse-command, argsert, obj-filter, is-promise,
|
|
3
|
-
* levenshtein, maybe-async-result, set-blocking, apply-extends, process-argv — ported
|
|
4
|
-
* for `burgee/yargs`. Its suite imports four of these by their upstream file paths; the
|
|
5
|
-
* oracle shims those paths to this entry, so the names here are the upstream names.
|
|
6
|
-
*/
|
|
7
1
|
import { readFileSync } from 'node:fs';
|
|
8
2
|
import { createRequire } from 'node:module';
|
|
9
3
|
import { dirname, resolve } from 'node:path';
|
|
@@ -165,10 +159,6 @@ export function getProcessArgvBin() {
|
|
|
165
159
|
}
|
|
166
160
|
const nodeRequire = createRequire(import.meta.url);
|
|
167
161
|
let previouslyVisitedConfigs = [];
|
|
168
|
-
/**
|
|
169
|
-
* `extends` in a config object. The upstream resolves a bare specifier with
|
|
170
|
-
* `import.meta.resolve` and then loads it through `require`; both are done from here.
|
|
171
|
-
*/
|
|
172
162
|
export function applyExtends(config, cwd, mergeExtends) {
|
|
173
163
|
let defaultConfig = {};
|
|
174
164
|
if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
|
|
@@ -218,4 +208,3 @@ function mergeDeep(config1, config2) {
|
|
|
218
208
|
export function objectKeys(object) {
|
|
219
209
|
return Object.keys(object);
|
|
220
210
|
}
|
|
221
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/yargs/validation.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* yargs' validation — demanded options and commands, unknown arguments under strict
|
|
3
|
-
* modes, choices, implications, conflicts, and `recommendCommands` — ported for
|
|
4
|
-
* `burgee/yargs`. Every message is the upstream's through y18n.
|
|
5
|
-
*/
|
|
6
1
|
import { argsert, levenshtein as distance, objFilter } from './utils.js';
|
|
7
2
|
const specialKeys = ['$0', '--', '_'];
|
|
8
3
|
export function validation(yargs, usage, shim) {
|
|
@@ -264,4 +259,3 @@ export function validation(yargs, usage, shim) {
|
|
|
264
259
|
};
|
|
265
260
|
return self;
|
|
266
261
|
}
|
|
267
|
-
//# sourceMappingURL=validation.js.map
|
package/dist/yargs/y18n.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* y18n 5 — yargs' string table — ported for `burgee/yargs`. The 29 locales ship with
|
|
3
|
-
* burgee under `locales/`, read on first use of a locale, never written (yargs runs
|
|
4
|
-
* y18n with `updateFiles: false`).
|
|
5
|
-
*/
|
|
6
1
|
import { readFileSync, statSync } from 'node:fs';
|
|
7
2
|
import { resolve } from 'node:path';
|
|
8
3
|
import { format } from 'node:util';
|
|
@@ -120,4 +115,3 @@ export function y18n(opts) {
|
|
|
120
115
|
locale: table.locale,
|
|
121
116
|
};
|
|
122
117
|
}
|
|
123
|
-
//# sourceMappingURL=y18n.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "burgee",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "An agent-native CLI framework, drop-in compatible with commander and yargs. One declaration; help, --json, --schema, --mcp and completions all projected from it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -107,9 +107,9 @@
|
|
|
107
107
|
"dependencies": {
|
|
108
108
|
"bellpull": "^0.1.1",
|
|
109
109
|
"closeout": "^0.2.1",
|
|
110
|
-
"linegauge": "^0.3.
|
|
110
|
+
"linegauge": "^0.3.2",
|
|
111
111
|
"roundel": "^0.3.1",
|
|
112
|
-
"seniority": "^0.3.
|
|
112
|
+
"seniority": "^0.3.1"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"vitest": "^5.0.0"
|