@bemoje/cli 1.1.0 → 1.1.1

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/Command.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ParseArgsOptionDescriptor } from 'node:util';
2
- import type { IHelp } from './Help';
2
+ import { type IHelp } from './Help';
3
3
  import type { AllUnionFields } from 'type-fest';
4
4
  /**
5
5
  * Command-line argument parser with fluent API and type-safe validation.
@@ -102,7 +102,7 @@ export declare class Command implements CommandDescriptor {
102
102
  };
103
103
  };
104
104
  /** Renders formatted help text using provided help definition */
105
- renderHelp(help: IHelp): string;
105
+ renderHelp(help?: IHelp): string;
106
106
  /** Validates CLI argument ordering */
107
107
  protected assertNoOptionalOrVariadicArguments(): void;
108
108
  /** Validates optional args don't follow variadic args */
package/lib/Command.js CHANGED
@@ -1,6 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  import { parseArgs } from "node:util";
4
+ import { Help } from "./Help.js";
4
5
  class Command {
5
6
  static {
6
7
  __name(this, "Command");
@@ -329,7 +330,7 @@ class Command {
329
330
  };
330
331
  }
331
332
  /** Renders formatted help text using provided help definition */
332
- renderHelp(help) {
333
+ renderHelp(help = new Help()) {
333
334
  const helper = Object.assign(help, this.helpConfiguration);
334
335
  return helper.formatHelp(this, helper);
335
336
  }
package/lib/Help.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ArgumentDescriptorBase, CommandDescriptor, OptionDescriptorBase } from './Command';
1
+ import type { ArgumentDescriptorBase, CommandDescriptor, OptionDescriptorBase } from './Command';
2
2
  /**
3
3
  * Although this is a class, methods are static in style to allow override using subclass or just functions.
4
4
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bemoje/cli",
3
3
  "description": "A type-safe CLI composer that can parse argv and generate help without execution coupling.",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "type": "module",