Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: update listr2 version
  • Loading branch information
yangannyx committed Mar 16, 2024
commit 1fa783f8f9dd950f083d76c5ca16b9c7b2df1a48
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"inquirer": "^8.0.0",
"lerna": "^6.6.2",
"lint-staged": "^12.1.7",
"listr2": "^5.0.3",
"listr2": "8.0.2",
"minimist": "^1.2.6",
"mocha": "^9.0.1",
"mocha-junit-reporter": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"commander": "^4.1.1",
"debug": "^4.3.1",
"fs-extra": "^10.0.0",
"listr2": "^5.0.3",
"listr2": "8.0.2",
"semver": "^7.2.1"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ program

await runner.run();

if (runner.err.length) {
if (runner.errors.length) {
console.error(
chalk.red(`\nIt looks like you are missing some dependencies you need to get Electron running.
Make sure you have git installed and Node.js version ${metadata.engines.node}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/util/check-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export async function checkSystem(task: ForgeListrTask<never>) {
concurrent: true,
exitOnError: false,
rendererOptions: {
collapse: true,
collapseSubtasks: true,
},
}
);
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"fs-extra": "^10.0.0",
"got": "^11.8.5",
"interpret": "^3.1.1",
"listr2": "^5.0.3",
"listr2": "8.0.2",
"lodash": "^4.17.20",
"log-symbols": "^4.0.0",
"node-fetch": "^2.6.7",
Expand Down
6 changes: 3 additions & 3 deletions packages/api/core/src/api/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default autoTrace(
const listrOptions = {
concurrent: false,
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
rendererSilent: !interactive,
Expand Down Expand Up @@ -91,7 +91,7 @@ export default autoTrace(
},
{
title: 'Processing configuration and dependencies',
options: {
rendererOptions: {
persistentOutput: true,
bottomBar: Infinity,
},
Expand Down Expand Up @@ -251,7 +251,7 @@ export default autoTrace(
},
{
title: 'Finalizing import',
options: {
rendererOptions: {
persistentOutput: true,
bottomBar: Infinity,
},
Expand Down
8 changes: 3 additions & 5 deletions packages/api/core/src/api/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export default async ({ dir = process.cwd(), interactive = false, copyCIFiles =
await initDirectory(dir, task, force);
await initGit(dir);
},
options: {
persistentOutput: true,
},
rendererOptions: { persistentOutput: true },
},
{
title: 'Preparing template',
Expand Down Expand Up @@ -153,8 +151,8 @@ export default async ({ dir = process.cwd(), interactive = false, copyCIFiles =
],
{
concurrent: false,
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG),
silentRendererCondition: !interactive,
fallbackRendererCondition: Boolean(process.env.DEBUG),
}
);

Expand Down
16 changes: 8 additions & 8 deletions packages/api/core/src/api/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getHostArch } from '@electron/get';
import chalk from 'chalk';
import filenamify from 'filenamify';
import fs from 'fs-extra';
import { Listr } from 'listr2';
import { Listr, PRESET_TIMER } from 'listr2';
import logSymbols from 'log-symbols';

import getForgeConfig from '../util/forge-config';
Expand Down Expand Up @@ -112,7 +112,7 @@ export const listrMake = (
const listrOptions = {
concurrent: false,
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
rendererSilent: !interactive,
Expand Down Expand Up @@ -206,7 +206,7 @@ export const listrMake = (
task.output = `Making for the following targets: ${chalk.magenta(`${makers.map((maker) => maker.name).join(', ')}`)}`;
}
),
options: {
rendererOptions: {
persistentOutput: true,
},
},
Expand All @@ -230,7 +230,7 @@ export const listrMake = (
task.skip();
}
}),
options: {
rendererOptions: {
persistentOutput: true,
},
},
Expand Down Expand Up @@ -258,7 +258,7 @@ export const listrMake = (
...listrOptions,
concurrent: true,
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
});
Expand Down Expand Up @@ -300,8 +300,8 @@ export const listrMake = (
}
}
}),
options: {
showTimer: true,
rendererOptions: {
timer: { ...PRESET_TIMER },
},
});
}
Expand All @@ -321,7 +321,7 @@ export const listrMake = (

task.output = `Artifacts available at: ${chalk.green(path.resolve(ctx.actualOutDir, 'make'))}`;
}),
options: {
rendererOptions: {
persistentOutput: true,
},
},
Expand Down
24 changes: 12 additions & 12 deletions packages/api/core/src/api/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import chalk from 'chalk';
import debug from 'debug';
import glob from 'fast-glob';
import fs from 'fs-extra';
import { Listr } from 'listr2';
import { Listr, PRESET_TIMER } from 'listr2';

import getForgeConfig from '../util/forge-config';
import { getHookListrTasks, runHook } from '../util/hook';
Expand Down Expand Up @@ -399,8 +399,8 @@ export const listrPackage = (
task: async () => {
await addSignalAndWait(signalPackageDone, target);
},
options: {
showTimer: true,
rendererOptions: {
timer: { ...PRESET_TIMER },
},
}
: {
Expand Down Expand Up @@ -431,10 +431,10 @@ export const listrPackage = (
signalRebuildStart.get(getTargetKey(target))?.pop()?.(task);
await addSignalAndWait(signalRebuildDone, target);
}),
options: {
rendererOptions: {
persistentOutput: true,
bottomBar: Infinity,
showTimer: true,
timer: { ...PRESET_TIMER },
},
},
{
Expand All @@ -444,18 +444,18 @@ export const listrPackage = (
}),
},
],
{ rendererOptions: { collapse: true, collapseErrors: false } }
{ rendererOptions: { collapseSubtasks: true, collapseErrors: false } }
),
'run'
);
}
),
options: {
showTimer: true,
rendererOptions: {
timer: { ...PRESET_TIMER },
},
}
),
{ concurrent: true, rendererOptions: { collapse: false, collapseErrors: false } }
{ concurrent: true, rendererOptions: { collapseSubtasks: false, collapseErrors: false } }
),
'run'
);
Expand Down Expand Up @@ -486,10 +486,10 @@ export const listrPackage = (
],
{
concurrent: false,
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG),
silentRendererCondition: !interactive,
fallbackRendererCondition: Boolean(process.env.DEBUG),
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
ctx: {} as PackageContext,
Expand Down
14 changes: 7 additions & 7 deletions packages/api/core/src/api/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default autoTrace(

return delayTraceTillSignal(
childTrace,
task.newListr<never>(
task.newListr<any>(
publishers.map((publisher) => ({
title: `${chalk.cyan(`[publisher-${publisher.name}]`)} Running the ${chalk.yellow('publish')} command`,
task: childTrace<Parameters<ForgeListrTaskFn>>(
Expand All @@ -126,13 +126,13 @@ export default autoTrace(
});
}
),
options: {
rendererOptions: {
persistentOutput: true,
},
})),
{
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
}
Expand All @@ -141,7 +141,7 @@ export default autoTrace(
);
}
),
options: {
rendererOptions: {
persistentOutput: true,
},
},
Expand Down Expand Up @@ -215,7 +215,7 @@ export default autoTrace(
}
}
),
options: {
rendererOptions: {
persistentOutput: true,
},
},
Expand Down Expand Up @@ -267,7 +267,7 @@ export default autoTrace(
makeResults: restoredMakeResults,
},
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
}),
Expand All @@ -279,7 +279,7 @@ export default autoTrace(
}),
{
rendererOptions: {
collapse: false,
collapseSubtasks: false,
collapseErrors: false,
},
}
Expand Down
6 changes: 3 additions & 3 deletions packages/api/core/src/api/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ElectronProcess, ForgeArch, ForgeListrTaskFn, ForgePlatform, ResolvedFo
import { autoTrace, delayTraceTillSignal } from '@electron-forge/tracer';
import chalk from 'chalk';
import debug from 'debug';
import { Listr } from 'listr2';
import { Listr, PRESET_TIMER } from 'listr2';

import locateElectronExecutable from '../util/electron-executable';
import getForgeConfig from '../util/forge-config';
Expand Down Expand Up @@ -89,10 +89,10 @@ export default autoTrace(
);
}
),
options: {
rendererOptions: {
persistentOutput: true,
bottomBar: Infinity,
showTimer: true,
timer: { ...PRESET_TIMER },
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/plugin-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class PluginInterface implements IForgePluginInterface {
}
}
),
options: {},
rendererOptions: {},
});
}
}
Expand Down
12 changes: 7 additions & 5 deletions packages/plugin/vite/src/VitePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { namedHookWithTaskFn, PluginBase } from '@electron-forge/plugin-base';
import chalk from 'chalk';
import debug from 'debug';
import fs from 'fs-extra';
// eslint-disable-next-line node/no-extraneous-import
import { PRESET_TIMER } from 'listr2';
// eslint-disable-next-line node/no-unpublished-import
import { default as vite } from 'vite';

Expand Down Expand Up @@ -138,9 +140,9 @@ the generated files). Instead, it is ${JSON.stringify(pj.main)}`);
task: async () => {
await this.launchRendererDevServers();
},
options: {
rendererOptions: {
persistentOutput: true,
showTimer: true,
timer: { ...PRESET_TIMER },
},
},
// The main process depends on the `server.port` of the renderer process, so the renderer process is run first.
Expand All @@ -149,8 +151,8 @@ the generated files). Instead, it is ${JSON.stringify(pj.main)}`);
task: async () => {
await this.build();
},
options: {
showTimer: true,
rendererOptions: {
timer: { ...PRESET_TIMER },
},
},
],
Expand Down Expand Up @@ -212,7 +214,7 @@ the generated files). Instead, it is ${JSON.stringify(pj.main)}`);
this.servers.push(viteDevServer);

if (viteDevServer.httpServer) {
// Make suee that `getDefines` in VitePlugin.ts gets the correct `server.port`. (#3198)
// Make sure that `getDefines` in VitePlugin.ts gets the correct `server.port`. (#3198)
const addressInfo = viteDevServer.httpServer.address();
const isAddressInfo = (x: any): x is AddressInfo => x?.address;

Expand Down
Loading