@oclif/core 3.9.2 → 3.10.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.
@@ -8,7 +8,9 @@ export declare class Plugin implements IPlugin {
8
8
  alias: string;
9
9
  alreadyLoaded: boolean;
10
10
  children: Plugin[];
11
+ commandIDs: string[];
11
12
  commands: Command.Loadable[];
13
+ commandsDir: string | undefined;
12
14
  hasManifest: boolean;
13
15
  hooks: {
14
16
  [k: string]: string[];
@@ -26,12 +28,9 @@ export declare class Plugin implements IPlugin {
26
28
  version: string;
27
29
  protected warned: boolean;
28
30
  _base: string;
29
- private _commandsDir;
30
31
  protected _debug: (..._: any) => void;
31
32
  private flexibleTaxonomy;
32
33
  constructor(options: PluginOptions);
33
- get commandIDs(): string[];
34
- get commandsDir(): string | undefined;
35
34
  get topics(): Topic[];
36
35
  findCommand(id: string, opts: {
37
36
  must: true;
@@ -42,5 +41,7 @@ export declare class Plugin implements IPlugin {
42
41
  load(): Promise<void>;
43
42
  private _manifest;
44
43
  private addErrorScope;
44
+ private getCommandIDs;
45
+ private getCommandsDir;
45
46
  private warn;
46
47
  }
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.Plugin = void 0;
4
- const globby_1 = require("globby");
7
+ const globby_1 = __importDefault(require("globby"));
5
8
  const node_path_1 = require("node:path");
6
9
  const node_util_1 = require("node:util");
7
10
  const errors_1 = require("../errors");
@@ -34,12 +37,27 @@ const search = (cmd) => {
34
37
  return cmd.default;
35
38
  return Object.values(cmd).find((cmd) => typeof cmd.run === 'function');
36
39
  };
40
+ const GLOB_PATTERNS = [
41
+ '**/*.+(js|cjs|mjs|ts|tsx|mts|cts)',
42
+ '!**/*.+(d.ts|test.ts|test.js|spec.ts|spec.js|d.mts|d.cts)?(x)',
43
+ ];
44
+ function processCommandIds(files) {
45
+ return files.map((file) => {
46
+ const p = (0, node_path_1.parse)(file);
47
+ const topics = p.dir.split('/');
48
+ const command = p.name !== 'index' && p.name;
49
+ const id = [...topics, command].filter(Boolean).join(':');
50
+ return id === '' ? '.' : id;
51
+ });
52
+ }
37
53
  class Plugin {
38
54
  options;
39
55
  alias;
40
56
  alreadyLoaded = false;
41
57
  children = [];
58
+ commandIDs = [];
42
59
  commands;
60
+ commandsDir;
43
61
  hasManifest = false;
44
62
  hooks;
45
63
  isRoot = false;
@@ -55,40 +73,12 @@ class Plugin {
55
73
  version;
56
74
  warned = false;
57
75
  _base = `${_pjson.name}@${_pjson.version}`;
58
- _commandsDir;
59
76
  // eslint-disable-next-line new-cap
60
77
  _debug = (0, util_2.Debug)();
61
78
  flexibleTaxonomy;
62
79
  constructor(options) {
63
80
  this.options = options;
64
81
  }
65
- get commandIDs() {
66
- if (!this.commandsDir)
67
- return [];
68
- const marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `plugin.commandIDs#${this.name}`, { plugin: this.name });
69
- this._debug(`loading IDs from ${this.commandsDir}`);
70
- const patterns = [
71
- '**/*.+(js|cjs|mjs|ts|tsx|mts|cts)',
72
- '!**/*.+(d.ts|test.ts|test.js|spec.ts|spec.js|d.mts|d.cts)?(x)',
73
- ];
74
- const ids = (0, globby_1.sync)(patterns, { cwd: this.commandsDir }).map((file) => {
75
- const p = (0, node_path_1.parse)(file);
76
- const topics = p.dir.split('/');
77
- const command = p.name !== 'index' && p.name;
78
- const id = [...topics, command].filter(Boolean).join(':');
79
- return id === '' ? '.' : id;
80
- });
81
- this._debug('found commands', ids);
82
- marker?.addDetails({ count: ids.length });
83
- marker?.stop();
84
- return ids;
85
- }
86
- get commandsDir() {
87
- if (this._commandsDir)
88
- return this._commandsDir;
89
- this._commandsDir = (0, ts_node_1.tsPath)(this.root, this.pjson.oclif.commands, this);
90
- return this._commandsDir;
91
- }
92
82
  get topics() {
93
83
  return topicsToArray(this.pjson.oclif.topics || {});
94
84
  }
@@ -131,7 +121,7 @@ class Plugin {
131
121
  return cmd;
132
122
  }
133
123
  async load() {
134
- this.type = this.options.type || 'core';
124
+ this.type = this.options.type ?? 'core';
135
125
  this.tag = this.options.tag;
136
126
  this.isRoot = this.options.isRoot ?? false;
137
127
  if (this.options.parent)
@@ -143,7 +133,7 @@ class Plugin {
143
133
  if (!root)
144
134
  throw new errors_1.CLIError(`could not find package.json with ${(0, node_util_1.inspect)(this.options)}`);
145
135
  this.root = root;
146
- this._debug('reading %s plugin %s', this.type, root);
136
+ this._debug(`loading ${this.type} plugin from ${root}`);
147
137
  this.pjson = await (0, fs_1.readJson)((0, node_path_1.join)(root, 'package.json'));
148
138
  this.flexibleTaxonomy = this.options?.flexibleTaxonomy || this.pjson.oclif?.flexibleTaxonomy || false;
149
139
  this.moduleType = this.pjson.type === 'module' ? 'module' : 'commonjs';
@@ -163,7 +153,12 @@ class Plugin {
163
153
  else {
164
154
  this.pjson.oclif = this.pjson['cli-engine'] || {};
165
155
  }
166
- this.hooks = (0, util_1.mapValues)(this.pjson.oclif.hooks ?? {}, (i) => (0, util_1.castArray)(i).map((i) => (0, ts_node_1.tsPath)(this.root, i, this)));
156
+ this.commandsDir = await this.getCommandsDir();
157
+ this.commandIDs = await this.getCommandIDs();
158
+ this.hooks = Object.fromEntries(await Promise.all(Object.entries(this.pjson.oclif.hooks ?? {}).map(async ([k, v]) => [
159
+ k,
160
+ await Promise.all((0, util_1.castArray)(v).map(async (i) => (0, ts_node_1.tsPath)(this.root, i, this))),
161
+ ])));
167
162
  this.manifest = await this._manifest();
168
163
  this.commands = Object.entries(this.manifest.commands)
169
164
  .map(([id, c]) => ({
@@ -253,6 +248,21 @@ class Plugin {
253
248
  ]).join('\n');
254
249
  return err;
255
250
  }
251
+ async getCommandIDs() {
252
+ if (!this.commandsDir)
253
+ return [];
254
+ const marker = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `plugin.getCommandIDs#${this.name}`, { plugin: this.name });
255
+ this._debug(`loading IDs from ${this.commandsDir}`);
256
+ const files = await (0, globby_1.default)(GLOB_PATTERNS, { cwd: this.commandsDir });
257
+ const ids = processCommandIds(files);
258
+ this._debug('found commands', ids);
259
+ marker?.addDetails({ count: ids.length });
260
+ marker?.stop();
261
+ return ids;
262
+ }
263
+ async getCommandsDir() {
264
+ return (0, ts_node_1.tsPath)(this.root, this.pjson.oclif.commands, this);
265
+ }
256
266
  warn(err, scope) {
257
267
  if (this.warned)
258
268
  return;
@@ -5,5 +5,5 @@ export declare const TS_CONFIGS: Record<string, TSConfig>;
5
5
  * this is for developing typescript plugins/CLIs
6
6
  * if there is a tsconfig and the original sources exist, it attempts to require ts-node
7
7
  */
8
- export declare function tsPath(root: string, orig: string, plugin: Plugin): string;
9
- export declare function tsPath(root: string, orig: string | undefined, plugin?: Plugin): string | undefined;
8
+ export declare function tsPath(root: string, orig: string, plugin: Plugin): Promise<string>;
9
+ export declare function tsPath(root: string, orig: string | undefined, plugin?: Plugin): Promise<string | undefined>;
@@ -15,36 +15,32 @@ const util_2 = require("./util");
15
15
  const debug = (0, util_2.Debug)('ts-node');
16
16
  exports.TS_CONFIGS = {};
17
17
  const REGISTERED = new Set();
18
- function loadTSConfig(root) {
19
- if (exports.TS_CONFIGS[root])
20
- return exports.TS_CONFIGS[root];
21
- const tsconfigPath = (0, node_path_1.join)(root, 'tsconfig.json');
22
- let typescript;
18
+ async function loadTSConfig(root) {
23
19
  try {
24
- typescript = require('typescript');
25
- }
26
- catch {
27
- try {
28
- typescript = require(require.resolve('typescript', { paths: [root, __dirname] }));
29
- }
30
- catch {
31
- debug(`Could not find typescript dependency. Skipping ts-node registration for ${root}.`);
32
- (0, errors_1.memoizedWarn)('Could not find typescript. Please ensure that typescript is a devDependency. Falling back to compiled source.');
20
+ if (exports.TS_CONFIGS[root])
21
+ return exports.TS_CONFIGS[root];
22
+ const tsconfigPath = (0, node_path_1.join)(root, 'tsconfig.json');
23
+ const tsconfig = await (0, fs_1.readJson)(tsconfigPath);
24
+ if (!tsconfig || Object.keys(tsconfig.compilerOptions).length === 0)
33
25
  return;
26
+ exports.TS_CONFIGS[root] = tsconfig;
27
+ if (tsconfig.extends) {
28
+ const { parse } = await import('tsconfck');
29
+ const result = await parse(tsconfigPath);
30
+ const tsNodeOpts = Object.fromEntries((result.extended ?? []).flatMap((e) => Object.entries(e.tsconfig['ts-node'] ?? {})).reverse());
31
+ exports.TS_CONFIGS[root] = { ...result.tsconfig, 'ts-node': tsNodeOpts };
34
32
  }
33
+ return exports.TS_CONFIGS[root];
35
34
  }
36
- if ((0, fs_1.existsSync)(tsconfigPath) && typescript) {
37
- const tsconfig = typescript.parseConfigFileTextToJson(tsconfigPath, (0, fs_1.readJsonSync)(tsconfigPath, false)).config;
38
- if (!tsconfig || !tsconfig.compilerOptions) {
39
- throw new Error(`Could not read and parse tsconfig.json at ${tsconfigPath}, or it ` +
40
- 'did not contain a "compilerOptions" section.');
35
+ catch (error) {
36
+ if (error instanceof SyntaxError) {
37
+ debug(`Could not parse tsconfig.json. Skipping ts-node registration for ${root}.`);
38
+ (0, errors_1.memoizedWarn)(`Could not parse tsconfig.json for ${root}. Falling back to compiled source.`);
41
39
  }
42
- exports.TS_CONFIGS[root] = tsconfig;
43
- return tsconfig;
44
40
  }
45
41
  }
46
- function registerTSNode(root) {
47
- const tsconfig = loadTSConfig(root);
42
+ async function registerTSNode(root) {
43
+ const tsconfig = await loadTSConfig(root);
48
44
  if (!tsconfig)
49
45
  return;
50
46
  if (REGISTERED.has(root))
@@ -71,24 +67,24 @@ function registerTSNode(root) {
71
67
  else if (tsconfig.compilerOptions.rootDir) {
72
68
  rootDirs.push((0, node_path_1.join)(root, tsconfig.compilerOptions.rootDir));
73
69
  }
70
+ else if (tsconfig.compilerOptions.baseUrl) {
71
+ rootDirs.push((0, node_path_1.join)(root, tsconfig.compilerOptions.baseUrl));
72
+ }
74
73
  else {
75
74
  rootDirs.push((0, node_path_1.join)(root, 'src'));
76
75
  }
76
+ // Because we need to provide a modified `rootDirs` to ts-node, we need to
77
+ // remove `baseUrl` and `rootDir` from `compilerOptions` so that they
78
+ // don't conflict.
79
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
80
+ const { baseUrl, rootDir, ...rest } = tsconfig.compilerOptions;
77
81
  const conf = {
78
82
  compilerOptions: {
79
- emitDecoratorMetadata: tsconfig.compilerOptions.emitDecoratorMetadata ?? false,
80
- esModuleInterop: tsconfig.compilerOptions.esModuleInterop,
81
- experimentalDecorators: tsconfig.compilerOptions.experimentalDecorators ?? false,
82
- module: tsconfig.compilerOptions.module ?? 'commonjs',
83
+ ...rest,
83
84
  rootDirs,
84
- sourceMap: tsconfig.compilerOptions.sourceMap ?? true,
85
- target: tsconfig.compilerOptions.target ?? 'es2019',
86
85
  typeRoots,
87
- ...(tsconfig.compilerOptions.moduleResolution
88
- ? { moduleResolution: tsconfig.compilerOptions.moduleResolution }
89
- : {}),
90
- ...(tsconfig.compilerOptions.jsx ? { jsx: tsconfig.compilerOptions.jsx } : {}),
91
86
  },
87
+ ...tsconfig['ts-node'],
92
88
  cwd: root,
93
89
  esm: tsconfig['ts-node']?.esm ?? true,
94
90
  experimentalSpecifierResolution: tsconfig['ts-node']?.experimentalSpecifierResolution ?? 'explicit',
@@ -99,7 +95,8 @@ function registerTSNode(root) {
99
95
  };
100
96
  tsNode.register(conf);
101
97
  REGISTERED.add(root);
102
- debug('%O', tsconfig);
98
+ debug('tsconfig: %O', tsconfig);
99
+ debug('ts-node options: %O', conf);
103
100
  return tsconfig;
104
101
  }
105
102
  /**
@@ -136,8 +133,8 @@ function cannotUseTsNode(root, plugin, isProduction) {
136
133
  /**
137
134
  * Determine the path to the source file from the compiled ./lib files
138
135
  */
139
- function determinePath(root, orig) {
140
- const tsconfig = registerTSNode(root);
136
+ async function determinePath(root, orig) {
137
+ const tsconfig = await registerTSNode(root);
141
138
  if (!tsconfig)
142
139
  return orig;
143
140
  debug(`determining path for ${orig}`);
@@ -174,7 +171,7 @@ function determinePath(root, orig) {
174
171
  (0, errors_1.memoizedWarn)(`Could not find source for ${orig} based on tsconfig. Defaulting to compiled source.`);
175
172
  return orig;
176
173
  }
177
- function tsPath(root, orig, plugin) {
174
+ async function tsPath(root, orig, plugin) {
178
175
  const rootPlugin = plugin?.options.isRoot ? plugin : cache_1.default.getInstance().get('rootPlugin');
179
176
  if (!orig)
180
177
  return orig;
@@ -204,7 +201,7 @@ function tsPath(root, orig, plugin) {
204
201
  return orig;
205
202
  }
206
203
  try {
207
- return determinePath(root, orig);
204
+ return await determinePath(root, orig);
208
205
  }
209
206
  catch (error) {
210
207
  debug(error);
@@ -22,8 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.Logger = exports.memoizedWarn = exports.warn = exports.error = exports.exit = exports.handle = exports.ModuleLoadError = exports.ExitError = exports.CLIError = exports.config = void 0;
30
+ const write_1 = __importDefault(require("../cli-ux/write"));
27
31
  const config_1 = require("./config");
28
32
  const cli_1 = require("./errors/cli");
29
33
  const exit_1 = require("./errors/exit");
@@ -56,7 +60,8 @@ function error(input, options = {}) {
56
60
  err = (0, pretty_print_1.applyPrettyPrintOptions)(err, options);
57
61
  if (options.exit === false) {
58
62
  const message = (0, pretty_print_1.default)(err);
59
- console.error(message);
63
+ if (message)
64
+ write_1.default.stderr(message + '\n');
60
65
  if (config_1.config.errorLogger)
61
66
  config_1.config.errorLogger.log(err?.stack ?? '');
62
67
  }
@@ -76,7 +81,8 @@ function warn(input) {
76
81
  throw new TypeError('first argument must be a string or instance of Error');
77
82
  }
78
83
  const message = (0, pretty_print_1.default)(err);
79
- console.error(message);
84
+ if (message)
85
+ write_1.default.stderr(message + '\n');
80
86
  if (config_1.config.errorLogger)
81
87
  config_1.config.errorLogger.log(err?.stack ?? '');
82
88
  }
@@ -35,6 +35,7 @@ export interface Plugin {
35
35
  alias: string;
36
36
  readonly commandIDs: string[];
37
37
  commands: Command.Loadable[];
38
+ readonly commandsDir: string | undefined;
38
39
  findCommand(id: string, opts: {
39
40
  must: true;
40
41
  }): Promise<Command.Class>;
@@ -13,9 +13,11 @@ export interface TSConfig {
13
13
  sourceMap?: boolean;
14
14
  target?: string;
15
15
  };
16
+ extends?: string;
16
17
  'ts-node'?: {
17
18
  esm?: boolean;
18
19
  experimentalSpecifierResolution?: 'explicit' | 'node';
19
20
  scope?: boolean;
21
+ swc?: boolean;
20
22
  };
21
23
  }
@@ -35,7 +35,7 @@ async function load(config, modulePath) {
35
35
  let isESM;
36
36
  try {
37
37
  ;
38
- ({ filePath, isESM } = resolvePath(config, modulePath));
38
+ ({ filePath, isESM } = await resolvePath(config, modulePath));
39
39
  return (isESM ? await import((0, node_url_1.pathToFileURL)(filePath).href) : require(filePath));
40
40
  }
41
41
  catch (error) {
@@ -68,7 +68,7 @@ async function loadWithData(config, modulePath) {
68
68
  let isESM;
69
69
  try {
70
70
  ;
71
- ({ filePath, isESM } = resolvePath(config, modulePath));
71
+ ({ filePath, isESM } = await resolvePath(config, modulePath));
72
72
  const module = isESM ? await import((0, node_url_1.pathToFileURL)(filePath).href) : require(filePath);
73
73
  return { filePath, isESM, module };
74
74
  }
@@ -155,7 +155,7 @@ exports.isPathModule = isPathModule;
155
155
  *
156
156
  * @returns {{isESM: boolean, filePath: string}} An object including file path and whether the module is ESM.
157
157
  */
158
- function resolvePath(config, modulePath) {
158
+ async function resolvePath(config, modulePath) {
159
159
  let isESM;
160
160
  let filePath;
161
161
  try {
@@ -164,7 +164,8 @@ function resolvePath(config, modulePath) {
164
164
  }
165
165
  catch {
166
166
  filePath =
167
- (isPlugin(config) ? (0, ts_node_1.tsPath)(config.root, modulePath, config) : (0, ts_node_1.tsPath)(config.root, modulePath)) ?? modulePath;
167
+ (isPlugin(config) ? await (0, ts_node_1.tsPath)(config.root, modulePath, config) : await (0, ts_node_1.tsPath)(config.root, modulePath)) ??
168
+ modulePath;
168
169
  let fileExists = false;
169
170
  let isDirectory = false;
170
171
  if ((0, fs_1.existsSync)(filePath)) {
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.findRoot = void 0;
7
+ const debug_1 = __importDefault(require("debug"));
4
8
  const node_path_1 = require("node:path");
5
9
  const fs_1 = require("./fs");
10
+ const debug = (0, debug_1.default)('find-root');
6
11
  // essentially just "cd .."
7
12
  function* up(from) {
8
13
  while ((0, node_path_1.dirname)(from) !== from) {
@@ -21,7 +26,9 @@ async function findPluginRoot(root, name) {
21
26
  // If we know the plugin name then we just need to traverse the file
22
27
  // system until we find the directory that matches the plugin name.
23
28
  if (name) {
29
+ debug.extend(name)(`Finding root starting at ${root}`);
24
30
  for (const next of up(root)) {
31
+ debug.extend(name)(`Checking ${next}`);
25
32
  if (next.endsWith((0, node_path_1.basename)(name)))
26
33
  return next;
27
34
  }
@@ -36,6 +43,7 @@ async function findPluginRoot(root, name) {
36
43
  }
37
44
  try {
38
45
  const cur = (0, node_path_1.join)(next, 'package.json');
46
+ debug.extend('root-plugin')(`Checking ${cur}`);
39
47
  if (await (0, fs_1.safeReadJson)(cur))
40
48
  return (0, node_path_1.dirname)(cur);
41
49
  }
@@ -49,6 +57,7 @@ async function findPluginRoot(root, name) {
49
57
  * See https://github.com/oclif/config/pull/289#issuecomment-983904051
50
58
  */
51
59
  async function findRootLegacy(name, root) {
60
+ debug.extend(name ?? 'root-plugin')('Finding root using legacy method');
52
61
  for (const next of up(root)) {
53
62
  let cur;
54
63
  if (name) {
@@ -94,6 +103,7 @@ function findPnpRoot(name, root) {
94
103
  maybeRequirePnpApi(root);
95
104
  if (!pnp)
96
105
  return;
106
+ debug.extend(name)('Finding root for using pnp method');
97
107
  const seen = new Set();
98
108
  const traverseDependencyTree = (locator, parentPkg) => {
99
109
  // Prevent infinite recursion when A depends on B which depends on A
@@ -145,15 +155,29 @@ function findPnpRoot(name, root) {
145
155
  */
146
156
  async function findRoot(name, root) {
147
157
  if (name) {
158
+ debug.extend(name)(`Finding root using ${root}`);
148
159
  let pkgPath;
149
160
  try {
150
161
  pkgPath = require.resolve(name, { paths: [root] });
162
+ debug.extend(name)(`Found starting point with require.resolve`);
151
163
  }
152
- catch { }
153
- if (pkgPath)
154
- return findPluginRoot((0, node_path_1.dirname)(pkgPath), name);
155
- return process.versions.pnp ? findPnpRoot(name, root) : findRootLegacy(name, root);
164
+ catch {
165
+ debug.extend(name)(`require.resolve could not find plugin starting point`);
166
+ }
167
+ if (pkgPath) {
168
+ const found = await findPluginRoot((0, node_path_1.dirname)(pkgPath), name);
169
+ if (found) {
170
+ debug.extend(name)(`Found root at ${found}`);
171
+ return found;
172
+ }
173
+ }
174
+ const found = process.versions.pnp ? findPnpRoot(name, root) : await findRootLegacy(name, root);
175
+ debug.extend(name)(found ? `Found root at ${found}` : 'No root found!');
176
+ return found;
156
177
  }
157
- return findPluginRoot(root);
178
+ debug.extend('root-plugin')(`Finding root plugin using ${root}`);
179
+ const found = await findPluginRoot(root);
180
+ debug.extend('root-plugin')(found ? `Found root at ${found}` : 'No root found!');
181
+ return found;
158
182
  }
159
183
  exports.findRoot = findRoot;
package/lib/util/fs.js CHANGED
@@ -4,7 +4,6 @@ exports.existsSync = exports.safeReadJson = exports.readJsonSync = 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 debug = require('debug');
8
7
  function requireJson(...pathParts) {
9
8
  return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(...pathParts), 'utf8'));
10
9
  }
@@ -50,7 +49,6 @@ const fileExists = async (input) => {
50
49
  };
51
50
  exports.fileExists = fileExists;
52
51
  async function readJson(path) {
53
- debug('config')('readJson %s', path);
54
52
  const contents = await (0, promises_1.readFile)(path, 'utf8');
55
53
  return JSON.parse(contents);
56
54
  }
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.9.2",
4
+ "version": "3.10.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -27,6 +27,7 @@
27
27
  "strip-ansi": "^6.0.1",
28
28
  "supports-color": "^8.1.1",
29
29
  "supports-hyperlinks": "^2.2.0",
30
+ "tsconfck": "^3.0.0",
30
31
  "widest-line": "^3.1.0",
31
32
  "wordwrap": "^1.0.0",
32
33
  "wrap-ansi": "^7.0.0"
@@ -43,6 +44,7 @@
43
44
  "@types/chai-as-promised": "^7.1.5",
44
45
  "@types/clean-stack": "^2.1.1",
45
46
  "@types/cli-progress": "^3.11.0",
47
+ "@types/debug": "^4.1.10",
46
48
  "@types/ejs": "^3.1.3",
47
49
  "@types/indent-string": "^4.0.1",
48
50
  "@types/js-yaml": "^3.12.7",