Skip to content

Commit

Permalink
Added client.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Dosé committed Jul 23, 2014
1 parent befd85c commit 1839d7b
Show file tree
Hide file tree
Showing 20 changed files with 26,249 additions and 24 deletions.
28 changes: 4 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3
/public/system
/coverage/
/spec/tmp
**.orig
rerun.txt
pickle-email-*.html
config/initializers/secret_token.rb
config/secrets.yml

## Environment normalisation:
/.bundle
/vendor/bundle

# these should all be checked in to normalise the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
node_modules
bower_components
.DS_Store
npm-debug.log
10 changes: 10 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "passport",
"version": "0.0.1",
"license": "MIT",
"private": true,
"dependencies": {
"bootstrap": "~3.1.1",
"jquery": "~2.1.1"
}
}
82 changes: 82 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
'use strict'
var gulp = require('gulp')
, source = require('vinyl-source-stream')
, streamify = require('gulp-streamify')
, browserify = require('browserify')
, less = require('gulp-less')
, jade = require('gulp-jade')
, uglify = require('gulp-uglify')
, livereload = require('gulp-livereload')
, gutil = require('gulp-util')
, concat = require('gulp-concat')

var PORT = 3333
, SRC = './src'
, DEST = './public'
, LESS_PATHS = [ './src/css'
, './bower_components/bootstrap/less'
]
, LEGACY_JS = [ './bower_components/jquery/dist/jquery.js'
, './bower_components/bootstrap/dist/js/bootstrap.js'
]

// wrap a stream in an error catcher
function catchErrors(stream) {
stream.on('error', function(err) {
gutil.log(gutil.colors.red('Error'), err.message)
stream.end()
})
return stream
}

// compile jade file
gulp.task('jade', function() {
gulp.src(SRC + '/pages/**/*.jade')
.pipe(catchErrors(jade()))
.pipe(gulp.dest(DEST))
})

// compile js as a browserify bundle
gulp.task('js', function() {
catchErrors(browserify(SRC + '/js/index.js').bundle())
.pipe(source('bundle.js'))
// .pipe(streamify(uglify()))
.pipe(gulp.dest(DEST + '/js'))
})

// concatenate legacy vendor js libraries
gulp.task('vendor-js', function() {
gulp.src (LEGACY_JS)
.pipe(concat('vendor.js'))
.pipe(gulp.dest(DEST + '/js'))
})

// compile less
gulp.task('less', function() {
gulp.src(SRC + '/css/main.less')
.pipe(catchErrors(less({paths: LESS_PATHS})))
.pipe(gulp.dest(DEST + '/css'))
})

// build all assets
gulp.task('build', ['jade', 'less', 'js', 'vendor-js'])

// start a simple static asset server
gulp.task('server', function(next) {
var connect = require('connect')
, server = connect()
server.use(connect.static(DEST)).listen(PORT, next)
})

// rebuild on changes + livereload
gulp.task('watch', ['build', 'server'], function() {
var server = livereload()

gulp.watch(SRC + '/css/**', ['less'])
gulp.watch(SRC + '/js/**', ['js'])
gulp.watch(SRC + '/**/*.jade', ['jade'])

gulp.watch(DEST + '/**').on('change', function(file) {
server.changed(file.path)
})
})
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "passport",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "./node_modules/gulp/bin/gulp.js watch",
"build": "./node_modules/gulp/bin/gulp.js build",
"postinstall": "./node_modules/bower/bin/bower install"
},
"devDependencies": {
"bower": "^1.3.8",
"browserify": "^4.1.2",
"connect": "^2.15.0",
"gulp": "^3.6.2",
"gulp-concat": "^2.2.0",
"gulp-jade": "^0.5.0",
"gulp-less": "^1.2.3",
"gulp-livereload": "^1.5.0",
"gulp-streamify": "0.0.5",
"gulp-uglify": "^0.3.0",
"gulp-util": "^2.2.14",
"knockout": "^3.1.0",
"moment": "^2.7.0",
"superagent": "^0.18.2",
"vinyl-source-stream": "^0.1.1"
},
"license": "MIT"
}
Loading

0 comments on commit 1839d7b

Please sign in to comment.