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,27 +67,6 @@ const copyJsToDocs = new Copy(gulp, preset, {
dest: 'docs/dist/' dest: 'docs/dist/'
}) })
const javascripts = series(gulp,
parallel(gulp,
new RollupEs(gulp, preset, rollupConfig, {options: {dest: 'bootstrap-material-design.es.js'}}),
new RollupUmd(gulp, preset, rollupConfig, {
options: {
dest: 'bootstrap-material-design.umd.js',
moduleName: 'bootstrapMaterialDesign'
}
}),
new RollupIife(gulp, preset, rollupConfig, {
options: {
dest: 'bootstrap-material-design.iife.js',
moduleName: 'bootstrapMaterialDesign'
}
})
),
copyJsToDocs
)
let eslint = new EsLint(gulp, preset)
let scsslint = new ScssLint(gulp, preset)
const copyCssToDocs = new Copy(gulp, preset, { const copyCssToDocs = new Copy(gulp, preset, {
task: {name: 'dist:css->docs'}, task: {name: 'dist:css->docs'},
source: { source: {
@ -97,56 +76,77 @@ const copyCssToDocs = new Copy(gulp, preset, {
dest: 'docs/dist/' dest: 'docs/dist/'
}) })
const sass = series(gulp, const js = new Aggregate(gulp, 'js',
new Sass(gulp, preset), series(gulp,
new CssNano(gulp, preset), new EsLint(gulp, preset),
copyCssToDocs parallel(gulp,
) new RollupEs(gulp, preset, rollupConfig, {options: {dest: 'bootstrap-material-design.es.js'}}),
let linters = parallel(gulp, scsslint, eslint) new RollupUmd(gulp, preset, rollupConfig, {
options: {
let recipes = series(gulp, dest: 'bootstrap-material-design.umd.js',
new Clean(gulp, preset), moduleName: 'bootstrapMaterialDesign'
linters, }
parallel(gulp, }),
sass, new RollupIife(gulp, preset, rollupConfig, {
javascripts options: {
dest: 'bootstrap-material-design.iife.js',
moduleName: 'bootstrapMaterialDesign'
}
})
),
copyJsToDocs
) )
) )
new Aggregate(gulp, 'default', recipes) const css = new Aggregate(gulp, 'css',
new Aggregate(gulp, 'lint', linters) series(gulp,
new Aggregate(gulp, 'js', series(gulp, eslint, javascripts)) new ScssLint(gulp, preset),
new Aggregate(gulp, 'css', series(gulp, scsslint, sass)) new Sass(gulp, preset),
new CssNano(gulp, preset),
copyCssToDocs
let docsDefaultRecipes = gulpDocs(gulp, {rollupConfig: rollupConfig}) )
const buildControlConfig = {
options: { // see https://github.com/alienfast/build-control/blob/master/src/buildControl.js#L11
//branch: 'v4-dist'
}
}
const prepRelease = series(gulp,
new Prepublish(gulp, preset), // asserts committed
recipes,
docsDefaultRecipes, // this cleans docs, so we need to re-copy dist to docs in this scenario
parallel(gulp, copyCssToDocs, copyJsToDocs),
new Jekyll(gulp, preset, {options: {raw: 'baseurl: "/bootstrap-material-design"'}})
) )
new Aggregate(gulp, 'prepRelease', prepRelease) const defaultRecipes = new Aggregate(gulp, 'default', series(gulp,
new Clean(gulp, preset),
new Aggregate(gulp, 'publish', series(gulp, parallel(gulp,
prepRelease, css,
new PublishBuild(gulp, preset), js
new PublishGhPages(gulp, preset, { )
options: {
remote: {
repo: 'git@github.com:rosskevin/bootstrap-material-design.git' // FIXME: temporary, remove this option when we are deploying to our home repo
}
}
})
)) ))
// load all docs tasks
let docsDefaultRecipes = gulpDocs(gulp, {rollupConfig: rollupConfig})
// publish
new Aggregate(gulp, 'publish',
series(gulp,
new Prepublish(gulp, preset), // asserts committed
defaultRecipes,
docsDefaultRecipes,
// ^^^docs:default cleans docs/dist, so we need to re-copy dist to docs in this scenario
parallel(gulp, copyCssToDocs, copyJsToDocs),
new Jekyll(gulp, preset, {options: {raw: 'baseurl: "/bootstrap-material-design"'}}),
new PublishBuild(gulp, preset, {
npm: {
bump: false,
publish: false
}
}),
new PublishGhPages(gulp, preset, {
options: {
remote: {
repo: 'git@github.com:rosskevin/bootstrap-material-design.git' // FIXME: temporary, remove this option when we are deploying to our home repo
}
}
})
)
)