Skip to content

Commit 36c19cd

Browse files
committed
Use inline version Babel plugin (#606)
1 parent bc68d3b commit 36c19cd

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"plugins": [ "transform-runtime", "add-module-exports" ],
2+
"plugins": [ "add-module-exports", "version-inline" ],
33
"presets": [ "es2015" ]
44
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"babel-cli": "^6.18.0",
6262
"babel-core": "^6.21.0",
6363
"babel-plugin-add-module-exports": "^0.2.1",
64-
"babel-plugin-transform-runtime": "^6.23.0",
6564
"babel-preset-es2015": "^6.18.0",
6665
"eslint-if-supported": "^1.0.1",
6766
"istanbul": "^1.1.0-alpha.1",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global __VERSION__ */
12
import Proto from 'uberproto';
23

34
import Application from './application';
@@ -13,5 +14,4 @@ export default function createApplication () {
1314
return app;
1415
}
1516

16-
// TODO use https://github.com/gnandretta/babel-plugin-version-inline
17-
createApplication.version = '__VERSION__';
17+
createApplication.version = __VERSION__;

test/application.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ describe('Feathers application', () => {
1212
assert.equal(typeof app.services, 'object');
1313
});
1414

15+
it('sets the version', () => {
16+
const pkg = require('../package.json');
17+
18+
assert.equal(feathers.version, pkg.version);
19+
});
20+
1521
it('is an event emitter', done => {
1622
const app = feathers();
1723
const original = { hello: 'world' };

yarn.lock

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,10 @@ babel-plugin-transform-strict-mode@^6.24.1:
503503
babel-runtime "^6.22.0"
504504
babel-types "^6.24.1"
505505

506+
babel-plugin-version-inline@^1.0.0:
507+
version "1.0.0"
508+
resolved "https://registry.yarnpkg.com/babel-plugin-version-inline/-/babel-plugin-version-inline-1.0.0.tgz#b99b6f925db4a4c6789eb08836e66d128dd5993f"
509+
506510
babel-polyfill@^6.23.0:
507511
version "6.23.0"
508512
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d"
@@ -1183,9 +1187,9 @@ fast-levenshtein@~2.0.4:
11831187
version "2.0.6"
11841188
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
11851189

1186-
feathers-commons@^0.8.7:
1187-
version "0.8.7"
1188-
resolved "https://registry.yarnpkg.com/feathers-commons/-/feathers-commons-0.8.7.tgz#11c6f25b537745a983e8d61552d7db8932d53782"
1190+
feathers-commons@^1.0.0-pre.1:
1191+
version "1.0.0-pre.1"
1192+
resolved "https://registry.yarnpkg.com/feathers-commons/-/feathers-commons-1.0.0-pre.1.tgz#ee5c2a0e4f8b36f6f701b216c641cd90894d9f25"
11891193

11901194
figures@^1.3.5:
11911195
version "1.7.0"

0 commit comments

Comments
 (0)