Skip to content

Commit

Permalink
Warn about using @babel/runtime@7.0.0-beta.56+ with Meteor 1.7.0.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Aug 6, 2018
1 parent 3fe7fb9 commit 4d5fff9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions packages/babel-runtime/babel-runtime.js
Expand Up @@ -4,6 +4,7 @@ try {
var babelRuntimeVersion = require("@babel/runtime/package.json").version;
} catch (e) {
throw new Error([
"",
"The @babel/runtime npm package could not be found in your node_modules ",
"directory. Please run the following command to install it:",
"",
Expand All @@ -14,6 +15,7 @@ try {

if (parseInt(babelRuntimeVersion, 10) < 6) {
throw new Error([
"",
"The version of @babel/runtime installed in your node_modules directory ",
"(" + babelRuntimeVersion + ") is out of date. Please upgrade it by running ",
"",
Expand All @@ -22,4 +24,21 @@ if (parseInt(babelRuntimeVersion, 10) < 6) {
"in your application directory.",
""
].join("\n"));

} else if (babelRuntimeVersion.startsWith("7.0.0-beta.")) {
var betaVersion = parseInt(babelRuntimeVersion.split(".").pop(), 10);
if (betaVersion > 55) {
console.warn([
"The version of @babel/runtime installed in your node_modules directory ",
"(" + babelRuntimeVersion + ") contains a breaking change which was introduced by ",
"https://github.com/babel/babel/pull/8266. Please either downgrade by ",
"running the following command:",
"",
" meteor npm install --save-exact @babel/runtime@7.0.0-beta.55",
"",
"or update to the latest beta version of Meteor 1.7.1, as explained in ",
"this pull request: https://github.com/meteor/meteor/pull/9942.",
""
].join("\n"));
}
}
2 changes: 1 addition & 1 deletion packages/babel-runtime/package.js
@@ -1,7 +1,7 @@
Package.describe({
name: "babel-runtime",
summary: "Runtime support for output of Babel transpiler",
version: '1.2.2',
version: '1.2.3',
documentation: 'README.md'
});

Expand Down

0 comments on commit 4d5fff9

Please sign in to comment.