oclif 4.11.3 → 4.12.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/lib/commands/generate/command.d.ts +3 -3
- package/lib/commands/generate/hook.d.ts +3 -3
- package/lib/commands/generate/hook.js +1 -4
- package/lib/commands/generate.d.ts +12 -12
- package/lib/commands/init.d.ts +6 -6
- package/lib/commands/manifest.js +1 -0
- package/lib/commands/pack/deb.d.ts +1 -1
- package/lib/commands/pack/tarballs.d.ts +6 -6
- package/lib/commands/pack/win.js +3 -0
- package/lib/commands/promote.d.ts +11 -11
- package/lib/commands/upload/deb.d.ts +1 -1
- package/lib/commands/upload/win.d.ts +2 -2
- package/lib/generator.d.ts +1 -1
- package/lib/generator.js +1 -2
- package/lib/log.js +1 -1
- package/lib/readme-generator.js +1 -1
- package/lib/tarballs/build.js +1 -1
- package/lib/tarballs/config.d.ts +2 -2
- package/lib/tarballs/config.js +3 -3
- package/lib/upload-util.d.ts +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { GeneratorCommand } from '../../generator';
|
|
2
2
|
export default class GenerateCommand extends GeneratorCommand<typeof GenerateCommand> {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static flags: {
|
|
8
|
-
'commands-dir': import("@oclif/core/
|
|
9
|
-
force: import("@oclif/core/
|
|
8
|
+
'commands-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { GeneratorCommand } from '../../generator';
|
|
2
2
|
export default class GenerateHook extends GeneratorCommand<typeof GenerateHook> {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static flags: {
|
|
8
|
-
event: import("@oclif/core/
|
|
9
|
-
force: import("@oclif/core/
|
|
8
|
+
event: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
}
|
|
@@ -65,10 +65,7 @@ class GenerateHook extends generator_1.GeneratorCommand {
|
|
|
65
65
|
const outDir = tsConfig.compilerOptions?.outDir ?? 'dist';
|
|
66
66
|
const hooks = packageJSON.oclif?.hooks ?? {};
|
|
67
67
|
hooks[this.flags.event] = hooks[this.flags.event]
|
|
68
|
-
? (0, util_1.uniq)([
|
|
69
|
-
...(0, util_1.castArray)(hooks[this.flags.event]),
|
|
70
|
-
`./${outDir}/hooks/${this.flags.event}/${this.args.name}`,
|
|
71
|
-
]).sort()
|
|
68
|
+
? (0, util_1.uniq)([...(0, util_1.castArray)(hooks[this.flags.event]), `./${outDir}/hooks/${this.flags.event}/${this.args.name}`]).sort()
|
|
72
69
|
: `./${outDir}/hooks/${this.flags.event}/${this.args.name}`;
|
|
73
70
|
const updatedPackageJSON = {
|
|
74
71
|
...packageJSON,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GeneratorCommand } from '../generator';
|
|
2
2
|
export default class Generate extends GeneratorCommand<typeof Generate> {
|
|
3
3
|
static args: {
|
|
4
|
-
name: import("@oclif/core/
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: {
|
|
@@ -49,17 +49,17 @@ export default class Generate extends GeneratorCommand<typeof Generate> {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
static flags: {
|
|
52
|
-
'output-dir': import("@oclif/core/
|
|
53
|
-
yes: import("@oclif/core/
|
|
54
|
-
name: import("@oclif/core/
|
|
55
|
-
description: import("@oclif/core/
|
|
56
|
-
repository: import("@oclif/core/
|
|
57
|
-
bin: import("@oclif/core/
|
|
58
|
-
author: import("@oclif/core/
|
|
59
|
-
license: import("@oclif/core/
|
|
60
|
-
"module-type": import("@oclif/core/
|
|
61
|
-
owner: import("@oclif/core/
|
|
62
|
-
"package-manager": import("@oclif/core/
|
|
52
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
53
|
+
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
54
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
55
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
56
|
+
repository: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
57
|
+
bin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
58
|
+
author: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
59
|
+
license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
60
|
+
"module-type": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
61
|
+
owner: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
62
|
+
"package-manager": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
63
63
|
};
|
|
64
64
|
static summary: string;
|
|
65
65
|
run(): Promise<void>;
|
package/lib/commands/init.d.ts
CHANGED
|
@@ -27,12 +27,12 @@ export default class Generate extends GeneratorCommand<typeof Generate> {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
static flags: {
|
|
30
|
-
'output-dir': import("@oclif/core/
|
|
31
|
-
yes: import("@oclif/core/
|
|
32
|
-
bin: import("@oclif/core/
|
|
33
|
-
"module-type": import("@oclif/core/
|
|
34
|
-
"package-manager": import("@oclif/core/
|
|
35
|
-
"topic-separator": import("@oclif/core/
|
|
30
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
32
|
+
bin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
+
"module-type": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
"package-manager": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
35
|
+
"topic-separator": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
36
36
|
};
|
|
37
37
|
static summary: string;
|
|
38
38
|
run(): Promise<void>;
|
package/lib/commands/manifest.js
CHANGED
|
@@ -100,6 +100,7 @@ class Manifest extends core_1.Command {
|
|
|
100
100
|
await plugin.load();
|
|
101
101
|
if (!plugin.valid) {
|
|
102
102
|
const { PluginLegacy } = await import('@oclif/plugin-legacy');
|
|
103
|
+
// @ts-expect-error for now because PluginLegacy doesn't use the same major of @oclif/core
|
|
103
104
|
plugin = new PluginLegacy(this.config, plugin);
|
|
104
105
|
await plugin.load();
|
|
105
106
|
}
|
|
@@ -2,7 +2,7 @@ import { Command, Interfaces } from '@oclif/core';
|
|
|
2
2
|
export default class PackDeb extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
compression: Interfaces.OptionFlag<"xz" | "
|
|
5
|
+
compression: Interfaces.OptionFlag<"xz" | "none" | "gzip" | "zstd" | undefined, Interfaces.CustomOptions>;
|
|
6
6
|
'prune-lockfiles': Interfaces.BooleanFlag<boolean>;
|
|
7
7
|
root: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
8
8
|
tarball: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
@@ -2,12 +2,12 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class PackTarballs extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
parallel: import("@oclif/core/
|
|
6
|
-
'prune-lockfiles': import("@oclif/core/
|
|
7
|
-
root: import("@oclif/core/
|
|
8
|
-
tarball: import("@oclif/core/
|
|
9
|
-
targets: import("@oclif/core/
|
|
10
|
-
xz: import("@oclif/core/
|
|
5
|
+
parallel: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'prune-lockfiles': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
tarball: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
targets: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
xz: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
static summary: string;
|
|
13
13
|
run(): Promise<void>;
|
package/lib/commands/pack/win.js
CHANGED
|
@@ -341,6 +341,9 @@ the CLI should already exist in a directory named after the CLI that is the root
|
|
|
341
341
|
}
|
|
342
342
|
exports.default = PackWin;
|
|
343
343
|
async function signWindows(o, arch, config, windows) {
|
|
344
|
+
if (!windows) {
|
|
345
|
+
throw new Error('windows not set in oclif configuration');
|
|
346
|
+
}
|
|
344
347
|
const buildLocationUnsigned = o.replace(`${arch}.exe`, `${arch}-unsigned.exe`);
|
|
345
348
|
await (0, fs_extra_1.move)(o, buildLocationUnsigned);
|
|
346
349
|
const pass = config.scopedEnvVar('WINDOWS_SIGNING_PASS');
|
|
@@ -2,17 +2,17 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class Promote extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
channel: import("@oclif/core/
|
|
6
|
-
deb: import("@oclif/core/
|
|
7
|
-
indexes: import("@oclif/core/
|
|
8
|
-
macos: import("@oclif/core/
|
|
9
|
-
'max-age': import("@oclif/core/
|
|
10
|
-
root: import("@oclif/core/
|
|
11
|
-
sha: import("@oclif/core/
|
|
12
|
-
targets: import("@oclif/core/
|
|
13
|
-
version: import("@oclif/core/
|
|
14
|
-
win: import("@oclif/core/
|
|
15
|
-
xz: import("@oclif/core/
|
|
5
|
+
channel: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
deb: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
indexes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
macos: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
'max-age': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
sha: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
targets: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
win: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
xz: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
};
|
|
17
17
|
run(): Promise<void>;
|
|
18
18
|
}
|
|
@@ -2,7 +2,7 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class UploadDeb extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
root: import("@oclif/core/
|
|
5
|
+
root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
};
|
|
7
7
|
run(): Promise<void>;
|
|
8
8
|
}
|
|
@@ -2,8 +2,8 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
export default class UploadWin extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
root: import("@oclif/core/
|
|
6
|
-
targets: import("@oclif/core/
|
|
5
|
+
root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
targets: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<void>;
|
|
9
9
|
}
|
package/lib/generator.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare function exec(command: string, opts?: {
|
|
|
36
36
|
}>;
|
|
37
37
|
export declare function readPJSON(location: string): Promise<({
|
|
38
38
|
scripts: Record<string, string>;
|
|
39
|
-
} & Interfaces.PJSON
|
|
39
|
+
} & Interfaces.PJSON) | undefined>;
|
|
40
40
|
export declare function makeFlags<T extends Record<string, FlaggablePrompt>>(flaggablePrompts: T): FlagsOfPrompts<T>;
|
|
41
41
|
export declare abstract class GeneratorCommand<T extends typeof Command> extends Command {
|
|
42
42
|
protected args: Args<T>;
|
package/lib/generator.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GeneratorCommand = exports.makeFlags = exports.readPJSON = exports.exec = void 0;
|
|
7
|
-
/* eslint-disable unicorn/no-await-expression-member */
|
|
8
7
|
const core_1 = require("@oclif/core");
|
|
9
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
9
|
const ejs_1 = require("ejs");
|
|
@@ -17,7 +16,7 @@ async function exec(command, opts) {
|
|
|
17
16
|
const silent = opts ? opts.silent : true;
|
|
18
17
|
return new Promise((resolve, reject) => {
|
|
19
18
|
if (!silent)
|
|
20
|
-
core_1.ux.
|
|
19
|
+
core_1.ux.stdout(chalk_1.default.dim(command));
|
|
21
20
|
const p = (0, node_child_process_1.exec)(command, opts ?? {}, (err, stdout, stderr) => {
|
|
22
21
|
if (err)
|
|
23
22
|
return reject(err);
|
package/lib/log.js
CHANGED
|
@@ -31,6 +31,6 @@ exports.debug = require('debug')('oclif');
|
|
|
31
31
|
exports.debug.new = (name) => require('debug')(`oclif:${name}`);
|
|
32
32
|
function log(format, ...args) {
|
|
33
33
|
args = args.map((arg) => (0, util_1.prettifyPaths)(arg));
|
|
34
|
-
exports.debug.enabled ? (0, exports.debug)(format, ...args) : core_1.ux.
|
|
34
|
+
exports.debug.enabled ? (0, exports.debug)(format, ...args) : core_1.ux.stdout(`oclif: ${util.format(format, ...args)}`);
|
|
35
35
|
}
|
|
36
36
|
exports.log = log;
|
package/lib/readme-generator.js
CHANGED
|
@@ -179,7 +179,7 @@ class ReadmeGenerator {
|
|
|
179
179
|
if (readme.includes(`<!-- ${tag}stop -->`)) {
|
|
180
180
|
readme = readme.replace(new RegExp(`<!-- ${tag} -->(.|\n)*<!-- ${tag}stop -->`, 'm'), `<!-- ${tag} -->`);
|
|
181
181
|
}
|
|
182
|
-
core_1.ux.
|
|
182
|
+
core_1.ux.stdout(`replacing <!-- ${tag} --> in ${this.options.readmePath}`);
|
|
183
183
|
}
|
|
184
184
|
return readme.replace(`<!-- ${tag} -->`, `<!-- ${tag} -->\n${body}\n<!-- ${tag}stop -->`);
|
|
185
185
|
}
|
package/lib/tarballs/build.js
CHANGED
|
@@ -227,7 +227,7 @@ const buildTarget = async (target, c, options) => {
|
|
|
227
227
|
if (c.xz)
|
|
228
228
|
await pack(workspace, c.dist(xzLocalKey));
|
|
229
229
|
}
|
|
230
|
-
if (!c.updateConfig.s3
|
|
230
|
+
if (!c.updateConfig.s3?.host)
|
|
231
231
|
return;
|
|
232
232
|
const rollout = typeof c.updateConfig.autoupdate === 'object' && c.updateConfig.autoupdate.rollout;
|
|
233
233
|
const gzCloudKey = `${(0, upload_util_1.commitAWSDir)(version, sha, c.updateConfig.s3)}/${gzLocalKey}`;
|
package/lib/tarballs/config.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export type S3Config = {
|
|
|
10
10
|
export type UpdateConfig = {
|
|
11
11
|
s3?: {
|
|
12
12
|
acl?: ObjectCannedACL;
|
|
13
|
-
} &
|
|
14
|
-
} &
|
|
13
|
+
} & Interfaces.S3;
|
|
14
|
+
} & Interfaces.OclifConfiguration['update'];
|
|
15
15
|
export type BuildConfig = {
|
|
16
16
|
config: Interfaces.Config;
|
|
17
17
|
dist(input: string): string;
|
package/lib/tarballs/config.js
CHANGED
|
@@ -53,9 +53,9 @@ async function buildConfig(root, options = {}) {
|
|
|
53
53
|
const tmp = await Tmp(config);
|
|
54
54
|
const updateConfig = (config.pjson.oclif.update || {});
|
|
55
55
|
updateConfig.s3 = updateConfig.s3 || {};
|
|
56
|
-
const nodeVersion = updateConfig.node
|
|
57
|
-
const nodeOptions = (0, util_1.castArray)(updateConfig.node.options ?? []);
|
|
58
|
-
const targets = (0, util_1.compact)(options.targets || updateConfig.node
|
|
56
|
+
const nodeVersion = updateConfig.node?.version || process.versions.node;
|
|
57
|
+
const nodeOptions = (0, util_1.castArray)((updateConfig.node ?? {}).options ?? []);
|
|
58
|
+
const targets = (0, util_1.compact)(options.targets || updateConfig.node?.targets || exports.TARGETS)
|
|
59
59
|
.filter((t) => {
|
|
60
60
|
if (t === 'darwin-arm64' && semver.lt(nodeVersion, '16.0.0')) {
|
|
61
61
|
core_1.ux.warn('darwin-arm64 is only supported for node >=16.0.0. Skipping...');
|
package/lib/upload-util.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ type TemplateOptions = {
|
|
|
10
10
|
version?: string;
|
|
11
11
|
versionShaRevision?: string;
|
|
12
12
|
} | Interfaces.Config.s3Key.Options;
|
|
13
|
-
export declare function templateShortKey(type: 'deb' | 'macos' | 'win32' | keyof Interfaces.
|
|
13
|
+
export declare function templateShortKey(type: 'deb' | 'macos' | 'win32' | keyof Interfaces.S3Templates, options?: TemplateOptions): string;
|
|
14
14
|
export type DebArch = 'amd64' | 'arm64' | 'armel' | 'i386';
|
|
15
15
|
export declare function debArch(arch: Interfaces.ArchTypes): DebArch;
|
|
16
16
|
export declare function debVersion(buildConfig: TarballConfig): string;
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oclif",
|
|
3
3
|
"description": "oclif: create your own CLI",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.12.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bin": {
|
|
7
7
|
"oclif": "bin/run.js"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@inquirer/confirm": "^3.1.6",
|
|
14
14
|
"@inquirer/input": "^2.1.8",
|
|
15
15
|
"@inquirer/select": "^2.3.4",
|
|
16
|
-
"@oclif/core": "^
|
|
16
|
+
"@oclif/core": "^4.0.0-beta.12",
|
|
17
17
|
"@oclif/plugin-help": "^6.0.21",
|
|
18
18
|
"@oclif/plugin-not-found": "^3.1.10",
|
|
19
19
|
"@oclif/plugin-warn-if-update-available": "^3.0.19",
|