@oclif/core 3.26.6 → 4.0.0-beta.10

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.
Files changed (124) hide show
  1. package/lib/args.d.ts +4 -4
  2. package/lib/cache.d.ts +3 -3
  3. package/lib/cache.js +1 -1
  4. package/lib/command.d.ts +18 -18
  5. package/lib/command.js +12 -21
  6. package/lib/config/config.d.ts +14 -40
  7. package/lib/config/config.js +120 -153
  8. package/lib/config/plugin-loader.d.ts +6 -6
  9. package/lib/config/plugin-loader.js +4 -28
  10. package/lib/config/plugin.d.ts +3 -3
  11. package/lib/config/plugin.js +7 -11
  12. package/lib/config/ts-path.d.ts +1 -1
  13. package/lib/config/ts-path.js +1 -2
  14. package/lib/config/util.d.ts +1 -1
  15. package/lib/config/util.js +5 -21
  16. package/lib/errors/error.js +5 -8
  17. package/lib/errors/errors/cli.d.ts +5 -5
  18. package/lib/errors/errors/cli.js +5 -5
  19. package/lib/errors/errors/pretty-print.d.ts +2 -2
  20. package/lib/errors/errors/pretty-print.js +2 -2
  21. package/lib/errors/exit.d.ts +1 -0
  22. package/lib/errors/exit.js +8 -0
  23. package/lib/errors/handle.js +4 -11
  24. package/lib/errors/index.d.ts +1 -3
  25. package/lib/errors/index.js +5 -12
  26. package/lib/errors/warn.d.ts +5 -0
  27. package/lib/errors/warn.js +10 -5
  28. package/lib/execute.js +1 -1
  29. package/lib/flags.d.ts +4 -4
  30. package/lib/{cli-ux/flush.js → flush.js} +2 -2
  31. package/lib/help/command.js +6 -5
  32. package/lib/help/formatter.d.ts +3 -3
  33. package/lib/help/formatter.js +8 -9
  34. package/lib/help/index.d.ts +1 -0
  35. package/lib/help/index.js +23 -17
  36. package/lib/help/root.js +3 -3
  37. package/lib/index.d.ts +6 -7
  38. package/lib/index.js +8 -12
  39. package/lib/interfaces/config.d.ts +9 -20
  40. package/lib/interfaces/errors.d.ts +5 -5
  41. package/lib/interfaces/flags.d.ts +2 -2
  42. package/lib/interfaces/index.d.ts +2 -1
  43. package/lib/interfaces/logger.d.ts +9 -0
  44. package/lib/interfaces/parser.d.ts +6 -6
  45. package/lib/interfaces/pjson.d.ts +217 -151
  46. package/lib/interfaces/plugin.d.ts +26 -24
  47. package/lib/interfaces/theme.d.ts +30 -19
  48. package/lib/interfaces/theme.js +2 -19
  49. package/lib/interfaces/topic.d.ts +2 -2
  50. package/lib/logger.d.ts +14 -0
  51. package/lib/logger.js +90 -0
  52. package/lib/main.js +5 -3
  53. package/lib/parser/errors.d.ts +1 -1
  54. package/lib/parser/errors.js +5 -5
  55. package/lib/parser/help.js +2 -2
  56. package/lib/parser/parse.js +2 -1
  57. package/lib/performance.js +3 -2
  58. package/lib/settings.d.ts +5 -11
  59. package/lib/util/determine-priority.d.ts +21 -0
  60. package/lib/util/determine-priority.js +55 -0
  61. package/lib/util/find-root.d.ts +1 -0
  62. package/lib/util/find-root.js +19 -19
  63. package/lib/util/fs.js +12 -0
  64. package/lib/util/ids.d.ts +1 -1
  65. package/lib/util/read-pjson.d.ts +7 -0
  66. package/lib/util/read-pjson.js +60 -0
  67. package/lib/util/read-tsconfig.js +3 -8
  68. package/lib/{cli-ux → ux}/action/base.d.ts +5 -7
  69. package/lib/{cli-ux → ux}/action/base.js +0 -3
  70. package/lib/{cli-ux → ux}/action/spinner.d.ts +5 -4
  71. package/lib/{cli-ux → ux}/action/spinner.js +16 -39
  72. package/lib/ux/action/types.d.ts +5 -0
  73. package/lib/ux/action/types.js +2 -0
  74. package/lib/ux/colorize-json.d.ts +28 -0
  75. package/lib/ux/colorize-json.js +67 -0
  76. package/lib/ux/index.d.ts +69 -0
  77. package/lib/ux/index.js +88 -0
  78. package/lib/{cli-ux → ux}/list.d.ts +1 -1
  79. package/lib/{cli-ux → ux}/list.js +1 -2
  80. package/lib/ux/theme.d.ts +9 -0
  81. package/lib/ux/theme.js +43 -0
  82. package/lib/ux/write.d.ts +2 -0
  83. package/lib/ux/write.js +22 -0
  84. package/package.json +37 -42
  85. package/flush.d.ts +0 -3
  86. package/flush.js +0 -1
  87. package/handle.js +0 -1
  88. package/lib/cli-ux/action/spinners.d.ts +0 -251
  89. package/lib/cli-ux/action/spinners.js +0 -374
  90. package/lib/cli-ux/action/types.d.ts +0 -5
  91. package/lib/cli-ux/config.d.ts +0 -25
  92. package/lib/cli-ux/config.js +0 -52
  93. package/lib/cli-ux/exit.d.ts +0 -8
  94. package/lib/cli-ux/exit.js +0 -16
  95. package/lib/cli-ux/index.d.ts +0 -133
  96. package/lib/cli-ux/index.js +0 -183
  97. package/lib/cli-ux/prompt.d.ts +0 -32
  98. package/lib/cli-ux/prompt.js +0 -185
  99. package/lib/cli-ux/stream.d.ts +0 -23
  100. package/lib/cli-ux/stream.js +0 -43
  101. package/lib/cli-ux/styled/index.d.ts +0 -4
  102. package/lib/cli-ux/styled/index.js +0 -36
  103. package/lib/cli-ux/styled/object.d.ts +0 -1
  104. package/lib/cli-ux/styled/object.js +0 -39
  105. package/lib/cli-ux/styled/progress.d.ts +0 -2
  106. package/lib/cli-ux/styled/progress.js +0 -8
  107. package/lib/cli-ux/styled/table.d.ts +0 -45
  108. package/lib/cli-ux/styled/table.js +0 -345
  109. package/lib/cli-ux/styled/tree.d.ts +0 -9
  110. package/lib/cli-ux/styled/tree.js +0 -37
  111. package/lib/cli-ux/theme.d.ts +0 -11
  112. package/lib/cli-ux/theme.js +0 -61
  113. package/lib/cli-ux/wait.d.ts +0 -2
  114. package/lib/cli-ux/wait.js +0 -5
  115. package/lib/cli-ux/write.d.ts +0 -8
  116. package/lib/cli-ux/write.js +0 -15
  117. package/lib/errors/config.d.ts +0 -6
  118. package/lib/errors/config.js +0 -38
  119. package/lib/errors/logger.d.ts +0 -8
  120. package/lib/errors/logger.js +0 -45
  121. /package/lib/{cli-ux/flush.d.ts → flush.d.ts} +0 -0
  122. /package/lib/{cli-ux/action/types.js → interfaces/logger.js} +0 -0
  123. /package/lib/{cli-ux → ux}/action/simple.d.ts +0 -0
  124. /package/lib/{cli-ux → ux}/action/simple.js +0 -0
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Command } from '../command';
3
3
  import { Hook, Hooks } from './hooks';
4
- import { PJSON } from './pjson';
4
+ import { OclifConfiguration, PJSON, S3Templates } from './pjson';
5
5
  import { Options, Plugin } from './plugin';
6
6
  import { Theme } from './theme';
7
7
  import { Topic } from './topic';
@@ -34,8 +34,8 @@ export interface Config {
34
34
  /**
35
35
  * name of any bin aliases that will execute the cli
36
36
  */
37
- readonly binAliases?: string[];
38
- readonly binPath?: string;
37
+ readonly binAliases?: string[] | undefined;
38
+ readonly binPath?: string | undefined;
39
39
  /**
40
40
  * cache directory to use for CLI
41
41
  *
@@ -57,22 +57,10 @@ export interface Config {
57
57
  * example: ~/.local/share/mycli
58
58
  */
59
59
  readonly dataDir: string;
60
- /**
61
- * debugging level
62
- *
63
- * set by ${BIN}_DEBUG or DEBUG=$BIN
64
- */
65
- readonly debug: number;
66
60
  /**
67
61
  * base dirname to use in cacheDir/configDir/dataDir
68
62
  */
69
63
  readonly dirname: string;
70
- /**
71
- * points to a file that should be appended to for error logs
72
- *
73
- * example: ~/Library/Caches/mycli/error.log
74
- */
75
- readonly errlog: string;
76
64
  findCommand(id: string, opts: {
77
65
  must: true;
78
66
  }): Command.Loadable;
@@ -101,9 +89,9 @@ export interface Config {
101
89
  /**
102
90
  * npm registry to use for installing plugins
103
91
  */
104
- readonly npmRegistry?: string;
105
- readonly nsisCustomization?: string;
106
- readonly pjson: PJSON.CLI;
92
+ readonly npmRegistry?: string | undefined;
93
+ readonly nsisCustomization?: string | undefined;
94
+ readonly pjson: PJSON;
107
95
  /**
108
96
  * process.platform
109
97
  */
@@ -113,7 +101,7 @@ export interface Config {
113
101
  runCommand<T = unknown>(id: string, argv?: string[], cachedCommand?: Command.Loadable): Promise<T>;
114
102
  runHook<T extends keyof Hooks>(event: T, opts: Hooks[T]['options'], timeout?: number, captureErrors?: boolean): Promise<Hook.Result<Hooks[T]['return']>>;
115
103
  s3Key(type: 'unversioned' | 'versioned', ext: '.tar.gz' | '.tar.xz', options?: Config.s3Key.Options): string;
116
- s3Key(type: keyof PJSON.S3.Templates, options?: Config.s3Key.Options): string;
104
+ s3Key(type: keyof S3Templates, options?: Config.s3Key.Options): string;
117
105
  s3Url(key: string): string;
118
106
  scopedEnvVar(key: string): string | undefined;
119
107
  scopedEnvVarKey(key: string): string;
@@ -123,9 +111,10 @@ export interface Config {
123
111
  * active shell
124
112
  */
125
113
  readonly shell: string;
126
- readonly theme?: Theme;
114
+ readonly theme?: Theme | undefined;
127
115
  topicSeparator: ' ' | ':';
128
116
  readonly topics: Topic[];
117
+ readonly updateConfig: NonNullable<OclifConfiguration['update']>;
129
118
  /**
130
119
  * user agent to use for http calls
131
120
  *
@@ -3,25 +3,25 @@ export type CommandError = Error & {
3
3
  };
4
4
  export interface OclifError {
5
5
  oclif: {
6
- exit?: number;
6
+ exit?: number | undefined;
7
7
  };
8
8
  }
9
9
  export interface PrettyPrintableError {
10
10
  /**
11
11
  * a unique error code for this error class
12
12
  */
13
- code?: string;
13
+ code?: string | undefined;
14
14
  /**
15
15
  * message to display related to the error
16
16
  */
17
- message?: string;
17
+ message?: string | undefined;
18
18
  /**
19
19
  * a url to find out more information related to this error
20
20
  * or fixing the error
21
21
  */
22
- ref?: string;
22
+ ref?: string | undefined;
23
23
  /**
24
24
  * a suggestion that may be useful or provide additional context
25
25
  */
26
- suggestions?: string[];
26
+ suggestions?: string[] | undefined;
27
27
  }
@@ -3,12 +3,12 @@ import { FlagInput } from './parser';
3
3
  * Infer the flags that are returned by Command.parse. This is useful for when you want to assign the flags as a class property.
4
4
  *
5
5
  * @example
6
- * export type StatusFlags = Interfaces.InferredFlags<typeof Status.flags & typeof Status.baseFlags>
6
+ * export type StatusFlags = Interfaces.InferredFlags<typeof Status.flags && typeof Status.baseFlags>
7
7
  *
8
8
  * export abstract class BaseCommand extends Command {
9
9
  * static enableJsonFlag = true
10
10
  *
11
- * static baseFlags = {
11
+ * static flags = {
12
12
  * config: Flags.string({
13
13
  * description: 'specify config file',
14
14
  * }),
@@ -5,9 +5,10 @@ export type { CommandError, OclifError, PrettyPrintableError } from './errors';
5
5
  export type { InferredFlags } from './flags';
6
6
  export type { HelpOptions } from './help';
7
7
  export type { Hook, Hooks } from './hooks';
8
+ export type { Logger } from './logger';
8
9
  export type { Manifest } from './manifest';
9
10
  export type { Arg, BooleanFlag, CustomOptions, Deprecation, Flag, FlagDefinition, OptionFlag } from './parser';
10
- export type { PJSON } from './pjson';
11
+ export type { OclifConfiguration, PJSON, S3, S3Templates, UserPJSON } from './pjson';
11
12
  export type { Options, Plugin, PluginOptions } from './plugin';
12
13
  export type { S3Manifest } from './s3-manifest';
13
14
  export type { Theme } from './theme';
@@ -0,0 +1,9 @@
1
+ export type Logger = {
2
+ debug: (formatter: unknown, ...args: unknown[]) => void;
3
+ error: (formatter: unknown, ...args: unknown[]) => void;
4
+ info: (formatter: unknown, ...args: unknown[]) => void;
5
+ trace: (formatter: unknown, ...args: unknown[]) => void;
6
+ warn: (formatter: unknown, ...args: unknown[]) => void;
7
+ child: (namespace: string) => Logger;
8
+ namespace: string;
9
+ };
@@ -8,10 +8,10 @@ export type ArgOutput = {
8
8
  };
9
9
  export type CLIParseErrorOptions = {
10
10
  parse: {
11
- input?: ParserInput;
12
- output?: ParserOutput;
11
+ input?: ParserInput | undefined;
12
+ output?: ParserOutput | undefined;
13
13
  };
14
- exit?: number;
14
+ exit?: number | undefined;
15
15
  };
16
16
  export type OutputArgs<T extends ParserInput['args']> = {
17
17
  [P in keyof T]: any;
@@ -431,7 +431,7 @@ export type Input<TFlags extends FlagOutput, BFlags extends FlagOutput, AFlags e
431
431
  baseFlags?: FlagInput<BFlags>;
432
432
  enableJsonFlag?: true | false;
433
433
  args?: ArgInput<AFlags>;
434
- strict?: boolean;
434
+ strict?: boolean | undefined;
435
435
  context?: ParserContext;
436
436
  '--'?: boolean;
437
437
  };
@@ -441,10 +441,10 @@ export type ParserInput = {
441
441
  args: ArgInput<any>;
442
442
  strict: boolean;
443
443
  context: ParserContext | undefined;
444
- '--'?: boolean;
444
+ '--'?: boolean | undefined;
445
445
  };
446
446
  export type ParserContext = Command & {
447
- token?: FlagToken | ArgToken;
447
+ token?: FlagToken | ArgToken | undefined;
448
448
  };
449
449
  export type FlagInput<T extends FlagOutput = {
450
450
  [flag: string]: any;
@@ -1,21 +1,5 @@
1
1
  import { HelpOptions } from './help';
2
- export interface PJSON {
3
- [k: string]: any;
4
- dependencies?: {
5
- [name: string]: string;
6
- };
7
- devDependencies?: {
8
- [name: string]: string;
9
- };
10
- oclif: {
11
- bin?: string;
12
- dirname?: string;
13
- hooks?: Record<string, string | string[]>;
14
- plugins?: string[];
15
- schema?: number;
16
- };
17
- version: string;
18
- }
2
+ import { Theme } from './theme';
19
3
  export type CommandDiscovery = {
20
4
  /**
21
5
  * The strategy to use for loading commands.
@@ -96,141 +80,223 @@ export type HookOptions = {
96
80
  */
97
81
  identifier: string;
98
82
  };
99
- export declare namespace PJSON {
100
- interface Plugin extends PJSON {
101
- name: string;
102
- oclif: PJSON['oclif'] & {
103
- additionalHelpFlags?: string[];
104
- additionalVersionFlags?: string[];
105
- aliases?: {
106
- [name: string]: null | string;
107
- };
108
- commands?: string | CommandDiscovery;
109
- /**
110
- * Default command id when no command is found. This is used to support single command CLIs.
111
- * Only supported value is "."
112
- *
113
- * @deprecated Use `commands.strategy: 'single'` instead.
114
- */
115
- default?: string;
83
+ export type HelpLocationOptions = {
84
+ /**
85
+ * The file path containing help class.
86
+ */
87
+ target: string;
88
+ /**
89
+ * The name of the export to use when loading the help class from the `target` file. Defaults to `default`.
90
+ */
91
+ identifier: string;
92
+ };
93
+ export type S3Templates = {
94
+ baseDir?: string;
95
+ manifest?: string;
96
+ unversioned?: string;
97
+ versioned?: string;
98
+ };
99
+ export type S3 = {
100
+ acl?: string | undefined;
101
+ bucket?: string | undefined;
102
+ folder?: string | undefined;
103
+ gz?: boolean | undefined;
104
+ host?: string | undefined;
105
+ indexVersionLimit?: number | undefined;
106
+ templates?: {
107
+ target: S3Templates;
108
+ vanilla: S3Templates;
109
+ } | undefined;
110
+ xz?: boolean | undefined;
111
+ };
112
+ export type OclifConfiguration = {
113
+ /**
114
+ * Flags in addition to --help that should trigger help output.
115
+ */
116
+ additionalHelpFlags?: string[];
117
+ /**
118
+ * Flags in addition to --version that should trigger version output.
119
+ */
120
+ additionalVersionFlags?: string[];
121
+ /**
122
+ * Plugin aliases.
123
+ */
124
+ aliases?: {
125
+ [name: string]: null | string;
126
+ };
127
+ /**
128
+ * The name of the executable.
129
+ */
130
+ bin?: string;
131
+ /**
132
+ * Aliases for the executable.
133
+ */
134
+ binAliases?: string[];
135
+ commands?: string | CommandDiscovery;
136
+ /**
137
+ * Your CLI's description. Overrides the description in the package.json.
138
+ */
139
+ description?: string | undefined;
140
+ /**
141
+ * Plugins to load when in development mode.
142
+ */
143
+ devPlugins?: string[];
144
+ /**
145
+ * The directory name to use when determining the cache, config, and data directories.
146
+ */
147
+ dirname?: string;
148
+ /**
149
+ * Example plugin to use in @oclif/plugin-plugin's help output.
150
+ */
151
+ examplePlugin?: string;
152
+ /**
153
+ * Customize the exit codes for the CLI.
154
+ */
155
+ exitCodes?: {
156
+ default?: number;
157
+ failedFlagParsing?: number;
158
+ failedFlagValidation?: number;
159
+ invalidArgsSpec?: number;
160
+ nonExistentFlag?: number;
161
+ requiredArgs?: number;
162
+ unexpectedArgs?: number;
163
+ };
164
+ /**
165
+ * Enable flexible taxonomy for commands.
166
+ */
167
+ flexibleTaxonomy?: boolean;
168
+ /**
169
+ * The location of your custom help class.
170
+ */
171
+ helpClass?: string | HelpLocationOptions;
172
+ /**
173
+ * Options for the help output.
174
+ */
175
+ helpOptions?: HelpOptions;
176
+ /**
177
+ * Register hooks to run at various points in the CLI lifecycle.
178
+ */
179
+ hooks?: {
180
+ [name: string]: string | string[] | HookOptions | HookOptions[];
181
+ };
182
+ /**
183
+ * Plugins that can be installed just-in-time.
184
+ */
185
+ jitPlugins?: Record<string, string>;
186
+ macos?: {
187
+ identifier?: string;
188
+ sign?: string;
189
+ };
190
+ /**
191
+ * Use a private or alternate npm registry.
192
+ */
193
+ npmRegistry?: string;
194
+ /**
195
+ * Script to run during postinstall on windows.
196
+ */
197
+ nsisCustomization?: string;
198
+ /**
199
+ * Plugin prefix to use when working with plugins with @oclif/plugin-plugins.
200
+ *
201
+ * Defaults to `plugin-`.
202
+ */
203
+ pluginPrefix?: string;
204
+ /**
205
+ * Plugins to load.
206
+ */
207
+ plugins?: string[];
208
+ /**
209
+ * Template string used to build links to source code in CLI's README (when using `oclif readme`).
210
+ */
211
+ repositoryPrefix?: string;
212
+ schema?: number;
213
+ /**
214
+ * The namespace to be used for plugins of your CLI, e.g. `@salesforce`.
215
+ */
216
+ scope?: string;
217
+ /**
218
+ * State of your CLI
219
+ *
220
+ * - `beta` - will show message to user that command or CLI is in beta
221
+ * - `deprecated` - will show message to user that command or CLI is deprecated
222
+ */
223
+ state?: 'beta' | 'deprecated' | string;
224
+ /**
225
+ * The theme to ship with the CLI.
226
+ *
227
+ * Can be a path to a JSON file or a Theme object.
228
+ */
229
+ theme?: string | Theme;
230
+ /**
231
+ * Separator to use for your CLI. Can be `:` or ` `.
232
+ */
233
+ topicSeparator?: ' ' | ':';
234
+ /**
235
+ * Customize the topics in the CLI.
236
+ */
237
+ topics?: {
238
+ [k: string]: {
116
239
  description?: string;
117
- devPlugins?: string[];
118
- exitCodes?: {
119
- default?: number;
120
- failedFlagParsing?: number;
121
- failedFlagValidation?: number;
122
- invalidArgsSpec?: number;
123
- nonExistentFlag?: number;
124
- requiredArgs?: number;
125
- unexpectedArgs?: number;
126
- };
127
- flexibleTaxonomy?: boolean;
128
- helpClass?: string;
129
- helpOptions?: HelpOptions;
130
- hooks?: {
131
- [name: string]: string | string[] | HookOptions | HookOptions[];
132
- };
133
- jitPlugins?: Record<string, string>;
134
- macos?: {
135
- identifier?: string;
136
- sign?: string;
137
- };
138
- plugins?: string[];
139
- repositoryPrefix?: string;
140
- schema?: number;
141
- state?: 'beta' | 'deprecated' | string;
142
- theme?: string;
143
- topicSeparator?: ' ' | ':';
144
- topics?: {
145
- [k: string]: {
146
- description?: string;
147
- hidden?: boolean;
148
- subtopics?: Plugin['oclif']['topics'];
149
- };
150
- };
151
- update: {
152
- autoupdate?: {
153
- debounce?: number;
154
- rollout?: number;
155
- };
156
- disableNpmLookup?: boolean;
157
- node: {
158
- targets?: string[];
159
- version?: string;
160
- options?: string | string[];
161
- };
162
- s3: S3;
163
- };
164
- windows?: {
165
- homepage?: string;
166
- keypath?: string;
167
- name?: string;
168
- };
169
- };
170
- version: string;
171
- }
172
- interface S3 {
173
- acl?: string;
174
- bucket?: string;
175
- folder?: string;
176
- gz?: boolean;
177
- host?: string;
178
- templates: {
179
- target: S3.Templates;
180
- vanilla: S3.Templates;
240
+ hidden?: boolean;
241
+ subtopics?: OclifConfiguration['topics'];
181
242
  };
182
- xz?: boolean;
183
- }
184
- namespace S3 {
185
- interface Templates {
186
- baseDir?: string;
187
- manifest?: string;
188
- unversioned?: string;
189
- versioned?: string;
190
- }
191
- }
192
- interface CLI extends Plugin {
193
- oclif: Plugin['oclif'] & {
194
- bin?: string;
195
- binAliases?: string[];
196
- dirname?: string;
197
- flexibleTaxonomy?: boolean;
198
- jitPlugins?: Record<string, string>;
199
- npmRegistry?: string;
200
- nsisCustomization?: string;
201
- schema?: number;
202
- scope?: string;
203
- pluginPrefix?: string;
204
- 'warn-if-update-available'?: {
205
- authorization: string;
206
- message: string;
207
- registry: string;
208
- timeoutInDays: number;
209
- frequency: number;
210
- frequencyUnit: 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds';
211
- };
243
+ };
244
+ update?: {
245
+ autoupdate?: {
246
+ debounce?: number;
247
+ rollout?: number;
212
248
  };
213
- }
214
- interface User extends PJSON {
215
- oclif: PJSON['oclif'] & {
216
- plugins?: (PluginTypes.Link | PluginTypes.User | string)[];
249
+ disableNpmLookup?: boolean;
250
+ node?: {
251
+ targets?: string[];
252
+ version?: string;
253
+ options?: string | string[];
217
254
  };
218
- private?: boolean;
219
- }
220
- type PluginTypes = {
221
- root: string;
222
- } | PluginTypes.Link | PluginTypes.User;
223
- namespace PluginTypes {
224
- interface User {
225
- name: string;
226
- tag?: string;
227
- type: 'user';
228
- url?: string;
229
- }
230
- interface Link {
231
- name: string;
232
- root: string;
233
- type: 'link';
234
- }
235
- }
236
- }
255
+ s3?: S3;
256
+ };
257
+ 'warn-if-update-available'?: {
258
+ authorization?: string;
259
+ message?: string;
260
+ registry?: string;
261
+ timeoutInDays?: number;
262
+ frequency?: number;
263
+ frequencyUnit?: 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds';
264
+ };
265
+ windows?: {
266
+ homepage?: string;
267
+ keypath?: string;
268
+ name?: string;
269
+ };
270
+ };
271
+ export type UserPlugin = {
272
+ name: string;
273
+ tag?: string;
274
+ type: 'user';
275
+ url?: string;
276
+ };
277
+ export type LinkedPlugin = {
278
+ name: string;
279
+ root: string;
280
+ type: 'link';
281
+ };
282
+ export type PluginTypes = {
283
+ root: string;
284
+ } | UserPlugin | LinkedPlugin;
285
+ export type UserPJSON = {
286
+ oclif: {
287
+ plugins?: PluginTypes[];
288
+ };
289
+ private?: boolean;
290
+ };
291
+ export type PJSON = {
292
+ [k: string]: any;
293
+ dependencies?: {
294
+ [name: string]: string;
295
+ };
296
+ devDependencies?: {
297
+ [name: string]: string;
298
+ };
299
+ name: string;
300
+ oclif: OclifConfiguration;
301
+ version: string;
302
+ };
@@ -1,35 +1,37 @@
1
1
  import { Command } from '../command';
2
+ import { Logger } from './logger';
2
3
  import { HookOptions, PJSON } from './pjson';
3
4
  import { Topic } from './topic';
4
5
  export interface PluginOptions {
5
- children?: Plugin[];
6
- errorOnManifestCreate?: boolean;
7
- flexibleTaxonomy?: boolean;
8
- ignoreManifest?: boolean;
9
- isRoot?: boolean;
10
- name?: string;
11
- parent?: Plugin;
12
- pjson?: PJSON.Plugin;
13
- respectNoCacheDefault?: boolean;
6
+ children?: Plugin[] | undefined;
7
+ errorOnManifestCreate?: boolean | undefined;
8
+ flexibleTaxonomy?: boolean | undefined;
9
+ ignoreManifest?: boolean | undefined;
10
+ isRoot?: boolean | undefined;
11
+ name?: string | undefined;
12
+ parent?: Plugin | undefined;
13
+ pjson?: PJSON | undefined;
14
+ respectNoCacheDefault?: boolean | undefined;
14
15
  root: string;
15
- tag?: string;
16
- type?: string;
17
- url?: string;
16
+ tag?: string | undefined;
17
+ type?: string | undefined;
18
+ url?: string | undefined;
18
19
  }
19
20
  export interface Options extends PluginOptions {
20
- channel?: string;
21
- devPlugins?: boolean;
22
- enablePerf?: boolean;
23
- jitPlugins?: boolean;
24
- pjson?: PJSON.Plugin;
21
+ channel?: string | undefined;
22
+ devPlugins?: boolean | undefined;
23
+ enablePerf?: boolean | undefined;
24
+ jitPlugins?: boolean | undefined;
25
+ logger?: Logger | undefined;
26
+ pjson?: PJSON | undefined;
25
27
  pluginAdditions?: {
26
28
  core?: string[];
27
29
  dev?: string[];
28
30
  path?: string;
29
- };
30
- plugins?: Map<string, Plugin>;
31
- userPlugins?: boolean;
32
- version?: string;
31
+ } | undefined;
32
+ plugins?: Map<string, Plugin> | undefined;
33
+ userPlugins?: boolean | undefined;
34
+ version?: string | undefined;
33
35
  }
34
36
  export interface Plugin {
35
37
  /**
@@ -67,13 +69,13 @@ export interface Plugin {
67
69
  */
68
70
  name: string;
69
71
  readonly options: Options;
70
- parent?: Plugin;
72
+ parent?: Plugin | undefined;
71
73
  /**
72
74
  * full package.json
73
75
  *
74
76
  * parsed with read-pkg
75
77
  */
76
- pjson: PJSON.CLI | PJSON.Plugin;
78
+ pjson: PJSON;
77
79
  /**
78
80
  * base path of plugin
79
81
  */
@@ -82,7 +84,7 @@ export interface Plugin {
82
84
  * npm dist-tag of plugin
83
85
  * only used for user plugins
84
86
  */
85
- tag?: string;
87
+ tag?: string | undefined;
86
88
  readonly topics: Topic[];
87
89
  /**
88
90
  * used to tell the user how the plugin was installed