juisy 2.0.0-beta.15 → 2.0.0-beta.17

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.
@@ -3,13 +3,11 @@ import docs from './private/docs/index.js'
3
3
  // import test from './private/test.js'
4
4
  // Public commands
5
5
  import printGlobals from './public/print-globals.js'
6
- import squeeze from './public/squeeze.js'
7
6
 
8
7
  export const commands = [
9
8
  // Private
10
9
  docs,
11
10
  // test,
12
11
  // Public
13
- printGlobals,
14
- squeeze
12
+ printGlobals
15
13
  ]
package/bin/cli/index.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  'use strict'
4
4
 
@@ -52,5 +52,7 @@ export type PluginAPI = {
52
52
  export declare function CLIFactory(builder: CLIBuilder, options?: CLIFactoryOptions): Promise<(argv?: typeof process.argv) => CLIEngine>;
53
53
  export declare namespace CLIFactory {
54
54
  var use: (plugin: Plugin) => void;
55
+ var removePlugin: (name: string) => void;
56
+ var getRegisteredPlugins: () => Plugin[];
55
57
  }
56
58
  export {};
@@ -1,11 +1,12 @@
1
- import { CommandObject } from './types';
1
+ import { OutputUtils } from './OutputUtils';
2
+ import { CLIEngine, CommandObject, CommandHandlerArgs } from './types';
2
3
  type CommandOptions = {
3
4
  command: CommandObject['command'];
4
5
  aliases?: CommandObject['aliases'];
5
6
  describe?: CommandObject['describe'];
6
7
  deprecated?: CommandObject['deprecated'];
7
- builder?: CommandObject['builder'];
8
- handler?: CommandObject['handler'];
8
+ builder?: Command['builder'];
9
+ handler?: Command['handler'];
9
10
  middlewares?: CommandObject['middlewares'];
10
11
  meta?: CommandObject['meta'];
11
12
  };
@@ -17,7 +18,7 @@ export declare class Command implements CommandObject {
17
18
  * Creates a Command instance from object (CommandObject)
18
19
  * @param {CommandObject} commandObject - The command definition object
19
20
  */
20
- constructor(commandObject: CommandOptions);
21
+ constructor(commandObject?: CommandOptions);
21
22
  /**
22
23
  * The command
23
24
  */
@@ -41,14 +42,53 @@ export declare class Command implements CommandObject {
41
42
  /**
42
43
  * Command builder
43
44
  */
44
- builder: (cli: import('./types').CLIEngine) => import('./types').CLIEngine | PromiseLike<import('./types').CLIEngine>;
45
+ builder(cli: CLIEngine): CLIEngine | PromiseLike<CLIEngine>;
45
46
  /**
46
47
  * Command handler
47
48
  */
48
- handler: import('./types').CommandHandler | undefined;
49
+ handler(this: Command, argv: CommandHandlerArgs): void | Promise<void>;
49
50
  /**
50
51
  * Command middlewares
51
52
  */
52
53
  middlewares: import('yargs').MiddlewareFunction[] | undefined;
54
+ /**
55
+ * Log a message in the console output. Uses OutputUtils.log method.
56
+ * @param msg The message to log. Can be empty to log blank line
57
+ * @param options The options to pass to OutputUtils.log second argument
58
+ */
59
+ log(msg?: string, options?: Parameters<typeof OutputUtils.log>[1]): void;
60
+ /**
61
+ * Get the process.argv without bin
62
+ * @returns An array of command line arguments
63
+ */
64
+ getProcessArgv(): string[];
65
+ /**
66
+ * Get Command instance as plain object
67
+ * @returns The command definition object to pass to yargs
68
+ */
69
+ toObject(): {
70
+ command: string | readonly string[] | undefined;
71
+ aliases: string | readonly string[] | undefined;
72
+ describe: string | false | undefined;
73
+ deprecated: string | boolean | undefined;
74
+ meta: Partial<import('./types').CommandMeta> | undefined;
75
+ builder: (cli: CLIEngine) => CLIEngine | PromiseLike<CLIEngine>;
76
+ handler: (argv: CommandHandlerArgs) => void | Promise<void>;
77
+ middlewares: import('yargs').MiddlewareFunction[] | undefined;
78
+ };
79
+ /**
80
+ * Getters
81
+ */
82
+ /**
83
+ * Get the CLI engine
84
+ */
85
+ get engine(): CLIEngine;
86
+ /**
87
+ * Static properties
88
+ */
89
+ /**
90
+ * The CLI engine. Will be set by createEngine method
91
+ */
92
+ static engine: CLIEngine;
53
93
  }
54
94
  export {};
@@ -13,6 +13,7 @@ declare global {
13
13
  };
14
14
  }
15
15
  export { CLIFactory } from './CLIFactory';
16
+ export { Plugin } from './Plugin';
16
17
  export * from './Command';
17
18
  export * from './InterfaceUtils';
18
19
  export * from './OutputUtils';
@@ -27,6 +28,5 @@ export type * from './plugins/register-git-hooks-commands/augment';
27
28
  export type * from './plugins/register-lint-commands/augment';
28
29
  export type * from './plugins/register-release-command/augment';
29
30
  export type * from './plugins/default-command-fallbacks/augment';
30
- export type * from './plugins/command-handler-injections/augment';
31
31
  export type * from './plugins/command-meta/augment';
32
32
  export type * from './plugins/private-commands/augment';