@oclif/core 3.10.6 → 3.10.8

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.
@@ -175,17 +175,17 @@ async function tsPath(root, orig, plugin) {
175
175
  return orig;
176
176
  }
177
177
  const isProduction = (0, util_1.isProd)();
178
+ // Do not skip ts-node registration if the plugin is linked
179
+ if (settings_1.settings.tsnodeEnabled === undefined && isProduction && plugin?.type !== 'link') {
180
+ debug(`Skipping ts-node registration for ${root} because NODE_ENV is NOT "test" or "development"`);
181
+ return orig;
182
+ }
178
183
  if (cannotTranspileEsm(rootPlugin, plugin, isProduction)) {
179
184
  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})`);
180
185
  if (plugin?.type === 'link')
181
186
  (0, errors_1.memoizedWarn)(`${plugin?.name} is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.`);
182
187
  return orig;
183
188
  }
184
- // Do not skip ts-node registration if the plugin is linked
185
- if (settings_1.settings.tsnodeEnabled === undefined && isProduction && plugin?.type !== 'link') {
186
- debug(`Skipping ts-node registration for ${root} because NODE_ENV is NOT "test" or "development"`);
187
- return orig;
188
- }
189
189
  if (cannotUseTsNode(root, plugin, isProduction)) {
190
190
  debug(`Skipping ts-node registration for ${root} because ts-node is run in node version ${process.version}"`);
191
191
  (0, errors_1.memoizedWarn)(`ts-node executable cannot transpile ESM in Node 20. Existing compiled source will be used instead. See https://github.com/oclif/core/issues/817.`);
package/lib/help/index.js CHANGED
@@ -193,7 +193,7 @@ class Help extends HelpBase {
193
193
  if (command) {
194
194
  if (command.hasDynamicHelp && command.pluginType !== 'jit') {
195
195
  const loaded = await command.load();
196
- for (const [name, flag] of Object.entries(loaded.flags)) {
196
+ for (const [name, flag] of Object.entries(loaded.flags ?? {})) {
197
197
  // As of v3 each flag that needs to be re-evaluated has the `hasDynamicHelp` property.
198
198
  // However, we cannot assume that the absence of this property means that the flag
199
199
  // doesn't need to be re-evaluated since any command from a v2 or older plugin will
@@ -144,9 +144,12 @@ class Performance {
144
144
  if (!Performance.enabled)
145
145
  return;
146
146
  const oclifDebug = require('debug')('oclif-perf');
147
- oclifDebug('Total Time: %sms', Performance.oclifPerf['oclif.runMs'].toFixed(4));
147
+ const processUpTime = (process.uptime() * 1000).toFixed(4);
148
+ oclifDebug('Process Uptime: %sms', processUpTime);
149
+ oclifDebug('Oclif Time: %sms', Performance.oclifPerf['oclif.runMs'].toFixed(4));
148
150
  oclifDebug('Init Time: %sms', Performance.oclifPerf['oclif.initMs'].toFixed(4));
149
151
  oclifDebug('Config Load Time: %sms', Performance.oclifPerf['oclif.configLoadMs'].toFixed(4));
152
+ oclifDebug(' • Root Plugin Load Time: %sms', Performance.getResult(exports.OCLIF_MARKER_OWNER, 'plugin.load#root')?.duration.toFixed(4) ?? 0);
150
153
  oclifDebug(' • Plugins Load Time: %sms', Performance.getResult(exports.OCLIF_MARKER_OWNER, 'config.loadAllPlugins')?.duration.toFixed(4) ?? 0);
151
154
  oclifDebug(' • Commands Load Time: %sms', Performance.getResult(exports.OCLIF_MARKER_OWNER, 'config.loadAllCommands')?.duration.toFixed(4) ?? 0);
152
155
  oclifDebug('Core Plugin Load Time: %sms', Performance.oclifPerf['oclif.corePluginsLoadMs'].toFixed(4));
@@ -170,6 +173,9 @@ class Performance {
170
173
  }
171
174
  oclifDebug('Command Load Time: %sms', Performance.oclifPerf['oclif.commandLoadMs'].toFixed(4));
172
175
  oclifDebug('Command Run Time: %sms', Performance.oclifPerf['oclif.commandRunMs'].toFixed(4));
176
+ if (Performance.oclifPerf['oclif.configLoadMs'] > Performance.oclifPerf['oclif.runMs']) {
177
+ oclifDebug('! Config load time is greater than total oclif time. This might mean that Config was instantiated before oclif was run.');
178
+ }
173
179
  const nonCoreDebug = require('debug')('non-oclif-perf');
174
180
  const nonCorePerf = Performance.results;
175
181
  if (nonCorePerf.size > 0) {
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.10.6",
4
+ "version": "3.10.8",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {