From ed59cb24830458ba463567ae420b9c67873ceb9f Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Thu, 30 Oct 2014 13:34:59 -0700 Subject: [PATCH 1/3] Fix jsdoc --- index.js | 3 ++- lib/executor.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 97e56dc..4894277 100644 --- a/index.js +++ b/index.js @@ -112,8 +112,9 @@ var addInstructionsToBrowserify = require('./lib/bundler'); * @property {Array.} [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) { diff --git a/lib/executor.js b/lib/executor.js index 61d38e8..8680794 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -7,8 +7,9 @@ var async = require('async'); /** * 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) */ From db917bf03bda4d85fcf4c9dbc42ff5978e287c66 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Mon, 10 Nov 2014 08:22:57 -0800 Subject: [PATCH 2/3] Fix the test for built-in models on Windows See https://github.com/strongloop/loopback/issues/756 --- lib/executor.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/executor.js b/lib/executor.js index 8680794..16ca218 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -3,6 +3,7 @@ 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`. @@ -181,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) { From f4c7b1ba3851925496f78c94826dc07f07f937b7 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Mon, 10 Nov 2014 08:57:46 -0800 Subject: [PATCH 3/3] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 745e521..7eba26f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loopback-boot", - "version": "2.3.0", + "version": "2.3.1", "description": "Convention-based bootstrapper for LoopBack applications", "keywords": [ "StrongLoop",