Skip to content

Commit

Permalink
Merge pull request #399 from Access4all/feature/update-dependencies
Browse files Browse the repository at this point in the history
chore: update npm dependencies and node to latest
  • Loading branch information
backflip authored May 4, 2023
2 parents deae263 + ce09f46 commit 8161cb9
Show file tree
Hide file tree
Showing 11 changed files with 14,734 additions and 10,440 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
6 changes: 3 additions & 3 deletions gulp/css.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const gulp = require('gulp')
const sass = require('gulp-sass')
const nodeSassGlobbing = require('node-sass-globbing')
const sass = require('gulp-sass')(require('node-sass'))
const globImporter = require('node-sass-glob-importer')

const autoprefixer = require('autoprefixer')
const postcss = require('gulp-postcss')
Expand All @@ -12,7 +12,7 @@ module.exports = config => {
})
.pipe(
sass({
importer: nodeSassGlobbing,
importer: globImporter(),
includePaths: config.includePaths
}).on('error', config.errorHandler)
)
Expand Down
4 changes: 2 additions & 2 deletions gulp/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const plumber = require('gulp-plumber')
const through = require('through2')
const handlebars = require('gulp-hb')
const frontMatter = require('front-matter')
const requireNew = require('require-new')
const importFresh = require('import-fresh')
const fs = require('fs')
const path = require('path')
const babel = require('@babel/core')
const babelPreset = require('@babel/preset-env')

module.exports = (config, cb) => {
const helpers = requireNew('./helpers/examples')
const helpers = importFresh('./helpers/examples')

const layout = fs.readFileSync('./src/templates/example.hbs')

Expand Down
4 changes: 2 additions & 2 deletions gulp/helpers/markdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const markdownIt = require('markdown-it')
const requireNew = require('require-new')
const importFresh = require('import-fresh')
const path = require('path')

const plugins = {
Expand Down Expand Up @@ -32,7 +32,7 @@ module.exports = rootDir => filePath => {
linkify: true,
typography: true
})
const examples = requireNew('./examples')
const examples = importFresh('./examples')

markdown.validateLink = url => {
const BAD_PROTO_RE = /^(vbscript|file|data):/
Expand Down
26 changes: 14 additions & 12 deletions gulp/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ const frontMatter = require('gulp-front-matter')
const through = require('through2')
const fs = require('fs')
const path = require('path')
const requireNew = require('require-new')
const importFresh = require('import-fresh')
const plumber = require('gulp-plumber')
const normalize = require('normalize-strings')
const { Sitemap } = require('sitemap')
const { SitemapStream, streamToPromise } = require('sitemap')
const { Readable } = require('stream')
const _ = require('lodash')
const { JSDOM } = require('jsdom')

Expand Down Expand Up @@ -126,11 +127,11 @@ const flattenNavigation = items =>
}, [])

module.exports = (config, cb) => {
const datetime = requireNew('./helpers/datetime')
const markdown = requireNew('./helpers/markdown')(config.rootDir)
const metatags = requireNew('./helpers/metatags')
const Feed = requireNew('./helpers/rss')
const appConfig = requireNew('../config')
const datetime = importFresh('./helpers/datetime')
const markdown = importFresh('./helpers/markdown')(config.rootDir)
const metatags = importFresh('./helpers/metatags')
const Feed = importFresh('./helpers/rss')
const appConfig = importFresh('../config')

const files = []
const sitemap = []
Expand Down Expand Up @@ -390,7 +391,7 @@ module.exports = (config, cb) => {
})
)
.pipe(gulp.dest('./dist'))
.on('finish', () => {
.on('finish', async () => {
// Generate RSS feeds
const feed = Feed(files)

Expand All @@ -403,12 +404,13 @@ module.exports = (config, cb) => {
fs.writeFileSync(config.feed.rss, feed.rss2())

// Generate sitemap
const sm = new Sitemap({
hostname: config.host,
urls: sitemap
const sitemapStream = new SitemapStream({
hostname: config.host
})

const xml = sm.toString()
const xml = await streamToPromise(
Readable.from(sitemap).pipe(sitemapStream)
).then(data => data.toString())

fs.writeFileSync(config.sitemap, xml)

Expand Down
2 changes: 1 addition & 1 deletion gulp/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = (config, cb) => {
return cb()
}

if (argv.watch) {
if (argv.webpackWatch) {
compiler.watch({}, log)
} else {
compiler.run(log)
Expand Down
Loading

0 comments on commit 8161cb9

Please sign in to comment.