yeoman / yeoman

Yeoman - a set of tools for automating development workflow
http://yeoman.io
10.08k stars 735 forks source link

Docs on registerTransformStream needs to be renamed to queueTransformStream #1758

Open e-dong opened 2 years ago

e-dong commented 2 years ago

I'm using yeoman-generator@5.6.1

When trying to use this.registerTransformStream, I got this.registerTransformStream is not a function https://yeoman.io/authoring/file-system.html#transform-output-files-through-streams

Looking at the node_modules, registerTransformStream does not exist, it has queueTransformStream

E.g.

  /**
   * Add a transform stream to the commit stream.
   *
   * Most usually, these transform stream will be Gulp plugins.
   *
   * @param  {stream.Transform|stream.Transform[]} streams An array of Transform stream
   * or a single one.
   * @return {this} This generator
   */
  queueTransformStream(transformStreams) {
    assert(
      transformStreams,
      'expected to receive a transform stream as parameter'
    );

    this.queueTask({
      method() {
        return this.env.applyTransforms(transformStreams);
      },
      taskName: 'transformStream',
      queueName: 'transform'
    });
    return this;
  }
}
danielsitnik commented 2 years ago

Thanks. Glad I found this issue because the docs are still mentioning registerTransformStream. 😢

ZhaoKunLong commented 1 year ago

AH! Yeah I also used It has been found to be wrong for several hours, but all the existing network data indicate that it should be used in this way.

e-dong commented 1 year ago

Wow this issue is still open? Lol