@oclif/core 3.3.3-dev.0 → 3.3.3
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/config.js
CHANGED
|
@@ -473,7 +473,14 @@ class Config {
|
|
|
473
473
|
catch (error) {
|
|
474
474
|
final.failures.push({ error: error, plugin: p });
|
|
475
475
|
debug(error);
|
|
476
|
-
|
|
476
|
+
// Do not throw the error if
|
|
477
|
+
// captureErrors is set to true
|
|
478
|
+
// error.oclif.exit is undefined or 0
|
|
479
|
+
// error.code is MODULE_NOT_FOUND
|
|
480
|
+
if (!captureErrors &&
|
|
481
|
+
error.oclif?.exit !== undefined &&
|
|
482
|
+
error.oclif?.exit !== 0 &&
|
|
483
|
+
error.code !== 'MODULE_NOT_FOUND')
|
|
477
484
|
throw error;
|
|
478
485
|
}
|
|
479
486
|
marker?.addDetails({
|
|
@@ -680,15 +687,6 @@ class Config {
|
|
|
680
687
|
insertLegacyPlugins(plugins) {
|
|
681
688
|
for (const plugin of plugins) {
|
|
682
689
|
this.plugins.set(plugin.name, plugin);
|
|
683
|
-
// Delete all commands from the legacy plugin so that we can re-add them.
|
|
684
|
-
// This is necessary because this.determinePriority will pick the initial
|
|
685
|
-
// command that was added, which won't have been converted by PluginLegacy yet.
|
|
686
|
-
for (const cmd of plugin.commands ?? []) {
|
|
687
|
-
this._commands.delete(cmd.id);
|
|
688
|
-
for (const alias of [...(cmd.aliases ?? []), ...(cmd.hiddenAliases ?? [])]) {
|
|
689
|
-
this._commands.delete(alias);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
690
|
this.loadCommands(plugin);
|
|
693
691
|
}
|
|
694
692
|
}
|
package/lib/config/ts-node.js
CHANGED
|
@@ -176,7 +176,7 @@ function determinePath(root, orig) {
|
|
|
176
176
|
return orig;
|
|
177
177
|
}
|
|
178
178
|
function tsPath(root, orig, plugin) {
|
|
179
|
-
const rootPlugin = cache_1.default.getInstance().get('rootPlugin');
|
|
179
|
+
const rootPlugin = plugin?.options.isRoot ? plugin : cache_1.default.getInstance().get('rootPlugin');
|
|
180
180
|
if (!orig)
|
|
181
181
|
return orig;
|
|
182
182
|
orig = orig.startsWith(root) ? orig : (0, node_path_1.join)(root, orig);
|
|
@@ -190,9 +190,12 @@ function tsPath(root, orig, plugin) {
|
|
|
190
190
|
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})))`);
|
|
191
191
|
if (plugin?.type === 'link')
|
|
192
192
|
(0, errors_1.memoizedWarn)(`${plugin?.name} is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.`);
|
|
193
|
+
if (plugin?.options.url)
|
|
194
|
+
(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.`);
|
|
193
195
|
return orig;
|
|
194
196
|
}
|
|
195
|
-
|
|
197
|
+
// Do not skip ts-node registration if the plugin is linked or installed from github
|
|
198
|
+
if (settings_1.settings.tsnodeEnabled === undefined && isProduction && plugin?.type !== 'link' && !plugin?.options.url) {
|
|
196
199
|
debug(`Skipping ts-node registration for ${root} because NODE_ENV is NOT "test" or "development"`);
|
|
197
200
|
return orig;
|
|
198
201
|
}
|
|
@@ -13,6 +13,7 @@ export interface PluginOptions {
|
|
|
13
13
|
root: string;
|
|
14
14
|
tag?: string;
|
|
15
15
|
type?: string;
|
|
16
|
+
url?: string;
|
|
16
17
|
}
|
|
17
18
|
export interface Options extends PluginOptions {
|
|
18
19
|
channel?: string;
|
|
@@ -57,6 +58,7 @@ export interface Plugin {
|
|
|
57
58
|
* name from package.json
|
|
58
59
|
*/
|
|
59
60
|
name: string;
|
|
61
|
+
readonly options: Options;
|
|
60
62
|
/**
|
|
61
63
|
* full package.json
|
|
62
64
|
*
|