@automattic/vip 2.40.0-dev.1 → 2.40.0-dev.3

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.
@@ -18,12 +18,19 @@ const examples = [{
18
18
  description: 'Return information about a local dev environment named "my_site"'
19
19
  }];
20
20
  (0, _command.default)().option('slug', 'Custom name of the dev environment', undefined, _devEnvironmentCli.processSlug).option('all', 'Show Info for all local dev environments').option('extended', 'Show extended information about the dev environment').examples(examples).argv(process.argv, async (arg, opt) => {
21
- const slug = await (0, _devEnvironmentCli.getEnvironmentName)(opt);
21
+ let trackingInfo;
22
+ let slug;
22
23
  const lando = await (0, _devEnvironmentLando.bootstrapLando)();
24
+ if (opt.all) {
25
+ trackingInfo = {
26
+ all: true
27
+ };
28
+ slug = '';
29
+ } else {
30
+ slug = await (0, _devEnvironmentCli.getEnvironmentName)(opt);
31
+ trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
32
+ }
23
33
  await (0, _devEnvironmentCli.validateDependencies)(lando, slug);
24
- const trackingInfo = opt.all ? {
25
- all: true
26
- } : (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
27
34
  await (0, _tracker.trackEvent)('dev_env_info_command_execute', trackingInfo);
28
35
  debug('Args: ', arg, 'Options: ', opt);
29
36
  try {
@@ -433,7 +433,8 @@ function promptForBoolean(message, initial) {
433
433
  if (isStdinTTY) {
434
434
  const confirm = new _enquirer.Confirm({
435
435
  message,
436
- initial: initial.toString()
436
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment
437
+ initial: initial // TS definition is wrong, so we need to bypass it to show the correct hint.
437
438
  });
438
439
  return confirm.run();
439
440
  }
@@ -223,7 +223,7 @@ ${maybeExitPrompt}
223
223
  const errorsFile = `media-import-${app.name ?? ''}-${Date.now()}${exportFileErrorsToJson ? '.json' : '.txt'}`;
224
224
  try {
225
225
  await (0, _promises.writeFile)(errorsFile, formattedData);
226
- progressTracker.suffix += `${_chalk.default.yellow(`⚠️ All errors have been exported to ${_chalk.default.bold((0, _nodePath.resolve)(errorsFile))}`)}`;
226
+ progressTracker.suffix += `${_chalk.default.yellow(`⚠️ All errors have been exported to ${_chalk.default.bold((0, _nodePath.resolve)(errorsFile))}\n`)}`;
227
227
  } catch (writeFileErr) {
228
228
  progressTracker.suffix += `${_chalk.default.red(`Could not export errors to file\n${writeFileErr.message}`)}`;
229
229
  }
@@ -231,13 +231,16 @@ ${maybeExitPrompt}
231
231
  async function fetchFailureDetails(fileErrorsUrl) {
232
232
  progressTracker.suffix += `
233
233
  =============================================================
234
- Downloading errors details from ${fileErrorsUrl}...
234
+ Downloading errors details from ${fileErrorsUrl}
235
235
  \n`;
236
+ progressTracker.print({
237
+ clearAfter: true
238
+ });
236
239
  try {
237
240
  const response = await fetch(fileErrorsUrl);
238
241
  return await response.json();
239
242
  } catch (err) {
240
- progressTracker.suffix += `${_chalk.default.red(`Could not download file import errors report\n${err.message}`)}`;
243
+ progressTracker.suffix += `${_chalk.default.red(`Could not download import errors report\n${err.message}`)}`;
241
244
  throw err;
242
245
  }
243
246
  }
@@ -245,12 +248,13 @@ Downloading errors details from ${fileErrorsUrl}...
245
248
  const failureDetails = await (0, _enquirer.prompt)({
246
249
  type: 'confirm',
247
250
  name: 'download',
248
- message: 'Download file import errors report now?'
251
+ message: 'Download import errors report now? (Report will be downloadable for up to 7 days from the completion of the import)'
249
252
  });
250
253
  if (!failureDetails.download) {
251
- progressTracker.suffix += `${_chalk.default.yellow(`⚠️ Click on the following link to download the file import errors report`)}`;
252
- progressTracker.suffix += `\n${_chalk.default.italic.yellow('(The link will be valid for the next 15 minutes & the data is retained for 7 days since the completion of the import)')} `;
253
- progressTracker.suffix += `\n\n${_chalk.default.bold.yellow(fileErrorsUrl)}`;
254
+ progressTracker.suffix += `${_chalk.default.yellow(`⚠️ An error report file has been generated for this media import. Access it within the next 15 minutes by clicking on the URL below.`)}`;
255
+ progressTracker.suffix += `\n${_chalk.default.yellow(`Or, generate a new URL by running the ${_chalk.default.bgYellow('vip import media status')} command.`)} `;
256
+ progressTracker.suffix += `\n${_chalk.default.yellow('The report will be downloadable for up to 7 days after the completion of the import or until a new media import is performed.')}`;
257
+ progressTracker.suffix += `\n\n${_chalk.default.underline(fileErrorsUrl)}\n`;
254
258
  progressTracker.print({
255
259
  clearAfter: true
256
260
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.40.0-dev.1",
3
+ "version": "2.40.0-dev.3",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@automattic/vip",
9
- "version": "2.40.0-dev.1",
9
+ "version": "2.40.0-dev.3",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.40.0-dev.1",
3
+ "version": "2.40.0-dev.3",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {