@oclif/core 1.2.0 → 1.3.2
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/CHANGELOG.md +28 -0
- package/lib/cli-ux/open.js +2 -2
- package/lib/cli-ux/prompt.js +1 -1
- package/lib/config/config.js +5 -1
- package/lib/config/plugin.js +1 -1
- package/lib/interfaces/hooks.d.ts +3 -1
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/interfaces/s3-manifest.d.ts +14 -0
- package/lib/interfaces/s3-manifest.js +2 -0
- package/lib/parser/parse.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.3.2](https://github.com/oclif/core/compare/v1.3.1...v1.3.2) (2022-02-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* fix default import of lodash ([#366](https://github.com/oclif/core/issues/366)) ([99fc7d1](https://github.com/oclif/core/commit/99fc7d1fdddbcd1509f649723057cd0ba7ee414c))
|
|
11
|
+
|
|
12
|
+
### [1.3.1](https://github.com/oclif/core/compare/v1.3.0...v1.3.1) (2022-02-07)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* Command parsing hangs under unit test ([#363](https://github.com/oclif/core/issues/363)) ([cb88427](https://github.com/oclif/core/commit/cb88427be5c1d5303b5cd7ef2d671f25ac6e91e6))
|
|
18
|
+
|
|
19
|
+
## [1.3.0](https://github.com/oclif/core/compare/v1.2.1...v1.3.0) (2022-02-01)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* add S3Manifest ([#354](https://github.com/oclif/core/issues/354)) ([ea5585d](https://github.com/oclif/core/commit/ea5585db6361f12c3c0608b05d1e33e16bc0b4b6))
|
|
25
|
+
|
|
26
|
+
### [1.2.1](https://github.com/oclif/core/compare/v1.2.0...v1.2.1) (2022-01-28)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* module resolution of linked plugins ([#352](https://github.com/oclif/core/issues/352)) ([c7f5d34](https://github.com/oclif/core/commit/c7f5d3439e7e60b6562362c87fe0d16a99a42a08))
|
|
32
|
+
|
|
5
33
|
## [1.2.0](https://github.com/oclif/core/compare/v1.1.2...v1.2.0) (2022-01-26)
|
|
6
34
|
|
|
7
35
|
|
package/lib/cli-ux/open.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
// this code is largely taken from opn
|
|
4
4
|
const childProcess = require("child_process");
|
|
5
|
-
const
|
|
5
|
+
const _ = require("lodash");
|
|
6
6
|
const isWsl = require('is-wsl');
|
|
7
7
|
function open(target, opts = {}) {
|
|
8
8
|
// opts = {wait: true, ...opts}
|
|
@@ -59,7 +59,7 @@ function open(target, opts = {}) {
|
|
|
59
59
|
return new Promise((resolve, reject) => {
|
|
60
60
|
cp.once('error', reject);
|
|
61
61
|
cp.once('close', code => {
|
|
62
|
-
if (
|
|
62
|
+
if (_.isNumber(code) && code > 0) {
|
|
63
63
|
reject(new Error('Exited with code ' + code));
|
|
64
64
|
return;
|
|
65
65
|
}
|
package/lib/cli-ux/prompt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.anykey = exports.confirm = exports.prompt = void 0;
|
|
4
|
-
const Errors = require("
|
|
4
|
+
const Errors = require("../errors");
|
|
5
5
|
const chalk = require("chalk");
|
|
6
6
|
const config_1 = require("./config");
|
|
7
7
|
const deps_1 = require("./deps");
|
package/lib/config/config.js
CHANGED
|
@@ -214,7 +214,11 @@ class Config {
|
|
|
214
214
|
debug('runCommand %s %o', id, argv);
|
|
215
215
|
const c = cachedCommand || this.findCommand(id);
|
|
216
216
|
if (!c) {
|
|
217
|
-
await this.runHook('command_not_found', { id, argv });
|
|
217
|
+
const hookResult = await this.runHook('command_not_found', { id, argv });
|
|
218
|
+
if (hookResult.successes[0]) {
|
|
219
|
+
const cmdResult = hookResult.successes[0].result;
|
|
220
|
+
return cmdResult;
|
|
221
|
+
}
|
|
218
222
|
throw new errors_1.CLIError(`command ${id} not found`);
|
|
219
223
|
}
|
|
220
224
|
const command = await c.load();
|
package/lib/config/plugin.js
CHANGED
|
@@ -78,7 +78,7 @@ async function findRoot(name, root) {
|
|
|
78
78
|
if (name) {
|
|
79
79
|
let pkgPath;
|
|
80
80
|
try {
|
|
81
|
-
pkgPath = (0, util_3.resolvePackage)(name, { paths: [
|
|
81
|
+
pkgPath = (0, util_3.resolvePackage)(name, { paths: [root] });
|
|
82
82
|
}
|
|
83
83
|
catch { }
|
|
84
84
|
return pkgPath ? findSourcesRoot(path.dirname(pkgPath)) : findRootLegacy(name, root);
|
|
@@ -32,12 +32,14 @@ export interface Hooks {
|
|
|
32
32
|
preupdate: {
|
|
33
33
|
options: {
|
|
34
34
|
channel: string;
|
|
35
|
+
version: string;
|
|
35
36
|
};
|
|
36
37
|
return: void;
|
|
37
38
|
};
|
|
38
39
|
update: {
|
|
39
40
|
options: {
|
|
40
41
|
channel: string;
|
|
42
|
+
version: string;
|
|
41
43
|
};
|
|
42
44
|
return: void;
|
|
43
45
|
};
|
|
@@ -46,7 +48,7 @@ export interface Hooks {
|
|
|
46
48
|
id: string;
|
|
47
49
|
argv?: string[];
|
|
48
50
|
};
|
|
49
|
-
return:
|
|
51
|
+
return: unknown;
|
|
50
52
|
};
|
|
51
53
|
'plugins:preinstall': {
|
|
52
54
|
options: {
|
|
@@ -5,6 +5,7 @@ export { OclifError, PrettyPrintableError } from './errors';
|
|
|
5
5
|
export { HelpOptions } from './help';
|
|
6
6
|
export { Hook, Hooks } from './hooks';
|
|
7
7
|
export { Manifest } from './manifest';
|
|
8
|
+
export { S3Manifest } from './s3-manifest';
|
|
8
9
|
export { ParserArg, Arg, ParseFn, ParserOutput, ParserInput, ArgToken, OptionalArg, FlagOutput, OutputArgs, OutputFlags, FlagUsageOptions, CLIParseErrorOptions, ArgInput, RequiredArg, Metadata, ParsingToken, FlagToken, List, ListItem, BooleanFlag, Flag, FlagBase, OptionFlag, Input, EnumFlagOptions, DefaultContext, Default, Definition, CompletableOptionFlag, Completion, CompletionContext, FlagInput, CompletableFlag, } from './parser';
|
|
9
10
|
export { PJSON } from './pjson';
|
|
10
11
|
export { Plugin, PluginOptions, Options } from './plugin';
|
package/lib/parser/parse.js
CHANGED