Skip to content

Commit

Permalink
fix(gulp): switch xml lint library
Browse files Browse the repository at this point in the history
  • Loading branch information
duncdrum committed Jan 29, 2020
1 parent 09c39d6 commit 5c71a83
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 111 deletions.
32 changes: 18 additions & 14 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ var paths = {
output: 'src/main/xar-resources/resources/'
},
fonts: {
output: 'src/main/xar-resources/resources/fonts/',
output: 'src/main/xar-resources/resources/fonts/'
},
listings: 'src/main/xar-resources/data/*/listings/*.xml'
xml: {
listings: 'src/main/xar-resources/data/*/listings/*.xml',
articles: 'src/main/xar-resources/data/*/*.xml'
}
}

/**
Expand Down Expand Up @@ -86,7 +89,7 @@ var lazypipe = require('lazypipe')
var rename = require('gulp-rename')
var header = require('gulp-header')
var pkg = require('./package.json')
var prettyData = require('gulp-pretty-data')
var muxml = require('gulp-muxml')


// Scripts
Expand Down Expand Up @@ -196,18 +199,19 @@ var lintScripts = function(done) {
done()
}

// minify and lint xml
// pretty print all xml listings
// articles not yet decided
var prettyXml = function(done) {
src(paths.listings, { base: "./" })
.pipe(prettyData({
type: 'minify',
preserveComments: true
}))
// … then pretty print xml
.pipe(prettyData({
type: 'prettify',
preserveComments: true
}))
src(paths.xml.listings, { base: "./" })
.pipe(muxml({
stripComments: false,
stripCdata: false,
stripInstruction: false,
saxOptions: {
trim: true,
normalize: true
}
}))
.pipe(dest("./"))
// Signal completion
done()
Expand Down
197 changes: 101 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"gulp-cssnano": "^2.1.3",
"gulp-flatmap": "^1.0.2",
"gulp-header": "^2.0.9",
"gulp-muxml": "^2.0.0",
"gulp-optimize-js": "^1.1.0",
"gulp-pretty-data": "^0.1.2",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.0.2",
"gulp-sourcemaps": "^2.6.5",
Expand Down

0 comments on commit 5c71a83

Please sign in to comment.