@oclif/core 3.25.0 → 3.25.1

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.
@@ -291,7 +291,7 @@ class Plugin {
291
291
  return manifest;
292
292
  }
293
293
  addErrorScope(err, scope) {
294
- err.name = `${err.name} Plugin: ${this.name}`;
294
+ err.name = err.name ?? (0, node_util_1.inspect)(err).trim();
295
295
  err.detail = (0, util_1.compact)([
296
296
  err.detail,
297
297
  `module: ${this._base}`,
@@ -368,7 +368,8 @@ class Plugin {
368
368
  warn(err, scope) {
369
369
  if (typeof err === 'string')
370
370
  err = new Error(err);
371
- process.emitWarning(this.addErrorScope(err, scope));
371
+ const warning = this.addErrorScope(err, scope);
372
+ process.emitWarning(warning.name, warning);
372
373
  }
373
374
  }
374
375
  exports.Plugin = Plugin;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.tsPath = exports.TS_CONFIGS = void 0;
7
+ const promises_1 = require("node:fs/promises");
7
8
  const node_path_1 = require("node:path");
8
9
  const cache_1 = __importDefault(require("../cache"));
9
10
  const warn_1 = require("../errors/warn");
@@ -200,8 +201,20 @@ async function determinePath(root, orig) {
200
201
  // In that case we attempt to resolve to the filename. If it fails it will revert back to the lib path
201
202
  debug(`lib dir: ${lib}`);
202
203
  debug(`src dir: ${src}`);
203
- debug(`src commands dir: ${out}`);
204
- if ((0, fs_1.existsSync)(out) || (0, fs_1.existsSync)(out + '.ts')) {
204
+ debug(`src directory to find: ${out}`);
205
+ if ((0, fs_1.existsSync)(out)) {
206
+ debug(`Found source directory for ${orig} at ${out}`);
207
+ return out;
208
+ }
209
+ const sourceFiles = await Promise.all([
210
+ (0, promises_1.access)(`${out}.ts`)
211
+ .then(() => `${out}.ts`)
212
+ .catch(() => false),
213
+ (0, promises_1.access)(`${out}.tsx`)
214
+ .then(() => `${out}.tsx`)
215
+ .catch(() => false),
216
+ ]);
217
+ if (sourceFiles.some(Boolean)) {
205
218
  debug(`Found source file for ${orig} at ${out}`);
206
219
  return out;
207
220
  }
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.25.0",
4
+ "version": "3.25.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {