Merge pull request #247 from strongloop/feature/upgrade-deps

Upgrade deps and fix style issues
This commit is contained in:
Raymond Feng 2017-05-22 10:41:07 -05:00 committed by GitHub
commit 63a11502a6
46 changed files with 265 additions and 170 deletions

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var Bootstrapper = require('./lib/bootstrapper');
/**

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
// Strong globalize
var g = require('./lib/globalize');
@ -144,6 +146,10 @@ var addInstructionsToBrowserify = require('./lib/bundler');
*/
exports = module.exports = function bootLoopBackApp(app, options, callback) {
if (typeof options === 'string') {
// The 2nd arg is appRootDir
options = {appRootDir: options};
}
if (typeof options === 'function' && callback === undefined) {
callback = options;
options = {};

2
lib/bootstrapper.js vendored
View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var _ = require('lodash');
var assert = require('assert');
var async = require('async');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var fs = require('fs');
var path = require('path');
var commondir = require('commondir');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var fs = require('fs');
var path = require('path');
var debug = require('debug')('loopback:boot:plugin');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var utils = require('./utils');
var path = require('path');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var assert = require('assert');
var semver = require('semver');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var utils = require('../utils');
var path = require('path');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var debug = require('debug')('loopback:boot:component');
var PluginBase = require('../plugin-base');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var utils = require('../utils');
var PluginBase = require('../plugin-base');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var assert = require('assert');
var path = require('path');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var fs = require('fs');
var path = require('path');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var assert = require('assert');
var util = require('util');
var PluginBase = require('../plugin-base');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var util = require('util');
var PluginBase = require('../plugin-base');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var debug = require('debug')('loopback:boot');
var path = require('path');
var Module = require('module');

View File

@ -27,7 +27,7 @@
},
"license": "MIT",
"dependencies": {
"async": "^1.5.2",
"async": "^2.4.0",
"bluebird": "^3.4.0",
"commondir": "^1.0.1",
"debug": "^2.2.0",
@ -42,11 +42,11 @@
"coffee-script": "^1.10.0",
"coffeeify": "^2.0.1",
"dirty-chai": "^1.2.2",
"eslint": "^2.11.1",
"eslint-config-loopback": "^1.0.0",
"fs-extra": "^0.30.0",
"eslint": "^3.19.0",
"eslint-config-loopback": "^8.0.0",
"fs-extra": "^3.0.1",
"loopback": "^3.0.0",
"mocha": "^2.5.3",
"supertest": "^1.2.0"
"mocha": "^3.3.0",
"supertest": "^3.0.0"
}
}

View File

@ -1,3 +1,5 @@
'use strict';
var path = require('path');
var loopback = require('loopback');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('../');
var async = require('async');
var exportBrowserifyToFile = require('./helpers/browserify').exportToSandbox;

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('../');
var exportBrowserifyToFile = require('./helpers/browserify').exportToSandbox;
var fs = require('fs');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var boot = require('../');
var fs = require('fs-extra');
var path = require('path');
@ -2481,7 +2483,7 @@ describe('compiler', function() {
});
});
it('resolves modules relative to appRootDir', function() {
it('resolves modules relative to appRootDir', function(done) {
var HANDLER_FILE = 'node_modules/handler/index.js';
appdir.writeFileSync(
HANDLER_FILE,

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var async = require('async');
var boot = require('../');
var path = require('path');
@ -70,7 +72,7 @@ describe('executor', function() {
simpleAppInstructions(function(err, context) {
if (err) return done(err);
boot.execute(app, context.instructions, function(err) {
expect(err).to.not.exist;
expect(err).to.not.exist();
expect(process.bootingFlagSet).to.be.true();
expect(app.booting).to.be.false();
done();
@ -80,7 +82,7 @@ describe('executor', function() {
it('should emit the `booted` event in the next tick', function(done) {
boot.execute(app, dummyInstructions, function(err) {
expect(err).to.not.exist;
expect(err).to.not.exist();
});
app.on('booted', function() {
// This test fails with a timeout when the `booted` event has not been
@ -130,7 +132,7 @@ describe('executor', function() {
}), function(err, context) {
if (err) return done(err);
expect(app.models.Customer).to.exist;
expect(app.models.Customer).to.exist();
expect(app.models.Customer.settings._customized).to.be.equal('Customer');
var UserModel = app.registry.getModel('User');
expect(UserModel.settings._customized).to.equal('Base');
@ -963,7 +965,7 @@ describe('executor', function() {
});
});
it('disables component when configuration is not set', function() {
it('disables component when configuration is not set', function(done) {
appdir.writeConfigFileSync('component-config.json', {
'./components/test-component': false,
});
@ -977,10 +979,12 @@ describe('executor', function() {
expect(Object.keys(require.cache)).to.not.include(
appdir.resolve('components/test-component/index.js'));
done();
});
});
it('disable component if overrided by production configuration', function() {
it('disables component if overrided by production configuration',
function(done) {
appdir.writeConfigFileSync('component-config.json', {
'./components/test-component': {},
});
@ -997,6 +1001,7 @@ describe('executor', function() {
expect(Object.keys(require.cache)).to.not.include(
appdir.resolve('components/test-component/index.js'));
done();
});
});

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('loopback');
var boot = require('../../../');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Robot) {
Robot.settings._customized = 'Robot';
Robot.base.settings._customized = 'Robot';

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var loopback = require('loopback');
var boot = require('../../../');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(app) {
app.set('custom-key', 'custom-value');
};

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(app, options) {
app.dummyComponentOptions = options;
};

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Model, options) {
Model.timeStampsMixin = true;
};

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(Customer) {
Customer.settings._customized = 'Customer';
Customer.base.settings._customized = 'Base';

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
process.bootFlags.push('barLoadedInTest');
module.exports = function(app, callback) {
callback();

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var framework = {
initialize: function(passport) {
return function(req, res, next) {

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
process.bootFlags.push('barLoaded');
module.exports = function(app, callback) {
process.bootFlags.push('barStarted');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
process.bootFlags.push('barSyncLoaded');
module.exports = function(app) {
process.bootFlags.push('barSyncExecuted');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(app, cb) {
if (app.booting)
process.bootingFlagSet = true;

View File

@ -3,4 +3,6 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
process.bootFlags.push('fooLoaded');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
exports.myMiddleware = function(name) {
return function(req, res, next) {
req._names = req._names || [];

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/**
* Exporting a middleware as a property of the main module
*/

View File

@ -1,3 +1,5 @@
'use strict';
module.exports = function(opitions) {
return new Tracker(opitions);
};

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(loopbackApp, params) {
loopbackApp.use('/component', function(req, res, next) {
res.send(params);

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(params) {
return function(req, res, next) {
res.send(params);

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var path = require('path');
var fs = require('fs-extra');
var extend = require('util')._extend;

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var vm = require('vm');
function createContext() {

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var fs = require('fs');
var sandbox = require('./sandbox');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
module.exports = function(name) {
return function(req, res, next) {
req._names = req._names || [];

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var fs = require('fs-extra');
var path = require('path');

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var utils = require('../lib/utils');
var expect = require('chai').expect;
var sandbox = require('./helpers/sandbox');