Merge branch 'release/2.6.4' into production
This commit is contained in:
commit
a03e881f0a
118
CHANGES.md
118
CHANGES.md
|
@ -1,115 +1,9 @@
|
|||
2015-01-13, Version 2.6.3
|
||||
2015-02-02, Version 2.6.4
|
||||
=========================
|
||||
|
||||
* Don't swallow error when a sub-dependency doesn't resolve. (Samuel Reed)
|
||||
* executor: pass correct `this` to middleware (Clark Wang)
|
||||
|
||||
* Fix "incompatible loopback version" check & msg (Miroslav Bajtoš)
|
||||
|
||||
* Add "booting" flag and emit "booted" event (Simon Ho)
|
||||
|
||||
* Configure components via `component-config.json` (Miroslav Bajtoš)
|
||||
|
||||
* Fix bad CLA URL in CONTRIBUTING.md (Ryan Graham)
|
||||
|
||||
* Dedupe boot scripts (Eric Satterwhite)
|
||||
|
||||
* Replace underscore with lodash (Ryan Graham)
|
||||
|
||||
* compiler: resolve paths in middleware params (Miroslav Bajtoš)
|
||||
|
||||
* Implement shorthand notation for middleware paths (Raymond Feng)
|
||||
|
||||
* Load middleware and phases from `middleware.json` (Miroslav Bajtoš)
|
||||
|
||||
* Add jscs style check, fix violations found (Miroslav Bajtoš)
|
||||
|
||||
* Clean up .jshintrc (Miroslav Bajtoš)
|
||||
|
||||
* Use `chai` instead of `must` (Miroslav Bajtoš)
|
||||
|
||||
* Bump version (Raymond Feng)
|
||||
|
||||
* Fix the test for built-in models on Windows (Raymond Feng)
|
||||
|
||||
* Fix jsdoc (Raymond Feng)
|
||||
|
||||
* compiler: fix coding style violations (Miroslav Bajtoš)
|
||||
|
||||
* support coffee-script models and client code (bitmage)
|
||||
|
||||
* compiler: support module-relative model sources (Miroslav Bajtoš)
|
||||
|
||||
* Skip definitions of built-in loopback models (Miroslav Bajtoš)
|
||||
|
||||
* package: update dependency versions (Miroslav Bajtoš)
|
||||
|
||||
* Use loopback 2.x in unit tests. (Miroslav Bajtoš)
|
||||
|
||||
* Add support for async boot scripts (Raymond Feng)
|
||||
|
||||
* Clean up jsdoc comments. (Miroslav Bajtoš)
|
||||
|
||||
* Custom rootDir for app config (johnsoftek)
|
||||
|
||||
* compiler: improve merging of Arrays and Objects (Miroslav Bajtoš)
|
||||
|
||||
* config-loader: deeply merge Array and Object vals (Shelby Sanders)
|
||||
|
||||
* gitignore: add Idea's *.iml files (Miroslav Bajtoš)
|
||||
|
||||
* package: Add `jshint` to `devDependencies` (Miroslav Bajtoš)
|
||||
|
||||
* Update contribution guidelines (Ryan Graham)
|
||||
|
||||
* test: ensure sandbox dir is present (Miroslav Bajtoš)
|
||||
|
||||
* test: add `global.navigator` for browser tests (Miroslav Bajtoš)
|
||||
|
||||
* test: increase timeout for browserify (Miroslav Bajtoš)
|
||||
|
||||
* index: fix jshint error (Miroslav Bajtoš)
|
||||
|
||||
* documentation fix (Alex)
|
||||
|
||||
* Fix typo (Fabien Franzen)
|
||||
|
||||
* Implemented modelSources, bootDirs and bootScripts options (Fabien Franzen)
|
||||
|
||||
* executor: remove `Base` arg from model function (Miroslav Bajtoš)
|
||||
|
||||
* v2.0.0-beta3 (Miroslav Bajtoš)
|
||||
|
||||
* compiler: return a clone of instructions (Miroslav Bajtoš)
|
||||
|
||||
* test: export Int32Array and DataView for browser (Miroslav Bajtoš)
|
||||
|
||||
* v2.0.0-beta2 (Miroslav Bajtoš)
|
||||
|
||||
* Rename `models.json` to `model-config.json` (Miroslav Bajtoš)
|
||||
|
||||
* Remove non-API docs. (Rand McKinney)
|
||||
|
||||
* 2.0.0-beta1 (Miroslav Bajtoš)
|
||||
|
||||
* test: fix jshint warnings (Miroslav Bajtoš)
|
||||
|
||||
* compiler: fix references to loopback (Miroslav Bajtoš)
|
||||
|
||||
* Rename `app.json` to `config.json` (Miroslav Bajtoš)
|
||||
|
||||
* compiler: Sort models topologically (Miroslav Bajtoš)
|
||||
|
||||
* executor: Split model boot into two phases (Miroslav Bajtoš)
|
||||
|
||||
* compiler: Move model-sources cfg to models.json (Miroslav Bajtoš)
|
||||
|
||||
* package: Bump up the version to 2.0.0-dev (Miroslav Bajtoš)
|
||||
|
||||
* Rework model configuration (Miroslav Bajtoš)
|
||||
|
||||
* Remove auto-attach. (Miroslav Bajtoš)
|
||||
|
||||
* Change models.json to configure existing models (Miroslav Bajtoš)
|
||||
* Fix broken links (Rand McKinney)
|
||||
|
||||
|
||||
2015-01-13, Version 2.6.2
|
||||
|
@ -240,6 +134,12 @@
|
|||
* Remove README from API docs (Rand McKinney)
|
||||
|
||||
|
||||
2015-01-13, Version 2.6.3
|
||||
=========================
|
||||
|
||||
* Don't swallow error when a sub-dependency doesn't resolve. (Samuel Reed)
|
||||
|
||||
|
||||
2015-01-12, Version 2.6.1
|
||||
=========================
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
A convention-based bootstrapper for LoopBack applications.
|
||||
|
||||
For full documentation, see the official StrongLoop documentation: [Application initialization](http://docs.strongloop.com/display/LB/Application+initialization) and [Creating a LoopBack application](http://docs.strongloop.com/display/LB/Creating+a+LoopBack+application).
|
||||
For full documentation, see the official StrongLoop documentation: [Defining boot scripts](http://docs.strongloop.com/display/LB/Defining+boot+scripts) and [Creating a LoopBack application](http://docs.strongloop.com/display/LB/Creating+an+application).
|
||||
|
||||
## Overview
|
||||
|
||||
|
@ -13,7 +13,7 @@ The loopback-boot module initializes (bootstraps) a LoopBack application. Speci
|
|||
- Configures application settings
|
||||
- Runs additional boot scripts, so you can put custom setup code in multiple small files instead of in the main application file.
|
||||
|
||||
For more information, see [Application initialization](http://docs.strongloop.com/display/LB/Application+initialization).
|
||||
For more information, see [Defining boot scripts](http://docs.strongloop.com/display/LB/Defining+boot+scripts).
|
||||
|
||||
### Version notes
|
||||
|
||||
|
@ -25,8 +25,6 @@ The version range `2.x` supports the new project layout as scaffolded by
|
|||
`yo loopback`.
|
||||
|
||||
This document describes the configuration conventions of the `2.x` versions.
|
||||
See the [official documentation](http://docs.strongloop.com/display/LB/Application+initialization)
|
||||
for instructions on upgrading existing projects.
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ function setupMiddleware(app, instructions) {
|
|||
data.fragment ? ('#' + data.fragment) : '');
|
||||
var factory = require(data.sourceFile);
|
||||
if (data.fragment) {
|
||||
factory = factory[data.fragment];
|
||||
factory = factory[data.fragment].bind(factory);
|
||||
}
|
||||
assert(typeof factory === 'function',
|
||||
'Middleware factory must be a function');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-boot",
|
||||
"version": "2.6.3",
|
||||
"version": "2.6.4",
|
||||
"description": "Convention-based bootstrapper for LoopBack applications",
|
||||
"keywords": [
|
||||
"StrongLoop",
|
||||
|
|
|
@ -467,6 +467,29 @@ describe('executor', function() {
|
|||
|
||||
expect(app.componentOptions).to.eql({ option: 'value' });
|
||||
});
|
||||
|
||||
it('configures middleware (that requires `this`)', function(done) {
|
||||
var passportPath = require.resolve('./fixtures/passport');
|
||||
|
||||
boot.execute(app, someInstructions({
|
||||
middleware: {
|
||||
phases: ['auth'],
|
||||
middleware: [
|
||||
{
|
||||
sourceFile: passportPath,
|
||||
fragment: 'initialize',
|
||||
config: {
|
||||
phase: 'auth:before'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}));
|
||||
|
||||
supertest(app)
|
||||
.get('/')
|
||||
.expect('passport', 'initialized', done);
|
||||
});
|
||||
});
|
||||
|
||||
function assertValidDataSource(dataSource) {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
var framework = {
|
||||
initialize: function(passport) {
|
||||
return function(req, res, next) {
|
||||
req._passport = passport;
|
||||
res.setHeader('passport', 'initialized');
|
||||
next();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
var Passport = function() {
|
||||
this._framework = framework;
|
||||
};
|
||||
|
||||
Passport.prototype.initialize = function() {
|
||||
return this._framework.initialize(this);
|
||||
};
|
||||
|
||||
module.exports = new Passport();
|
Loading…
Reference in New Issue