burgee 0.2.0 → 0.4.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.
Files changed (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -9
  3. package/dist/brand.d.ts +62 -1
  4. package/dist/brand.js +73 -7
  5. package/dist/cli.d.ts +11 -0
  6. package/dist/cli.js +17 -1
  7. package/dist/{commander-argument.js → commander/argument.js} +4 -1
  8. package/dist/{commander-command.d.ts → commander/command.d.ts} +15 -5
  9. package/dist/{commander-command.js → commander/command.js} +175 -22
  10. package/dist/{commander-error.js → commander/error.js} +2 -0
  11. package/dist/{commander-help.d.ts → commander/help.d.ts} +3 -3
  12. package/dist/{commander-help.js → commander/help.js} +18 -1
  13. package/dist/{commander-option.d.ts → commander/option.d.ts} +1 -1
  14. package/dist/{commander-option.js → commander/option.js} +15 -1
  15. package/dist/commander.d.ts +8 -8
  16. package/dist/commander.js +8 -8
  17. package/dist/completions.js +15 -4
  18. package/dist/dev.d.ts +47 -0
  19. package/dist/dev.js +132 -0
  20. package/dist/execute.d.ts +22 -1
  21. package/dist/execute.js +75 -24
  22. package/dist/help.d.ts +19 -7
  23. package/dist/help.js +50 -21
  24. package/dist/index.d.ts +3 -3
  25. package/dist/index.js +1 -1
  26. package/dist/manifest.d.ts +15 -0
  27. package/dist/manifest.js +12 -1
  28. package/dist/mcp.d.ts +14 -2
  29. package/dist/mcp.js +15 -2
  30. package/dist/runtime.d.ts +12 -0
  31. package/dist/runtime.js +7 -0
  32. package/dist/schema.d.ts +10 -0
  33. package/dist/schema.js +11 -0
  34. package/dist/testing-helpers.d.ts +18 -1
  35. package/dist/testing-helpers.js +35 -0
  36. package/dist/testing.d.ts +2 -2
  37. package/dist/testing.js +1 -1
  38. package/dist/unknown-option.d.ts +9 -0
  39. package/dist/unknown-option.js +27 -0
  40. package/dist/{yargs-burgee.d.ts → yargs/burgee.d.ts} +2 -2
  41. package/dist/{yargs-burgee.js → yargs/burgee.js} +15 -1
  42. package/dist/{yargs-cliui.js → yargs/cliui.js} +8 -0
  43. package/dist/{yargs-command.d.ts → yargs/command.d.ts} +5 -5
  44. package/dist/{yargs-command.js → yargs/command.js} +9 -2
  45. package/dist/{yargs-completion.d.ts → yargs/completion.d.ts} +3 -3
  46. package/dist/{yargs-completion.js → yargs/completion.js} +7 -2
  47. package/dist/{yargs-factory.d.ts → yargs/factory.d.ts} +8 -8
  48. package/dist/{yargs-factory.js → yargs/factory.js} +63 -13
  49. package/dist/{yargs-middleware.js → yargs/middleware.js} +6 -1
  50. package/dist/{yargs-shim.d.ts → yargs/shim.d.ts} +3 -3
  51. package/dist/{yargs-shim.js → yargs/shim.js} +24 -5
  52. package/dist/{yargs-usage.d.ts → yargs/usage.d.ts} +1 -1
  53. package/dist/{yargs-usage.js → yargs/usage.js} +9 -1
  54. package/dist/{yargs-utils.js → yargs/utils.js} +11 -0
  55. package/dist/{yargs-validation.d.ts → yargs/validation.d.ts} +1 -1
  56. package/dist/{yargs-validation.js → yargs/validation.js} +7 -1
  57. package/dist/{yargs-y18n.js → yargs/y18n.js} +6 -0
  58. package/dist/yargs-helpers.d.ts +1 -1
  59. package/dist/yargs-helpers.js +1 -1
  60. package/dist/yargs.d.ts +4 -4
  61. package/dist/yargs.js +5 -5
  62. package/package.json +3 -2
  63. /package/dist/{commander-argument.d.ts → commander/argument.d.ts} +0 -0
  64. /package/dist/{commander-error.d.ts → commander/error.d.ts} +0 -0
  65. /package/dist/{commander-suggest.d.ts → suggest.d.ts} +0 -0
  66. /package/dist/{commander-suggest.js → suggest.js} +0 -0
  67. /package/dist/{yargs-cliui.d.ts → yargs/cliui.d.ts} +0 -0
  68. /package/dist/{yargs-middleware.d.ts → yargs/middleware.d.ts} +0 -0
  69. /package/dist/{yargs-utils.d.ts → yargs/utils.d.ts} +0 -0
  70. /package/dist/{yargs-y18n.d.ts → yargs/y18n.d.ts} +0 -0
@@ -1,4 +1,9 @@
1
- import { objFilter, setBlocking, YError } from './yargs-utils.js';
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
+ import { objFilter, setBlocking, YError } from './utils.js';
2
7
  function isBoolean(fail) {
3
8
  return typeof fail === 'boolean';
4
9
  }
@@ -55,6 +60,8 @@ export function usage(yargs, shim) {
55
60
  }
56
61
  }
57
62
  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.
58
65
  if (yargs.getExitProcess())
59
66
  return yargs.exit(1, err);
60
67
  else if (yargs.getInternalMethods().hasParseCallback())
@@ -477,3 +484,4 @@ function getIndentation(text) {
477
484
  function getText(text) {
478
485
  return isIndentedText(text) ? text.text : text;
479
486
  }
487
+ //# sourceMappingURL=usage.js.map
@@ -1,3 +1,9 @@
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
+ */
1
7
  import { readFileSync } from 'node:fs';
2
8
  import { createRequire } from 'node:module';
3
9
  import { dirname, resolve } from 'node:path';
@@ -158,6 +164,10 @@ export function getProcessArgvBin() {
158
164
  }
159
165
  const nodeRequire = createRequire(import.meta.url);
160
166
  let previouslyVisitedConfigs = [];
167
+ /**
168
+ * `extends` in a config object. The upstream resolves a bare specifier with
169
+ * `import.meta.resolve` and then loads it through `require`; both are done from here.
170
+ */
161
171
  export function applyExtends(config, cwd, mergeExtends) {
162
172
  let defaultConfig = {};
163
173
  if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
@@ -207,3 +217,4 @@ function mergeDeep(config1, config2) {
207
217
  export function objectKeys(object) {
208
218
  return Object.keys(object);
209
219
  }
220
+ //# sourceMappingURL=utils.js.map
@@ -3,7 +3,7 @@
3
3
  * modes, choices, implications, conflicts, and `recommendCommands` — ported for
4
4
  * `burgee/yargs`. Every message is the upstream's through y18n.
5
5
  */
6
- import type { PlatformShim } from './yargs-shim.js';
6
+ import type { PlatformShim } from './shim.js';
7
7
  export interface ValidationInstance {
8
8
  nonOptionCount: (argv: any) => void;
9
9
  positionalCount: (required: number, observed: number) => void;
@@ -1,4 +1,9 @@
1
- import { argsert, levenshtein as distance, objFilter } from './yargs-utils.js';
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
+ import { argsert, levenshtein as distance, objFilter } from './utils.js';
2
7
  const specialKeys = ['$0', '--', '_'];
3
8
  export function validation(yargs, usage, shim) {
4
9
  const __ = shim.y18n.__;
@@ -259,3 +264,4 @@ export function validation(yargs, usage, shim) {
259
264
  };
260
265
  return self;
261
266
  }
267
+ //# sourceMappingURL=validation.js.map
@@ -1,3 +1,8 @@
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
+ */
1
6
  import { readFileSync, statSync } from 'node:fs';
2
7
  import { resolve } from 'node:path';
3
8
  import { format } from 'node:util';
@@ -115,3 +120,4 @@ export function y18n(opts) {
115
120
  locale: table.locale,
116
121
  };
117
122
  }
123
+ //# sourceMappingURL=y18n.js.map
@@ -2,5 +2,5 @@
2
2
  * `burgee/yargs/helpers` — what `yargs/helpers` exports: `hideBin`, `applyExtends`
3
3
  * and the parser.
4
4
  */
5
- export { applyExtends, hideBin } from './yargs-utils.js';
5
+ export { applyExtends, hideBin } from './yargs/utils.js';
6
6
  export { Parser } from './yargs-parser.js';
@@ -1,2 +1,2 @@
1
- export { applyExtends, hideBin } from './yargs-utils.js';
1
+ export { applyExtends, hideBin } from './yargs/utils.js';
2
2
  export { Parser } from './yargs-parser.js';
package/dist/yargs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { YargsInstance, isYargsInstance, type Options, type ParseCallback } from './yargs-factory.js';
1
+ export { YargsInstance, isYargsInstance, type Options, type ParseCallback } from './yargs/factory.js';
2
2
  export { Parser, camelCase, decamelize, looksLikeNumber, type DetailedArguments } from './yargs-parser.js';
3
- export { applyExtends, argsert, hideBin, isPromise, objFilter, parseCommand, YError, type ParsedCommand } from './yargs-utils.js';
4
- export { shim as platformShim, type PlatformShim } from './yargs-shim.js';
5
- declare const Yargs: (processArgs?: string | string[], cwd?: string, parentRequire?: NodeJS.Require) => import("./yargs-factory.js").YargsInstance;
3
+ export { applyExtends, argsert, hideBin, isPromise, objFilter, parseCommand, YError, type ParsedCommand } from './yargs/utils.js';
4
+ export { shim as platformShim, type PlatformShim } from './yargs/shim.js';
5
+ declare const Yargs: (processArgs?: string | string[], cwd?: string, parentRequire?: NodeJS.Require) => import("./yargs/factory.js").YargsInstance;
6
6
  export default Yargs;
package/dist/yargs.js CHANGED
@@ -1,8 +1,8 @@
1
- import { YargsFactory } from './yargs-factory.js';
2
- import { shim } from './yargs-shim.js';
3
- export { YargsInstance, isYargsInstance } from './yargs-factory.js';
1
+ import { YargsFactory } from './yargs/factory.js';
2
+ import { shim } from './yargs/shim.js';
3
+ export { YargsInstance, isYargsInstance } from './yargs/factory.js';
4
4
  export { Parser, camelCase, decamelize, looksLikeNumber } from './yargs-parser.js';
5
- export { applyExtends, argsert, hideBin, isPromise, objFilter, parseCommand, YError } from './yargs-utils.js';
6
- export { shim as platformShim } from './yargs-shim.js';
5
+ export { applyExtends, argsert, hideBin, isPromise, objFilter, parseCommand, YError } from './yargs/utils.js';
6
+ export { shim as platformShim } from './yargs/shim.js';
7
7
  const Yargs = YargsFactory(shim);
8
8
  export default Yargs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "burgee",
3
- "version": "0.2.0",
3
+ "version": "0.4.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",
@@ -69,6 +69,7 @@
69
69
  "build": "tsc -p tsconfig.build.json && node ../../scripts/strip-comments.mjs dist",
70
70
  "typecheck": "tsc -p tsconfig.json --noEmit",
71
71
  "test": "vitest run --passWithNoTests",
72
+ "coverage": "vitest run --coverage.enabled",
72
73
  "lint": "eslint src"
73
74
  },
74
75
  "repository": {
@@ -95,7 +96,7 @@
95
96
  "provenance": true
96
97
  },
97
98
  "devDependencies": {
98
- "vitest": "^4.0.0"
99
+ "vitest": "^5.0.0"
99
100
  },
100
101
  "bin": {
101
102
  "burgee": "./dist/cli.js"
File without changes
File without changes
File without changes
File without changes
File without changes