diff --git a/client/README.md b/client/README.md index b75516ce384197..5ba2586944b6e0 100644 --- a/client/README.md +++ b/client/README.md @@ -1,3 +1,4 @@ This is the entry point for the client Code that should only run on the client should be put here. + NOTE(berks): For react specific stuff this should be the entry point diff --git a/client/config.json b/client/config.json deleted file mode 100644 index 3f5ecb7649e2b7..00000000000000 --- a/client/config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "restApiRoot": "/api", - "remoting": { - "context": { - "enableHttpContext": false - } - } -} diff --git a/client/config.local.js b/client/config.local.js deleted file mode 100644 index e5058ced89b20d..00000000000000 --- a/client/config.local.js +++ /dev/null @@ -1,5 +0,0 @@ -var globalConfig = require('../common/config.global'); - -module.exports = { - restApiRoot: globalConfig.restApi -}; diff --git a/client/datasources.json b/client/datasources.json deleted file mode 100644 index d6d2206bd6434f..00000000000000 --- a/client/datasources.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "remote": { - "name": "remote", - "connector": "remote" - }, - "local": { - "name": "local", - "connector": "memory" - } -} diff --git a/client/datasources.local.js b/client/datasources.local.js deleted file mode 100644 index 4f07ba41f355c1..00000000000000 --- a/client/datasources.local.js +++ /dev/null @@ -1,7 +0,0 @@ -var globalConfig = require('../common/config.global'); - -module.exports = { - remote: { - url: globalConfig.restApiUrl - } -}; diff --git a/client/loopbackClient.js b/client/loopbackClient.js deleted file mode 100644 index 9f860ae72b2f36..00000000000000 --- a/client/loopbackClient.js +++ /dev/null @@ -1,8 +0,0 @@ -var loopback = require('loopback'), - boot = require('loopback-boot'); - -var app = loopback(); - -boot(app, __dirname); - -module.exports = app; diff --git a/client/model-config.json b/client/model-config.json deleted file mode 100644 index 61e1e58d3d9e9c..00000000000000 --- a/client/model-config.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "_meta": { - "sources": [ - "../common/models", - "./models" - ] - }, - "user": { - "dataSource": "remote" - }, - "bonfire": { - "dataSource": "remote" - }, - "challenge": { - "dataSource": "remote" - }, - "comment": { - "dataSource": "remote" - }, - "fieldGuide": { - "dataSource": "remote" - }, - "job": { - "dataSource": "remote" - }, - "nonprofit": { - "dataSource": "remote" - }, - "story": { - "dataSource": "remote" - } -} diff --git a/gulpfile.js b/gulpfile.js index 28cef3e44a32cd..106748b8ab8ae9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,16 +4,11 @@ var Rx = require('rx'), path = require('path'), // utils + plumber = require('gulp-plumber'), notify = require('gulp-notify'), debug = require('debug')('freecc:gulp'), bower = require('bower-main-files'), - // loopback client - browserify = require('browserify'), - boot = require('loopback-boot'), - envify = require('envify/custom'), - toVinylWithName = require('vinyl-source-stream'), - // react app webpack = require('gulp-webpack'), webpackConfig = require('./webpack.config.js'), @@ -67,57 +62,45 @@ var paths = { ] }; +function errorHandler() { + var args = Array.prototype.slice.call(arguments); + + // Send error to notification center with gulp-notify + notify.onError({ + title: 'Compile Error', + message: '<%= error %>' + }).apply(this, args); + + // Keep gulp from hanging on this task + this.emit('end'); +} + gulp.task('inject', function() { gulp.src('views/home.jade') + .pipe(plumber({ errorHandler })) .pipe(inject(gulp.src(bower()), { //ignorePath: '/public' })) .pipe(gulp.dest('views')); }); -// NOTE(berks): not using this for now as loopback client is just too large -gulp.task('loopback', function() { - var config = { - basedir: __dirname, - debug: true, - cache: {}, - packageCache: {}, - fullPaths: true, - standalone: paths.loopback.clientName - }; - - var b = browserify(config); - - // compile loopback for the client - b.require(paths.loopback.client); - - boot.compileToBrowserify(paths.loopback.root, b); - - // sub process.env for proper strings - b.transform(envify({ - NODE_ENV: 'development' - })); - - return b.bundle() - .on('error', errorNotifier) - .pipe(toVinylWithName(paths.loopback.clientName + '.js')) - .pipe(gulp.dest(paths.publicJs)); -}); - gulp.task('pack-client', function() { return gulp.src(webpackConfig.entry) + .pipe(plumber({ errorHandler })) .pipe(webpack(webpackConfig)) .pipe(gulp.dest(webpackConfig.output.path)); }); gulp.task('pack-watch', function() { return gulp.src(webpackConfig.entry) + .pipe(plumber({ errorHandler })) .pipe(webpack(Object.assign(webpackConfig, { watch: true }))) .pipe(gulp.dest(webpackConfig.output.path)); }); gulp.task('pack-node', function() { return gulp.src(webpackConfigNode.entry) + .pipe(plumber({ errorHandler })) .pipe(webpack(webpackConfigNode)) .pipe(gulp.dest(webpackConfigNode.output.path)); }); @@ -174,6 +157,7 @@ gulp.task('lint', function() { gulp.task('less', function() { return gulp.src('./public/css/*.less') + .pipe(plumber({ errorHandler })) .pipe(less({ paths: [ path.join(__dirname, 'less', 'includes') ] })) @@ -188,15 +172,3 @@ gulp.task('watch', ['less', 'serve', 'sync'], function() { gulp.task('default', ['less', 'serve', 'sync', 'watch', 'pack-watch']); -function errorNotifier() { - var args = Array.prototype.slice.call(arguments); - - // Send error to notification center with gulp-notify - notify.onError({ - title: 'Compile Error', - message: '<%= error %>' - }).apply(this, args); - - // Keep gulp from hanging on this task - this.emit('end'); -} diff --git a/package.json b/package.json index 6ad19b0dba6529..675336c28fe582 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "gulp-inject": "~1.0.2", "gulp-nodemon": "^2.0.3", "gulp-notify": "^2.2.0", + "gulp-plumber": "^1.0.1", "istanbul": "^0.3.15", "loopback-explorer": "^1.7.2", "loopback-testing": "^1.1.0",