working on gulp 4 integration

This commit is contained in:
Kevin Ross 2016-03-17 15:11:07 -05:00
parent 8f4ec7c96c
commit 560af73402
5 changed files with 54 additions and 46 deletions

View File

@ -4,7 +4,8 @@
"extends": "eslint:recommended",
"env": {
"browser": true,
"jquery": true
"jquery": true,
"es6": true
}
//,
// "rules": {

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015-2016, Federico Zivolo
Copyright (c) 2015-2016, Federico Zivolo and contributors - https://github.com/FezVrasta/bootstrap-material-design
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -23,10 +23,8 @@ SOFTWARE.
## Acknowledgements:
### Bootstrap
Some original Bootstrap tooling code and documentation http://getbootstrap.com
Copyright (c) 2011-2016 Twitter, Inc
- Some original Bootstrap code and documentation http://getbootstrap.com
`Copyright (c) 2011-2015 Twitter, Inc`
### MDL
Some original MDL code http://www.getmdl.io/
Copyright 2015 Google Inc. All Rights Reserved.
- Some original MDL code http://www.getmdl.io/
`Copyright 2015 Google Inc. All Rights Reserved.`

View File

@ -1,4 +1,4 @@
import {Preset, Clean, Copy, Jekyll, MinifyCss, Sass, RollupEs, RollupUmd, RollupIife, ScssLint, EsLint, TaskSeries, Uglify} from 'gulp-pipeline/src/index'
import {Preset, Clean, Copy, Jekyll, MinifyCss, Sass, RollupEs, RollupUmd, RollupIife, ScssLint, EsLint, Aggregate, Uglify, parallel, series} from 'gulp-pipeline/src/index'
const referenceDocNotice =
`$1\n
@ -34,7 +34,7 @@ const prefix = {task: {prefix: 'docs:'}}
export default function (gulp, options) {
let javascripts = [
let javascripts = parallel(gulp,
new RollupIife(gulp, preset, prefix, options.rollupConfig, {
options: {
dest: 'docs.iife.js',
@ -46,31 +46,34 @@ export default function (gulp, options) {
source: {options: {cwd: 'docs/assets/js/vendor'}},
options: {dest: 'docs-vendor.min.js'}
})
]
)
let eslint = new EsLint(gulp, preset, prefix)
let scsslint = new ScssLint(gulp, preset, prefix, {
source: {glob: ['**/*.scss', '!docs.scss']},
watch: {glob: ['**/*.scss', '!docs.scss']}
})
let linters = [scsslint, eslint]
let linters = parallel(gulp, scsslint, eslint)
let sass = new Sass(gulp, preset, prefix)
new TaskSeries(gulp, 'default', [
let recipes = series(gulp,
new Clean(gulp, preset, prefix),
linters,
sass,
javascripts,
new MinifyCss(gulp, preset, prefix)
], prefix)
new TaskSeries(gulp, 'lint', linters, prefix)
new TaskSeries(gulp, 'js', [eslint, javascripts], prefix)
new TaskSeries(gulp, 'css', [scsslint, sass], prefix)
)
new Aggregate(gulp, 'default', recipes, prefix)
new Aggregate(gulp, 'lint', linters, prefix)
new Aggregate(gulp, 'js', series(gulp, eslint, javascripts), prefix)
new Aggregate(gulp, 'css', series(gulp, scsslint, sass), prefix)
// docs copy
new TaskSeries(gulp, 'copy:bs-docs', [
new Aggregate(gulp, 'copy:bs-docs', parallel(gulp,
new Copy(gulp, preset, prefix, {
task: {name: 'copy:bs-docs-content'},
debug: true,
task: false, //{name: 'copy:bs-docs-content'},
source: {
options: {cwd: '../bootstrap/docs/content'},
glob: ['**/*']
@ -79,7 +82,7 @@ export default function (gulp, options) {
process: copyProcessor
}),
new Copy(gulp, preset, prefix, {
task: {name: 'copy:bs-docs-components'},
task: false, //{name: 'copy:bs-docs-components'},
source: {
options: {cwd: '../bootstrap/docs/components'},
glob: ['**/*']
@ -88,7 +91,7 @@ export default function (gulp, options) {
process: copyProcessor
}),
new Copy(gulp, preset, prefix, {
task: {name: 'copy:bs-docs-scss'},
task: false, //{name: 'copy:bs-docs-scss'},
source: {
options: {cwd: '../bootstrap/docs/assets/scss'},
glob: ['**/*', '!docs.scss'] // keep variable customizations
@ -99,7 +102,7 @@ export default function (gulp, options) {
}
}),
new Copy(gulp, preset, prefix, {
task: {name: 'copy:bs-docs-plugins'},
task: false, //{name: 'copy:bs-docs-plugins'},
source: {
options: {cwd: '../bootstrap/docs/_plugins'},
glob: ['**/*', '!bridge.rb']
@ -107,7 +110,7 @@ export default function (gulp, options) {
dest: 'docs/_plugins/'
}),
new Copy(gulp, preset, prefix, {
task: {name: 'copy:bs-docs-js-vendor'},
task: false, //{name: 'copy:bs-docs-js-vendor'},
source: {
options: {cwd: '../bootstrap/docs/assets/js/vendor'},
glob: [
@ -118,5 +121,7 @@ export default function (gulp, options) {
},
dest: 'docs/assets/js/vendor/'
}, prefix)
])
))
return recipes
}

View File

@ -1,4 +1,4 @@
import {Preset, Clean, Copy, Jekyll, MinifyCss, Prepublish, PublishBuild, Sass, RollupEs, RollupUmd, RollupIife, ScssLint, EsLint, TaskSeries, Uglify} from 'gulp-pipeline/src/index'
import {Preset, Clean, Copy, Jekyll, MinifyCss, Prepublish, PublishBuild, Sass, RollupEs, RollupUmd, RollupIife, ScssLint, EsLint, Aggregate, Uglify, series, parallel} from 'gulp-pipeline/src/index'
import gulp from 'gulp'
import findup from 'findup-sync'
import pkg from './package.json'
@ -52,7 +52,7 @@ let rollupConfig = {
}
}
let javascripts = [
let javascripts = parallel(gulp,
new RollupEs(gulp, preset, rollupConfig, {options: {dest: 'bootstrap-material-design.es.js'}}),
new RollupUmd(gulp, preset, rollupConfig, {
options: {
@ -65,34 +65,38 @@ let javascripts = [
dest: 'bootstrap-material-design.iife.js',
moduleName: 'bootstrapMaterialDesign'
}
}),
]
})
)
let eslint = new EsLint(gulp, preset)
let scsslint = new ScssLint(gulp, preset)
let sass = new Sass(gulp, preset)
let linters = [scsslint, eslint]
let linters = parallel(gulp, scsslint, eslint)
new TaskSeries(gulp, 'default', [
let recipes = series(gulp,
new Clean(gulp, preset),
linters,
sass,
javascripts,
parallel(gulp,
sass,
javascripts
),
new MinifyCss(gulp, preset)
])
new TaskSeries(gulp, 'lint', linters)
new TaskSeries(gulp, 'js', [eslint, javascripts])
new TaskSeries(gulp, 'css', [scsslint, sass])
)
new Aggregate(gulp, 'default', recipes, {debug: true})
new Aggregate(gulp, 'lint', linters)
new Aggregate(gulp, 'js', series(gulp, eslint, javascripts))
new Aggregate(gulp, 'css', series(gulp, scsslint, sass))
gulpDocs(gulp, {rollupConfig: rollupConfig})
let docsDefaultRecipes = gulpDocs(gulp, {rollupConfig: rollupConfig})
//
let prepRelease = new TaskSeries(gulp, 'prep-release', [
new Prepublish(gulp, preset),
'default',
'docs:default',
let prepRelease = new Aggregate(gulp, 'prep-release', [
//new Prepublish(gulp, preset), // asserts committed
[
recipes,
docsDefaultRecipes
],
new Copy(gulp, preset, {
task: {name: 'copy:dist-to-docs'},
source: {
@ -105,7 +109,7 @@ let prepRelease = new TaskSeries(gulp, 'prep-release', [
])
new TaskSeries(gulp, 'publish', [
new Aggregate(gulp, 'publish', [
prepRelease,
new PublishBuild(gulp, preset, {
npm: {

View File

@ -42,8 +42,8 @@
"babel-polyfill": "^6.6",
"babel-preset-es2015": "^6.6.0",
"extend": "^3.0.0",
"gulp": "^3.9.1",
"gulp-pipeline": "^0.4",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-pipeline": "^4.0",
"moment": "^2.11.2"
},
"old-grunt-devDependencies": {