diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.ts index 9f191acc0..fe4ff9ee1 100644 --- a/packages/cli/src/bin.ts +++ b/packages/cli/src/bin.ts @@ -1,4 +1,10 @@ #! /usr/bin/env node + +/** + * This file will get referenced under `bin` in the `package.json` file and when loaded immediately executes the CLI. + * For exports of logic and types please use the `index` entry point. + */ + import { cli } from './index'; import { hideBin } from 'yargs/helpers'; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 75ba31ff4..b0c228a00 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,3 +1,7 @@ +/** + * This file will get referenced under `main` in the `package.json` file + * and maintains exports of logic and types. + */ import { yargsCli } from './lib/cli'; import { yargsGlobalOptionsDefinition } from './lib/options'; import { middlewares } from './lib/middlewares'; diff --git a/packages/cli/src/lib/commands.ts b/packages/cli/src/lib/commands.ts index 24a3d9646..6d39204a1 100644 --- a/packages/cli/src/lib/commands.ts +++ b/packages/cli/src/lib/commands.ts @@ -1,4 +1,10 @@ import { CommandModule } from 'yargs'; import { yargsCollectCommandObject } from './collect/command-object'; -export const commands: CommandModule[] = [yargsCollectCommandObject()]; +export const commands: CommandModule[] = [ + { + ...yargsCollectCommandObject(), + command: '*', + }, + yargsCollectCommandObject(), +];