-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from jh3y/develop
Address #57
- Loading branch information
Showing
84 changed files
with
2,230 additions
and
1,731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015", "react"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var gulp = require('gulp'), | ||
gConfig = require('../gulp-config'), | ||
pluginOpts = gConfig.pluginOpts, | ||
sources = gConfig.paths.sources, | ||
destinations = gConfig.paths.destinations, | ||
env = require('./utils').getEnv(), | ||
plugins = require('gulp-load-plugins')(pluginOpts.load); | ||
|
||
var assets = { | ||
scripts: function() { | ||
var yapFilter = plugins.filter([ | ||
'**/*.js', | ||
'!**/yap.min.js' | ||
]); | ||
return gulp.src(sources.vendor.js) | ||
.pipe(plugins.plumber()) | ||
.pipe(env.dist ? yapFilter: plugins.gUtil.noop()) | ||
.pipe(plugins.concat('vendor.js')) | ||
.pipe(gulp.dest(destinations.js)) | ||
.pipe(plugins.uglify(pluginOpts.uglify)) | ||
.pipe(plugins.rename(pluginOpts.rename)) | ||
.pipe(gulp.dest(destinations.js)); | ||
}, | ||
fonts: function() { | ||
return gulp.src(sources.vendor.fonts) | ||
.pipe(plugins.plumber()) | ||
.pipe(gulp.dest(destinations.fonts)); | ||
}, | ||
styles: function() { | ||
return gulp.src(sources.vendor.css) | ||
.pipe(plugins.plumber()) | ||
.pipe(plugins.concat('vendor.css')) | ||
.pipe(gulp.dest(destinations.css)) | ||
.pipe(plugins.minify(pluginOpts.minify)) | ||
.pipe(plugins.rename(pluginOpts.rename)) | ||
.pipe(gulp.dest(destinations.css)); | ||
}, | ||
img: function() { | ||
return gulp.src(sources.img) | ||
.pipe(plugins.plumber()) | ||
.pipe(gulp.dest(destinations.img)); | ||
}, | ||
json: function() { | ||
return gulp.src(sources.json) | ||
.pipe(plugins.plumber()) | ||
.pipe(gulp.dest(destinations.js)); | ||
} | ||
}; | ||
|
||
module.exports = assets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var gulp = require('gulp'), | ||
gConfig = require('../gulp-config'), | ||
pluginOpts = gConfig.pluginOpts, | ||
sources = gConfig.paths.sources, | ||
destinations = gConfig.paths.destinations, | ||
env = require('./utils').getEnv(), | ||
plugins = require('gulp-load-plugins')(pluginOpts.load); | ||
|
||
var deploy = { | ||
deploy: function () { | ||
return gulp.src(sources.overwatch) | ||
.pipe(plugins.deploy()); | ||
} | ||
}; | ||
|
||
module.exports = deploy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var gulp = require('gulp'), | ||
gConfig = require('../gulp-config'), | ||
pluginOpts = gConfig.pluginOpts, | ||
sources = gConfig.paths.sources, | ||
destinations = gConfig.paths.destinations, | ||
env = require('./utils').getEnv(), | ||
plugins = require('gulp-load-plugins')(pluginOpts.load); | ||
|
||
var markup = { | ||
compile: function() { | ||
return gulp.src(sources.docs) | ||
.pipe(plugins.plumber()) | ||
.pipe(plugins.pug(pluginOpts.pug)) | ||
.pipe(gulp.dest(destinations.html)); | ||
}, | ||
watch: function() { | ||
gulp.watch(sources.markup, ['markup:compile']); | ||
} | ||
}; | ||
|
||
module.exports = markup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var gulp = require('gulp'), | ||
browserify = require('browserify'), | ||
source = require('vinyl-source-stream'), | ||
buffer = require('vinyl-buffer'), | ||
fs = require('fs'), | ||
gConfig = require('../gulp-config'), | ||
pluginOpts = gConfig.pluginOpts, | ||
sources = gConfig.paths.sources, | ||
destinations = gConfig.paths.destinations, | ||
env = require('./utils').getEnv(), | ||
plugins = require('gulp-load-plugins')(pluginOpts.load); | ||
|
||
var scripts = { | ||
compile: function () { | ||
var b = browserify({ | ||
entries: [ | ||
'./src/script/app.js' | ||
], | ||
transform: 'babelify', | ||
extensions: '.js', | ||
debug: env.mapped ? true: false | ||
}); | ||
|
||
return b.bundle() | ||
.pipe(plugins.plumber()) | ||
.pipe(source(gConfig.pkg.name + '.js')) | ||
.pipe(buffer()) | ||
.pipe(env.mapped ? plugins.sourcemaps.init({loadMaps: true}): plugins.gUtil.noop()) | ||
.pipe(plugins.wrap(pluginOpts.wrap)) | ||
.pipe(plugins.header(fs.readFileSync('./LICENSE', 'utf-8'))) | ||
.pipe(env.stat ? plugins.size(pluginOpts.gSize): plugins.gUtil.noop()) | ||
.pipe(gulp.dest(destinations.js)) | ||
.pipe(plugins.uglify(pluginOpts.uglify)) | ||
.pipe(plugins.rename(pluginOpts.rename)) | ||
.pipe(env.mapped ? plugins.sourcemaps.write('./'): plugins.gUtil.noop()) | ||
.pipe(env.stat ? plugins.size(pluginOpts.gSize): plugins.gUtil.noop()) | ||
.pipe(gulp.dest(env.dist ? destinations.dist: destinations.js)); | ||
|
||
}, | ||
watch: function() { | ||
gulp.watch(sources.script, ['script:compile']); | ||
} | ||
}; | ||
|
||
module.exports = scripts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var gulp = require('gulp'), | ||
browsersync = require('browser-sync'), | ||
vss = require('vinyl-source-stream'), | ||
vb = require('vinyl-buffer'), | ||
vf = require('vinyl-file'), | ||
gConfig = require('../gulp-config'), | ||
opts = gConfig.pluginOpts, | ||
src = gConfig.paths.sources, | ||
dest = gConfig.paths.destinations; | ||
/* | ||
start; creates local static livereload server using browser-sync. | ||
*/ | ||
var server = { | ||
start: function() { | ||
var server = browsersync.create(); | ||
server.init(opts.browserSync); | ||
return server.watch(src.overwatch, function(evt, file) { | ||
if (evt === 'change' && file.indexOf('.css') === -1) | ||
server.reload(); | ||
if (evt === 'change' && file.indexOf('.css') !== -1) | ||
vf.readSync(file) | ||
.pipe(vss(file)) | ||
.pipe(vb()) | ||
.pipe(server.stream()); | ||
}); | ||
} | ||
}; | ||
|
||
module.exports = server; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var gulp = require('gulp'), | ||
gConfig = require('../gulp-config'), | ||
pluginOpts = gConfig.pluginOpts, | ||
sources = gConfig.paths.sources, | ||
destinations = gConfig.paths.destinations, | ||
env = require('./utils').getEnv(), | ||
plugins = require('gulp-load-plugins')(pluginOpts.load); | ||
|
||
var style = { | ||
compile: function() { | ||
return gulp.src(sources.style, {base: 'src/style'}) | ||
.pipe(plugins.plumber()) | ||
.pipe(plugins.order(pluginOpts.order.stylus)) | ||
.pipe(plugins.concat(gConfig.pkg.name + '.styl')) | ||
.pipe(plugins.stylus()) | ||
.pipe(plugins.prefix(pluginOpts.prefix)) | ||
.pipe(gulp.dest(destinations.css)) | ||
.pipe(plugins.minify()) | ||
.pipe(plugins.rename(pluginOpts.rename)) | ||
.pipe(gulp.dest(destinations.css)); | ||
}, | ||
watch: function() { | ||
gulp.watch(sources.style, ['style:compile']); | ||
} | ||
}; | ||
|
||
module.exports = style; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var gulp = require('gulp'), | ||
gConfig = require('../gulp-config'), | ||
pluginOpts = gConfig.pluginOpts, | ||
sources = gConfig.paths.sources, | ||
destinations = gConfig.paths.destinations, | ||
env = require('./utils').getEnv(), | ||
plugins = require('gulp-load-plugins')(pluginOpts.load); | ||
|
||
var tmpl = { | ||
compile: function(){ | ||
return gulp.src(sources.templates) | ||
.pipe(plugins.plumber()) | ||
.pipe(plugins.pug(pluginOpts.pug)) | ||
.pipe(plugins.template({ | ||
name: 'templates.js', | ||
base: 'src/markup/templates/', | ||
variable: 'module.exports', | ||
options: { | ||
variable: 'tyto' | ||
} | ||
})) | ||
.pipe(gulp.dest(destinations.templates)); | ||
}, | ||
watch: function() { | ||
gulp.watch(sources.templates, ['tmpl:compile']); | ||
} | ||
}; | ||
|
||
module.exports = tmpl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var getEnv = function() { | ||
var gutil = require('gulp-util'), | ||
activeEnvs = {}, | ||
envs = [ | ||
'dist', | ||
'dev', | ||
'deploy', | ||
'mapped', | ||
'stat' | ||
]; | ||
for (var i = 0; i < envs.length; i++) { | ||
activeEnvs[envs[i]] = (gutil.env[envs[i]]) ? true: false; | ||
} | ||
return activeEnvs; | ||
}; | ||
module.exports = { | ||
getEnv: getEnv | ||
}; |
Oops, something went wrong.