Skip to content

Commit

Permalink
Update npm dependencies (#9)
Browse files Browse the repository at this point in the history
* Fix typo in readme
* update postcss, browserify, cssnano, fancy-log, fs-extra, gulp-imagemin, gulp-vinyl-zip, js-yaml (safe by default now), prettier-eslint, typeface-roboto
  • Loading branch information
countableSet authored Apr 5, 2022
1 parent 5f23c00 commit f29a594
Show file tree
Hide file tree
Showing 5 changed files with 5,360 additions and 5,559 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ See releases for publish versions of the ui-bundle zip.

link:https://docs.antora.org/antora-ui-default/[Original docs] for full help.

For a link of all the gulp taks
For a link of all the gulp tasks

$ gulp --tasks-simple

Expand Down
2 changes: 1 addition & 1 deletion gulp.d/tasks/build-preview-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
)

function loadSampleUiModel (src) {
return fs.readFile(ospath.join(src, 'ui-model.yml'), 'utf8').then((contents) => yaml.safeLoad(contents))
return fs.readFile(ospath.join(src, 'ui-model.yml'), 'utf8').then((contents) => yaml.load(contents))
}

function registerPartials (src) {
Expand Down
47 changes: 24 additions & 23 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const buffer = require('vinyl-buffer')
const concat = require('gulp-concat')
const cssnano = require('cssnano')
const fs = require('fs-extra')
const imagemin = require('gulp-imagemin')
const merge = require('merge-stream')
const ospath = require('path')
const path = ospath.posix
Expand All @@ -17,7 +16,6 @@ const postcssUrl = require('postcss-url')
const postcssVar = require('postcss-custom-properties')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const through = () => map((file, enc, next) => next(null, file))
const uglify = require('gulp-uglify')
const vfs = require('vinyl-fs')

Expand Down Expand Up @@ -51,9 +49,8 @@ module.exports = (src, dest, preview) => () => {
postcssVar({ preserve: true }),
preview ? postcssCalc : () => {},
autoprefixer,
preview
? () => {}
: (css, result) => cssnano({ preset: 'default' })(css, result).then(() => postcssPseudoElementFixer(css, result)),
preview ? () => {} : cssnano({ preset: 'default' }),
preview ? () => {} : (css, result) => postcssPseudoElementFixer(css, result),
]

return merge(
Expand Down Expand Up @@ -129,24 +126,28 @@ module.exports = (src, dest, preview) => () => {
.src(['css/site.css', 'css/vendor/*.css'], { ...opts, sourcemaps })
.pipe(postcss((file) => ({ plugins: postcssPlugins, options: { file } }))),
vfs.src('font/*.{ttf,woff*(2)}', opts),
vfs.src('img/**/*.{gif,ico,jpg,png,svg}', opts).pipe(
preview
? through()
: imagemin(
[
imagemin.gifsicle(),
imagemin.jpegtran(),
imagemin.optipng(),
imagemin.svgo({
plugins: [
{ cleanupIDs: { preservePrefixes: ['icon-', 'view-'] } },
{ removeViewBox: false },
{ removeDesc: false },
],
}),
].reduce((accum, it) => (it ? accum.concat(it) : accum), [])
)
),
vfs.src('img/**/*.{gif,ico,jpg,png,svg}', opts)
.pipe(map((file, enc, next) => {
if (!preview) {
import('gulp-imagemin').then((imagemin) => {
imagemin.default([
imagemin.gifsicle(),
imagemin.mozjpeg(),
imagemin.optipng(),
imagemin.svgo({
plugins: [
{ cleanupIDs: { preservePrefixes: ['icon-', 'view-'] } },
{ removeViewBox: false },
{ removeDesc: false },
],
}),
].reduce((accum, it) => (it ? accum.concat(it) : accum), []))
next(null, file)
})
} else {
next(null, file)
}
})),
vfs.src('helpers/*.js', opts),
vfs.src('layouts/*.hbs', opts),
vfs.src('partials/*.hbs', opts)
Expand Down
Loading

0 comments on commit f29a594

Please sign in to comment.