babel-upgrade
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -94,4 +94,2 @@ "use strict"; | ||
'babel-plugin-syntax-export-extensions': ['@babel/plugin-syntax-export-default-from', '@babel/plugin-syntax-export-namespace-from'], | ||
'babel-plugin-syntax-export-default-from': '@babel/plugin-syntax-export-default-from', | ||
'babel-plugin-syntax-export-namespace-from': '@babel/plugin-syntax-export-namespace-from', | ||
'babel-plugin-syntax-flow': '@babel/plugin-syntax-flow', | ||
@@ -130,7 +128,6 @@ 'babel-plugin-syntax-function-bind': '@babel/plugin-syntax-function-bind', | ||
'babel-plugin-transform-decorators': '@babel/plugin-proposal-decorators', | ||
'babel-plugin-transform-decorators-legacy': '@babel/plugin-proposal-decorators', | ||
'babel-plugin-transform-do-expressions': '@babel/plugin-proposal-do-expressions', | ||
'babel-plugin-transform-export-default': ['@babel/plugin-proposal-export-default-from', '@babel/plugin-proposal-export-namespace-from'], | ||
'babel-plugin-transform-export-extensions': ['@babel/plugin-proposal-export-default-from', '@babel/plugin-proposal-export-namespace-from'], | ||
'babel-plugin-transform-export-default-from': '@babel/plugin-proposal-export-default-from', | ||
'babel-plugin-transform-export-namespace-from': '@babel/plugin-proposal-export-namespace-from', | ||
'babel-plugin-transform-function-bind': '@babel/plugin-proposal-function-bind', | ||
@@ -137,0 +134,0 @@ 'babel-plugin-transform-function-sent': '@babel/plugin-proposal-function-sent', |
@@ -12,3 +12,4 @@ "use strict"; | ||
'babel-loader': '^8.0.0', | ||
'rollup-plugin-babel': '^4.0.1' | ||
'rollup-plugin-babel': '^4.0.1', | ||
'babel-eslint': '^9.0.0' | ||
}; | ||
@@ -49,3 +50,3 @@ | ||
dependencies[pkg] = version; // TODO: refactor out somewhere else | ||
} else if (otherPackages[pkg]) { | ||
} else if (otherPackages[pkg] && semver.lt(semver.valid(semver.coerce(dependencies[pkg])), semver.valid(semver.coerce(otherPackages[pkg])))) { | ||
dependencies[pkg] = otherPackages[pkg]; | ||
@@ -82,2 +83,6 @@ } | ||
if (dependencies['jest'] || dependencies['jest-cli']) { | ||
dependencies['babel-jest'] = '^23.4.2'; | ||
} | ||
for (var stage = 0; stage <= 3; stage++) { | ||
@@ -84,0 +89,0 @@ if (dependencies[`@babel/preset-stage-${stage}`]) { |
{ | ||
"name": "babel-upgrade", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "Upgrade tool for Babel", | ||
@@ -5,0 +5,0 @@ "bin": "./bin/babel-upgrade", |
# babel-upgrade | ||
> A tool that tries to automatically update most dependencies, config files, and JavaScript files that require Babel packages directly to [Babel v7](http://new.babeljs.io/docs/en/next/v7-migration.html) (and more in the future). | ||
> A tool that tries to automatically update most dependencies, config files, and JavaScript files that require Babel packages directly to [Babel 7](http://babeljs.io/docs/en/v7-migration.html) (and more in the future). | ||
@@ -44,5 +44,5 @@ ## Usage | ||
"devDependencies": { | ||
+ "@babel/core": "7.0.0-beta.39", | ||
+ "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.39", | ||
+ "@babel/preset-env": "7.0.0-beta.39", | ||
+ "@babel/core": "^7.0.0", | ||
+ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
+ "@babel/preset-env": "^7.0.0", | ||
+ "babel-loader": "v8.0.0-beta.0" | ||
@@ -72,3 +72,3 @@ - "babel-loader": "6.0.0", | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.39", | ||
"@babel/core": "^7.0.0", | ||
+ "babel-core": "7.0.0-bridge.0", | ||
@@ -86,4 +86,4 @@ "jest": "^22.0.0" | ||
"devDependencies": { | ||
"@babel/cli": "7.0.0-beta.39", | ||
+ "@babel/node": "7.0.0-beta.39" | ||
"@babel/cli": "^7.0.0", | ||
+ "@babel/node": "^7.0.0" | ||
}, | ||
@@ -165,3 +165,3 @@ "scripts": { | ||
- "presets": "env, react", | ||
+ "presets": ["env", "react"], | ||
+ "presets": ["@babel/preset-env", "@babel/preset-react"], | ||
``` | ||
@@ -173,4 +173,4 @@ | ||
{ | ||
"@babel/preset-react": "7.0.0-beta.39", | ||
+ "@babel/preset-flow": "7.0.0-beta.39" | ||
"@babel/preset-react": "^7.0.0", | ||
+ "@babel/preset-flow": "^7.0.0" | ||
} | ||
@@ -195,7 +195,7 @@ ``` | ||
{ | ||
- "@babel/preset-stage-3": "7.0.0-beta.54" | ||
+ "@babel/plugin-proposal-class-properties": "7.0.0-beta.54", | ||
+ "@babel/plugin-proposal-json-strings": "7.0.0-beta.54", | ||
+ "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.54", | ||
+ "@babel/plugin-syntax-import-meta": "7.0.0-beta.54" | ||
- "@babel/preset-stage-3": "^7.0.0" | ||
+ "@babel/plugin-proposal-class-properties": "^7.0.0", | ||
+ "@babel/plugin-proposal-json-strings": "^7.0.0", | ||
+ "@babel/plugin-syntax-dynamic-import": "^7.0.0", | ||
+ "@babel/plugin-syntax-import-meta": "^7.0.0" | ||
} | ||
@@ -202,0 +202,0 @@ ``` |
@@ -90,4 +90,2 @@ const transformPlugins = { | ||
'babel-plugin-syntax-export-extensions': ['@babel/plugin-syntax-export-default-from', '@babel/plugin-syntax-export-namespace-from'], | ||
'babel-plugin-syntax-export-default-from': '@babel/plugin-syntax-export-default-from', | ||
'babel-plugin-syntax-export-namespace-from': '@babel/plugin-syntax-export-namespace-from', | ||
'babel-plugin-syntax-flow': '@babel/plugin-syntax-flow', | ||
@@ -131,7 +129,6 @@ 'babel-plugin-syntax-function-bind': '@babel/plugin-syntax-function-bind', | ||
'babel-plugin-transform-decorators': '@babel/plugin-proposal-decorators', | ||
'babel-plugin-transform-decorators-legacy': '@babel/plugin-proposal-decorators', | ||
'babel-plugin-transform-do-expressions': '@babel/plugin-proposal-do-expressions', | ||
'babel-plugin-transform-export-default': ['@babel/plugin-proposal-export-default-from', '@babel/plugin-proposal-export-namespace-from'], | ||
'babel-plugin-transform-export-extensions': ['@babel/plugin-proposal-export-default-from', '@babel/plugin-proposal-export-namespace-from'], | ||
'babel-plugin-transform-export-default-from': '@babel/plugin-proposal-export-default-from', | ||
'babel-plugin-transform-export-namespace-from': '@babel/plugin-proposal-export-namespace-from', | ||
'babel-plugin-transform-function-bind': '@babel/plugin-proposal-function-bind', | ||
@@ -138,0 +135,0 @@ 'babel-plugin-transform-function-sent': '@babel/plugin-proposal-function-sent', |
@@ -7,2 +7,3 @@ const semver = require('semver'); | ||
'rollup-plugin-babel': '^4.0.1', | ||
'babel-eslint': '^9.0.0', | ||
}; | ||
@@ -39,3 +40,9 @@ | ||
// TODO: refactor out somewhere else | ||
} else if (otherPackages[pkg]) { | ||
} else if ( | ||
otherPackages[pkg] && | ||
semver.lt( | ||
semver.valid(semver.coerce(dependencies[pkg])), | ||
semver.valid(semver.coerce(otherPackages[pkg])) | ||
) | ||
) { | ||
dependencies[pkg] = otherPackages[pkg]; | ||
@@ -80,2 +87,6 @@ } | ||
if (dependencies['jest'] || dependencies['jest-cli']) { | ||
dependencies['babel-jest'] = '^23.4.2'; | ||
} | ||
for (let stage = 0; stage <= 3; stage++) { | ||
@@ -82,0 +93,0 @@ if (dependencies[`@babel/preset-stage-${stage}`]) { |
1515
79134