@oclif/core 3.0.0-beta.8 → 3.0.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.
- package/README.md +4 -2
- package/flush.d.ts +3 -0
- package/flush.js +1 -0
- package/handle.js +1 -0
- package/lib/args.d.ts +2 -2
- package/lib/args.js +17 -18
- package/lib/{ux → cli-ux}/action/base.d.ts +19 -21
- package/lib/{ux → cli-ux}/action/base.js +126 -120
- package/lib/{ux → cli-ux}/action/simple.js +25 -30
- package/lib/{ux → cli-ux}/action/spinner.d.ts +9 -7
- package/lib/{ux → cli-ux}/action/spinner.js +45 -37
- package/lib/{ux → cli-ux}/action/spinners.js +187 -187
- package/lib/cli-ux/action/types.d.ts +5 -0
- package/lib/cli-ux/action/types.js +2 -0
- package/lib/{ux → cli-ux}/config.d.ts +5 -5
- package/lib/{ux → cli-ux}/config.js +17 -17
- package/lib/{ux → cli-ux}/exit.js +3 -0
- package/lib/cli-ux/flush.d.ts +1 -0
- package/lib/cli-ux/flush.js +28 -0
- package/lib/cli-ux/index.d.ts +39 -0
- package/lib/{ux → cli-ux}/index.js +74 -97
- package/lib/{ux → cli-ux}/list.js +3 -3
- package/lib/{ux → cli-ux}/prompt.d.ts +3 -3
- package/lib/{ux → cli-ux}/prompt.js +35 -25
- package/lib/{ux → cli-ux}/stream.d.ts +6 -6
- package/lib/{ux → cli-ux}/stream.js +11 -10
- package/lib/cli-ux/styled/index.d.ts +4 -0
- package/lib/cli-ux/styled/index.js +11 -0
- package/lib/{ux → cli-ux}/styled/object.js +7 -9
- package/lib/{ux → cli-ux}/styled/table.d.ts +10 -10
- package/lib/{ux → cli-ux}/styled/table.js +130 -133
- package/lib/{ux → cli-ux}/styled/tree.js +11 -13
- package/lib/cli-ux/wait.js +5 -0
- package/lib/command.d.ts +82 -88
- package/lib/command.js +196 -175
- package/lib/config/config.d.ts +89 -90
- package/lib/config/config.js +466 -566
- package/lib/config/index.d.ts +0 -1
- package/lib/config/index.js +1 -3
- package/lib/config/plugin-loader.d.ts +12 -12
- package/lib/config/plugin-loader.js +72 -56
- package/lib/config/plugin.d.ts +25 -24
- package/lib/config/plugin.js +188 -154
- package/lib/config/ts-node.d.ts +2 -1
- package/lib/config/ts-node.js +71 -58
- package/lib/config/util.d.ts +1 -11
- package/lib/config/util.js +6 -59
- package/lib/errors/config.d.ts +1 -1
- package/lib/errors/config.js +6 -6
- package/lib/errors/errors/cli.d.ts +7 -7
- package/lib/errors/errors/cli.js +20 -16
- package/lib/errors/errors/exit.d.ts +1 -4
- package/lib/errors/errors/exit.js +1 -1
- package/lib/errors/errors/module-load.d.ts +1 -4
- package/lib/errors/errors/module-load.js +1 -1
- package/lib/errors/errors/pretty-print.d.ts +1 -1
- package/lib/errors/errors/pretty-print.js +12 -10
- package/lib/errors/handle.d.ts +12 -2
- package/lib/errors/handle.js +26 -14
- package/lib/errors/index.d.ts +10 -10
- package/lib/errors/index.js +25 -24
- package/lib/errors/logger.d.ts +2 -2
- package/lib/errors/logger.js +14 -13
- package/lib/execute.d.ts +6 -6
- package/lib/execute.js +10 -9
- package/lib/flags.d.ts +103 -32
- package/lib/flags.js +79 -45
- package/lib/help/command.d.ts +16 -14
- package/lib/help/command.js +178 -163
- package/lib/help/docopts.d.ts +5 -5
- package/lib/help/docopts.js +50 -54
- package/lib/help/formatter.d.ts +37 -37
- package/lib/help/formatter.js +66 -55
- package/lib/help/index.d.ts +25 -21
- package/lib/help/index.js +169 -147
- package/lib/help/root.d.ts +1 -1
- package/lib/help/root.js +15 -17
- package/lib/help/util.d.ts +2 -8
- package/lib/help/util.js +8 -28
- package/lib/index.d.ts +19 -20
- package/lib/index.js +37 -43
- package/lib/interfaces/config.d.ts +67 -66
- package/lib/interfaces/errors.d.ts +5 -5
- package/lib/interfaces/help.d.ts +17 -17
- package/lib/interfaces/hooks.d.ts +49 -49
- package/lib/interfaces/index.d.ts +7 -7
- package/lib/interfaces/manifest.d.ts +1 -1
- package/lib/interfaces/parser.d.ts +175 -51
- package/lib/interfaces/pjson.d.ts +41 -41
- package/lib/interfaces/plugin.d.ts +47 -41
- package/lib/interfaces/s3-manifest.d.ts +7 -7
- package/lib/interfaces/topic.d.ts +1 -1
- package/lib/interfaces/ts-config.d.ts +7 -7
- package/lib/main.d.ts +2 -2
- package/lib/main.js +16 -16
- package/lib/module-loader.d.ts +67 -77
- package/lib/module-loader.js +183 -150
- package/lib/parser/errors.d.ts +7 -7
- package/lib/parser/errors.js +29 -22
- package/lib/parser/help.js +5 -5
- package/lib/parser/index.js +2 -2
- package/lib/parser/parse.d.ts +9 -6
- package/lib/parser/parse.js +253 -221
- package/lib/parser/validate.js +53 -33
- package/lib/performance.d.ts +43 -32
- package/lib/performance.js +133 -91
- package/lib/screen.js +2 -2
- package/lib/settings.d.ts +11 -12
- package/lib/settings.js +2 -2
- package/lib/util/aggregate-flags.d.ts +2 -0
- package/lib/util/aggregate-flags.js +13 -0
- package/lib/util/cache-command.d.ts +3 -0
- package/lib/util/cache-command.js +109 -0
- package/lib/util/cache-default-value.d.ts +2 -0
- package/lib/util/cache-default-value.js +28 -0
- package/lib/util/ensure-arg-object.d.ts +12 -0
- package/lib/util/ensure-arg-object.js +14 -0
- package/lib/util/fs.d.ts +7 -0
- package/lib/util/fs.js +54 -0
- package/lib/util/os.d.ts +19 -0
- package/lib/util/os.js +28 -0
- package/lib/{util.d.ts → util/util.d.ts} +7 -16
- package/lib/util/util.js +98 -0
- package/package.json +35 -37
- package/lib/util.js +0 -126
- package/lib/ux/flush.d.ts +0 -1
- package/lib/ux/flush.js +0 -27
- package/lib/ux/index.d.ts +0 -64
- package/lib/ux/styled/index.d.ts +0 -6
- package/lib/ux/styled/index.js +0 -13
- package/lib/ux/styled/json.d.ts +0 -1
- package/lib/ux/styled/json.js +0 -15
- package/lib/ux/wait.js +0 -7
- package/lib/{ux → cli-ux}/action/simple.d.ts +4 -4
- package/lib/{ux → cli-ux}/action/spinners.d.ts +117 -117
- package/lib/{ux → cli-ux}/exit.d.ts +2 -2
- package/lib/{ux → cli-ux}/list.d.ts +0 -0
- package/lib/{ux → cli-ux}/styled/object.d.ts +0 -0
- package/lib/{ux → cli-ux}/styled/progress.d.ts +0 -0
- package/lib/{ux → cli-ux}/styled/progress.js +0 -0
- package/lib/{ux → cli-ux}/styled/tree.d.ts +1 -1
- /package/lib/{ux → cli-ux}/wait.d.ts +0 -0
package/lib/config/config.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { Options, Plugin as IPlugin } from '../interfaces/plugin';
|
|
2
|
-
import { Config as IConfig, ArchTypes, PlatformTypes, LoadOptions, VersionDetails } from '../interfaces/config';
|
|
3
|
-
import { Hook, Hooks, PJSON, Topic } from '../interfaces';
|
|
4
1
|
import { Command } from '../command';
|
|
2
|
+
import { Hook, Hooks, PJSON, Topic } from '../interfaces';
|
|
3
|
+
import { ArchTypes, Config as IConfig, LoadOptions, PlatformTypes, VersionDetails } from '../interfaces/config';
|
|
4
|
+
import { Plugin as IPlugin, Options } from '../interfaces/plugin';
|
|
5
5
|
export declare class Config implements IConfig {
|
|
6
6
|
options: Options;
|
|
7
7
|
private _base;
|
|
8
|
+
private _commandIDs;
|
|
9
|
+
private _commands;
|
|
10
|
+
private static _rootPlugin;
|
|
11
|
+
private _topics;
|
|
12
|
+
private commandPermutations;
|
|
13
|
+
private pluginLoader;
|
|
14
|
+
private topicPermutations;
|
|
8
15
|
arch: ArchTypes;
|
|
9
16
|
bin: string;
|
|
17
|
+
binAliases?: string[];
|
|
10
18
|
binPath?: string;
|
|
11
19
|
cacheDir: string;
|
|
12
20
|
channel: string;
|
|
@@ -19,62 +27,66 @@ export declare class Config implements IConfig {
|
|
|
19
27
|
home: string;
|
|
20
28
|
name: string;
|
|
21
29
|
npmRegistry?: string;
|
|
30
|
+
nsisCustomization?: string;
|
|
22
31
|
pjson: PJSON.CLI;
|
|
23
32
|
platform: PlatformTypes;
|
|
24
33
|
plugins: Map<string, IPlugin>;
|
|
25
34
|
root: string;
|
|
26
35
|
shell: string;
|
|
27
|
-
topicSeparator: '
|
|
36
|
+
topicSeparator: ' ' | ':';
|
|
28
37
|
userAgent: string;
|
|
29
38
|
userPJSON?: PJSON.User;
|
|
30
39
|
valid: boolean;
|
|
31
40
|
version: string;
|
|
32
|
-
windows: boolean;
|
|
33
|
-
binAliases?: string[];
|
|
34
|
-
nsisCustomization?: string;
|
|
35
41
|
protected warned: boolean;
|
|
36
|
-
|
|
37
|
-
private topicPermutations;
|
|
38
|
-
private _commands;
|
|
39
|
-
private _topics;
|
|
40
|
-
private _commandIDs;
|
|
41
|
-
private pluginLoader;
|
|
42
|
-
private static _rootPlugin;
|
|
42
|
+
windows: boolean;
|
|
43
43
|
constructor(options: Options);
|
|
44
44
|
static load(opts?: LoadOptions): Promise<Config>;
|
|
45
45
|
static get rootPlugin(): IPlugin | undefined;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
force: boolean;
|
|
49
|
-
}): Promise<void>;
|
|
50
|
-
runHook<T extends keyof Hooks>(event: T, opts: Hooks[T]['options'], timeout?: number, captureErrors?: boolean): Promise<Hook.Result<Hooks[T]['return']>>;
|
|
51
|
-
runCommand<T = unknown>(id: string, argv?: string[], cachedCommand?: Command.Loadable | null): Promise<T>;
|
|
52
|
-
scopedEnvVar(k: string): string | undefined;
|
|
53
|
-
scopedEnvVarTrue(k: string): boolean;
|
|
46
|
+
protected _debug(): number;
|
|
47
|
+
protected _shell(): string;
|
|
54
48
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
49
|
+
* This method is responsible for locating the correct plugin to use for a named command id
|
|
50
|
+
* It searches the {Config} registered commands to match either the raw command id or the command alias
|
|
51
|
+
* It is possible that more than one command will be found. This is due the ability of two distinct plugins to
|
|
52
|
+
* create the same command or command alias.
|
|
53
|
+
*
|
|
54
|
+
* In the case of more than one found command, the function will select the command based on the order in which
|
|
55
|
+
* the plugin is included in the package.json `oclif.plugins` list. The command that occurs first in the list
|
|
56
|
+
* is selected as the command to run.
|
|
57
|
+
*
|
|
58
|
+
* Commands can also be present from either an install or a link. When a command is one of these and a core plugin
|
|
59
|
+
* is present, this function defers to the core plugin.
|
|
60
|
+
*
|
|
61
|
+
* If there is not a core plugin command present, this function will return the first
|
|
62
|
+
* plugin as discovered (will not change the order)
|
|
63
|
+
*
|
|
64
|
+
* @param commands commands to determine the priority of
|
|
65
|
+
* @returns command instance {Command.Loadable} or undefined
|
|
58
66
|
*/
|
|
59
|
-
|
|
67
|
+
private determinePriority;
|
|
68
|
+
private getCmdLookupId;
|
|
69
|
+
private getTopicLookupId;
|
|
60
70
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
71
|
+
* Insert legacy plugins
|
|
72
|
+
*
|
|
73
|
+
* Replace invalid CLI plugins (cli-engine plugins, mostly Heroku) loaded via `this.loadPlugins`
|
|
74
|
+
* with oclif-compatible ones returned by @oclif/plugin-legacy init hook.
|
|
75
|
+
*
|
|
76
|
+
* @param plugins array of oclif-compatible plugins
|
|
77
|
+
* @returns void
|
|
64
78
|
*/
|
|
65
|
-
|
|
79
|
+
private insertLegacyPlugins;
|
|
80
|
+
private isJitPluginCommand;
|
|
81
|
+
private loadCommands;
|
|
82
|
+
private loadTopics;
|
|
83
|
+
protected dir(category: 'cache' | 'config' | 'data'): string;
|
|
66
84
|
findCommand(id: string, opts: {
|
|
67
85
|
must: true;
|
|
68
86
|
}): Command.Loadable;
|
|
69
87
|
findCommand(id: string, opts?: {
|
|
70
88
|
must: boolean;
|
|
71
89
|
}): Command.Loadable | undefined;
|
|
72
|
-
findTopic(id: string, opts: {
|
|
73
|
-
must: true;
|
|
74
|
-
}): Topic;
|
|
75
|
-
findTopic(id: string, opts?: {
|
|
76
|
-
must: boolean;
|
|
77
|
-
}): Topic | undefined;
|
|
78
90
|
/**
|
|
79
91
|
* Find all command ids that include the provided command id.
|
|
80
92
|
*
|
|
@@ -89,69 +101,56 @@ export declare class Config implements IConfig {
|
|
|
89
101
|
* @returns string[]
|
|
90
102
|
*/
|
|
91
103
|
findMatches(partialCmdId: string, argv: string[]): Command.Loadable[];
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
findTopic(id: string, opts: {
|
|
105
|
+
must: true;
|
|
106
|
+
}): Topic;
|
|
107
|
+
findTopic(id: string, opts?: {
|
|
108
|
+
must: boolean;
|
|
109
|
+
}): Topic | undefined;
|
|
97
110
|
/**
|
|
98
111
|
* Returns an array of all command ids. If flexible taxonomy is enabled then all permutations will be appended to the array.
|
|
99
112
|
* @returns string[]
|
|
100
113
|
*/
|
|
101
114
|
getAllCommandIDs(): string[];
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Returns an array of all commands. If flexible taxonomy is enabled then all permutations will be appended to the array.
|
|
117
|
+
* @returns Command.Loadable[]
|
|
118
|
+
*/
|
|
119
|
+
getAllCommands(): Command.Loadable[];
|
|
120
|
+
getPluginsList(): IPlugin[];
|
|
121
|
+
load(): Promise<void>;
|
|
122
|
+
loadPluginsAndCommands(opts?: {
|
|
123
|
+
force: boolean;
|
|
124
|
+
}): Promise<void>;
|
|
125
|
+
protected macosCacheDir(): string | undefined;
|
|
126
|
+
runCommand<T = unknown>(id: string, argv?: string[], cachedCommand?: Command.Loadable | null): Promise<T>;
|
|
127
|
+
runHook<T extends keyof Hooks>(event: T, opts: Hooks[T]['options'], timeout?: number, captureErrors?: boolean): Promise<Hook.Result<Hooks[T]['return']>>;
|
|
106
128
|
s3Key(type: keyof PJSON.S3.Templates, ext?: '.tar.gz' | '.tar.xz' | IConfig.s3Key.Options, options?: IConfig.s3Key.Options): string;
|
|
107
129
|
s3Url(key: string): string;
|
|
108
|
-
|
|
109
|
-
|
|
130
|
+
scopedEnvVar(k: string): string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* this DOES NOT account for bin aliases, use scopedEnvVarKeys instead which will account for bin aliases
|
|
133
|
+
* @param {string} k, the unscoped key you want to get the value for
|
|
134
|
+
* @returns {string} returns the env var key
|
|
135
|
+
*/
|
|
136
|
+
scopedEnvVarKey(k: string): string;
|
|
137
|
+
/**
|
|
138
|
+
* gets the scoped env var keys for a given key, including bin aliases
|
|
139
|
+
* @param {string} k, the env key e.g. 'debug'
|
|
140
|
+
* @returns {string[]} e.g. ['SF_DEBUG', 'SFDX_DEBUG']
|
|
141
|
+
*/
|
|
142
|
+
scopedEnvVarKeys(k: string): string[];
|
|
143
|
+
scopedEnvVarTrue(k: string): boolean;
|
|
144
|
+
protected warn(err: {
|
|
145
|
+
detail: string;
|
|
146
|
+
name: string;
|
|
147
|
+
} | Error | string, scope?: string): void;
|
|
110
148
|
protected windowsHome(): string | undefined;
|
|
111
149
|
protected windowsHomedriveHome(): string | undefined;
|
|
112
150
|
protected windowsUserprofileHome(): string | undefined;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
protected _debug(): number;
|
|
116
|
-
protected warn(err: string | Error | {
|
|
117
|
-
name: string;
|
|
118
|
-
detail: string;
|
|
119
|
-
}, scope?: string): void;
|
|
151
|
+
get commandIDs(): string[];
|
|
152
|
+
get commands(): Command.Loadable[];
|
|
120
153
|
protected get isProd(): boolean;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
private getTopicLookupId;
|
|
124
|
-
private loadCommands;
|
|
125
|
-
private loadTopics;
|
|
126
|
-
/**
|
|
127
|
-
* This method is responsible for locating the correct plugin to use for a named command id
|
|
128
|
-
* It searches the {Config} registered commands to match either the raw command id or the command alias
|
|
129
|
-
* It is possible that more than one command will be found. This is due the ability of two distinct plugins to
|
|
130
|
-
* create the same command or command alias.
|
|
131
|
-
*
|
|
132
|
-
* In the case of more than one found command, the function will select the command based on the order in which
|
|
133
|
-
* the plugin is included in the package.json `oclif.plugins` list. The command that occurs first in the list
|
|
134
|
-
* is selected as the command to run.
|
|
135
|
-
*
|
|
136
|
-
* Commands can also be present from either an install or a link. When a command is one of these and a core plugin
|
|
137
|
-
* is present, this function defers to the core plugin.
|
|
138
|
-
*
|
|
139
|
-
* If there is not a core plugin command present, this function will return the first
|
|
140
|
-
* plugin as discovered (will not change the order)
|
|
141
|
-
*
|
|
142
|
-
* @param commands commands to determine the priority of
|
|
143
|
-
* @returns command instance {Command.Loadable} or undefined
|
|
144
|
-
*/
|
|
145
|
-
private determinePriority;
|
|
146
|
-
/**
|
|
147
|
-
* Insert legacy plugins
|
|
148
|
-
*
|
|
149
|
-
* Replace invalid CLI plugins (cli-engine plugins, mostly Heroku) loaded via `this.loadPlugins`
|
|
150
|
-
* with oclif-compatible ones returned by @oclif/plugin-legacy init hook.
|
|
151
|
-
*
|
|
152
|
-
* @param plugins array of oclif-compatible plugins
|
|
153
|
-
* @returns void
|
|
154
|
-
*/
|
|
155
|
-
private insertLegacyPlugins;
|
|
154
|
+
get topics(): Topic[];
|
|
155
|
+
get versionDetails(): VersionDetails;
|
|
156
156
|
}
|
|
157
|
-
export declare function toCached(c: Command.Class, plugin?: IPlugin, respectNoCacheDefault?: boolean): Promise<Command.Cached>;
|