refactored for a simpler gulp file with reuse of aggregates now that it is possible

This commit is contained in:
Kevin Ross 2016-03-18 12:00:51 -05:00
parent 194f67f0cf
commit c03e48f023
2 changed files with 68 additions and 67 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
# Ignore the root dist as buildcontrol will place it on it's own branch (same for gh-pages) # Ignore the root dist as buildcontrol will place it on it's own branch (same for gh-pages)
/dist /dist
/build
# Ignore docs dist files # Ignore docs dist files
docs/dist/**/* docs/dist/**/*

View File

@ -67,7 +67,18 @@ const copyJsToDocs = new Copy(gulp, preset, {
dest: 'docs/dist/' dest: 'docs/dist/'
}) })
const javascripts = series(gulp, const copyCssToDocs = new Copy(gulp, preset, {
task: {name: 'dist:css->docs'},
source: {
options: {cwd: 'dist'},
glob: ['*.css']
},
dest: 'docs/dist/'
})
const js = new Aggregate(gulp, 'js',
series(gulp,
new EsLint(gulp, preset),
parallel(gulp, parallel(gulp,
new RollupEs(gulp, preset, rollupConfig, {options: {dest: 'bootstrap-material-design.es.js'}}), new RollupEs(gulp, preset, rollupConfig, {options: {dest: 'bootstrap-material-design.es.js'}}),
new RollupUmd(gulp, preset, rollupConfig, { new RollupUmd(gulp, preset, rollupConfig, {
@ -85,62 +96,50 @@ const javascripts = series(gulp,
), ),
copyJsToDocs copyJsToDocs
) )
)
let eslint = new EsLint(gulp, preset) const css = new Aggregate(gulp, 'css',
let scsslint = new ScssLint(gulp, preset) series(gulp,
const copyCssToDocs = new Copy(gulp, preset, { new ScssLint(gulp, preset),
task: {name: 'dist:css->docs'},
source: {
options: {cwd: 'dist'},
glob: ['*.css']
},
dest: 'docs/dist/'
})
const sass = series(gulp,
new Sass(gulp, preset), new Sass(gulp, preset),
new CssNano(gulp, preset), new CssNano(gulp, preset),
copyCssToDocs copyCssToDocs
) )
let linters = parallel(gulp, scsslint, eslint) )
let recipes = series(gulp, const defaultRecipes = new Aggregate(gulp, 'default', series(gulp,
new Clean(gulp, preset), new Clean(gulp, preset),
linters,
parallel(gulp, parallel(gulp,
sass, css,
javascripts js
)
) )
))
new Aggregate(gulp, 'default', recipes) // load all docs tasks
new Aggregate(gulp, 'lint', linters)
new Aggregate(gulp, 'js', series(gulp, eslint, javascripts))
new Aggregate(gulp, 'css', series(gulp, scsslint, sass))
let docsDefaultRecipes = gulpDocs(gulp, {rollupConfig: rollupConfig}) let docsDefaultRecipes = gulpDocs(gulp, {rollupConfig: rollupConfig})
const buildControlConfig = { // publish
options: { // see https://github.com/alienfast/build-control/blob/master/src/buildControl.js#L11 new Aggregate(gulp, 'publish',
//branch: 'v4-dist'
}
}
series(gulp,
const prepRelease = series(gulp,
new Prepublish(gulp, preset), // asserts committed new Prepublish(gulp, preset), // asserts committed
recipes,
docsDefaultRecipes, // this cleans docs, so we need to re-copy dist to docs in this scenario defaultRecipes,
docsDefaultRecipes,
// ^^^docs:default cleans docs/dist, so we need to re-copy dist to docs in this scenario
parallel(gulp, copyCssToDocs, copyJsToDocs), parallel(gulp, copyCssToDocs, copyJsToDocs),
new Jekyll(gulp, preset, {options: {raw: 'baseurl: "/bootstrap-material-design"'}})
)
new Aggregate(gulp, 'prepRelease', prepRelease) new Jekyll(gulp, preset, {options: {raw: 'baseurl: "/bootstrap-material-design"'}}),
new PublishBuild(gulp, preset, {
npm: {
bump: false,
publish: false
}
}),
new Aggregate(gulp, 'publish', series(gulp,
prepRelease,
new PublishBuild(gulp, preset),
new PublishGhPages(gulp, preset, { new PublishGhPages(gulp, preset, {
options: { options: {
remote: { remote: {
@ -148,5 +147,6 @@ new Aggregate(gulp, 'publish', series(gulp,
} }
} }
}) })
)) )
)