@oclif/core 3.10.7 → 3.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.
@@ -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.`);
@@ -125,8 +125,7 @@ class CommandHelp extends formatter_1.HelpFormatter {
125
125
  let label = flag.helpLabel;
126
126
  if (!label) {
127
127
  const labels = [];
128
- if (flag.char)
129
- labels.push(`-${flag.char[0]}`);
128
+ labels.push(flag.char ? `-${flag.char[0]}` : ' ');
130
129
  if (flag.name) {
131
130
  if (flag.type === 'boolean' && flag.allowNo) {
132
131
  labels.push(`--[no-]${flag.name.trim()}`);
@@ -135,7 +134,7 @@ class CommandHelp extends formatter_1.HelpFormatter {
135
134
  labels.push(`--${flag.name.trim()}`);
136
135
  }
137
136
  }
138
- label = labels.join(', ');
137
+ label = labels.join(flag.char ? ', ' : ' ');
139
138
  }
140
139
  if (flag.type === 'option') {
141
140
  let value = flag.helpValue || (this.opts.showFlagNameInTitle ? flag.name : '<value>');
@@ -153,8 +152,11 @@ class CommandHelp extends formatter_1.HelpFormatter {
153
152
  flags(flags) {
154
153
  if (flags.length === 0)
155
154
  return;
155
+ const noChar = flags.reduce((previous, current) => previous && current.char === undefined, true);
156
156
  return flags.map((flag) => {
157
- const left = this.flagHelpLabel(flag);
157
+ let left = this.flagHelpLabel(flag);
158
+ if (noChar)
159
+ left = left.replace(' ', '');
158
160
  let right = flag.summary || flag.description || '';
159
161
  if (flag.type === 'option' && flag.default) {
160
162
  right = `[default: ${flag.default}] ${right}`;
@@ -176,6 +178,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
176
178
  // Guaranteed to be set because of the filter above, but make ts happy
177
179
  const summary = flag.summary || '';
178
180
  let flagHelp = this.flagHelpLabel(flag, true);
181
+ if (!flag.char)
182
+ flagHelp = flagHelp.replace(' ', '');
179
183
  flagHelp +=
180
184
  flagHelp.length + summary.length + 2 < this.opts.maxWidth
181
185
  ? ' ' + summary
@@ -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.7",
4
+ "version": "3.11.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -34,17 +34,17 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@commitlint/config-conventional": "^17.7.0",
37
- "@oclif/plugin-help": "^5.2.8",
37
+ "@oclif/plugin-help": "^5.2.20",
38
38
  "@oclif/plugin-plugins": "^3.3.0",
39
39
  "@oclif/prettier-config": "^0.2.1",
40
40
  "@oclif/test": "^3.0.3",
41
41
  "@types/ansi-styles": "^3.2.1",
42
42
  "@types/benchmark": "^2.1.2",
43
- "@types/chai": "^4.3.8",
44
- "@types/chai-as-promised": "^7.1.5",
43
+ "@types/chai": "^4.3.10",
44
+ "@types/chai-as-promised": "^7.1.8",
45
45
  "@types/clean-stack": "^2.1.1",
46
46
  "@types/cli-progress": "^3.11.0",
47
- "@types/debug": "^4.1.10",
47
+ "@types/debug": "^4.1.12",
48
48
  "@types/ejs": "^3.1.3",
49
49
  "@types/indent-string": "^4.0.1",
50
50
  "@types/js-yaml": "^3.12.7",