Merge branch 'release/2.3.1' into production

This commit is contained in:
Raymond Feng 2014-11-10 08:58:32 -08:00
commit 9cd5d3d125
3 changed files with 14 additions and 5 deletions

View File

@ -112,8 +112,9 @@ var addInstructionsToBrowserify = require('./lib/bundler');
* @property {Array.<String>} [bootScripts] List of script files to execute
* on boot.
* @end
* @param {Function} [callback] Callback function.
*
* @header boot(app, [options])
* @header boot(app, [options], [callback])
*/
exports = module.exports = function bootLoopBackApp(app, options, callback) {

View File

@ -3,12 +3,14 @@ var _ = require('underscore');
var semver = require('semver');
var debug = require('debug')('loopback:boot:executor');
var async = require('async');
var path = require('path');
/**
* Execute bootstrap instructions gathered by `boot.compile`.
*
* @options {Object} app The loopback app to boot.
* @param {Object} app The loopback app to boot.
* @options {Object} instructions Boot instructions.
* @param {Function} [callback] Callback function.
*
* @header boot.execute(instructions)
*/
@ -180,13 +182,19 @@ function defineModels(app, instructions) {
});
}
// Regular expression to match built-in loopback models
var LOOPBACK_MODEL_REGEXP = new RegExp(
['', 'node_modules', 'loopback', '[^\\/\\\\]+', 'models', '[^\\/\\\\]+\\.js$']
.join('\\' + path.sep));
function isBuiltinLoopBackModel(app, data) {
// 1. Built-in models are exposed on the loopback object
if (!app.loopback[data.name]) return false;
// 2. Built-in models have a script file `loopback/{facet}/models/{name}.js`
return data.sourceFile &&
/node_modules\/loopback\/[^\/]+\/models\/[^\/]+\.js$/.test(data.sourceFile);
var srcFile = data.sourceFile;
return srcFile &&
LOOPBACK_MODEL_REGEXP.test(srcFile);
}
function forEachKeyedObject(obj, fn) {

View File

@ -1,6 +1,6 @@
{
"name": "loopback-boot",
"version": "2.3.0",
"version": "2.3.1",
"description": "Convention-based bootstrapper for LoopBack applications",
"keywords": [
"StrongLoop",