@oclif/core 1.9.9 → 1.11.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.11.0](https://github.com/oclif/core/compare/v1.10.0...v1.11.0) (2022-07-18)
6
+
7
+
8
+ ### Features
9
+
10
+ * print error info when module not found ([#427](https://github.com/oclif/core/issues/427)) ([223e79b](https://github.com/oclif/core/commit/223e79b363ad01da327e264244daf23810849d70))
11
+
12
+ ## [1.10.0](https://github.com/oclif/core/compare/v1.9.10...v1.10.0) (2022-07-15)
13
+
14
+
15
+ ### Features
16
+
17
+ * add stderr method ([#441](https://github.com/oclif/core/issues/441)) ([d9490f7](https://github.com/oclif/core/commit/d9490f77ff4cac0ee9767f1386f18c7357e0666e))
18
+
19
+ ### [1.9.10](https://github.com/oclif/core/compare/v1.9.9...v1.9.10) (2022-07-15)
20
+
5
21
  ### [1.9.9](https://github.com/oclif/core/compare/v1.9.8...v1.9.9) (2022-07-14)
6
22
 
7
23
 
package/lib/command.d.ts CHANGED
@@ -86,6 +86,7 @@ export default abstract class Command {
86
86
  exit?: number;
87
87
  } & PrettyPrintableError): never;
88
88
  log(message?: string, ...args: any[]): void;
89
+ logToStderr(message?: string, ...args: any[]): void;
89
90
  jsonEnabled(): boolean;
90
91
  /**
91
92
  * actual command run code goes here
package/lib/command.js CHANGED
@@ -91,11 +91,16 @@ class Command {
91
91
  }
92
92
  log(message = '', ...args) {
93
93
  if (!this.jsonEnabled()) {
94
- // tslint:disable-next-line strict-type-predicates
95
94
  message = typeof message === 'string' ? message : (0, util_1.inspect)(message);
96
95
  process.stdout.write((0, util_1.format)(message, ...args) + '\n');
97
96
  }
98
97
  }
98
+ logToStderr(message = '', ...args) {
99
+ if (!this.jsonEnabled()) {
100
+ message = typeof message === 'string' ? message : (0, util_1.inspect)(message);
101
+ process.stderr.write((0, util_1.format)(message, ...args) + '\n');
102
+ }
103
+ }
99
104
  jsonEnabled() {
100
105
  return this.ctor.enableJsonFlag && this.argv.includes('--json');
101
106
  }
@@ -82,7 +82,7 @@ class ModuleLoader {
82
82
  }
83
83
  catch (error) {
84
84
  if (error.code === 'MODULE_NOT_FOUND' || error.code === 'ERR_MODULE_NOT_FOUND') {
85
- throw new errors_1.ModuleLoadError(`${isESM ? 'import()' : 'require'} failed to load ${filePath || modulePath}`);
85
+ throw new errors_1.ModuleLoadError(`${isESM ? 'import()' : 'require'} failed to load ${filePath || modulePath}: ${error.message}`);
86
86
  }
87
87
  throw error;
88
88
  }
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": "1.9.9",
4
+ "version": "1.11.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {