@oclif/core 3.10.7 → 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.
- package/lib/config/ts-node.js +5 -5
- package/lib/performance.js +7 -1
- package/package.json +1 -1
package/lib/config/ts-node.js
CHANGED
|
@@ -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/performance.js
CHANGED
|
@@ -144,9 +144,12 @@ class Performance {
|
|
|
144
144
|
if (!Performance.enabled)
|
|
145
145
|
return;
|
|
146
146
|
const oclifDebug = require('debug')('oclif-perf');
|
|
147
|
-
|
|
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) {
|