diff --git a/.babelrc b/.babelrc index a0259e4ad..3cd9f6c13 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,4 @@ { - "plugins": [ "transform-runtime", "add-module-exports" ], + "plugins": [ "add-module-exports", "version-inline" ], "presets": [ "es2015" ] } diff --git a/package.json b/package.json index 78b4a1e04..dbfb4e748 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "babel-cli": "^6.18.0", "babel-core": "^6.21.0", "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "^6.18.0", "eslint-if-supported": "^1.0.1", "istanbul": "^1.1.0-alpha.1", diff --git a/src/index.js b/src/index.js index 5d61a75b0..06f54237f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +/* global __VERSION__ */ import Proto from 'uberproto'; import Application from './application'; @@ -13,5 +14,4 @@ export default function createApplication () { return app; } -// TODO use https://github.com/gnandretta/babel-plugin-version-inline -createApplication.version = '__VERSION__'; +createApplication.version = __VERSION__; diff --git a/test/application.test.js b/test/application.test.js index efba09475..a5dc92294 100644 --- a/test/application.test.js +++ b/test/application.test.js @@ -12,6 +12,12 @@ describe('Feathers application', () => { assert.equal(typeof app.services, 'object'); }); + it('sets the version', () => { + const pkg = require('../package.json'); + + assert.equal(feathers.version, pkg.version); + }); + it('is an event emitter', done => { const app = feathers(); const original = { hello: 'world' }; diff --git a/yarn.lock b/yarn.lock index 57ecb6376..0d9ee717c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,6 +503,10 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" +babel-plugin-version-inline@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-version-inline/-/babel-plugin-version-inline-1.0.0.tgz#b99b6f925db4a4c6789eb08836e66d128dd5993f" + babel-polyfill@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" @@ -1183,9 +1187,9 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -feathers-commons@^0.8.7: - version "0.8.7" - resolved "https://registry.yarnpkg.com/feathers-commons/-/feathers-commons-0.8.7.tgz#11c6f25b537745a983e8d61552d7db8932d53782" +feathers-commons@^1.0.0-pre.1: + version "1.0.0-pre.1" + resolved "https://registry.yarnpkg.com/feathers-commons/-/feathers-commons-1.0.0-pre.1.tgz#ee5c2a0e4f8b36f6f701b216c641cd90894d9f25" figures@^1.3.5: version "1.7.0"