Skip to content

Commit b518a47

Browse files
committed
Introduce schema version in package.json
THis is to maintain compatibility between ember-cli-fastboot and fastboot.
1 parent 12cfc6f commit b518a47

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
language: node_js
33
node_js:
4-
- "5"
54
- "4"
5+
- "stable"
66

77
env:
88
- CXX=g++-4.8 WORKER_COUNT=2

lib/broccoli/fastboot-config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ var md5Hex = require('md5-hex');
55
var path = require('path');
66
var Plugin = require('broccoli-plugin');
77

8+
var LATEST_SCHEMA_VERSION = 1;
9+
810
function FastBootConfig(inputNode, options) {
911
Plugin.call(this, [inputNode], {
1012
annotation: "Generate: FastBoot package.json"
@@ -157,6 +159,7 @@ FastBootConfig.prototype.toJSONString = function() {
157159
dependencies: this.dependencies,
158160
fastboot: {
159161
moduleWhitelist: this.moduleWhitelist,
162+
schemaVersion: LATEST_SCHEMA_VERSION,
160163
manifest: this.manifest,
161164
hostWhitelist: this.normalizeHostWhitelist(),
162165
appConfig: this.appConfig

test/package-json-test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ describe('generating package.json', function() {
4242
});
4343
});
4444

45+
it("contains a schema version", function() {
46+
var pkg = fs.readJsonSync(app.filePath('/dist/package.json'));
47+
48+
expect(pkg.fastboot.schemaVersion).to.deep.equal(1);
49+
});
50+
4551
it("contains a whitelist of allowed module names", function() {
4652
var pkg = fs.readJsonSync(app.filePath('/dist/package.json'));
4753

0 commit comments

Comments
 (0)