From 66e334e73e774d5d914c2ec54c87447bacd6fd4f Mon Sep 17 00:00:00 2001 From: Kyle Herock Date: Sat, 25 Feb 2023 19:50:03 -0500 Subject: [PATCH] refactor(plugin-workspaces-export): remove unnecessary monkeypatch --- .../sources/commands/export.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/plugin-workspaces-export/sources/commands/export.ts b/packages/plugin-workspaces-export/sources/commands/export.ts index eb59ada..0e17e1e 100644 --- a/packages/plugin-workspaces-export/sources/commands/export.ts +++ b/packages/plugin-workspaces-export/sources/commands/export.ts @@ -29,7 +29,6 @@ import { stringifyMessageName, miscUtils, ConfigurationValueMap, - LightReport, } from '@yarnpkg/core'; import { Filename, @@ -192,7 +191,6 @@ export default class WorkspacesExportCommand extends BaseCommand { foreachCommand.push(...this.from.flatMap(pattern => [`--from`, pattern])); try { - monkeyPatchNextStreamReport(); const exitCode = await this.cli.run([ ...foreachCommand, ...exportCommand, @@ -203,7 +201,6 @@ export default class WorkspacesExportCommand extends BaseCommand { } finally { exportContext.phase = `post`; if (!this.skipPackLifecycle) { - monkeyPatchNextStreamReport(); await this.cli.run([ ...foreachCommand, ...exportCommand, @@ -363,18 +360,3 @@ function prettyWorkspaceVersion(workspace: Workspace) { return `unknown`; } } - -class LightInfoReport extends LightReport { - reportInfo(name: MessageName | null, text: string): void { - // eslint-disable-next-line dot-notation - this[`stdout`].write(`${text}\n`); - } -} - -function monkeyPatchNextStreamReport() { - const {start} = StreamReport; - StreamReport.start = function (opts, cb: any) { - this.start = start; - return LightInfoReport.start(opts, cb) as any; - }; -}