@oclif/core 4.0.3 → 4.0.5
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/util/read-pjson.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PJSON } from '../interfaces';
|
|
2
2
|
/**
|
|
3
|
-
* Read the package.json file from a given path and add the oclif config (found by
|
|
3
|
+
* Read the package.json file from a given path and add the oclif config (found by lilconfig) if it exists.
|
|
4
4
|
*
|
|
5
5
|
* We can assume that the package.json file exists because the plugin root has already been loaded at this point.
|
|
6
6
|
*/
|
package/lib/util/read-pjson.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readPjson = void 0;
|
|
4
|
-
const
|
|
4
|
+
const lilconfig_1 = require("lilconfig");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const logger_1 = require("../logger");
|
|
7
7
|
const fs_1 = require("./fs");
|
|
8
8
|
const debug = (0, logger_1.makeDebug)('read-pjson');
|
|
9
9
|
/**
|
|
10
|
-
* Read the package.json file from a given path and add the oclif config (found by
|
|
10
|
+
* Read the package.json file from a given path and add the oclif config (found by lilconfig) if it exists.
|
|
11
11
|
*
|
|
12
12
|
* We can assume that the package.json file exists because the plugin root has already been loaded at this point.
|
|
13
13
|
*/
|
|
@@ -18,13 +18,13 @@ async function readPjson(path) {
|
|
|
18
18
|
return (0, fs_1.readJson)(pjsonPath);
|
|
19
19
|
}
|
|
20
20
|
const pjson = await (0, fs_1.readJson)(pjsonPath);
|
|
21
|
-
// don't bother with
|
|
21
|
+
// don't bother with lilconfig if the plugin's package.json already has an oclif config
|
|
22
22
|
if (pjson.oclif) {
|
|
23
23
|
debug(`found oclif config in ${pjsonPath}`);
|
|
24
24
|
return pjson;
|
|
25
25
|
}
|
|
26
26
|
debug(`searching for oclif config in ${path}`);
|
|
27
|
-
const explorer = (0,
|
|
27
|
+
const explorer = (0, lilconfig_1.lilconfig)('oclif', {
|
|
28
28
|
/**
|
|
29
29
|
* Remove the following from the defaults:
|
|
30
30
|
* - package.json
|
|
@@ -33,18 +33,14 @@ async function readPjson(path) {
|
|
|
33
33
|
searchPlaces: [
|
|
34
34
|
'.oclifrc',
|
|
35
35
|
'.oclifrc.json',
|
|
36
|
-
'.oclifrc.yaml',
|
|
37
|
-
'.oclifrc.yml',
|
|
38
36
|
'.oclifrc.js',
|
|
39
|
-
'.oclifrc.ts',
|
|
40
37
|
'.oclifrc.mjs',
|
|
41
38
|
'.oclifrc.cjs',
|
|
42
39
|
'oclif.config.js',
|
|
43
|
-
'oclif.config.ts',
|
|
44
40
|
'oclif.config.mjs',
|
|
45
41
|
'oclif.config.cjs',
|
|
46
42
|
],
|
|
47
|
-
|
|
43
|
+
stopDir: path,
|
|
48
44
|
});
|
|
49
45
|
const result = await explorer.search(path);
|
|
50
46
|
if (!result?.config) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/core",
|
|
3
3
|
"description": "base library for oclif CLIs",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.5",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/core/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"ansis": "^3.1.1",
|
|
10
10
|
"clean-stack": "^3.0.1",
|
|
11
11
|
"cli-spinners": "^2.9.2",
|
|
12
|
-
"cosmiconfig": "^9.0.0",
|
|
13
12
|
"debug": "^4.3.5",
|
|
14
13
|
"ejs": "^3.1.10",
|
|
15
14
|
"get-package-type": "^0.1.0",
|
|
16
15
|
"globby": "^11.1.0",
|
|
17
16
|
"indent-string": "^4.0.0",
|
|
18
17
|
"is-wsl": "^2.2.0",
|
|
18
|
+
"lilconfig": "^3.1.2",
|
|
19
19
|
"minimatch": "^9.0.4",
|
|
20
20
|
"string-width": "^4.2.3",
|
|
21
21
|
"supports-color": "^8",
|