Skip to content

Commit

Permalink
refactor(plugin-workspaces-export): remove unnecessary monkeypatch
Browse files Browse the repository at this point in the history
  • Loading branch information
kherock committed Feb 26, 2023
1 parent 09deee9 commit 66e334e
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions packages/plugin-workspaces-export/sources/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
stringifyMessageName,
miscUtils,
ConfigurationValueMap,
LightReport,
} from '@yarnpkg/core';
import {
Filename,
Expand Down Expand Up @@ -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,
Expand All @@ -203,7 +201,6 @@ export default class WorkspacesExportCommand extends BaseCommand {
} finally {
exportContext.phase = `post`;
if (!this.skipPackLifecycle) {
monkeyPatchNextStreamReport();
await this.cli.run([
...foreachCommand,
...exportCommand,
Expand Down Expand Up @@ -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;
};
}

0 comments on commit 66e334e

Please sign in to comment.