@oclif/core 4.0.0-beta.7 → 4.0.0-beta.9
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.
- package/lib/args.d.ts +4 -4
- package/lib/cache.d.ts +3 -3
- package/lib/cache.js +1 -1
- package/lib/command.d.ts +18 -19
- package/lib/command.js +10 -8
- package/lib/config/config.d.ts +10 -30
- package/lib/config/config.js +25 -66
- package/lib/config/plugin-loader.d.ts +6 -6
- package/lib/config/plugin-loader.js +3 -26
- package/lib/config/plugin.d.ts +3 -3
- package/lib/config/plugin.js +2 -5
- package/lib/config/ts-path.d.ts +1 -1
- package/lib/errors/errors/cli.d.ts +5 -5
- package/lib/errors/errors/pretty-print.d.ts +2 -2
- package/lib/flags.d.ts +4 -4
- package/lib/flush.js +2 -2
- package/lib/help/formatter.d.ts +3 -3
- package/lib/help/index.d.ts +1 -0
- package/lib/help/index.js +19 -10
- package/lib/index.d.ts +4 -5
- package/lib/index.js +1 -1
- package/lib/interfaces/config.d.ts +9 -9
- package/lib/interfaces/errors.d.ts +5 -5
- package/lib/interfaces/flags.d.ts +3 -2
- package/lib/interfaces/hooks.d.ts +1 -1
- package/lib/interfaces/index.d.ts +1 -1
- package/lib/interfaces/parser.d.ts +7 -8
- package/lib/interfaces/pjson.d.ts +217 -151
- package/lib/interfaces/plugin.d.ts +25 -25
- package/lib/interfaces/topic.d.ts +2 -2
- package/lib/main.js +2 -2
- package/lib/parser/errors.d.ts +1 -1
- package/lib/parser/index.d.ts +1 -1
- package/lib/settings.d.ts +5 -5
- package/lib/util/aggregate-flags.d.ts +1 -1
- package/lib/util/aggregate-flags.js +2 -3
- package/lib/util/cache-command.js +3 -4
- package/lib/util/determine-priority.d.ts +21 -0
- package/lib/util/determine-priority.js +55 -0
- package/lib/util/ids.d.ts +1 -1
- package/lib/util/read-pjson.d.ts +1 -1
- package/lib/ux/colorize-json.d.ts +2 -2
- package/lib/ux/index.d.ts +7 -2
- package/lib/ux/index.js +15 -3
- package/lib/ux/theme.d.ts +1 -1
- package/package.json +26 -11
- package/flush.d.ts +0 -3
- package/flush.js +0 -1
- package/handle.js +0 -1
package/lib/help/formatter.d.ts
CHANGED
|
@@ -59,9 +59,9 @@ export declare class HelpFormatter {
|
|
|
59
59
|
indent(body: string, spacing?: number): string;
|
|
60
60
|
renderList(input: (string | undefined)[][], opts: {
|
|
61
61
|
indentation: number;
|
|
62
|
-
multiline?: boolean;
|
|
63
|
-
spacer?: string;
|
|
64
|
-
stripAnsi?: boolean;
|
|
62
|
+
multiline?: boolean | undefined;
|
|
63
|
+
spacer?: string | undefined;
|
|
64
|
+
stripAnsi?: boolean | undefined;
|
|
65
65
|
}): string;
|
|
66
66
|
section(header: string, body: [string, string | undefined][] | HelpSection | HelpSectionKeyValueTable | string): string;
|
|
67
67
|
/**
|
package/lib/help/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as Interfaces from '../interfaces';
|
|
|
3
3
|
import { CommandHelp } from './command';
|
|
4
4
|
import { HelpFormatter } from './formatter';
|
|
5
5
|
export { CommandHelp } from './command';
|
|
6
|
+
export { HelpFormatter, type HelpSection, type HelpSectionKeyValueTable, type HelpSectionRenderer } from './formatter';
|
|
6
7
|
export { getHelpFlagAdditions, normalizeArgv, standardizeIDFromArgv } from './util';
|
|
7
8
|
export declare abstract class HelpBase extends HelpFormatter {
|
|
8
9
|
constructor(config: Interfaces.Config, opts?: Partial<Interfaces.HelpOptions>);
|
package/lib/help/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.loadHelpClass = exports.Help = exports.HelpBase = exports.standardizeIDFromArgv = exports.normalizeArgv = exports.getHelpFlagAdditions = exports.CommandHelp = void 0;
|
|
6
|
+
exports.loadHelpClass = exports.Help = exports.HelpBase = exports.standardizeIDFromArgv = exports.normalizeArgv = exports.getHelpFlagAdditions = exports.HelpFormatter = exports.CommandHelp = void 0;
|
|
7
7
|
const ansis_1 = __importDefault(require("ansis"));
|
|
8
8
|
const ts_path_1 = require("../config/ts-path");
|
|
9
9
|
const error_1 = require("../errors/error");
|
|
@@ -12,7 +12,7 @@ const symbols_1 = require("../symbols");
|
|
|
12
12
|
const cache_default_value_1 = require("../util/cache-default-value");
|
|
13
13
|
const ids_1 = require("../util/ids");
|
|
14
14
|
const util_1 = require("../util/util");
|
|
15
|
-
const ux_1 =
|
|
15
|
+
const ux_1 = require("../ux");
|
|
16
16
|
const theme_1 = require("../ux/theme");
|
|
17
17
|
const command_1 = require("./command");
|
|
18
18
|
const formatter_1 = require("./formatter");
|
|
@@ -20,6 +20,8 @@ const root_1 = __importDefault(require("./root"));
|
|
|
20
20
|
const util_2 = require("./util");
|
|
21
21
|
var command_2 = require("./command");
|
|
22
22
|
Object.defineProperty(exports, "CommandHelp", { enumerable: true, get: function () { return command_2.CommandHelp; } });
|
|
23
|
+
var formatter_2 = require("./formatter");
|
|
24
|
+
Object.defineProperty(exports, "HelpFormatter", { enumerable: true, get: function () { return formatter_2.HelpFormatter; } });
|
|
23
25
|
var util_3 = require("./util");
|
|
24
26
|
Object.defineProperty(exports, "getHelpFlagAdditions", { enumerable: true, get: function () { return util_3.getHelpFlagAdditions; } });
|
|
25
27
|
Object.defineProperty(exports, "normalizeArgv", { enumerable: true, get: function () { return util_3.normalizeArgv; } });
|
|
@@ -144,7 +146,7 @@ class Help extends HelpBase {
|
|
|
144
146
|
return new this.CommandHelpClass(command, this.config, this.opts);
|
|
145
147
|
}
|
|
146
148
|
log(...args) {
|
|
147
|
-
this.opts.sendToStderr ? ux_1.
|
|
149
|
+
this.opts.sendToStderr ? ux_1.ux.stderr(args) : ux_1.ux.stdout(args);
|
|
148
150
|
}
|
|
149
151
|
async showCommandHelp(command) {
|
|
150
152
|
const name = command.id;
|
|
@@ -314,17 +316,24 @@ exports.Help = Help;
|
|
|
314
316
|
function extractClass(exported) {
|
|
315
317
|
return exported && exported.default ? exported.default : exported;
|
|
316
318
|
}
|
|
319
|
+
function determineLocation(helpClass) {
|
|
320
|
+
if (typeof helpClass === 'string')
|
|
321
|
+
return { identifier: 'default', target: helpClass };
|
|
322
|
+
if (!helpClass.identifier)
|
|
323
|
+
return { ...helpClass, identifier: 'default' };
|
|
324
|
+
return helpClass;
|
|
325
|
+
}
|
|
317
326
|
async function loadHelpClass(config) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (configuredClass) {
|
|
327
|
+
if (config.pjson.oclif?.helpClass) {
|
|
328
|
+
const { identifier, target } = determineLocation(config.pjson.oclif?.helpClass);
|
|
321
329
|
try {
|
|
322
|
-
const path = (await (0, ts_path_1.tsPath)(config.root,
|
|
323
|
-
const
|
|
324
|
-
|
|
330
|
+
const path = (await (0, ts_path_1.tsPath)(config.root, target)) ?? target;
|
|
331
|
+
const module = await (0, module_loader_1.load)(config, path);
|
|
332
|
+
const helpClass = module[identifier] ?? (identifier === 'default' ? extractClass(module) : undefined);
|
|
333
|
+
return extractClass(helpClass);
|
|
325
334
|
}
|
|
326
335
|
catch (error) {
|
|
327
|
-
throw new Error(`Unable to load configured help class "${
|
|
336
|
+
throw new Error(`Unable to load configured help class "${target}", failed with message:\n${error.message}`);
|
|
328
337
|
}
|
|
329
338
|
}
|
|
330
339
|
return Help;
|
package/lib/index.d.ts
CHANGED
|
@@ -6,15 +6,14 @@ export { handle } from './errors/handle';
|
|
|
6
6
|
export { execute } from './execute';
|
|
7
7
|
export * as Flags from './flags';
|
|
8
8
|
export { flush } from './flush';
|
|
9
|
-
export { CommandHelp, Help, HelpBase, loadHelpClass } from './help';
|
|
10
|
-
export { HelpSection, HelpSectionKeyValueTable, HelpSectionRenderer } from './help/formatter';
|
|
9
|
+
export { CommandHelp, Help, HelpBase, type HelpSection, type HelpSectionKeyValueTable, type HelpSectionRenderer, loadHelpClass, } from './help';
|
|
11
10
|
export * as Interfaces from './interfaces';
|
|
12
|
-
export { Hook } from './interfaces/hooks';
|
|
11
|
+
export { type Hook } from './interfaces/hooks';
|
|
13
12
|
export { getLogger } from './logger';
|
|
14
13
|
export { run } from './main';
|
|
15
14
|
export * as ModuleLoader from './module-loader';
|
|
16
15
|
export * as Parser from './parser';
|
|
17
16
|
export { Performance } from './performance';
|
|
18
|
-
export { Settings, settings } from './settings';
|
|
17
|
+
export { type Settings, settings } from './settings';
|
|
19
18
|
export { toConfiguredId, toStandardizedId } from './util/ids';
|
|
20
|
-
export {
|
|
19
|
+
export { ux } from './ux';
|
package/lib/index.js
CHANGED
|
@@ -69,4 +69,4 @@ var ids_1 = require("./util/ids");
|
|
|
69
69
|
Object.defineProperty(exports, "toConfiguredId", { enumerable: true, get: function () { return ids_1.toConfiguredId; } });
|
|
70
70
|
Object.defineProperty(exports, "toStandardizedId", { enumerable: true, get: function () { return ids_1.toStandardizedId; } });
|
|
71
71
|
var ux_1 = require("./ux");
|
|
72
|
-
Object.defineProperty(exports, "ux", { enumerable: true, get: function () { return ux_1.
|
|
72
|
+
Object.defineProperty(exports, "ux", { enumerable: true, get: function () { return ux_1.ux; } });
|
|
@@ -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
|
*
|
|
@@ -89,9 +89,9 @@ export interface Config {
|
|
|
89
89
|
/**
|
|
90
90
|
* npm registry to use for installing plugins
|
|
91
91
|
*/
|
|
92
|
-
readonly npmRegistry?: string;
|
|
93
|
-
readonly nsisCustomization?: string;
|
|
94
|
-
readonly pjson: PJSON
|
|
92
|
+
readonly npmRegistry?: string | undefined;
|
|
93
|
+
readonly nsisCustomization?: string | undefined;
|
|
94
|
+
readonly pjson: PJSON;
|
|
95
95
|
/**
|
|
96
96
|
* process.platform
|
|
97
97
|
*/
|
|
@@ -101,7 +101,7 @@ export interface Config {
|
|
|
101
101
|
runCommand<T = unknown>(id: string, argv?: string[], cachedCommand?: Command.Loadable): Promise<T>;
|
|
102
102
|
runHook<T extends keyof Hooks>(event: T, opts: Hooks[T]['options'], timeout?: number, captureErrors?: boolean): Promise<Hook.Result<Hooks[T]['return']>>;
|
|
103
103
|
s3Key(type: 'unversioned' | 'versioned', ext: '.tar.gz' | '.tar.xz', options?: Config.s3Key.Options): string;
|
|
104
|
-
s3Key(type: keyof
|
|
104
|
+
s3Key(type: keyof S3Templates, options?: Config.s3Key.Options): string;
|
|
105
105
|
s3Url(key: string): string;
|
|
106
106
|
scopedEnvVar(key: string): string | undefined;
|
|
107
107
|
scopedEnvVarKey(key: string): string;
|
|
@@ -111,10 +111,10 @@ export interface Config {
|
|
|
111
111
|
* active shell
|
|
112
112
|
*/
|
|
113
113
|
readonly shell: string;
|
|
114
|
-
readonly theme?: Theme;
|
|
114
|
+
readonly theme?: Theme | undefined;
|
|
115
115
|
topicSeparator: ' ' | ':';
|
|
116
116
|
readonly topics: Topic[];
|
|
117
|
-
readonly updateConfig: NonNullable<
|
|
117
|
+
readonly updateConfig: NonNullable<OclifConfiguration['update']>;
|
|
118
118
|
/**
|
|
119
119
|
* user agent to use for http calls
|
|
120
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
|
|
6
|
+
* export type StatusFlags = Interfaces.InferredFlags<typeof Status.flags>
|
|
7
7
|
*
|
|
8
8
|
* export abstract class BaseCommand extends Command {
|
|
9
9
|
* static enableJsonFlag = true
|
|
10
10
|
*
|
|
11
|
-
* static
|
|
11
|
+
* static flags = {
|
|
12
12
|
* config: Flags.string({
|
|
13
13
|
* description: 'specify config file',
|
|
14
14
|
* }),
|
|
@@ -17,6 +17,7 @@ import { FlagInput } from './parser';
|
|
|
17
17
|
*
|
|
18
18
|
* export default class Status extends BaseCommand {
|
|
19
19
|
* static flags = {
|
|
20
|
+
* ...BaseCommand.flags,
|
|
20
21
|
* force: Flags.boolean({char: 'f', description: 'a flag'}),
|
|
21
22
|
* }
|
|
22
23
|
*
|
|
@@ -8,7 +8,7 @@ export type { Hook, Hooks } from './hooks';
|
|
|
8
8
|
export type { Logger } from './logger';
|
|
9
9
|
export type { Manifest } from './manifest';
|
|
10
10
|
export type { Arg, BooleanFlag, CustomOptions, Deprecation, Flag, FlagDefinition, OptionFlag } from './parser';
|
|
11
|
-
export type { PJSON } from './pjson';
|
|
11
|
+
export type { OclifConfiguration, PJSON, S3, S3Templates, UserPJSON } from './pjson';
|
|
12
12
|
export type { Options, Plugin, PluginOptions } from './plugin';
|
|
13
13
|
export type { S3Manifest } from './s3-manifest';
|
|
14
14
|
export type { Theme } from './theme';
|
|
@@ -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;
|
|
@@ -426,12 +426,11 @@ export type FlagDefinition<T, P = CustomOptions, R extends ReturnTypeSwitches =
|
|
|
426
426
|
}>>;
|
|
427
427
|
};
|
|
428
428
|
export type Flag<T> = BooleanFlag<T> | OptionFlag<T>;
|
|
429
|
-
export type Input<TFlags extends FlagOutput,
|
|
429
|
+
export type Input<TFlags extends FlagOutput, AFlags extends ArgOutput> = {
|
|
430
430
|
flags?: FlagInput<TFlags>;
|
|
431
|
-
baseFlags?: FlagInput<BFlags>;
|
|
432
431
|
enableJsonFlag?: true | false;
|
|
433
432
|
args?: ArgInput<AFlags>;
|
|
434
|
-
strict?: boolean;
|
|
433
|
+
strict?: boolean | undefined;
|
|
435
434
|
context?: ParserContext;
|
|
436
435
|
'--'?: boolean;
|
|
437
436
|
};
|
|
@@ -441,10 +440,10 @@ export type ParserInput = {
|
|
|
441
440
|
args: ArgInput<any>;
|
|
442
441
|
strict: boolean;
|
|
443
442
|
context: ParserContext | undefined;
|
|
444
|
-
'--'?: boolean;
|
|
443
|
+
'--'?: boolean | undefined;
|
|
445
444
|
};
|
|
446
445
|
export type ParserContext = Command & {
|
|
447
|
-
token?: FlagToken | ArgToken;
|
|
446
|
+
token?: FlagToken | ArgToken | undefined;
|
|
448
447
|
};
|
|
449
448
|
export type FlagInput<T extends FlagOutput = {
|
|
450
449
|
[flag: string]: any;
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { HelpOptions } from './help';
|
|
2
|
-
|
|
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
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
249
|
+
disableNpmLookup?: boolean;
|
|
250
|
+
node?: {
|
|
251
|
+
targets?: string[];
|
|
252
|
+
version?: string;
|
|
253
|
+
options?: string | string[];
|
|
217
254
|
};
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
+
};
|