@oclif/core 4.0.0-beta.10 → 4.0.0-beta.11
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/interfaces/index.d.ts +1 -1
- package/lib/interfaces/pjson.d.ts +1 -4
- package/lib/parser/parse.js +1 -3
- package/lib/util/fs.js +10 -1
- package/package.json +1 -1
|
@@ -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 { OclifConfiguration, PJSON, S3, S3Templates, UserPJSON } from './pjson';
|
|
11
|
+
export type { LinkedPlugin, OclifConfiguration, PJSON, S3, S3Templates, UserPJSON, UserPlugin } 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';
|
|
@@ -279,12 +279,9 @@ export type LinkedPlugin = {
|
|
|
279
279
|
root: string;
|
|
280
280
|
type: 'link';
|
|
281
281
|
};
|
|
282
|
-
export type PluginTypes = {
|
|
283
|
-
root: string;
|
|
284
|
-
} | UserPlugin | LinkedPlugin;
|
|
285
282
|
export type UserPJSON = {
|
|
286
283
|
oclif: {
|
|
287
|
-
plugins?:
|
|
284
|
+
plugins?: (UserPlugin | LinkedPlugin)[];
|
|
288
285
|
};
|
|
289
286
|
private?: boolean;
|
|
290
287
|
};
|
package/lib/parser/parse.js
CHANGED
|
@@ -315,9 +315,7 @@ class Parser {
|
|
|
315
315
|
.map(async (v) => parseFlagOrThrowError(v, i.inputFlag.flag, this.context, {
|
|
316
316
|
...(0, util_1.last)(i.tokens),
|
|
317
317
|
input: v,
|
|
318
|
-
}))))
|
|
319
|
-
// eslint-disable-next-line unicorn/no-await-expression-member
|
|
320
|
-
.map((v) => validateOptions(i.inputFlag.flag, v)),
|
|
318
|
+
})))).map((v) => validateOptions(i.inputFlag.flag, v)),
|
|
321
319
|
};
|
|
322
320
|
}
|
|
323
321
|
// multiple in the oclif-core style
|
package/lib/util/fs.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.existsSync = exports.safeReadJson = exports.readJsonSync = exports.readJson = exports.fileExists = exports.dirExists = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const util_1 = require("./util");
|
|
6
7
|
/**
|
|
7
8
|
* Parser for Args.directory and Flags.directory. Checks that the provided path
|
|
8
9
|
* exists and is a directory.
|
|
@@ -43,7 +44,15 @@ const fileExists = async (input) => {
|
|
|
43
44
|
return input;
|
|
44
45
|
};
|
|
45
46
|
exports.fileExists = fileExists;
|
|
46
|
-
|
|
47
|
+
class ProdOnlyCache extends Map {
|
|
48
|
+
set(key, value) {
|
|
49
|
+
if ((0, util_1.isProd)() ?? false) {
|
|
50
|
+
super.set(key, value);
|
|
51
|
+
}
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const cache = new ProdOnlyCache();
|
|
47
56
|
async function readJson(path) {
|
|
48
57
|
if (cache.has(path)) {
|
|
49
58
|
return JSON.parse(cache.get(path));
|