-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite in Coffeescript, updated gulp build
Still need to add a build stage as for now nothing is being minified, but for development this should work fine for now. All sourcemaps working. Cleared out uncertain files. Added a more robust .gitignore. Removed Susy/Compass. Added Bourbon/Neat.
- Loading branch information
1 parent
c4f5745
commit 56e214e
Showing
195 changed files
with
513 additions
and
65,109 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 |
---|---|---|
@@ -1,2 +1,18 @@ | ||
# As Yeoman assumes the usage of Bower and Grunt, ignore the below: | ||
bower_components | ||
node_modules | ||
|
||
# Ignore automatically generated cruft | ||
*.log | ||
.sass-cache | ||
|
||
# Ignore Test Files | ||
index.html | ||
|
||
# Operating system files | ||
.Spotlight-V100 | ||
.Trashes | ||
.DS_Store | ||
.sass-cache | ||
.DS_Store? | ||
ehthumbs.db | ||
Thumbs.db |
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
{ | ||
"name": "thm", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"underscore": "~1.6.0" | ||
}, | ||
"dependencies": {}, | ||
"private": true | ||
} |
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,38 @@ | ||
neat = require('node-neat').includePaths | ||
dest = "../bld" | ||
src = "./src" | ||
|
||
module.exports = | ||
|
||
browserSync: | ||
proxy: "thm.dev/" | ||
ghostMode: | ||
clicks: false | ||
location: false | ||
forms: false | ||
scroll: false | ||
|
||
sass: | ||
src: "styl/src/**" | ||
dest: dest | ||
settings: | ||
sourceComments: 'map', | ||
imagePath: '/img', | ||
errLogToConsole: true, | ||
includePaths: ['sass'].concat(neat) | ||
|
||
markup: | ||
src: ['../*.html', '../*.php', '../inc/*.php', '../templates/*.php'] | ||
|
||
images: | ||
src: "/img/**" | ||
dest: dest + "/img" | ||
|
||
browserify: | ||
bundleConfigs: [ | ||
entries: './js/src/app.coffee' | ||
dest: dest | ||
extensions: ['.coffee'] | ||
outputName: 'app.js' | ||
debug: true | ||
] |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
browserSync = require 'browser-sync' | ||
gulp = require 'gulp' | ||
config = require('../config').browserSync | ||
|
||
gulp.task 'browserSync', -> | ||
browserSync(config) | ||
|
||
gulp.task 'bs-reload', -> | ||
browserSync.reload() |
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
browserify = require 'browserify' | ||
browserSync = require 'browser-sync' | ||
watchify = require 'watchify' | ||
bundleLogger = require '../util/bundleLogger' | ||
gulp = require 'gulp' | ||
handleErrors = require '../util/handleErrors' | ||
source = require 'vinyl-source-stream' | ||
config = require('../config').browserify | ||
_ = require 'lodash' | ||
|
||
browserifyTask = (callback, devMode) -> | ||
|
||
bundleQueue = config.bundleConfigs.length | ||
|
||
browserifyThis = (bundleConfig) -> | ||
|
||
if devMode | ||
_.extend bundleConfig, watchify.args, debug: true | ||
bundleConfig = _.omit bundleConfig, ['external', 'require'] | ||
|
||
b = browserify(bundleConfig) | ||
|
||
bundle = -> | ||
bundleLogger.start(bundleConfig.outputName) | ||
|
||
return b | ||
.bundle() | ||
.on 'error', handleErrors | ||
.pipe(source(bundleConfig.outputName)) | ||
.pipe(gulp.dest(bundleConfig.dest)) | ||
.on 'end', reportFinished | ||
.pipe(browserSync.reload | ||
stream: true | ||
) | ||
|
||
b = watchify(b) | ||
b.on 'update', bundle | ||
bundleLogger.watch(bundleConfig.outputName) | ||
|
||
reportFinished = -> | ||
bundleLogger.end(bundleConfig.outputName) | ||
|
||
if bundleQueue | ||
bundleQueue-- | ||
if bundleQueue is 0 | ||
callback() | ||
return | ||
|
||
return bundle() | ||
|
||
config.bundleConfigs.forEach(browserifyThis) | ||
|
||
gulp.task 'browserify', browserifyTask | ||
|
||
module.exports = browserifyTask |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
gulp = require 'gulp' | ||
|
||
gulp.task 'default', ['browserify', 'sass', 'images', 'watch'] |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
changed = require 'gulp-changed' | ||
gulp = require 'gulp' | ||
imagemin = require 'gulp-imagemin' | ||
config = require('../config').images | ||
browserSync = require 'browser-sync' | ||
|
||
gulp.task 'images', -> | ||
return gulp.src(config.src) | ||
.pipe(changed(config.dest)) | ||
.pipe(imagemin()) | ||
.pipe(gulp.dest(config.dest)) | ||
.pipe(browserSync.reload | ||
stream: true | ||
) |
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,9 @@ | ||
gulp = require 'gulp' | ||
config = require('../config').markup | ||
browserSync = require 'browser-sync' | ||
|
||
gulp.task 'markup', -> | ||
return gulp.src(config.src) | ||
.pipe(browserSync.reload | ||
stream: true | ||
) |
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,25 @@ | ||
gulp = require('gulp') | ||
browserSync = require('browser-sync') | ||
sass = require('gulp-sass') | ||
sourcemaps = require('gulp-sourcemaps') | ||
handleErrors = require('../util/handleErrors') | ||
config = require('../config').sass | ||
autoprefixer = require('gulp-autoprefixer') | ||
neat = require('node-neat').includePaths | ||
|
||
gulp.task 'sass', -> | ||
return gulp.src('styl/src/screen.scss') | ||
.pipe(sourcemaps.init()) | ||
.pipe(sass | ||
sourceComments: 'map' | ||
imagePath: '/img' | ||
errLogToConsole: true | ||
includePaths: ['sass'].concat(neat) | ||
) | ||
.pipe(autoprefixer | ||
browsers: ['last 2 version'] | ||
) | ||
.pipe(sourcemaps.write()) | ||
.on('error', handleErrors) | ||
.pipe(gulp.dest(config.dest)) | ||
.pipe(browserSync.reload({stream:true})) |
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,4 @@ | ||
gulp = require 'gulp' | ||
|
||
gulp.task 'setWatch', -> | ||
global.isWatching = true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
gulp = require 'gulp' | ||
config = require('../config').browserify | ||
size = require 'gulp-filesize' | ||
uglify = require 'gulp-uglify' | ||
rename = require 'gulp-rename' | ||
browserSync = require 'browser-sync' | ||
|
||
gulp.task 'uglify', ['browserify'], -> | ||
return gulp.src('../bld/app.js') | ||
.pipe(uglify()) | ||
.pipe(rename | ||
suffix: '.min' | ||
) | ||
.pipe(gulp.dest('../bld')) | ||
.pipe(size()) | ||
.pipe(browserSync.reload | ||
stream: true | ||
once: true | ||
notify: false | ||
) |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
gulp = require 'gulp' | ||
config = require '../config' | ||
watchify = require './browserify' | ||
|
||
gulp.task 'watch', ['setWatch','browserSync'], (callback) -> | ||
gulp.watch('./js/src/*.coffee', ['browserify']) | ||
# gulp.watch('../bld/app.js', ['uglify']) | ||
gulp.watch(config.sass.src, ['sass']) | ||
gulp.watch(config.images.src, ['images']) | ||
gulp.watch(config.markup.src, ['bs-reload']) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.