@oclif/core 3.3.2 → 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.
@@ -473,7 +473,14 @@ class Config {
473
473
  catch (error) {
474
474
  final.failures.push({ error: error, plugin: p });
475
475
  debug(error);
476
- if (!captureErrors && error.oclif?.exit !== undefined)
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({
@@ -110,6 +110,7 @@ class PluginLoader {
110
110
  if (typeof plugin !== 'string') {
111
111
  opts.tag = plugin.tag || opts.tag;
112
112
  opts.root = plugin.root || opts.root;
113
+ opts.url = plugin.url;
113
114
  }
114
115
  if (parent) {
115
116
  opts.parent = parent;
@@ -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
- if (settings_1.settings.tsnodeEnabled === undefined && isProduction && plugin?.type !== 'link') {
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
  *
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": "3.3.2",
4
+ "version": "3.3.3",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {