@tsed/cli-core 3.16.1 → 3.17.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.
@@ -2,6 +2,11 @@ import Inquirer from "inquirer";
2
2
  import { Tasks } from "./Tasks";
3
3
  export declare type QuestionOptions<T = any> = Inquirer.QuestionCollection<T>;
4
4
  export interface CommandProvider<Ctx = any> {
5
+ /**
6
+ * Run a function before the main prompt. Useful for pre-loading data from the file system
7
+ * @param initialOptions
8
+ */
9
+ $beforePrompt?(initialOptions: Partial<Ctx>): Partial<Ctx>;
5
10
  /**
6
11
  * Hook to create the main prompt for the command
7
12
  * See https://github.com/enquirer/enquirer for more detail on question configuration.
@@ -24,6 +24,12 @@ export declare class CliService {
24
24
  */
25
25
  runLifecycle(cmdName: string, data?: any): Promise<void>;
26
26
  exec(cmdName: string, ctx: any): Promise<any>;
27
+ /**
28
+ * Run prompt for a given command
29
+ * @param cmdName
30
+ * @param ctx Initial data
31
+ */
32
+ beforePrompt(cmdName: string, ctx?: any): Promise<any>;
27
33
  /**
28
34
  * Run prompt for a given command
29
35
  * @param cmdName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/cli-core",
3
- "version": "3.16.1",
3
+ "version": "3.17.0",
4
4
  "description": "Build your CLI with TypeScript and Decorators",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/index.js",