Commit Graph

132 Commits

Author SHA1 Message Date
Miroslav Bajtoš 8cc2518cb0 compiler: resolve paths in middleware params
Introduce a convention for specifying relative paths in middleware
params: values prefixed with `$!` and starting with `./` or `../`
are resolved relatively to `middleware.json`.

Example:

    {
      "files": {
        "loopback#static": {
          "params": "$!../client"
        },
        "loopback#static": {
          "params": "$!./public"
        }
      }
    }
2014-11-28 12:17:27 +01:00
Miroslav Bajtoš 81303b3093 Merge tag 'v2.4.0'
2.4.0

 * 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š)
2014-11-27 19:23:49 +01:00
Miroslav Bajtoš d3145f5745 Merge branch 'release/2.4.0' into production 2014-11-27 19:23:47 +01:00
Miroslav Bajtoš 097fced310 v2.4.0 2014-11-27 19:23:45 +01:00
Miroslav Bajtoš 6de571f442 Merge pull request #70 from strongloop/feature/short-middleware-paths
#68 - Implement shorthand notation for middleware paths
2014-11-25 11:51:00 +01:00
Raymond Feng 2f72006c88 Implement shorthand notation for middleware paths
When the middleware name (path) is in the format {module}#{filename},
loopback-boot resolves the path by trying multiple locations and
using the first one that exists:

 - {module} and check the {filename} property of the exports
     -> e.g. loopback.rest
- {module}/server/middleware/{filename}
    -> e.g. loopback/server/middleware/rest
 - {module}/middleware/{filename}
    -> e.g. loopback/middleware/rest

Values in any other format will bypass this resolution algorithm and
they will be used in the original form:

 - a full path in a module: loopback/server/middleware/rest
 - a relative path: ./middleware/custom, ./custom, ../logger
 - an absolute path: /usr/local/lib/node_modules/compression
2014-11-25 11:43:00 +01:00
Miroslav Bajtoš d25c64523d Merge pull request #66 from strongloop/feature/middleware-mounting
Load middleware and phases from `middleware.json`
2014-11-19 09:58:38 +01:00
Miroslav Bajtoš 1114bc9227 Load middleware and phases from `middleware.json`
Sample JSON:

        {
          "routes:before": {
            "morgan": {
              "params": ["dev"]
            }
          },
          "routes": {
            "loopback/server/middleware/rest": {
            }
          },
          "subapps": {
            "./adminer": {
            },
          }
        }

The JSON file can be customized using the usual conventions:
  - middleware.local.{js|json}
  - middleware.{env}.{js|json}

It is also possible to mount the same middleware in the same phase
multiple times with different configuration.

Example config:

    {
      "auth": {
        "oauth2": [
          {
            "params": "first"
          },
          {
            "params": "second"
          }
        ]
      },
    });
2014-11-19 09:45:04 +01:00
Miroslav Bajtoš 08fcc5faa7 Merge pull request #67 from strongloop/feature/infrastructure-cleanup
Infrastructure cleanup
2014-11-13 16:09:10 +01:00
Miroslav Bajtoš 5b5071864b Add jscs style check, fix violations found 2014-11-13 15:54:59 +01:00
Miroslav Bajtoš 83723379a2 Clean up .jshintrc
jshint does not support `trailing` as of v1.5.0.

Remove `maxlen` too, jscs provides better implementation.

Fix definition of global mocha variables - mark them as immutable.
2014-11-13 15:33:23 +01:00
Miroslav Bajtoš e2aff71bf9 Use `chai` instead of `must`
As of 1.10, chai supports nonary assertions, there are no more reasons
for using a different variant.
2014-11-13 15:31:35 +01:00
Raymond Feng 6040f66adc Merge tag 'v2.3.1'
2.3.1
2014-11-10 08:58:42 -08:00
Raymond Feng 9cd5d3d125 Merge branch 'release/2.3.1' into production 2014-11-10 08:58:32 -08:00
Raymond Feng f4c7b1ba38 Bump version 2014-11-10 08:57:46 -08:00
Raymond Feng 27bd48e0f6 Merge pull request #63 from strongloop/feature/fix-lb-issue-756
Fix the test for built-in models on Windows
2014-11-10 08:56:21 -08:00
Raymond Feng db917bf03b Fix the test for built-in models on Windows
See https://github.com/strongloop/loopback/issues/756
2014-11-10 08:22:57 -08:00
Raymond Feng ed59cb2483 Fix jsdoc 2014-10-30 13:34:59 -07:00
Miroslav Bajtoš 176f96e242 Merge tag 'v2.3.0'
2.3.0
2014-10-27 11:14:50 +01:00
Miroslav Bajtoš f5ac5273a7 Merge branch 'release/2.3.0' into production 2014-10-27 11:14:40 +01:00
Miroslav Bajtoš 84f8a51138 2.3.0 2014-10-27 11:14:19 +01:00
Miroslav Bajtoš d7bdbd31b1 compiler: fix coding style violations 2014-10-27 11:13:02 +01:00
Miroslav Bajtoš b480efde8a Merge pull request #59 from TorchlightSoftware/coffee-fix2
support coffee-script models and client code
2014-10-24 20:04:21 +02:00
bitmage e936deffe2 support coffee-script models and client code
Load models for any filetypes registered in require.extensions.

 - Server side coffee-script requires a `require('coffee-script/register');`

 - Client side coffee-script requires Coffeeify.
2014-10-24 10:42:30 -07:00
Miroslav Bajtoš 3961f1c615 Merge tag 'v2.2.0'
2.2.0
2014-10-22 08:58:40 +02:00
Miroslav Bajtoš 56c74174f1 Merge branch 'release/2.2.0' into production 2014-10-22 08:58:05 +02:00
Miroslav Bajtoš 5cea78c6aa 2.2.0 2014-10-22 08:57:44 +02:00
Miroslav Bajtoš b5c585291b Merge pull request #60 from strongloop/feature/skip-builtin-loopback-models
Skip definitions of built-in loopback models
2014-10-21 18:17:49 +02:00
Miroslav Bajtoš aa4cbdd80f compiler: support module-relative model sources
Interpret model sources in the same way how `require.resolve`
interprets the path:

 - values starting with `./` and `../` are relative to the file
   where they are specified

 - other values are relative to node modules folders

This way it's possible to specify a source `loopback/common/models`
and have it resolved to whatever place the loopback is installed.
2014-10-21 18:10:22 +02:00
Miroslav Bajtoš 26abb43ad4 Skip definitions of built-in loopback models
LoopBack built-in models are special: they follow the loopback-boot
structure and provide `common/models/{name}.json` files, but they are
also automatically loaded (created) by loopback.

This change modifies `executor` to recognize built-in models and do not
redefine them.
2014-10-21 18:10:22 +02:00
Miroslav Bajtoš 011296d825 Merge pull request #58 from strongloop/feature/use-loopback-2x-for-tests
Use loopback 2x for tests, update dependency versions
2014-10-21 09:45:50 +02:00
Miroslav Bajtoš c04946073f package: update dependency versions 2014-10-21 09:40:52 +02:00
Miroslav Bajtoš 927bee82f7 Use loopback 2.x in unit tests. 2014-10-21 09:38:25 +02:00
Raymond Feng fadfaffe25 Merge tag 'v2.1.0'
2.1.0
2014-10-09 12:23:19 -07:00
Raymond Feng 676f347f36 Merge branch 'release/2.1.0' into production 2014-10-09 12:23:15 -07:00
Raymond Feng 68593c8100 Bump version 2014-10-09 12:22:34 -07:00
Raymond Feng e0abff007e Merge pull request #50 from strongloop/feature/support-async-scripts
Add support async scripts
2014-10-09 12:19:21 -07:00
Raymond Feng 94cb4d6342 Add support for async boot scripts 2014-10-09 12:18:36 -07:00
Miroslav Bajtoš 38c4944e2e Merge pull request #54 from strongloop/feature/support-nested-values-in-config-overrides
Support nested values in config overrides
2014-10-09 19:33:13 +02:00
Miroslav Bajtoš 0d4b5bb7c4 Merge pull request #43 from johnsoftek/master
Custom rootDir for app config

Close #43
2014-10-09 16:36:31 +02:00
Miroslav Bajtoš d54e2b54d0 Clean up jsdoc comments.
- Fix formatting to improve the way how the text is rendered on
   http://apidocs.strongloop.com/loopback-boot/

 - Add `@property` entry for `options.appConfigRootDir`.
2014-10-09 16:36:19 +02:00
johnsoftek 18121a4208 Custom rootDir for app config 2014-10-09 16:36:19 +02:00
Miroslav Bajtoš f0836719c9 compiler: improve merging of Arrays and Objects
Add more unit-tests to cover various edge cases. Fix issues discovered
by these new tests.
2014-10-08 17:15:32 +02:00
Shelby Sanders e1d870dced config-loader: deeply merge Array and Object vals 2014-10-08 17:15:32 +02:00
Miroslav Bajtoš abda37fee9 gitignore: add Idea's *.iml files 2014-10-08 17:15:30 +02:00
Miroslav Bajtoš ac73288cef Merge pull request #51 from strongloop/feature/fix-jshint-problems
package: Add `jshint` to `devDependencies`
2014-10-08 15:06:19 +02:00
Miroslav Bajtoš ed0880d00f package: Add `jshint` to `devDependencies`
Remove dependency on a globally installed jshint instance
and fix `npm test` on machines without a global jshint.
2014-10-08 12:09:16 +02:00
Ryan Graham e974033395 Update contribution guidelines
Replace commit signing process with https://cla.strongloop.com/
2014-10-01 18:06:20 -07:00
Miroslav Bajtoš 6c26e99ab9 Merge pull request #36 from strongloop/feature/fix-CI-build
test: fix failures on CI
2014-08-19 19:37:39 +02:00
Miroslav Bajtoš 0169f22cd0 test: ensure sandbox dir is present
Fix test/browser.test.js failing on CI due to sandbox dir not present
on the first run.
2014-08-19 09:26:57 +02:00