Skip to content

Commit

Permalink
remove loopback client files
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Jul 25, 2015
1 parent 227e486 commit 38cb4b2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 117 deletions.
1 change: 1 addition & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -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
8 changes: 0 additions & 8 deletions client/config.json

This file was deleted.

5 changes: 0 additions & 5 deletions client/config.local.js

This file was deleted.

10 changes: 0 additions & 10 deletions client/datasources.json

This file was deleted.

7 changes: 0 additions & 7 deletions client/datasources.local.js

This file was deleted.

8 changes: 0 additions & 8 deletions client/loopbackClient.js

This file was deleted.

32 changes: 0 additions & 32 deletions client/model-config.json

This file was deleted.

66 changes: 19 additions & 47 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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));
});
Expand Down Expand Up @@ -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') ]
}))
Expand All @@ -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');
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 38cb4b2

Please sign in to comment.