Merge pull request #67 from strongloop/feature/infrastructure-cleanup
Infrastructure cleanup
This commit is contained in:
commit
08fcc5faa7
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"preset": "google",
|
||||||
|
"requireCurlyBraces": [
|
||||||
|
"do",
|
||||||
|
"try",
|
||||||
|
"catch"
|
||||||
|
],
|
||||||
|
"disallowSpacesInsideObjectBrackets": null,
|
||||||
|
"requireSpaceAfterLineComment": true,
|
||||||
|
"maximumLineLength": {
|
||||||
|
"value": 80,
|
||||||
|
"allowRegex": true
|
||||||
|
},
|
||||||
|
"validateJSDoc": {
|
||||||
|
"checkParamNames": false,
|
||||||
|
"checkRedundantParams": false,
|
||||||
|
"requireParamTypes": true
|
||||||
|
},
|
||||||
|
"excludeFiles": [
|
||||||
|
"node_modules/**",
|
||||||
|
"coverage/**",
|
||||||
|
"test/sandbox/**"
|
||||||
|
]
|
||||||
|
}
|
15
.jshintrc
15
.jshintrc
|
@ -1,24 +1,21 @@
|
||||||
{
|
{
|
||||||
"node": true,
|
"node": true,
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"camelcase" : true,
|
|
||||||
"eqnull" : true,
|
"eqnull" : true,
|
||||||
"indent": 2,
|
"indent": 2,
|
||||||
"undef": true,
|
"undef": true,
|
||||||
"unused": true,
|
"unused": true,
|
||||||
"quotmark": "single",
|
"quotmark": "single",
|
||||||
"maxlen": 80,
|
|
||||||
"trailing": true,
|
|
||||||
"newcap": true,
|
"newcap": true,
|
||||||
"nonew": true,
|
"nonew": true,
|
||||||
"sub": true,
|
"sub": true,
|
||||||
"unused": "vars",
|
"unused": "vars",
|
||||||
"globals": {
|
"globals": {
|
||||||
"describe": true,
|
"describe": false,
|
||||||
"it": true,
|
"it": false,
|
||||||
"before": true,
|
"before": false,
|
||||||
"beforeEach": true,
|
"beforeEach": false,
|
||||||
"after": true,
|
"after": false,
|
||||||
"afterEach": true
|
"afterEach": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
index.js
2
index.js
|
@ -136,7 +136,7 @@ exports.compileToBrowserify = function(options, bundler) {
|
||||||
addInstructionsToBrowserify(compile(options), bundler);
|
addInstructionsToBrowserify(compile(options), bundler);
|
||||||
};
|
};
|
||||||
|
|
||||||
//-- undocumented low-level API --//
|
/*-- undocumented low-level API --*/
|
||||||
|
|
||||||
exports.ConfigLoader = ConfigLoader;
|
exports.ConfigLoader = ConfigLoader;
|
||||||
exports.compile = compile;
|
exports.compile = compile;
|
||||||
|
|
|
@ -309,7 +309,9 @@ function loadModelDefinition(rootDir, jsonFile, allFiles) {
|
||||||
var basename = path.basename(jsonFile, path.extname(jsonFile));
|
var basename = path.basename(jsonFile, path.extname(jsonFile));
|
||||||
|
|
||||||
// find a matching file with a supported extension like `.js` or `.coffee`
|
// find a matching file with a supported extension like `.js` or `.coffee`
|
||||||
var base, ext, validFileType;
|
var base;
|
||||||
|
var ext;
|
||||||
|
var validFileType;
|
||||||
var sourceFile = allFiles
|
var sourceFile = allFiles
|
||||||
.filter(function(f) {
|
.filter(function(f) {
|
||||||
ext = path.extname(f);
|
ext = path.extname(f);
|
||||||
|
|
|
@ -189,8 +189,8 @@ function hasCompatibleType(origValue, newValue) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to read a config file with .json extension
|
* Try to read a config file with .json extension
|
||||||
* @param cwd Dirname of the file
|
* @param {string} cwd Dirname of the file
|
||||||
* @param fileName Name of the file without extension
|
* @param {string} fileName Name of the file without extension
|
||||||
* @returns {Object|undefined} Content of the file, undefined if not found.
|
* @returns {Object|undefined} Content of the file, undefined if not found.
|
||||||
*/
|
*/
|
||||||
function tryReadJsonConfig(cwd, fileName) {
|
function tryReadJsonConfig(cwd, fileName) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ function assertLoopBackVersion(app) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setHost(app, instructions) {
|
function setHost(app, instructions) {
|
||||||
//jshint camelcase:false
|
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
|
||||||
var host =
|
var host =
|
||||||
process.env.npm_config_host ||
|
process.env.npm_config_host ||
|
||||||
process.env.OPENSHIFT_SLS_IP ||
|
process.env.OPENSHIFT_SLS_IP ||
|
||||||
|
@ -86,7 +86,7 @@ function setHost(app, instructions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPort(app, instructions) {
|
function setPort(app, instructions) {
|
||||||
//jshint camelcase:false
|
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
|
||||||
var port = _.find([
|
var port = _.find([
|
||||||
process.env.npm_config_port,
|
process.env.npm_config_port,
|
||||||
process.env.OPENSHIFT_SLS_PORT,
|
process.env.OPENSHIFT_SLS_PORT,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pretest": "jshint .",
|
"pretest": "jscs . && jshint .",
|
||||||
"test": "mocha"
|
"test": "mocha"
|
||||||
},
|
},
|
||||||
"license": {
|
"license": {
|
||||||
|
@ -32,15 +32,15 @@
|
||||||
"underscore": "^1.6.0"
|
"underscore": "^1.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "^6.1.0",
|
|
||||||
"fs-extra": "^0.12.0",
|
|
||||||
"browserify": "^4.1.8",
|
"browserify": "^4.1.8",
|
||||||
|
"chai": "^1.10.0",
|
||||||
"coffee-script": "^1.8.0",
|
"coffee-script": "^1.8.0",
|
||||||
"coffeeify": "^0.7.0",
|
"coffeeify": "^0.7.0",
|
||||||
|
"fs-extra": "^0.12.0",
|
||||||
|
"jscs": "^1.7.3",
|
||||||
"jshint": "^2.5.6",
|
"jshint": "^2.5.6",
|
||||||
"loopback": "^2.5.0",
|
"loopback": "^2.5.0",
|
||||||
"mocha": "^1.19.0",
|
"mocha": "^1.19.0",
|
||||||
"must": "^0.12.0",
|
|
||||||
"supertest": "^0.14.0"
|
"supertest": "^0.14.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
var boot = require('../');
|
var boot = require('../');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var expect = require('must');
|
var expect = require('chai').expect;
|
||||||
var browserify = require('browserify');
|
var browserify = require('browserify');
|
||||||
var sandbox = require('./helpers/sandbox');
|
var sandbox = require('./helpers/sandbox');
|
||||||
var vm = require('vm');
|
var vm = require('vm');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
var boot = require('../');
|
var boot = require('../');
|
||||||
var fs = require('fs-extra');
|
var fs = require('fs-extra');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var expect = require('must');
|
var expect = require('chai').expect;
|
||||||
var sandbox = require('./helpers/sandbox');
|
var sandbox = require('./helpers/sandbox');
|
||||||
var appdir = require('./helpers/appdir');
|
var appdir = require('./helpers/appdir');
|
||||||
|
|
||||||
|
@ -12,7 +12,10 @@ describe('compiler', function() {
|
||||||
beforeEach(appdir.init);
|
beforeEach(appdir.init);
|
||||||
|
|
||||||
describe('from options', function() {
|
describe('from options', function() {
|
||||||
var options, instructions, appConfig;
|
var options;
|
||||||
|
var instructions;
|
||||||
|
var appConfig;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
options = {
|
options = {
|
||||||
config: {
|
config: {
|
||||||
|
|
|
@ -2,7 +2,7 @@ var boot = require('../');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var loopback = require('loopback');
|
var loopback = require('loopback');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var expect = require('must');
|
var expect = require('chai').expect;
|
||||||
var fs = require('fs-extra');
|
var fs = require('fs-extra');
|
||||||
var sandbox = require('./helpers/sandbox');
|
var sandbox = require('./helpers/sandbox');
|
||||||
var appdir = require('./helpers/appdir');
|
var appdir = require('./helpers/appdir');
|
||||||
|
@ -266,7 +266,7 @@ describe('executor', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should prioritize sources', function() {
|
it('should prioritize sources', function() {
|
||||||
/*jshint camelcase:false */
|
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
|
||||||
process.env.npm_config_host = randomHost();
|
process.env.npm_config_host = randomHost();
|
||||||
process.env.OPENSHIFT_SLS_IP = randomHost();
|
process.env.OPENSHIFT_SLS_IP = randomHost();
|
||||||
process.env.OPENSHIFT_NODEJS_IP = randomHost();
|
process.env.OPENSHIFT_NODEJS_IP = randomHost();
|
||||||
|
@ -328,7 +328,6 @@ describe('executor', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function assertValidDataSource(dataSource) {
|
function assertValidDataSource(dataSource) {
|
||||||
// has methods
|
// has methods
|
||||||
assert.isFunc(dataSource, 'createModel');
|
assert.isFunc(dataSource, 'createModel');
|
||||||
|
|
|
@ -2,4 +2,3 @@ process.bootFlags.push('barSyncLoaded');
|
||||||
module.exports = function(app) {
|
module.exports = function(app) {
|
||||||
process.bootFlags.push('barSyncExecuted');
|
process.bootFlags.push('barSyncExecuted');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue