Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Right now, this addon assumes that your application is using [DS.JSONAPISerializ

`ember install ember-data-fastboot`

Starting with version 0.1.0 this addon requires at least ember-cli-fastboot 1.0.0-rc.1.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ export function initialize(applicationInstance) {

export default {
name: 'ember-data-fastboot',
initialize
initialize() {
if (typeof FastBoot === 'undefined') {
initialize(...arguments);
}
}
};
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
/* jshint node: true */
'use strict';

const VersionChecker = require('ember-cli-version-checker');

module.exports = {
name: 'ember-data-fastboot'
name: 'ember-data-fastboot',

init: function() {
this._super && this._super.init.apply(this, arguments);

let checker = new VersionChecker(this);
let fastBootVersion = checker.for('ember-cli-fastboot');
if (!(fastBootVersion.gte('1.0.0') || fastBootVersion.gte('1.0.0-rc.1'))) {
let error = new Error(`This version of ember-data-fastboot requires at ember-cli-fastboot above 1.0.0-rc.1, but you have ${fastBootVersion.version}. Revert to the latest 0.0.x version for support for beta versions of ember-cli-fastboot.`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just use silent-error instead of explicitly suppressing the stack trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Used that before. Copy pasted this from ember-cli-version-checker's assert method...

error.suppressStacktrace = true;
throw error;
}
}
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"repository": "https://github.com/cardstack/ember-data-fastboot",
"engines": {
"node": ">= 0.10.0"
"node": ">= 4"
},
"author": "Edward Faulkner <ef@alum.mit.edu>",
"license": "MIT",
Expand Down Expand Up @@ -45,7 +45,8 @@
"ember-data"
],
"dependencies": {
"ember-cli-babel": "^5.1.6"
"ember-cli-babel": "^5.1.6",
"ember-cli-version-checker": "^2.0.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down