@oclif/core 3.10.1 → 3.10.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/lib/config/ts-node.js +2 -4
- package/lib/util/fs.js +2 -1
- package/lib/util/util.d.ts +1 -0
- package/lib/util/util.js +8 -1
- package/package.json +1 -1
package/lib/config/ts-node.js
CHANGED
|
@@ -179,12 +179,10 @@ async function tsPath(root, orig, plugin) {
|
|
|
179
179
|
debug(`Skipping ts-node registration for ${root} because it's an ESM module (NODE_ENV: ${process.env.NODE_ENV}, root plugin module type: ${rootPlugin?.moduleType})))`);
|
|
180
180
|
if (plugin?.type === 'link')
|
|
181
181
|
(0, errors_1.memoizedWarn)(`${plugin?.name} is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.`);
|
|
182
|
-
if (plugin?.options.url)
|
|
183
|
-
(0, errors_1.memoizedWarn)(`${plugin?.name} is an ESM module installed from github and cannot be auto-transpiled. Existing compiled source will be used instead.`);
|
|
184
182
|
return orig;
|
|
185
183
|
}
|
|
186
|
-
// Do not skip ts-node registration if the plugin is linked
|
|
187
|
-
if (settings_1.settings.tsnodeEnabled === undefined && isProduction && plugin?.type !== 'link'
|
|
184
|
+
// Do not skip ts-node registration if the plugin is linked
|
|
185
|
+
if (settings_1.settings.tsnodeEnabled === undefined && isProduction && plugin?.type !== 'link') {
|
|
188
186
|
debug(`Skipping ts-node registration for ${root} because NODE_ENV is NOT "test" or "development"`);
|
|
189
187
|
return orig;
|
|
190
188
|
}
|
package/lib/util/fs.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.readTSConfig = exports.existsSync = exports.safeReadJson = exports.readJ
|
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const promises_1 = require("node:fs/promises");
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
|
+
const util_1 = require("./util");
|
|
7
8
|
function requireJson(...pathParts) {
|
|
8
9
|
return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(...pathParts), 'utf8'));
|
|
9
10
|
}
|
|
@@ -72,7 +73,7 @@ exports.existsSync = existsSync;
|
|
|
72
73
|
async function readTSConfig(path) {
|
|
73
74
|
const { parse } = await import('tsconfck');
|
|
74
75
|
const result = await parse(path);
|
|
75
|
-
const tsNodeOpts =
|
|
76
|
+
const tsNodeOpts = (0, util_1.mergeNestedObjects)(result.extended ?? [result], 'tsconfig.ts-node');
|
|
76
77
|
return { ...result.tsconfig, 'ts-node': tsNodeOpts };
|
|
77
78
|
}
|
|
78
79
|
exports.readTSConfig = readTSConfig;
|
package/lib/util/util.d.ts
CHANGED
|
@@ -19,4 +19,5 @@ export declare function mapValues<T extends Record<string, any>, TResult>(obj: {
|
|
|
19
19
|
}, fn: (i: T[keyof T], k: keyof T) => TResult): {
|
|
20
20
|
[P in keyof T]: TResult;
|
|
21
21
|
};
|
|
22
|
+
export declare function mergeNestedObjects(objs: Record<string, any>[], path: string): Record<string, any>;
|
|
22
23
|
export {};
|
package/lib/util/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapValues = exports.uniq = exports.isNotFalsy = exports.isTruthy = exports.capitalize = exports.sumBy = exports.maxBy = exports.isProd = exports.castArray = exports.sortBy = exports.last = exports.uniqBy = exports.compact = exports.pickBy = void 0;
|
|
3
|
+
exports.mergeNestedObjects = exports.mapValues = exports.uniq = exports.isNotFalsy = exports.isTruthy = exports.capitalize = exports.sumBy = exports.maxBy = exports.isProd = exports.castArray = exports.sortBy = exports.last = exports.uniqBy = exports.compact = exports.pickBy = void 0;
|
|
4
4
|
function pickBy(obj, fn) {
|
|
5
5
|
return Object.entries(obj).reduce((o, [k, v]) => {
|
|
6
6
|
if (fn(v))
|
|
@@ -96,3 +96,10 @@ function mapValues(obj, fn) {
|
|
|
96
96
|
}, {});
|
|
97
97
|
}
|
|
98
98
|
exports.mapValues = mapValues;
|
|
99
|
+
function get(obj, path) {
|
|
100
|
+
return path.split('.').reduce((o, p) => o?.[p], obj);
|
|
101
|
+
}
|
|
102
|
+
function mergeNestedObjects(objs, path) {
|
|
103
|
+
return Object.fromEntries(objs.flatMap((o) => Object.entries(get(o, path) ?? {})).reverse());
|
|
104
|
+
}
|
|
105
|
+
exports.mergeNestedObjects = mergeNestedObjects;
|