Commit Graph

66 Commits

Author SHA1 Message Date
Miroslav Bajtoš b5989e907e package: update dependency versions 2014-07-22 10:57:44 +02:00
Miroslav Bajtoš eac6cdf645 v2.0.0-beta3 2014-07-17 19:00:55 +02:00
Miroslav Bajtoš 6bf995c55b compiler: return a clone of instructions
When executor passes the instruction to loopback methods,
loopback modifies the data. Since we are loading the data using
`require` such changes affects also code that calls
`require` for one of the instructions files.

This change adds a deep clone step to prevent this issue.
2014-07-17 18:44:15 +02:00
Miroslav Bajtoš 53ca2f697a v2.0.0-beta2 2014-07-16 08:21:16 +02:00
Miroslav Bajtoš 5e23db50a5 2.0.0-beta1 2014-06-26 14:56:02 +02:00
Miroslav Bajtoš 0a0a6f5d01 Merge branch 'master' into 2.0
Conflicts:
	index.js
	package.json
2014-06-16 19:49:45 +02:00
Miroslav Bajtoš 57e96b0d38 compiler: Sort models topologically
Sort models topologically using Base->Model as edges. This way
the base models are defined before the models extending them.
2014-06-16 19:45:34 +02:00
Miroslav Bajtoš a9a401ad56 package: Bump up the version to 2.0.0-dev 2014-06-16 16:38:28 +02:00
Miroslav Bajtoš bad5b60623 package: Fix repository url 2014-06-16 15:27:54 +02:00
Miroslav Bajtoš c3a9a09941 Drop peer dep on loopback; add a runtime check
Replace peerDependency with a run-time check based on
`app.loopback.version`.
2014-06-16 15:23:32 +02:00
Miroslav Bajtoš 5f85971d11 Implement compileToBrowserify and bootBrowserApp
Hide `compile` and `execute` and provide a better API for browserified
applications:

 - `boot.compileToBrowserify(options, bundler)` calls `compile` under
   the hood and adds all instructions and scripts to the bundler.

 - `bootBrowserApp(app)` is exported by loopback-boot when the module
   is loaded in a browser, the function loads the instructions as
   bundled by `compileToBrowserify`.

This new API hides all implementation details from the user and makes
it easy to add loopback-boot to any build script.
2014-06-03 14:08:34 +02:00
Miroslav Bajtoš 6196054a8b Change loopback peer dep to "1.x || 2.x"
Support the upcoming 2.x version of LoopBack.

The devDependency is intentionally kept at 1.x to ensure the module
supports LoopBack 1.x too.
2014-05-28 16:03:56 +02:00
Miroslav Bajtoš 255217f6a7 Ignore models/ and boot/ subdirs without index
Sub-directories of `models/` and `boot/` that cannot be required
(they don't have an index.js file) are silently skipped now.

This enables developers to put test files into `models/test/`.
2014-05-27 16:44:21 +02:00
Miroslav Bajtoš c1743dc2ff Load datasources and app cfg from multiple files
Modify loading of `appConfig` and `dataSourceConfig` to look for
the following files:

  - app.json
  - app.local.{js|json}
  - app.{$env}.{js|json}

  - datasources.json
  - datasources.local.{js|json}
  - datasources.{$env}.{js|json}

where $env is the value of `app.get('env')`, which usually defaults
to `process.env.NODE_ENV`.

The values in the additional files are applied to the config object,
overwritting any existing values. The new values must be value types
like String or Number; Object and Array are not supported.

Additional datasource config files cannot define new datasources,
only modify existing ones.

The commit includes refactoring of the config-loading code into
a standalone file.
2014-05-27 14:08:58 +02:00
Miroslav Bajtoš a4402a3979 Initial implementation
Move `app.boot()` and its tests from loopback.

Fix jshint warnings.

Clean up unit tests - remove dependency on global variables created
by loopback's test/support.js
2014-05-23 16:50:40 +02:00
Miroslav Bajtoš cda7eec295 Initial commit 2014-05-23 15:51:20 +02:00