remove loopback client files

This commit is contained in:
Berkeley Martinez
2015-07-25 08:51:41 -07:00
parent 227e486fdc
commit 38cb4b2873
9 changed files with 21 additions and 117 deletions

View File

@ -1,3 +1,4 @@
This is the entry point for the client This is the entry point for the client
Code that should only run on the client should be put here. Code that should only run on the client should be put here.
NOTE(berks): For react specific stuff this should be the entry point NOTE(berks): For react specific stuff this should be the entry point

View File

@ -1,8 +0,0 @@
{
"restApiRoot": "/api",
"remoting": {
"context": {
"enableHttpContext": false
}
}
}

View File

@ -1,5 +0,0 @@
var globalConfig = require('../common/config.global');
module.exports = {
restApiRoot: globalConfig.restApi
};

View File

@ -1,10 +0,0 @@
{
"remote": {
"name": "remote",
"connector": "remote"
},
"local": {
"name": "local",
"connector": "memory"
}
}

View File

@ -1,7 +0,0 @@
var globalConfig = require('../common/config.global');
module.exports = {
remote: {
url: globalConfig.restApiUrl
}
};

View File

@ -1,8 +0,0 @@
var loopback = require('loopback'),
boot = require('loopback-boot');
var app = loopback();
boot(app, __dirname);
module.exports = app;

View File

@ -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"
}
}

View File

@ -4,16 +4,11 @@ var Rx = require('rx'),
path = require('path'), path = require('path'),
// utils // utils
plumber = require('gulp-plumber'),
notify = require('gulp-notify'), notify = require('gulp-notify'),
debug = require('debug')('freecc:gulp'), debug = require('debug')('freecc:gulp'),
bower = require('bower-main-files'), 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 // react app
webpack = require('gulp-webpack'), webpack = require('gulp-webpack'),
webpackConfig = require('./webpack.config.js'), 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.task('inject', function() {
gulp.src('views/home.jade') gulp.src('views/home.jade')
.pipe(plumber({ errorHandler }))
.pipe(inject(gulp.src(bower()), { .pipe(inject(gulp.src(bower()), {
//ignorePath: '/public' //ignorePath: '/public'
})) }))
.pipe(gulp.dest('views')); .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() { gulp.task('pack-client', function() {
return gulp.src(webpackConfig.entry) return gulp.src(webpackConfig.entry)
.pipe(plumber({ errorHandler }))
.pipe(webpack(webpackConfig)) .pipe(webpack(webpackConfig))
.pipe(gulp.dest(webpackConfig.output.path)); .pipe(gulp.dest(webpackConfig.output.path));
}); });
gulp.task('pack-watch', function() { gulp.task('pack-watch', function() {
return gulp.src(webpackConfig.entry) return gulp.src(webpackConfig.entry)
.pipe(plumber({ errorHandler }))
.pipe(webpack(Object.assign(webpackConfig, { watch: true }))) .pipe(webpack(Object.assign(webpackConfig, { watch: true })))
.pipe(gulp.dest(webpackConfig.output.path)); .pipe(gulp.dest(webpackConfig.output.path));
}); });
gulp.task('pack-node', function() { gulp.task('pack-node', function() {
return gulp.src(webpackConfigNode.entry) return gulp.src(webpackConfigNode.entry)
.pipe(plumber({ errorHandler }))
.pipe(webpack(webpackConfigNode)) .pipe(webpack(webpackConfigNode))
.pipe(gulp.dest(webpackConfigNode.output.path)); .pipe(gulp.dest(webpackConfigNode.output.path));
}); });
@ -174,6 +157,7 @@ gulp.task('lint', function() {
gulp.task('less', function() { gulp.task('less', function() {
return gulp.src('./public/css/*.less') return gulp.src('./public/css/*.less')
.pipe(plumber({ errorHandler }))
.pipe(less({ .pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ] 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']); 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');
}

View File

@ -117,6 +117,7 @@
"gulp-inject": "~1.0.2", "gulp-inject": "~1.0.2",
"gulp-nodemon": "^2.0.3", "gulp-nodemon": "^2.0.3",
"gulp-notify": "^2.2.0", "gulp-notify": "^2.2.0",
"gulp-plumber": "^1.0.1",
"istanbul": "^0.3.15", "istanbul": "^0.3.15",
"loopback-explorer": "^1.7.2", "loopback-explorer": "^1.7.2",
"loopback-testing": "^1.1.0", "loopback-testing": "^1.1.0",