Skip to content

Commit

Permalink
fix: replace Duplex with Transform (#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Dec 11, 2024
1 parent e0b8286 commit 6b70b9f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/actions/lifecycle.ts
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
import { dirname, isAbsolute, resolve as pathResolve, relative } from 'node:path';
import { pathToFileURL } from 'node:url';
import { createRequire } from 'node:module';
import { Duplex } from 'node:stream';
import { Transform } from 'node:stream';
import { stat } from 'node:fs/promises';
import createDebug from 'debug';
import type { BaseGenerator, ComposeOptions as EnvironmentComposeOptions, GetGeneratorOptions } from '@yeoman/types';
Expand Down Expand Up @@ -679,11 679,12 @@ export abstract class TasksMixin {
env.sharedFs.pipeline(
{ filter, ...memFsPipelineOptions },
...transforms,
Duplex.from(async function* (generator: AsyncGenerator<MemFsEditorFile>) {
for await (const file of generator) {
new Transform({
objectMode: true,
transform(file: MemFsEditorFile, _encoding, callback) {
step('Completed', relative(env.logCwd, file.path));
yield file;
}
callback(null, file);
},
}),
),
{ disabled, name },
Expand Down

0 comments on commit 6b70b9f

Please sign in to comment.