Skip to content

Commit f35975e

Browse files
committed
Upgrade babel and associated plugins to v7
Ignore __tests__ folders in babel transpilation
1 parent 6857707 commit f35975e

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.babelrc.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
"presets": [["env", {
2+
"presets": [["@babel/preset-env", {
33
"modules": process.env.BABEL_MODULES ? false : 'commonjs',
44
"targets": {
55
"node": 6,
@@ -15,12 +15,12 @@ module.exports = {
1515
"plugins": [
1616
"./resources/inline-invariant",
1717
"syntax-async-functions",
18-
"syntax-async-generators",
19-
"transform-class-properties",
20-
"transform-flow-strip-types",
21-
"transform-object-rest-spread",
22-
["transform-es2015-classes", {"loose": true}],
23-
["transform-es2015-destructuring", {"loose": true}],
24-
["transform-es2015-spread", {"loose": true}]
18+
"@babel/plugin-syntax-async-generators",
19+
"@babel/plugin-proposal-class-properties",
20+
"@babel/plugin-transform-flow-strip-types",
21+
"@babel/plugin-proposal-object-rest-spread",
22+
["@babel/plugin-transform-classes", {"loose": true}],
23+
["@babel/plugin-transform-destructuring", {"loose": true}],
24+
["@babel/plugin-transform-spread", {"loose": true}]
2525
]
2626
};

package.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"watch": "babel-node ./resources/watch.js",
2525
"test": "npm run lint && npm run check && npm run testonly",
2626
"test:ci": "npm run lint && npm run check && npm run testonly:coveralls",
27-
"t": "mocha --require babel-register --require babel-polyfill",
28-
"testonly": "mocha --require babel-register --require babel-polyfill --check-leaks --full-trace --timeout 15000 src/**/__tests__/**/*-test.js",
27+
"t": "mocha --require @babel/register --require @babel/polyfill",
28+
"testonly": "mocha --require @babel/register --require @babel/polyfill --check-leaks --full-trace --timeout 15000 src/**/__tests__/**/*-test.js",
2929
"testonly:cover": "nyc --reporter html --reporter text-summary -- npm run testonly",
3030
"testonly:coveralls": "nyc --silent -- npm run testonly && nyc report --reporter text-lcov | coveralls",
3131
"lint": "eslint --rulesdir ./resources/lint src || (printf '\\033[33mTry: \\033[7m npm run lint -- --fix \\033[0m\\n' && exit 1)",
@@ -37,8 +37,8 @@
3737
"build:clean": "rm -rf ./dist && mkdir ./dist",
3838
"build:cp": "cp README.md LICENSE ./dist",
3939
"build:package-json": "node ./resources/copy-package-json.js",
40-
"build:cjs": "babel src --optional runtime --ignore __tests__ --out-dir dist/",
41-
"build:mjs": "BABEL_MODULES=1 babel src --optional runtime --ignore __tests__ --out-dir dist/module/ && for file in $(find dist/module -name '*.js'); do mv \"$file\" `echo \"$file\" | sed 's/dist\\/module/dist/g; s/.js$/.mjs/g'`; done && rm -rf dist/module",
40+
"build:cjs": "babel src --optional runtime --ignore '**/__tests__' --out-dir dist/",
41+
"build:mjs": "BABEL_MODULES=1 babel src --optional runtime --ignore '**/__tests__' --out-dir dist/module/ && for file in $(find dist/module -name '*.js'); do mv \"$file\" `echo \"$file\" | sed 's/dist\\/module/dist/g; s/.js$/.mjs/g'`; done && rm -rf dist/module",
4242
"build:flow": "for file in $(find ./src -name '*.js' -not -path '*/__tests__*'); do cp \"$file\" `echo \"$file\" | sed 's/\\/src\\//\\/dist\\//g'`.flow; done",
4343
"preversion": ". ./resources/checkgit.sh && npm test",
4444
"prepublishOnly": ". ./resources/prepublish.sh",
@@ -48,16 +48,22 @@
4848
"iterall": "^1.2.2"
4949
},
5050
"devDependencies": {
51-
"babel-cli": "6.26.0",
51+
"@babel/cli": "^7.0.0-beta.46",
52+
"@babel/core": "^7.0.0-beta.46",
53+
"@babel/node": "^7.0.0-beta.46",
54+
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.46",
55+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.46",
56+
"@babel/plugin-syntax-async-generators": "^7.0.0-beta.46",
57+
"@babel/plugin-transform-classes": "^7.0.0-beta.46",
58+
"@babel/plugin-transform-destructuring": "^7.0.0-beta.46",
59+
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.46",
60+
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.46",
61+
"@babel/plugin-transform-spread": "^7.0.0-beta.46",
62+
"@babel/polyfill": "^7.0.0-beta.46",
63+
"@babel/preset-env": "^7.0.0-beta.46",
64+
"@babel/register": "^7.0.0-beta.46",
5265
"babel-eslint": "8.2.3",
5366
"babel-plugin-syntax-async-functions": "6.13.0",
54-
"babel-plugin-syntax-async-generators": "6.13.0",
55-
"babel-plugin-transform-class-properties": "6.24.1",
56-
"babel-plugin-transform-flow-strip-types": "6.22.0",
57-
"babel-plugin-transform-object-rest-spread": "6.26.0",
58-
"babel-polyfill": "^6.26.0",
59-
"babel-preset-env": "^1.7.0",
60-
"babel-register": "^6.26.0",
6167
"beautify-benchmark": "0.2.4",
6268
"benchmark": "2.1.4",
6369
"chai": "4.1.2",

0 commit comments

Comments
 (0)