bob-core 2.0.0-beta.7 → 2.0.0-beta.8

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.
@@ -1,4 +1,4 @@
1
- const s = "bob-core", t = "2.0.0-beta.7", e = "BOB Core", i = "module", l = !1, n = ["dist/**"], r = { ".": { import: "./dist/esm/index.js", require: "./dist/cjs/index.js" } }, o = { "*": { "*": ["./dist/cjs/*.d.ts"] } }, c = { start: "node -r @swc-node/register debug/main.ts", build: "rimraf ./dist && vite build", typecheck: "tsc --noEmit", prepare: "npm run build", test: "vitest run" }, d = "Léo Hubert", p = "ISC", a = { "@faker-js/faker": "^10.0.0", "@swc-node/register": "^1.11.1", "@types/minimist": "^1.2.5", "@types/node": "^20.14.5", "@types/prompts": "^2.4.9", "@types/string-similarity": "^4.0.2", "@vitest/coverage-v8": "^3.2.4", rimraf: "^6.0.1", tsx: "^4.20.6", typescript: "^5.7.3", vite: "^7.1.6", "vite-plugin-dts": "^4.5.4", vitest: "^3.2.4" }, m = { chalk: "^4.1.2", minimist: "^1.2.8", prompts: "^2.4.2", "string-similarity": "^4.0.4" }, u = {
1
+ const s = "bob-core", t = "2.0.0-beta.8", e = "BOB Core", i = "module", l = !1, n = ["dist/**"], r = { ".": { import: "./dist/esm/index.js", require: "./dist/cjs/index.js" } }, o = { "*": { "*": ["./dist/cjs/*.d.ts"] } }, c = { start: "node -r @swc-node/register debug/main.ts", build: "rimraf ./dist && vite build", typecheck: "tsc --noEmit", prepare: "npm run build", test: "vitest run" }, d = "Léo Hubert", p = "ISC", a = { "@faker-js/faker": "^10.0.0", "@swc-node/register": "^1.11.1", "@types/minimist": "^1.2.5", "@types/node": "^20.14.5", "@types/prompts": "^2.4.9", "@types/string-similarity": "^4.0.2", "@vitest/coverage-v8": "^3.2.4", rimraf: "^6.0.1", tsx: "^4.20.6", typescript: "^5.7.3", vite: "^7.1.6", "vite-plugin-dts": "^4.5.4", vitest: "^3.2.4" }, m = { chalk: "^4.1.2", minimist: "^1.2.8", prompts: "^2.4.2", "string-similarity": "^4.0.4" }, u = {
2
2
  name: s,
3
3
  version: t,
4
4
  description: e,
@@ -1,4 +1,4 @@
1
- import { CommandRegistry } from './CommandRegistry.js';
1
+ import { CommandRegistry, CommandResolver, FileImporter } from './CommandRegistry.js';
2
2
  import { default as HelpCommand, HelpCommandOptions } from './commands/HelpCommand.js';
3
3
  import { ExceptionHandler } from './ExceptionHandler.js';
4
4
  import { Command } from './Command.js';
@@ -23,7 +23,8 @@ export declare class Cli<C = any> {
23
23
  logger: Logger;
24
24
  }): ExceptionHandler;
25
25
  constructor(opts?: CliOptions<C>);
26
- setCommandResolver(resolver: (path: string) => Promise<Command<C>>): void;
26
+ withCommandResolver(resolver: CommandResolver): this;
27
+ withFileImporter(importer: FileImporter): this;
27
28
  withCommands(...commands: Array<Command<C, any, any> | {
28
29
  new (): Command<C>;
29
30
  } | string>): Promise<void>;
@@ -13,10 +13,8 @@ export declare class CommandRegistry {
13
13
  getCommands(): Array<Command>;
14
14
  private importFile;
15
15
  private commandResolver;
16
- setCommandResolver(resolver: CommandResolver): this;
17
- setFileImporter(importer: FileImporter): this;
18
- fileCheck: (filePath: string) => boolean;
19
- setFileCheck(check: (filePath: string) => boolean): this;
16
+ withCommandResolver(resolver: CommandResolver): this;
17
+ withFileImporter(importer: FileImporter): this;
20
18
  registerCommand(command: Command<any, any, any>, force?: boolean): void;
21
19
  loadCommandsPath(commandsPath: string): Promise<void>;
22
20
  runCommand(ctx: any, command: string | Command, ...args: any[]): Promise<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bob-core",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.8",
4
4
  "description": "BOB Core",
5
5
  "type": "module",
6
6
  "sideEffects": false,