This repository was archived by the owner on Jun 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Babel 7 upgrade #145
Merged
Merged
Babel 7 upgrade #145
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7106663
use upath for cross platform path testing
bj00rn 9755796
upgrade to babel 7
bj00rn e8a8949
babel 7 supports 6 and above
bj00rn 0b6e0ac
upgrade to release
bj00rn c92904c
upgrade babel-plugin-espower
bj00rn ccece78
semver ^7.0.0
bj00rn db0e9c9
deduplicate dependecies
bj00rn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"presets": [ | ||
"es2015" | ||
"@babel/preset-env" | ||
], | ||
"plugins": [ | ||
"transform-object-rest-spread", | ||
"transform-runtime" | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-transform-runtime" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,29 +10,33 @@ | |
"main": "lib/index.js", | ||
"author": "Eric Ferraiuolo <[email protected]>", | ||
"dependencies": { | ||
"babel-runtime": "^6.2.0", | ||
"@babel/runtime": "^7.0.0", | ||
"intl-messageformat-parser": "^1.2.0", | ||
"mkdirp": "^0.5.1" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.1.18", | ||
"babel-plugin-espower": "^2.3.1", | ||
"babel-plugin-transform-object-rest-spread": "^6.1.18", | ||
"babel-plugin-transform-runtime": "^6.1.18", | ||
"babel-preset-es2015": "^6.1.18", | ||
"babel-preset-react": "^6.11.1", | ||
"babel-register": "^6.11.6", | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/node": "^7.0.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"babel-plugin-espower": "^3.0.0", | ||
"cross-env": "^3.1.4", | ||
"eslint": "^3.14.1", | ||
"eslint-plugin-react": "^6.1.2", | ||
"mocha": "^3.0.2", | ||
"power-assert": "^1.4.1", | ||
"rimraf": "^2.4.3" | ||
"rimraf": "^2.4.3", | ||
"upath": "^1.1.0", | ||
"uuid": "^3.3.2" | ||
}, | ||
"scripts": { | ||
"lint": "eslint src/", | ||
"clean": "rimraf lib/", | ||
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-register", | ||
"test": "cross-env NODE_ENV=test mocha --compilers js:@babel/register", | ||
"build": "babel src/ --out-dir lib/", | ||
"build:fixtures": "babel-node ./scripts/build-fixtures.js", | ||
"preversion": "npm run lint && npm run clean && npm run build", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* See the accompanying LICENSE file for terms. | ||
*/ | ||
|
||
import * as p from 'path'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue seems to be here where upath is clearly used in library code, but not added to normal dependencies but only devDependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @serwer-WittGruppe want to test it out and open a PR with the fix? |
||
import * as p from 'upath'; | ||
import {writeFileSync} from 'fs'; | ||
import {sync as mkdirpSync} from 'mkdirp'; | ||
import printICUMessage from './print-icu-message'; | ||
|
@@ -152,7 +152,7 @@ export default function ({types: t}) { | |
let loc; | ||
if (opts.extractSourceLocation) { | ||
loc = { | ||
file: p.relative(process.cwd(), file.opts.filename), | ||
file: p.toUnix(p.relative(process.cwd(), file.opts.filename)), | ||
...path.node.loc, | ||
}; | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"presets": [ | ||
"es2015", | ||
"react" | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
], | ||
"env": { | ||
"test": { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,56 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
|
||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _react = _interopRequireWildcard(require("react")); | ||
|
||
var _react = require('react'); | ||
var _reactIntl = require("react-intl"); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
|
||
var _reactIntl = require('react-intl'); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
|
||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
|
||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
|
||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
|
||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
|
||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
|
||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
|
||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Foo = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(Foo, _Component); | ||
|
||
var Foo = function (_Component) { | ||
_inherits(Foo, _Component); | ||
function Foo() { | ||
_classCallCheck(this, Foo); | ||
|
||
function Foo() { | ||
_classCallCheck(this, Foo); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Foo).apply(this, arguments)); | ||
} | ||
|
||
return _possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).apply(this, arguments)); | ||
_createClass(Foo, [{ | ||
key: "render", | ||
value: function render() { | ||
return _react.default.createElement(_reactIntl.FormattedHTMLMessage, { | ||
id: "foo.bar.baz", | ||
defaultMessage: "<h1>Hello World!</h1>" | ||
}); | ||
} | ||
}]); | ||
|
||
_createClass(Foo, [{ | ||
key: 'render', | ||
value: function render() { | ||
return _react2.default.createElement(_reactIntl.FormattedHTMLMessage, { | ||
id: 'foo.bar.baz', | ||
defaultMessage: '<h1>Hello World!</h1>' | ||
}); | ||
} | ||
}]); | ||
|
||
return Foo; | ||
return Foo; | ||
}(_react.Component); | ||
|
||
exports.default = Foo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,56 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
|
||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _react = _interopRequireWildcard(require("react")); | ||
|
||
var _react = require('react'); | ||
var _reactIntl = require("react-intl"); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
|
||
var _reactIntl = require('react-intl'); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
|
||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
|
||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
|
||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
|
||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
|
||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
|
||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
|
||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Foo = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(Foo, _Component); | ||
|
||
var Foo = function (_Component) { | ||
_inherits(Foo, _Component); | ||
function Foo() { | ||
_classCallCheck(this, Foo); | ||
|
||
function Foo() { | ||
_classCallCheck(this, Foo); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Foo).apply(this, arguments)); | ||
} | ||
|
||
return _possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).apply(this, arguments)); | ||
_createClass(Foo, [{ | ||
key: "render", | ||
value: function render() { | ||
return _react.default.createElement(_reactIntl.FormattedMessage, { | ||
id: "foo.bar.baz", | ||
defaultMessage: "Hello World!" | ||
}); | ||
} | ||
}]); | ||
|
||
_createClass(Foo, [{ | ||
key: 'render', | ||
value: function render() { | ||
return _react2.default.createElement(_reactIntl.FormattedMessage, { | ||
id: 'foo.bar.baz', | ||
defaultMessage: 'Hello World!' | ||
}); | ||
} | ||
}]); | ||
|
||
return Foo; | ||
return Foo; | ||
}(_react.Component); | ||
|
||
exports.default = Foo; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have testing on v8 and v10 right now.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems a little out-of-scope for this, dont you think? maybe a separate PR for this?