UNPKG

lux-framework

Version:

Build scalable, Node.js-powered REST APIs with almost no code.

793 lines (622 loc) • 96.6 kB
# Lux Changelog ### v1.2.3 (July 20, 2018) * [[`56225dac71`](https://github.com/postlight/lux/commit/56225dac71)] - **fix**: falsy IDs breaking relationships (#730) (Nick Schot) * [[`667febd98f`](https://github.com/postlight/lux/commit/667febd98f)] - **release**: v1.2.2 🔧 (#722) (Zachary Golba) ### v1.2.2 (Aug 28, 2017) * [[`6c22bdf071`](https://github.com/postlight/lux/commit/6c22bdf071)] - **fix**: do not validate param existence for patch requests (#721) (Zachary Golba) * [[`ea2b8f9926`](https://github.com/postlight/lux/commit/ea2b8f9926)] - **release**: v1.2.1 🔧 (#716) (Zachary Golba) ### v1.2.1 (July 11, 2017) * [[`6b3547f436`](https://github.com/postlight/lux/commit/6b3547f436)] - **fix**: filtering with an empty array as a value causes an error (#715) (Nick Schot) * [[`0f406b5908`](https://github.com/postlight/lux/commit/0f406b5908)] - **fix**: detailed error messages leak into production responses (#713) (Zachary Golba) * [[`2327c13d1a`](https://github.com/postlight/lux/commit/2327c13d1a)] - **docs**: additional documentation around cli generators (#711) (Kyle MacDonald) * [[`1691f9ad50`](https://github.com/postlight/lux/commit/1691f9ad50)] - **release**: 1.2.0 ✨ (#705) (Zachary Golba) ### v1.2.0 (May 16, 2017) ##### Commits * [[`10eaa2309c`](https://github.com/postlight/lux/commit/10eaa2309c)] - **feat**: enable rollup cache feature (#700) (Nick Schot) * [[`73bb9d1817`](https://github.com/postlight/lux/commit/73bb9d1817)] - **deps**: update outdated dependencies (#704) (Zachary Golba) * [[`5ba179700d`](https://github.com/postlight/lux/commit/5ba179700d)] - **fix**: gracefully shutdown workers instead of waiting for the timeout to pass (fixes #702) (#703) (Nick Schot) * [[`df96fd669b`](https://github.com/postlight/lux/commit/df96fd669b)] - **feat**: expands knex query coverage on models (#691) (Will Viles) * [[`dd200af8a2`](https://github.com/postlight/lux/commit/dd200af8a2)] - **docs**: clarify after action behavior (#690) (Nick Schot) * [[`b636bf527d`](https://github.com/postlight/lux/commit/b636bf527d)] - **docs**: fix typos (#689) (Nick Schot) * [[`608409d670`](https://github.com/postlight/lux/commit/608409d670)] - **docs**: add code of conduct and contributing documentation (#671) (Zachary Golba) * [[`61bb4f4b04`](https://github.com/postlight/lux/commit/61bb4f4b04)] - **feat**: source code & test app debugger (#685) (Will Viles) * [[`7858af506c`](https://github.com/postlight/lux/commit/7858af506c)] - **fix**: serialized responses containing a self join is missing attributes (#675) (Zachary Golba) * [[`2e223dfc8e`](https://github.com/postlight/lux/commit/2e223dfc8e)] - **feat**: allow creating model instance with a specific id (#679) (Jame) * [[`33a0ef3194`](https://github.com/postlight/lux/commit/33a0ef3194)] - **deps**: update babel-plugin-istanbul to version 4.0.0 (#680) (Greenkeeper) * [[`9c50ed46d2`](https://github.com/postlight/lux/commit/9c50ed46d2)] - **deps**: update eslint-config-airbnb-base to version 11.1.0 (#677) (Greenkeeper) * [[`ed943b506a`](https://github.com/postlight/lux/commit/ed943b506a)] - **deps**: update eslint to version 3.15.0 (#676) (Greenkeeper) * [[`1e703f1a1e`](https://github.com/postlight/lux/commit/1e703f1a1e)] - **deps**: update third party type definitions (#670) (Zachary Golba) * [[`c44ec71414`](https://github.com/postlight/lux/commit/c44ec71414)] - **deps**: update fb-watchman to version 2.0.0 (#673) (Greenkeeper) * [[`478d4d27c5`](https://github.com/postlight/lux/commit/478d4d27c5)] - **dx**: add .nvmrc file (#672) (Zachary Golba) * [[`8b9c4772f3`](https://github.com/postlight/lux/commit/8b9c4772f3)] - **deps**: update source-map-support to version 0.4.11 (#667) (Greenkeeper) * [[`8035ab7dd8`](https://github.com/postlight/lux/commit/8035ab7dd8)] - **deps**: update inflection to version 1.12.0 (#669) (Greenkeeper) * [[`1ed30b373c`](https://github.com/postlight/lux/commit/1ed30b373c)] - **deps**: update fb-watchman to version 1.9.2 (#668) (Greenkeeper) * [[`41793aedc8`](https://github.com/postlight/lux/commit/41793aedc8)] - **deps**: update eslint to version 3.14.1 (#665) (Greenkeeper) * [[`f3cd85926a`](https://github.com/postlight/lux/commit/f3cd85926a)] - **test**: properly test against pg driver on appveyor (#664) (Zachary Golba) * [[`65821af0c1`](https://github.com/postlight/lux/commit/65821af0c1)] - **release**: v1.1.7 🔧 (#663) (Zachary Golba) ### v1.1.7 (Jan 24, 2017) ##### Commits * [[`d9c538ea3e`](https://github.com/postlight/lux/commit/d9c538ea3e)] - **fix**: children one layer deep cannot resolve their parent controller (#662) (Zachary Golba) * [[`c8f0254397`](https://github.com/postlight/lux/commit/c8f0254397)] - **deps**: update eslint to version 3.14.0 (#656) (Greenkeeper) * [[`bcf2c2fbff`](https://github.com/postlight/lux/commit/bcf2c2fbff)] - **fix**: properly set environment before running db:* commands (#661) (Zachary Golba) * [[`083e112a6b`](https://github.com/postlight/lux/commit/083e112a6b)] - **release**: v1.1.6 🔧 (#660) (Zachary Golba) ### v1.1.6 (Jan 22, 2017) ##### Commits * [[`6f1f16a2dc`](https://github.com/postlight/lux/commit/6f1f16a2dc)] - **fix**: recursive readdir is broken (#659) (Zachary Golba) * [[`d6b2d6cfa4`](https://github.com/postlight/lux/commit/d6b2d6cfa4)] - **release**: v1.1.5 🔧 (#658) (Zachary Golba) ### v1.1.5 (Jan 21, 2017) ##### Commits * [[`ddbcd9e43b`](https://github.com/postlight/lux/commit/ddbcd9e43b)] - **fix**: sort not working (#657) (Nick Schot) * [[`20eea5c71b`](https://github.com/postlight/lux/commit/20eea5c71b)] - **deps**: update babel-core to version 6.22.1 (#654) (Greenkeeper) * [[`f83bdf413c`](https://github.com/postlight/lux/commit/f83bdf413c)] - **deps**: update ora to version 1.1.0 (#655) (Greenkeeper) * [[`4ee7b28724`](https://github.com/postlight/lux/commit/4ee7b28724)] - **deps**: update babel-plugin-transform-es2015-modules-commonjs to version 6.22.0 (#653) (Greenkeeper) * [[`c5bd0cc02a`](https://github.com/postlight/lux/commit/c5bd0cc02a)] - **deps**: update babel-core to version 6.22.0 (#652) (Greenkeeper) * [[`26594fdf10`](https://github.com/postlight/lux/commit/26594fdf10)] - **chore**: add gitter integrations (#651) (Zachary Golba) * [[`cdebc089ec`](https://github.com/postlight/lux/commit/cdebc089ec)] - **deps**: update flow-bin to version 0.38.0 (#647) (Greenkeeper) * [[`4e40c2b550`](https://github.com/postlight/lux/commit/4e40c2b550)] - **release**: v1.1.4 🔧 (#650) (Zachary Golba) ### v1.1.4 (Jan 19, 2017) ##### Commits * [[`d1c5e8d00e`](https://github.com/postlight/lux/commit/d1c5e8d00e)] - **fix**: cli and compilation errors (#649) (Zachary Golba) * [[`06d9fc7f65`](https://github.com/postlight/lux/commit/06d9fc7f65)] - **fix**: make sure result is an instance of query in resource enhancer (#648) (Nick Schot) * [[`4f4bd16c12`](https://github.com/postlight/lux/commit/4f4bd16c12)] - **deps**: update nyc to version 10.1.2 (#646) (Greenkeeper) * [[`d6c9ab49fc`](https://github.com/postlight/lux/commit/d6c9ab49fc)] - **release**: v1.1.3 🔧 (#644) (Zachary Golba) ### v1.1.3 (Jan 17, 2017) ##### Upgrading Due to a change in the way the cli modules are bundled, you may need to uninstall and reinstall lux globally before upgrading your application. ```bash npm uninstall -g lux-framework npm cache clean npm install -g lux-framework@latest ``` ##### Commits * [[`89dff6162c`](https://github.com/postlight/lux/commit/89dff6162c)] - **fix**: we should check for lux under the dependency key in package.json not root (#643) (Zachary Golba) * [[`b7c66cb41f`](https://github.com/postlight/lux/commit/b7c66cb41f)] - **fix**: make sure dates are correctly validated & parsed (#639) (Nick Schot) * [[`00273c8279`](https://github.com/postlight/lux/commit/00273c8279)] - **deps**: update ora to version 1.0.0 (#641) (Greenkeeper) * [[`fe2b860abd`](https://github.com/postlight/lux/commit/fe2b860abd)] - **deps**: update source-map-support to version 0.4.10 (#642) (Greenkeeper) * [[`f41fc048b9`](https://github.com/postlight/lux/commit/f41fc048b9)] - **deps**: integrate rollup-plugin-lux (#632) (Zachary Golba) * [[`e4ed011b0a`](https://github.com/postlight/lux/commit/e4ed011b0a)] - **deps**: update eslint-plugin-flowtype to version 2.30.0 (#636) (Greenkeeper) * [[`df95938f3f`](https://github.com/postlight/lux/commit/df95938f3f)] - **deps**: update source-map-support to version 0.4.9 (#634) (Greenkeeper) * [[`ebbcf577bd`](https://github.com/postlight/lux/commit/ebbcf577bd)] - **fix**: migration generator indexes (#625) (Nick Schot) * [[`93aa5c47bd`](https://github.com/postlight/lux/commit/93aa5c47bd)] - **fix**: make pages consistent when using sort on non-unique attributes (#633) (Nick Schot) * [[`d1589ab8f3`](https://github.com/postlight/lux/commit/d1589ab8f3)] - **test**: allow appveyor builds to fail with pg driver (#635) (Zachary Golba) * [[`682d6fef56`](https://github.com/postlight/lux/commit/682d6fef56)] - **chore**: improve ci config and process (#627) (Zachary Golba) * [[`d0795c36fa`](https://github.com/postlight/lux/commit/d0795c36fa)] - **deps**: update rollup to version 0.41.4 (#630) (Greenkeeper) * [[`20d6f0dbe7`](https://github.com/postlight/lux/commit/20d6f0dbe7)] - **deps**: update ansi-regex to version 2.1.1 (#629) (Greenkeeper) * [[`016938c401`](https://github.com/postlight/lux/commit/016938c401)] - **deps**: update rollup to version 0.41.3 (#628) (Greenkeeper) * [[`e7d069ffe7`](https://github.com/postlight/lux/commit/e7d069ffe7)] - **deps**: update rollup to version 0.41.1 (#616) (Greenkeeper) * [[`1626cd882c`](https://github.com/postlight/lux/commit/1626cd882c)] - **deps**: update ora to version 0.4.1 (#623) (Greenkeeper) * [[`60b33a6a33`](https://github.com/postlight/lux/commit/60b33a6a33)] - **deps**: update eslint to version 3.13.1 (#622) (Greenkeeper) * [[`b050cfaf03`](https://github.com/postlight/lux/commit/b050cfaf03)] - **deps**: update eslint-config-airbnb-base to version 11.0.1 (#619) (Greenkeeper) * [[`5a879d467e`](https://github.com/postlight/lux/commit/5a879d467e)] - **deps**: update eslint to version 3.13.0 (#615) (Greenkeeper) * [[`fbbf198e2b`](https://github.com/postlight/lux/commit/fbbf198e2b)] - **deps**: update babel-plugin-istanbul to version 3.1.2 (#611) (Greenkeeper) * [[`4c5e326afa`](https://github.com/postlight/lux/commit/4c5e326afa)] - **release**: v1.1.2 🔧 (#609) (Zachary Golba) ### v1.1.2 (Jan 3, 2017) :tada: Happy New Year! ##### Commits * [[`f828e8effa`](https://github.com/postlight/lux/commit/f828e8effa)] - **fix**: database is undefined when using the postgresql driver (#605) (Zachary Golba) * [[`46ed68b35a`](https://github.com/postlight/lux/commit/46ed68b35a)] - **deps**: update third party type definitions (#604) (Zachary Golba) * [[`914a4b831d`](https://github.com/postlight/lux/commit/914a4b831d)] - **deps**: update sinon to version 1.17.7 (#602) (Greenkeeper) * [[`d3ffda9156`](https://github.com/postlight/lux/commit/d3ffda9156)] - **deps**: update eslint-plugin-flowtype to version 2.29.2 (#595) (Greenkeeper) * [[`f5b002e3dd`](https://github.com/postlight/lux/commit/f5b002e3dd)] - **release**: v1.1.1 🔧 (#594) (Zachary Golba) ### v1.1.1 (Dec 28, 2016) ##### Commits * [[`c54cc20844`](https://github.com/postlight/lux/commit/c54cc20844)] - **fix**: options request does not work with query params (#573) (Zachary Golba) * [[`93df71f3c9`](https://github.com/postlight/lux/commit/93df71f3c9)] - **deps**: update babel-plugin-istanbul to version 3.0.0 (#591) (Greenkeeper) * [[`0f724109fa`](https://github.com/postlight/lux/commit/0f724109fa)] - **deps**: update source-map-support to version 0.4.8 🚀 (#590) (Greenkeeper) * [[`fdb7a9e7fc`](https://github.com/postlight/lux/commit/fdb7a9e7fc)] - **deps**: update flow-bin to version 0.37.4 🚀 (#587) (Greenkeeper) * [[`302a10fd61`](https://github.com/postlight/lux/commit/302a10fd61)] - **docs**: remove irrelevant doc comments from query class (#578) (Zachary Golba) * [[`ccb645c0f0`](https://github.com/postlight/lux/commit/ccb645c0f0)] - **refactor**: lint binary and scripts (#576) (Zachary Golba) * [[`20c381fd75`](https://github.com/postlight/lux/commit/20c381fd75)] - **deps**: update test-app dependencies (#577) (Zachary Golba) * [[`4fad8cbdf5`](https://github.com/postlight/lux/commit/4fad8cbdf5)] - **deps**: update babel-preset-lux to version 2.0.1 (#570) (Zachary Golba) * [[`ac08ca4fea`](https://github.com/postlight/lux/commit/ac08ca4fea)] - **deps**: update ora to version 0.4.0 (#575) (Greenkeeper) * [[`557e2c2805`](https://github.com/postlight/lux/commit/557e2c2805)] - **deps**: update babel-core to version 6.21.0 (#567) (Greenkeeper) * [[`c94b2597df`](https://github.com/postlight/lux/commit/c94b2597df)] - **deps**: update remark-lint to version 5.4.0 (#572) (Greenkeeper) * [[`8ab08b3bba`](https://github.com/postlight/lux/commit/8ab08b3bba)] - **deps**: update eslint to version 3.12.1 (#564) (Greenkeeper) * [[`a139b81b8e`](https://github.com/postlight/lux/commit/a139b81b8e)] - **deps**: update eslint-config-airbnb-base to version 11.0.0 🚀 (#560) (Greenkeeper) * [[`821a2c49af`](https://github.com/postlight/lux/commit/821a2c49af)] - **deps**: update rollup to version 0.37.0 (#561) (Greenkeeper) * [[`7eab2633d0`](https://github.com/postlight/lux/commit/7eab2633d0)] - **deps**: update flow-bin to version 0.37.0 🚀 (#563) (Greenkeeper) * [[`ae4c4df189`](https://github.com/postlight/lux/commit/ae4c4df189)] - **deps**: update rollup-plugin-babel to version 2.7.1 (#565) (Greenkeeper) * [[`f94ac5234c`](https://github.com/postlight/lux/commit/f94ac5234c)] - **docs**: add more api docs and improve existing content (#559) (Zachary Golba) ### 1.1.0 (Dec 10, 2016) ##### Features ###### Transactions This release introduces a public transaction api to the model class. Changes are backwards compatible with the previous model api. Internally, all methods that modify the state of the database are wrapped in transactions. If the transaction fails, all calls to `create`, `save`, or `update` will be rolled back to the state before the transaction began. **Example:** ```javascript import User from 'app/models/user'; // This internally uses a transaction. await User.create({ firstName: 'New', lastName: 'User' }); ``` ### Working With Transactions You have the ability to manually specify the transaction that will be used for a `create`, `update`, or `save` call with the static and instance method, `transacting`. **Example:** ```javascript import { Model } from 'lux-framework'; import Profile from 'app/models/profile'; class User extends Model { static hasOne = { profile: { inverse: 'user' } }; static hooks = { async beforeCreate(user, trx) { // If the transaction fails the profile instance will not be persisted. user.profile = await Profile .transacting(trx) .create(); } }; } ``` You can also manually trigger create a transaction if you plan on creating many model instances as once. **Example:** ```javascript import User from 'app/models/user'; User.transaction(trx => ( Promise.all([ User .transacting(trx) .create({ firstName: 'New', lastName: 'User' }), User .transacting(trx) .create({ firstName: 'New', lastName: 'User' }), User .transacting(trx) .create({ firstName: 'New', lastName: 'User' }) ]) )); ``` ##### Commits * [[`3f15362600`](https://github.com/postlight/lux/commit/3f15362600)] - **deps**: update babel-core to version 6.20.0 (#556) (Greenkeeper) * [[`9a20c5ce11`](https://github.com/postlight/lux/commit/9a20c5ce11)] - **deps**: update eslint to version 3.12.0 (#557) (Greenkeeper) * [[`7f53cd230c`](https://github.com/postlight/lux/commit/7f53cd230c)] - **docs**: fix broken logo in readme (#555) (Zachary Golba) * [[`590956ed52`](https://github.com/postlight/lux/commit/590956ed52)] - **docs**: add preliminary guide files (#554) (Zachary Golba) * [[`16d224b4e7`](https://github.com/postlight/lux/commit/16d224b4e7)] - **feat**: use transactions when writing to the database (#527) (Zachary Golba) * [[`9e89b042cd`](https://github.com/postlight/lux/commit/9e89b042cd)] - **deps**: update eslint-plugin-flowtype to version 2.29.1 (#549) (Greenkeeper) * [[`5b3e91e5f9`](https://github.com/postlight/lux/commit/5b3e91e5f9)] - **deps**: update eslint to version 3.11.1 (#547) (Greenkeeper) * [[`4eb0c9b926`](https://github.com/postlight/lux/commit/4eb0c9b926)] - **deps**: update eslint-plugin-flowtype to version 2.28.2 (#546) (Greenkeeper) * [[`42f1707ac8`](https://github.com/postlight/lux/commit/42f1707ac8)] - **deps**: update eslint to version 3.11.0 🚀 (#539) (Greenkeeper) * [[`39adf76c3a`](https://github.com/postlight/lux/commit/39adf76c3a)] - **deps**: update rollup to version 0.36.4 (#536) (Greenkeeper) * [[`23189f535b`](https://github.com/postlight/lux/commit/23189f535b)] - **deps**: update flow-bin to version 0.36.0 🚀 (#537) (Greenkeeper) * [[`394d3132e7`](https://github.com/postlight/lux/commit/394d3132e7)] - **deps**: update nyc to version 10.0.0 (#535) (Greenkeeper) * [[`ef33526860`](https://github.com/postlight/lux/commit/ef33526860)] - **deps**: update mocha to version 3.2.0 (#538) (Greenkeeper) * [[`760ae5f68c`](https://github.com/postlight/lux/commit/760ae5f68c)] - **release**: 1.0.5 🔧 (#534) (Zachary Golba) ### 1.0.5 (Nov 20, 2016) ##### Commits * [[`45c18600c4`](https://github.com/postlight/lux/commit/45c18600c4)] - **deps**: update babel-eslint to version 7.1.1 (#533) (Greenkeeper) * [[`0720dda77f`](https://github.com/postlight/lux/commit/0720dda77f)] - **deps**: update eslint to version 3.10.2 (#532) (Greenkeeper) * [[`dbdcc5a2de`](https://github.com/postlight/lux/commit/dbdcc5a2de)] - **fix**: query parameters are not added to custom routes (#528) (Nick Schot) * [[`4530d0ce8d`](https://github.com/postlight/lux/commit/4530d0ce8d)] - **deps**: update nyc to version 9.0.1 (#530) (Greenkeeper) * [[`8d36091058`](https://github.com/postlight/lux/commit/8d36091058)] - **deps**: update eslint to version 3.10.1 (#529) (Greenkeeper) * [[`c586f350f6`](https://github.com/postlight/lux/commit/c586f350f6)] - **docs**: use master branch for appveyor badge (#526) (Zachary Golba) * [[`e93b45ca4b`](https://github.com/postlight/lux/commit/e93b45ca4b)] - **deps**: update test-app dependencies (#525) (Zachary Golba) * [[`0bbb7af65c`](https://github.com/postlight/lux/commit/0bbb7af65c)] - **release**: 1.0.4 🔧 (#524) (Zachary Golba) ### 1.0.4 (Nov 12, 2016) ##### Commits * [[`7d2ff0d316`](https://github.com/postlight/lux/commit/7d2ff0d316)] - **fix**: ids in json payloads should be cast to number (#523) (Zachary Golba) * [[`8cca55e756`](https://github.com/postlight/lux/commit/8cca55e756)] - **fix**: empty 1:1 relationships are not returned in correct format (#521) (Zachary Golba) * [[`6919517b37`](https://github.com/postlight/lux/commit/6919517b37)] - **test**: prevent ci builds from failing due to time constraints (#520) (Zachary Golba) * [[`090f871f18`](https://github.com/postlight/lux/commit/090f871f18)] - **fix**: passing value null in post to type number throws type error (#516) (Zachary Golba) * [[`6cd3e68b6e`](https://github.com/postlight/lux/commit/6cd3e68b6e)] - **deps**: update flow-bin to version 0.35.0 🚀 (#517) (Greenkeeper) * [[`cd4f63fe4a`](https://github.com/postlight/lux/commit/cd4f63fe4a)] - **deps**: update eslint to version 3.10.0 (#518) (Greenkeeper) * [[`b97d093c9a`](https://github.com/postlight/lux/commit/b97d093c9a)] - **fix**: default values override all falsy attribute values (#515) (Zachary Golba) * [[`6f4e17078c`](https://github.com/postlight/lux/commit/6f4e17078c)] - **dx**: use flow-typed instead of custom type declarations when possible (#514) (Zachary Golba) * [[`44b88250a2`](https://github.com/postlight/lux/commit/44b88250a2)] - **docs**: use shields.io for project status badges in readme (#513) (Zachary Golba) * [[`2e9c3353b1`](https://github.com/postlight/lux/commit/2e9c3353b1)] - **release**: 1.0.3 🔧 (#512) (Zachary Golba) ### 1.0.3 (Nov 10, 2016) ##### Commits * [[`53378f622b`](https://github.com/postlight/lux/commit/53378f622b)] - **fix**: dynamic segments are not parsed on model-less resources (#510) (Zachary Golba) * [[`56321bb7df`](https://github.com/postlight/lux/commit/56321bb7df)] - **fix**: small typos in model initialize-class.js (#505) (Nick Schot) * [[`7769865731`](https://github.com/postlight/lux/commit/7769865731)] - **chore**: use codecov bash uploader (#511) (Zachary Golba) * [[`edb4635b8c`](https://github.com/postlight/lux/commit/edb4635b8c)] - **fix**: some strings in request body cast to another type (#506) (Zachary Golba) * [[`dea08354ab`](https://github.com/postlight/lux/commit/dea08354ab)] - **deps**: update eslint-config-airbnb-base to version 10.0.1 🚀 (#503) (Greenkeeper) * [[`b7435570fc`](https://github.com/postlight/lux/commit/b7435570fc)] - **deps**: update eslint-plugin-import to version 2.2.0 (#504) (Greenkeeper) * [[`18ba638610`](https://github.com/postlight/lux/commit/18ba638610)] - **deps**: update babel-plugin-transform-es2015-modules-commonjs to version 6.18.0 (#500) (Zachary Golba) * [[`59a16f19ca`](https://github.com/postlight/lux/commit/59a16f19ca)] - **deps**: update eslint to version 3.9.1 (#501) (Zachary Golba) * [[`e12eb406d2`](https://github.com/postlight/lux/commit/e12eb406d2)] - **deps**: update eslint-plugin-import to version 2.1.0 (#498) (Greenkeeper) * [[`7b1c48b4aa`](https://github.com/postlight/lux/commit/7b1c48b4aa)] - **deps**: update eslint to version 3.9.0 🚀 (#489) (Greenkeeper) * [[`61c37cc4de`](https://github.com/postlight/lux/commit/61c37cc4de)] - **deps**: update source-map-support to version 0.4.6 (#492) (Greenkeeper) * [[`055bf5f5fe`](https://github.com/postlight/lux/commit/055bf5f5fe)] - **deps**: update babel-core to version 6.18.2 (#496) (Greenkeeper) * [[`63db399c8c`](https://github.com/postlight/lux/commit/63db399c8c)] - **deps**: update nyc to version 8.4.0 (#497) (Greenkeeper) * [[`26ba4e5a21`](https://github.com/postlight/lux/commit/26ba4e5a21)] - **deps**: update remark-lint to version 5.2.0 (#494) (Greenkeeper) * [[`46f223b77f`](https://github.com/postlight/lux/commit/46f223b77f)] - **deps**: update flow-bin to version 0.34.0 (#490) (Greenkeeper) * [[`71214e17ff`](https://github.com/postlight/lux/commit/71214e17ff)] - **deps**: update remark-cli to version 2.1.0 (#488) (Greenkeeper) * [[`748b26b577`](https://github.com/postlight/lux/commit/748b26b577)] - **deps**: update babel-eslint to version 7.1.0 (#487) (Greenkeeper) * [[`d98139e08c`](https://github.com/postlight/lux/commit/d98139e08c)] - **deps**: update eslint-plugin-flowtype to version 2.25.0 (#486) (Greenkeeper) * [[`40bea0b2d1`](https://github.com/postlight/lux/commit/40bea0b2d1)] - **deps**: update eslint-plugin-flowtype to version 2.24.0 (#485) (Greenkeeper) * [[`edaec79e12`](https://github.com/postlight/lux/commit/edaec79e12)] - **deps**: update babel-core to version 6.18.0 (#483) (Greenkeeper) * [[`ce25efdad7`](https://github.com/postlight/lux/commit/ce25efdad7)] - **deps**: update eslint-plugin-flowtype to version 2.23.1 (#484) (Greenkeeper) * [[`be7fef2034`](https://github.com/postlight/lux/commit/be7fef2034)] - **deps**: update eslint-plugin-flowtype to version 2.22.0 (#481) (Greenkeeper) * [[`3e578257f9`](https://github.com/postlight/lux/commit/3e578257f9)] - **release**: 1.0.2 🔧 (#480) (Zachary Golba) ### 1.0.2 (Oct 24, 2016) ##### Commits * [[`bbf68000ea`](https://github.com/postlight/lux/commit/bbf68000ea)] - **fix**: controllers are not properly resolving for resources with custom paths (#478) (Zachary Golba) * [[`1a52cc1cec`](https://github.com/postlight/lux/commit/1a52cc1cec)] - **deps**: update eslint-plugin-flowtype to version 2.21.0 (#479) (Greenkeeper) * [[`fe35b45935`](https://github.com/postlight/lux/commit/fe35b45935)] - **release**: 1.0.1 🔧 (#477) (Zachary Golba) ### 1.0.1 (Oct 20, 2016) ##### Commits * [[`f27eab4e66`](https://github.com/postlight/lux/commit/f27eab4e66)] - **fix**: readdir error is causing cli commands to fail (#476) (Zachary Golba) * [[`2deea84ab9`](https://github.com/postlight/lux/commit/2deea84ab9)] - **release**: 1.0.0 🎉 (#472) (Zachary Golba) ### 1.0.0 (Oct 20, 2016) ##### Commits * [[`34d9478323`](https://github.com/postlight/lux/commit/34d9478323)] - **deps**: update test-app dependencies (#475) (Zachary Golba) * [[`71dc913fb8`](https://github.com/postlight/lux/commit/71dc913fb8)] - **chore**: add markdown linter (#474) (Zachary Golba) * [[`0f1aa9fe69`](https://github.com/postlight/lux/commit/0f1aa9fe69)] - **deps**: update nyc to version 8.3.2 (#473) (Greenkeeper) * [[`0ca4477935`](https://github.com/postlight/lux/commit/0ca4477935)] - **docs**: fix link to guides in readme (#471) (Chris Watts) * [[`ea471aad7f`](https://github.com/postlight/lux/commit/ea471aad7f)] - **fix**: eslint config in compiler inherits from lux .eslintrc.json (#469) (Zachary Golba) * [[`2c74a0cc9c`](https://github.com/postlight/lux/commit/2c74a0cc9c)] - **docs**: add logo to readme (#470) (Zachary Golba) * [[`6656b9aca5`](https://github.com/postlight/lux/commit/6656b9aca5)] - **docs**: finalize public api docs for 1.0 release (#418) (Zachary Golba) * [[`7af75be54f`](https://github.com/postlight/lux/commit/7af75be54f)] - **deps**: update source-map-support to version 0.4.5 (#468) (Greenkeeper) * [[`362b196db3`](https://github.com/postlight/lux/commit/362b196db3)] - **deps**: update eslint to version 3.8.1 (#467) (Greenkeeper) * [[`d8833a9968`](https://github.com/postlight/lux/commit/d8833a9968)] - **deps**: update eslint-config-airbnb-base to version 9.0.0 🚀 (#464) (Greenkeeper) * [[`e0cde3bc20`](https://github.com/postlight/lux/commit/e0cde3bc20)] - **deps**: update babel-plugin-istanbul to version 2.0.3 (#465) (Greenkeeper) * [[`0b9b017a26`](https://github.com/postlight/lux/commit/0b9b017a26)] - **test**: improve logger test coverage (#452) (Zachary Golba) * [[`a343f87273`](https://github.com/postlight/lux/commit/a343f87273)] - **refactor**: ensure tableName is statically evaluated (#462) (Zachary Golba) * [[`fd60ff7b77`](https://github.com/postlight/lux/commit/fd60ff7b77)] - **deps**: update source-map-support to version 0.4.4 (#463) (Greenkeeper) * [[`b86a4cbe3d`](https://github.com/postlight/lux/commit/b86a4cbe3d)] - **deps**: update test-app dependencies (#461) (Zachary Golba) * [[`54db513fa3`](https://github.com/postlight/lux/commit/54db513fa3)] - **feat**: expose controller and action in public request api (#460) (Zachary Golba) * [[`e289ffc142`](https://github.com/postlight/lux/commit/e289ffc142)] - **feat**: add after-action middleware hook to controller (#459) (Zachary Golba) * [[`b74b52ff75`](https://github.com/postlight/lux/commit/b74b52ff75)] - **deps**: update mocha to version 3.1.2 (#458) (Zachary Golba) * [[`c14625a38c`](https://github.com/postlight/lux/commit/c14625a38c)] - **deps**: update eslint to version 3.8.0 🚀 (#457) (Greenkeeper) * [[`0a6c953345`](https://github.com/postlight/lux/commit/0a6c953345)] - **fix**: namespaced resources without root controllers/serializers is not… (#454) (Zachary Golba) * [[`a2bee41294`](https://github.com/postlight/lux/commit/a2bee41294)] - **fix**: compiler does not properly format class names for nested namespaces (#449) (Zachary Golba) * [[`adc723040c`](https://github.com/postlight/lux/commit/adc723040c)] - **deps**: update eslint-plugin-import to version 2.0.1 (#451) (Greenkeeper) * [[`c8995a2f75`](https://github.com/postlight/lux/commit/c8995a2f75)] - **test**: add unit tests for route definitions (#443) (Zachary Golba) * [[`ec18b7ac96`](https://github.com/postlight/lux/commit/ec18b7ac96)] - **deps**: update mocha to version 3.1.1 (#448) (Greenkeeper) * [[`f6a868bd77`](https://github.com/postlight/lux/commit/f6a868bd77)] - **deps**: update rollup to version 0.36.3 (#447) (Greenkeeper) * [[`3dfc2907e2`](https://github.com/postlight/lux/commit/3dfc2907e2)] - **fix**: remove unused plugins in lib/babel-hook (#444) (Zachary Golba) * [[`e7316c0df3`](https://github.com/postlight/lux/commit/e7316c0df3)] - **fix**: use path.sep to resolve root tmp dirs in fs tests (#442) (Zachary Golba) * [[`345e8c6b73`](https://github.com/postlight/lux/commit/345e8c6b73)] - **test**: add unit tests for controller utils (#441) (Zachary Golba) * [[`a4d9952984`](https://github.com/postlight/lux/commit/a4d9952984)] - **refactor**: make watcher a child of the fs package (#412) (Zachary Golba) * [[`20480fa1c9`](https://github.com/postlight/lux/commit/20480fa1c9)] - **deps**: update test-app dependencies (#440) (Zachary Golba) * [[`b3445ce5a4`](https://github.com/postlight/lux/commit/b3445ce5a4)] - **deps**: update nyc to version 8.3.1 (#439) (Greenkeeper) * [[`1bfd98e77a`](https://github.com/postlight/lux/commit/1bfd98e77a)] - **test**: run flow on appveyor builds (#432) (Zachary Golba) * [[`9e2f84bd2d`](https://github.com/postlight/lux/commit/9e2f84bd2d)] - **refactor**: use airbnb eslint rules (#434) (Zachary Golba) * [[`57101cfaf1`](https://github.com/postlight/lux/commit/57101cfaf1)] - **deps**: update eslint-plugin-flowtype to version 2.20.0 (#438) (Greenkeeper) * [[`bf213b49b8`](https://github.com/postlight/lux/commit/bf213b49b8)] - **deps**: update eslint to version 3.7.1 (#437) (Zachary Golba) * [[`84b7bd0d14`](https://github.com/postlight/lux/commit/84b7bd0d14)] - **deps**: update babel-preset-lux to version 1.3.0 (#436) (Greenkeeper) * [[`eaeb9eb983`](https://github.com/postlight/lux/commit/eaeb9eb983)] - **test**: enable parallel circleci builds (#435) (Zachary Golba) * [[`c8f05ee180`](https://github.com/postlight/lux/commit/c8f05ee180)] - **deps**: update babel-core to version 6.17.0 (#433) (Greenkeeper) * [[`856aeae646`](https://github.com/postlight/lux/commit/856aeae646)] - **test**: switch to circleci (#431) (Zachary Golba) * [[`0a49d14f1e`](https://github.com/postlight/lux/commit/0a49d14f1e)] - **deps**: update source-map-support to version 0.4.3 (#428) (Greenkeeper) * [[`339c35c864`](https://github.com/postlight/lux/commit/339c35c864)] - **deps**: update babel-core to version 6.16.0 (#427) (Zachary Golba) * [[`c3483ac1dc`](https://github.com/postlight/lux/commit/c3483ac1dc)] - chore(package): update babel-core to version 6.16.0 (greenkeeperio-bot) * [[`17780a1c6c`](https://github.com/postlight/lux/commit/17780a1c6c)] - **deps**: update babel-plugin-transform-es2015-modules-commonjs to version 6.16.0 (#430) (Greenkeeper) * [[`fd7bbe2f90`](https://github.com/postlight/lux/commit/fd7bbe2f90)] - **deps**: update flow-bin to version 0.33.0 🚀 (#429) (Greenkeeper) * [[`d3c67a51c8`](https://github.com/postlight/lux/commit/d3c67a51c8)] - **deps**: update rollup to version 0.36.1 (#426) (Greenkeeper) * [[`de8c3f16bb`](https://github.com/postlight/lux/commit/de8c3f16bb)] - **chore**: change ecmaVersion to 2017 in .eslintrc.json (#425) (Zachary Golba) * [[`32064c964e`](https://github.com/postlight/lux/commit/32064c964e)] - **deps**: update babel-eslint to version 7.0.0 (#424) (Greenkeeper) * [[`5fb4a42192`](https://github.com/postlight/lux/commit/5fb4a42192)] - **deps**: update mocha to version 3.1.0 (#423) (Greenkeeper) * [[`c7fe135343`](https://github.com/postlight/lux/commit/c7fe135343)] - **deps**: update eslint to version 3.6.1 (#422) (Greenkeeper) * [[`0e6ec39138`](https://github.com/postlight/lux/commit/0e6ec39138)] - **refactor**: cleanup unecessary controller props (#420) (Zachary Golba) * [[`a12bcad4c9`](https://github.com/postlight/lux/commit/a12bcad4c9)] - **deps**: update node-fetch to version 1.6.3 (#421) (Zachary Golba) * [[`85fc7fc82f`](https://github.com/postlight/lux/commit/85fc7fc82f)] - chore(package): update node-fetch to version 1.6.3 (greenkeeperio-bot) * [[`28b03d63f7`](https://github.com/postlight/lux/commit/28b03d63f7)] - **docs**: update examples (#419) (Zachary Golba) * [[`6b2f86da48`](https://github.com/postlight/lux/commit/6b2f86da48)] - **deps**: update sinon to version 1.17.6 (#416) (Zachary Golba) * [[`15c5ca0c0c`](https://github.com/postlight/lux/commit/15c5ca0c0c)] - **deps**: update node-fetch to version 1.6.2 (#415) (Greenkeeper) * [[`aa81af568c`](https://github.com/postlight/lux/commit/aa81af568c)] - **deps**: update eslint to version 3.6.0 (#414) (Greenkeeper) * [[`f0d660c599`](https://github.com/postlight/lux/commit/f0d660c599)] - **fix**: application keys being overwritten (#411) (Zachary Golba) * [[`585584d2f7`](https://github.com/postlight/lux/commit/585584d2f7)] - **test**: improve luxify test coverage (#409) (Zachary Golba) * [[`73579fb570`](https://github.com/postlight/lux/commit/73579fb570)] - **test**: add unit tests for route namespaces (#410) (Zachary Golba) * [[`29dab32f86`](https://github.com/postlight/lux/commit/29dab32f86)] - **test**: refactor serializer tests to improve coverage (#408) (Zachary Golba) * [[`999f64933c`](https://github.com/postlight/lux/commit/999f64933c)] - **deps**: update mysql2 to v1.1.0 in test-app (#413) (Zachary Golba) * [[`233d4a716c`](https://github.com/postlight/lux/commit/233d4a716c)] - **test**: add unit tests for relationships module in database package (#407) (Zachary Golba) * [[`ade16b5d5e`](https://github.com/postlight/lux/commit/ade16b5d5e)] - **deps**: update eslint-plugin-flowtype to version 2.19.0 (#406) (Greenkeeper) * [[`a11ee86f27`](https://github.com/postlight/lux/commit/a11ee86f27)] - **deps**: update rollup to version 0.36.0 (Greenkeeper) * [[`4d35d593bf`](https://github.com/postlight/lux/commit/4d35d593bf)] - **test**: improve overall test coverage (#287) (Zachary Golba) * [[`cd1e822817`](https://github.com/postlight/lux/commit/cd1e822817)] - **deps**: update eslint-plugin-flowtype to version 2.18.2 (#397) (Greenkeeper) * [[`bf5571db8f`](https://github.com/postlight/lux/commit/bf5571db8f)] - **deps**: update test-app dependencies (#395) (Zachary Golba) * [[`007fd125ae`](https://github.com/postlight/lux/commit/007fd125ae)] - **deps**: update eslint-plugin-flowtype to version 2.18.1 (#389) (Greenkeeper) * [[`b0bb089ae3`](https://github.com/postlight/lux/commit/b0bb089ae3)] - **deps**: update eslint-plugin-flowtype to version 2.17.1 (#387) (Greenkeeper) * [[`d1e42c47f4`](https://github.com/postlight/lux/commit/d1e42c47f4)] - **chore**: switch to bcryptjs instead of native bcrypt in social-network example (#383) (Zachary Golba) * [[`e4966fd1f7`](https://github.com/postlight/lux/commit/e4966fd1f7)] - **chore**: fix authentication in social-network example (#378) (Zachary Golba) * [[`bbbe317a44`](https://github.com/postlight/lux/commit/bbbe317a44)] - **deps**: update eslint to version 3.5.0 (#373) (Greenkeeper) * [[`271722efd2`](https://github.com/postlight/lux/commit/271722efd2)] - **deps**: update eslint-plugin-flowtype to version 2.16.1 (#372) (Greenkeeper) * [[`7a3b836d51`](https://github.com/postlight/lux/commit/7a3b836d51)] - **deps**: update rollup-plugin-eslint to version 3.0.0 (#370) (Greenkeeper) * [[`c823ce4da2`](https://github.com/postlight/lux/commit/c823ce4da2)] - **chore**: use bcrypt in social network example (#371) (Adrien Montfort) * [[`bc7eba0e44`](https://github.com/postlight/lux/commit/bc7eba0e44)] - **deps**: update eslint-plugin-flowtype to version 2.16.0 (#369) (Greenkeeper) * [[`15e21ec3bf`](https://github.com/postlight/lux/commit/15e21ec3bf)] - **deps**: update rollup-plugin-json to version 2.0.2 (#368) (Greenkeeper) * [[`9f1e3ef7db`](https://github.com/postlight/lux/commit/9f1e3ef7db)] - **deps**: update eslint-plugin-flowtype to version 2.15.0 (#367) (Greenkeeper) * [[`38081786f6`](https://github.com/postlight/lux/commit/38081786f6)] - **deps**: update eslint-plugin-flowtype to version 2.14.3 (#366) (Greenkeeper) * [[`77b623a257`](https://github.com/postlight/lux/commit/77b623a257)] - **release**: 1.0.0-rc.7 (#363) (Zachary Golba) ### 1.0.0-rc.7 (Sept 4, 2016) This release implements a fix for a regression in `1.0.0-rc.6` where model migrations would include the formatted filename as the table name (i.e `'2016050414243335_create_posts'` instead of `'posts'`). ##### Commits * [[`7bd0f4d87b`](https://github.com/postlight/lux/commit/7bd0f4d87b)] - **chore**: update example applications (#361) (Zachary Golba) * [[`9bcecc5650`](https://github.com/postlight/lux/commit/9bcecc5650)] - **release**: 1.0.0-rc.6 (#360) (Zachary Golba) ### 1.0.0-rc.6 (Sept 4, 2016) This release contains a number of bug fixes related to overriding default behavior such as custom actions, model-less controllers, etc. In addition to bug fixes this release contains some awesome new features. ##### Upgrading Route definitions have changed quite a bit with the implementation of router namespaces. In order to upgrade you will have to remove any calls to `this.route` within the `app/routes.js` file. Previously, `this.route` was a means of defining custom routes or just defining individual routes rather than a whole resource. It did not scale well to multiple namespaces and was kind of a clunky API to begin with. To define a custom route within a resource you may do the following: ```javascript export default function routes() { // Arbitrary Routes (i.e /{route}) // GET /health => ApplicationController#health this.get('health'); this.resource('posts', function () { // Member Routes (i.e /posts/:id/{route}) this.member(function () { // GET /posts/1/comments => PostsController#comments() this.get('comments'); // POST /posts/1/comments => PostsController#createComment() this.post('comments', 'createComment'); }); // Collection Routes (i.e /posts/{route}) this.collection(function () { // GET /posts/drafts => PostsController#drafts() this.get('drafts'); }); }); } ``` To only define a subset of routes for a given resource you may now do the following as shortcut: ```javascript export default function routes() { // GET /posts => 200 OK // GET /posts/1 => 200 OK // POST /posts => 404 Not Found // PATCH /posts/1 => 404 Not Found // DELETE /posts/1 => 404 Not Found this.resource('posts', { only: ['show', 'index'] }); } ``` ##### Features ###### Router Namespaces You now have the ability to define namespaces with your routes. Common uses cases for defining a namespace within your routes include admin-only routes, requiring payment from a user, api versioning, etc. **Generators** To generate a resource within a namespace, include the namespace as part of the name argument passed to the `generate` command. *Example:* ```bash lux generate resource admin/posts ``` The command above will result in the following files being created: * `app/controllers/admin/posts` * `app/serializers/admin/posts` If you do not already have an `ApplicationController` or `ApplicationSerializer` for a namespace, they will automatically be generated. Also, the `generate` command will omit namespaces when generating a `Model` or `Migration`. If you generate a resource in a namespace that already has a `Model`, you will be given the choice to either overwrite or skip the `Model` or `Migration` files. **Controllers** You can think of a namespace as if it is it's own Lux application that you are mounting into it's parent namespace. Similar to how a `Controller` works in previous versions, a `Controller` within a namespace will merge it's middleware with the `ApplicationController` for the namespace it is a part of. If the `Controller` is the `ApplicationController` for a namespace, it will merge it's middleware with the `ApplicationController` of parent namespace if possible. *Example:* ```javascript /********************* * Namespace: 'Root' * * Path: '/' * *********************/ import { Controller } from 'lux-framework'; class ApplicationController extends Controller { beforeAction = [ async function sayHello({ logger }) { logger.info('Hello world!'); } ]; } class PostsController extends Controller { index() { return Post.isPublic(); } } ``` A `GET` request to `/posts` will result in the following functions (in this order) handling the request: * `sayHello` * `PostsController#index` The `PostsController#index` action only gives us the posts that are publicly available. This is what we want, but we should have a way for user's with admin access to be able to see what has not been published yet. To accomplish this we will use a namespace. ```javascript /********************** * Namespace: 'admin' * * Path: '/admin' * **********************/ import { Controller } from 'lux-framework'; class AdminApplicationController extends Controller { beforeAction = [ async function authenticate() { // Authenticate request... } ]; } class AdminPostsController extends Controller { index() { return Post.all(); } } ``` A `GET` request to `/admin/posts` will result in the following functions (in this order) handling the request: * `sayHello` * `authenticate` * `AdminPostsController#index` As you can see in the example above, namespaces allow you to isolate middleware functions in a `beforeAction` array to only execute at certain paths of your application. This is done behind the scenes with Lux and does not require you to use inheritance between your controllers. Inheritance is 100% opt-in so feel free to start from scratch while still gaining the benefit of shared middleware functions. Sometimes it can be nice to use inheritance if we're only slightly changing the behavior of a `Controller`. Let's look at an example where the `AdminPostsController` extends the `PostsController`. ```javascript import PostsController from 'app/controllers/posts'; class AdminPostsController extends PostsController { index(request, response) { return super.index(request, response).unscope('isPublic'); } } ``` In the example above we are able to simply remove the `isPublic` scope from the `#index()` action because we are using inheritance. This would be very helpful if we added additional logic to the `#index()` route that would have otherwise had to duplicate across `posts` routes in other namespaces. Keep in mind, inheritance can be an anti-pattern if it takes you more work to override methods than it would be to start fresh. **Serializers** Serializers within a namespace work very similar to a `Controller`. The main difference being that it is not required to have a `Serializer` within each namespace. Serializers will resolve to their closest ancestor. That means that if you have a `PostsSerializer` for a `posts` resource at the root namespace, requests to `/admin/posts` will fall back to use the `PostsSerializer` if a `AdminPostsSerializer` is not found at `app/serializers/admin/posts.js`. Serializers within a namespace are great for versioning an api. Over time some fields may become deprecated in your responses and using serializers in a namespace is a great way to solve this problem. *Example:* ```javascript /********************** * Namespace: 'v1' * * Path: '/v1' * **********************/ import { Serializer } from 'lux-framework'; class V1PostsSerializer extends Serializer { attributes = [ 'body', 'title', 'deprecated' ]; hasOne = [ 'author' ]; haMany = [ 'comments' ]; } ``` As you can see above we have a `V1PostsSerializer` that has an attribute that we no longer wish to include in responses in the `v2` namespace. We can use a namespaces to help us accomplish this task. ```javascript /********************** * Namespace: 'v2' * * Path: '/v2' * **********************/ import V1PostsSerializer from 'app/serializers/v1/posts'; class V2PostsSerializer extends V1PostsSerializer { attributes = [ 'body', 'title' ]; } ``` 🎉 It's that simple. Requests to `/v1/posts` will include the `deprecated` attribute while requests to `/v2/posts` will not. **Defining Namespaces** To define a namespace in your application, you must specify it in the `app/routes.js` file. ```javascript function routes() { this.resource('posts'); this.namespace('admin', function () { this.resource('posts'); }); } ``` There is no limit to how many levels you nest namespaces. Lux will flatten the execution of functions nested within namespaces during application boot so feel free to go crazy. ```javascript function routes() { this.namespace('a', function () { this.resource('posts'); this.namespace('b', function () { this.resource('posts'); this.namespace('c', function () { this.resource('posts'); this.namespace('d', function () { this.resource('posts'); }); }); }); }); } ``` ###### Persistence Checking Previously, the only means of checking persistence was by checking if a Model has an dirty attributes. This was unsuitable for determining wether or not a record has been persisted to the database yet. We have added `Model#isNew` and `Model#persisted` to handle this. *Example:* ```javascript import Post from 'app/models/posts'; let post = await Post.first(); /** * Check existing record's persistence... */ post.isDirty // => false post.isNew // => false post.persisted // => true /** * Check an existing record's persistence after an attribute has been changed... */ post.title = 'add ability to check if model has been saved'; // => 'add ability to check if model has been saved' post.isDirty // => true post.isNew // => false post.persisted // => false await post.save(); /** * Check a recently saved record's persistence... */ post.isDirty // => false post.isNew // => false post.persisted // => true post = new Post({ title: 'I have yet to be saved.' }); /** * Check the persistence of a record that has yet to be saved... */ post.isDirty // => false post.isNew // => true post.persisted // => false /** * Check a new record that was created via the #create() method... */ post = await Post.create({ title: 'I have yet to be saved.' }); post.isDirty // => false post.isNew // => false post.persisted // => true ``` ###### Distinct Queries 🎉 You can now do distinct queries on a Model. ```javascript import Post from 'app/models/post'; Post.distinct('title' /*, 'body', ...etc */).where({ isPublic: true }); // SELECT DISTINCT "posts"."title" AS "title" FROM "posts" WHERE "posts"."is_public" = TRUE ``` ##### Commits * [[`361acd467f`](https://github.com/postlight/lux/commit/361acd467f)] - **deps**: update babel-preset-lux to version 1.2.0 (#359) (Greenkeeper) * [[`1adeb907df`](https://github.com/postlight/lux/commit/1adeb907df)] - **feat**: router namespaces (#338) (Zachary Golba) * [[`1f9094e5db`](https://github.com/postlight/lux/commit/1f9094e5db)] - **chore**: add appveyor badge to readme (#358) (Zachary Golba) * [[`af75c59062`](https://github.com/postlight/lux/commit/af75c59062)] - **chore**: remove unnecessary event emitter decl (#357) (Zachary Golba) * [[`ce5568297d`](https://github.com/postlight/lux/commit/ce5568297d)] - **deps**: update flow-bin to version 0.32.0 🚀 (#356) (Greenkeeper) * [[`48d1cf8cd9`](https://github.com/postlight/lux/commit/48d1cf8cd9)] - **chore**: improve ci set up (#350) (Zachary Golba) * [[`58a4c6ed04`](https://github.com/postlight/lux/commit/58a4c6ed04)] - **deps**: update rollup to version 0.34.13 (#355) (Greenkeeper) * [[`603c45a5ec`](https://github.com/postlight/lux/commit/603c45a5ec)] - **deps**: update rollup to version 0.34.11 (#353) (Greenkeeper) * [[`0e05e3d9b9`](https://github.com/postlight/lux/commit/0e05e3d9b9)] - **fix**: lux console fails when running on an npm linked version of the master branch (#349) (Zachary Golba) * [[`5d492f5cea`](https://github.com/postlight/lux/commit/5d492f5cea)] - **feat**: add #distinct() query method (#346) (Zachary Golba) * [[`d9e00625e6`](https://github.com/postlight/lux/commit/d9e00625e6)] - **feat**: add ability to check if model has been saved (#347) (Zachary Golba) * [[`6474d516b5`](https://github.com/postlight/lux/commit/6474d516b5)] - **deps**: update eslint to version 3.4.0 (#345) (Greenkeeper) * [[`482bfe272a`](https://github.com/postlight/lux/commit/482bfe272a)] - **deps**: update eslint-plugin-flowtype to version 2.11.4 (#344) (Greenkeeper) * [[`0e66aa5405`](https://github.com/postlight/lux/commit/0e66aa5405)] - **deps**: update flow-bin to version 0.31.1 🚀 (#341) (Greenkeeper) * [[`6e88a55c08`](https://github.com/postlight/lux/commit/6e88a55c08)] - **deps**: update babel-plugin-transform-es2015-modules-commonjs to version 6.14.0 (#343) (Greenkeeper) * [[`15b648aa77`](https://github.com/postlight/lux/commit/15b648aa77)] - **deps**: update babel-core to version 6.14.0 (#342) (Greenkeeper) * [[`d33e6e67c3`](https://github.com/postlight/lux/commit/d33e6e67c3)] - **deps**: update eslint-plugin-flowtype to version 2.11.1 (#339) (Greenkeeper) * [[`56e329f968`](https://github.com/postlight/lux/commit/56e329f968)] - **docs**: small readme typos/rephrasings (#330) (Kevin Barrett) * [[`bace2de2bd`](https://github.com/postlight/lux/commit/bace2de2bd)] - **fix**: errors occuring during application boot fail silently (#316) (Zachary Golba) * [[`b8c5815045`](https://github.com/postlight/lux/commit/b8c5815045)] - **deps**: update rollup to version 0.34.10 (#328) (Greenkeeper) * [[`20f18a3459`](https://github.com/postlight/lux/commit/20f18a3459)] - **Feat**: Ignoring build/dist folder (#327) (Adam Pash) * [[`98dcfe05ce`](https://github.com/postlight/lux/commit/98dcfe05ce)] - **deps**: update eslint-plugin-flowtype to version 2.7.1 (#326) (Greenkeeper) * [[`d2852