1

    /**
     * @deprecated This method was removed in v2.0.
     * If file.contents is a Buffer, it will write it to the stream.
     * If file.contents is a Stream, it will pipe it to the stream.
     * If file.contents is null, it will do nothing.
     */
    pipe<T extends NodeJS.WritableStream>(
        stream: T,
        opts?: {
            /**
             * If false, the destination stream will not be ended (same as node core).
             */
            end?: boolean | undefined;
        }
    ): T; } 

@types/vinyl v2.0.7

Because of it, many previously valid Gulp pipelines has become alerted. No need to read the code in the below picture - it actual only for my project, I just want to show which troubles this deprecation could cause:

enter image description here

If I must to paste the code sample, just below one will be enough for the reproduction:

Gulp.src([]).pipe();

Deprecated: This method was removed in v2.0. If file.contents is a Buffer, it will write it to the stream. If file.contents is a Stream, it will pipe it to the stream. If file.contents is null, it will do nothing

Fine, what we should to do now? I don't think that the arbitrary pipeline could be replaced with Gulp series and parallels.

Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124
  • From what I can tell, `.pipe` as a custom method on non-streams was [removed from Vinyl way back in 2016](https://github.com/gulpjs/vinyl/issues/107), the `pipe` on Gulp streams is still around (because that's inherited from Streams). Could this be an issue with your editor config as in [this comment](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31561#issuecomment-449392797)? – Zac Anger Apr 18 '23 at 00:45
  • @ZacAnger, Thank you for the comment. Unfortunately, I have not understood how to fix the alert in `Gulp.src([]).pipe();`. The code sample `if (file.isStream()) { file.contents = file.contents.pipe(transform()); }` posted in the issue seems to be unrelated with `Gulp.src([]).pipe();`. – Takeshi Tokugawa YD Apr 18 '23 at 23:55
  • 1
    What I'm saying is that it looks like this is an issue with your editor and its TypeScript configuration, not with Gulp itself. `gulp.src('/some/*glob.js').pipe(gulp.dest('some-destination/'))` is still completely valid. What was removed was a little-used `pipe` method from Vinyl, but that doesn't affect pipe working in general. – Zac Anger Apr 19 '23 at 02:16
  • @ZacAnger, I see. Sound like the new bug ticket for the IntelliJ IDEA. – Takeshi Tokugawa YD Apr 19 '23 at 02:47

0 Answers0