Skip to content

Commit

Permalink
drop through2 dependency
Browse files Browse the repository at this point in the history
use native stream.Transform instead
  • Loading branch information
mojavelinux committed Nov 6, 2020
1 parent 158beeb commit 6181177
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 208 deletions.
3 changes: 2 additions & 1 deletion gulp.d/lib/gulp-prettier-eslint.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict'

const log = require('fancy-log')
const { obj: map } = require('through2')
const PluginError = require('plugin-error')
const prettierEslint = require('prettier-eslint')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })

module.exports = () => {
const report = { changed: 0, unchanged: 0 }
Expand Down
5 changes: 3 additions & 2 deletions gulp.d/tasks/build-preview-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ Error.call = (self, ...args) => {
const asciidoctor = require('asciidoctor.js')()
const fs = require('fs-extra')
const handlebars = require('handlebars')
const { obj: map } = require('through2')
const merge = require('merge-stream')
const ospath = require('path')
const path = ospath.posix
const requireFromString = require('require-from-string')
const { Transform } = require('stream')
const map = (transform = () => {}, flush = undefined) => new Transform({ objectMode: true, transform, flush })
const vfs = require('vinyl-fs')
const yaml = require('js-yaml')

Expand Down Expand Up @@ -62,7 +63,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
})
)
.pipe(vfs.dest(previewDest))
.on('error', (e) => done)
//.on('error', done)
.pipe(sink())
)

Expand Down
3 changes: 2 additions & 1 deletion gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const concat = require('gulp-concat')
const cssnano = require('cssnano')
const fs = require('fs-extra')
const imagemin = require('gulp-imagemin')
const { obj: map } = require('through2')
const merge = require('merge-stream')
const ospath = require('path')
const path = ospath.posix
Expand All @@ -16,6 +15,8 @@ const postcssCalc = require('postcss-calc')
const postcssImport = require('postcss-import')
const postcssUrl = require('postcss-url')
const postcssVar = require('postcss-custom-properties')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const uglify = require('gulp-uglify')
const vfs = require('vinyl-fs')

Expand Down
3 changes: 2 additions & 1 deletion gulp.d/tasks/remove.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict'

const fs = require('fs-extra')
const { obj: map } = require('through2')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const vfs = require('vinyl-fs')

module.exports = (files) => () =>
Expand Down
Loading

0 comments on commit 6181177

Please sign in to comment.