Skip to content

Commit

Permalink
changed files only
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Lasky authored and Shuwen Qian committed Mar 3, 2016
1 parent d086872 commit 1930f92
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
33 changes: 29 additions & 4 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,35 @@ var run = require('run-sequence');
var htmlmin = require('gulp-minify-html');
var wrap = require('gulp-wrap');
var inlineAssets = require('gulp-inline-assets');
var marked = require('gulp-marked');
var changed = require('gulp-changed');
var es = require('event-stream');
var cache = require('gulp-cached');

var SRC = 'src/';
var BUILD = 'build/';
var DOCS = 'build_docs/';
var BUILD_DOCS = 'build_docs/';
var DIST = 'dist/';
var TEMPLATES = 'grunt/templates/'; //TODO swap to gulp

/** BUILD **/

gulp.task('clean', function() {
return del(BUILD, DOCS, DIST);
return del([BUILD + '**', BUILD_DOCS+ '**', DIST+ '**']);
});

gulp.task('copy', function() {
return gulp.src([SRC + '**/*.+(html|js|woff)', '!' + SRC +'**/example.html'])
.pipe(changed(BUILD))
.pipe(debug())
.pipe(gulp.dest(BUILD));
});

gulp.task('sass', function() {
return gulp.src(SRC + 'mm-*/*.scss')
// .pipe(cache())
.pipe(changed(BUILD, {extension:'.css'}))
.pipe(debug())
.pipe(sass({includePaths: ['./bower_components/bourbon/app/assets/stylesheets/', './src/shared/sass/']}).on('error', sass.logError))
.pipe(gulp.dest(BUILD))
.pipe(wrap({src:TEMPLATES + "style_module_template.html"},{},{engine:"hogan"}))
Expand All @@ -54,6 +63,7 @@ gulp.task('font', function() {

gulp.task('vulcanize', function() {
var modules = gulp.src(BUILD + "mm-*/mm-*.html")
.pipe(changed(BUILD))
.pipe(vulcanize({
inlineScripts:true,
inlineCss:true,
Expand Down Expand Up @@ -85,6 +95,10 @@ gulp.task('default', function(cb) {
run('clean','copy',['sass','font'],'vulcanize',cb);
});

gulp.task('build', function(cb) {
run('copy', ['sass','font'],'vulcanize', cb);
});

gulp.task('vulcanize:prod', function() {
return gulp.src(BUILD + "mm-*/mm-*.html")
.pipe(vulcanize({
Expand All @@ -104,12 +118,23 @@ gulp.task('vulcanize:prod', function() {

gulp.task('docs', function() {
var modules = glob.sync("mm-*", {cwd:SRC});
var articles = glob.sync("*.md", {cwd:"./docs/articles/"});
var articleMap = JSON.parse(fs.readFileSync('./docs/articles/manifest.json'));

var articleStream = gulp.src('./docs/articles/*.md')
.pipe(debug())
.pipe(marked().on('error',console.log))
.pipe(wrap({src:"./docs/article_template.html"},{},{engine:"hogan"}).on('error',console.log))
.pipe(gulp.dest(BUILD_DOCS));
return articles;
});

/** LIVE **/

gulp.task('sass:watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
gulp.task('watch', function () {
gulp.watch(SRC + 'mm-*/*.scss', ['sass']);
// gulp.watch(SRC)
// gulp.watch('./')
});

/** DEPLOY **/
2 changes: 1 addition & 1 deletion docs/article_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{> footer}}
<article class="layout-article">
<div class="docs-content article">
{{{article}}}
{{{contents}}}
</div>
<div class="layout-push"></div>
</article>
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"Justin Moore <[email protected]>",
"Derek Olson <[email protected]>"
],
"license": "BSD",
"license": "BSD-3-Clause",
"devDependencies": {
"autoprefixer": "^6.0.3",
"del": "^2.0.2",
"event-stream": "^3.3.2",
"glob": "^5.0.15",
"grunt": "*",
"grunt-banner": "^0.3.1",
"grunt-bump": "^0.3.0",
Expand All @@ -33,22 +35,23 @@
"grunt-shell": "^1.1.2",
"grunt-text-replace": "^0.4.0",
"grunt-vulcanize": "^1.0.0",
"load-grunt-tasks": "*",
"marked": "^0.3.3",
"time-grunt": "^1.2.1",
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-cached": "^1.1.0",
"gulp-changed": "^1.3.0",
"gulp-debug": "^2.1.2",
"gulp-inline-assets": "^0.1.1",
"gulp-marked": "^1.0.0",
"gulp-minify-html": "^1.0.4",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.1.0",
"gulp-util": "^3.0.7",
"gulp-vulcanize": "^6.0.1",
"gulp-wrap": "^0.11.0",
"hogan.js": "^3.0.2",
"load-grunt-tasks": "*",
"marked": "^0.3.3",
"merge-stream": "^1.0.0",
"run-sequence": "^1.1.4",
"glob": "^5.0.15"
"time-grunt": "^1.2.1"
}
}

0 comments on commit 1930f92

Please sign in to comment.