Skip to content

Commit

Permalink
Babel 7 patches (#143)
Browse files Browse the repository at this point in the history
* Fix babel 7

* Simplify babel export
  • Loading branch information
jaredpalmer authored Oct 31, 2018
1 parent 6fed694 commit 8098180
Show file tree
Hide file tree
Showing 12 changed files with 3,401 additions and 2,787 deletions.
9 changes: 6 additions & 3 deletions examples/with-custom-babel-config/.babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"presets": [
"backpack-core/babel",
"stage-0"
"backpack-core/babel"

],
"plugins": [
"@babel/plugin-proposal-do-expressions"
]
}
}
5 changes: 3 additions & 2 deletions examples/with-custom-babel-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
},
"license": "MIT",
"dependencies": {
"babel-preset-stage-0": "^6.16.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"backpack-core": "^0.8.0",
"express": "^4.14.0"
}
}
}
4 changes: 2 additions & 2 deletions examples/with-flowtype/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"backpack-core/babel"
],
"plugins": [
"transform-flow-strip-types"
"@babel/plugin-transform-flow-strip-types"
]
}
}
6 changes: 3 additions & 3 deletions examples/with-flowtype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
},
"license": "MIT",
"dependencies": {
"@babel/core": "^7.0.0-beta.37",
"@babel/plugin-transform-flow-strip-types": "7.0.0-beta.39",
"@babel/core": "^7.1.2",
"@babel/plugin-transform-flow-strip-types": "7.0.0",
"backpack-core": "^0.8.0",
"express": "^4.14.0",
"flow-bin": "^0.37.4"
}
}
}
9 changes: 4 additions & 5 deletions examples/with-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
},
"license": "MIT",
"dependencies": {
"@babel/core": "7.0.0-beta.39",
"babel-core": "7.0.0-bridge.0",
"@babel/core": "^7.1.2",
"backpack-core": "^0.8.0",
"express": "^4.14.0"
},
"devDependencies": {
"babel-jest": "^18.0.0",
"jest-cli": "^18.1.0",
"babel-jest": "^23.6.0",
"jest-cli": "^23.6.0",
"supertest": "^2.0.1"
},
"jest": {
Expand All @@ -29,4 +28,4 @@
"__DEV__": true
}
}
}
}
2 changes: 1 addition & 1 deletion examples/with-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"express": "^4.14.0",
"typescript": "^2.1.5"
}
}
}
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
"reinstall": "yarn purge && yarn",
"build": "lerna run build --stream --parallel"
},
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-stage-0": "^7.0.0-beta.37",
"express": "^4.16.2"
},
"workspaces": [
"packages/*",
"examples/*"
]
}
}
9 changes: 5 additions & 4 deletions packages/babel-preset-backpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ module.exports = function() {
require.resolve('@babel/plugin-transform-runtime'),
{
helpers: false,
polyfill: false,
regenerator: true,
// Resolve the Babel runtime relative to the config.
moduleName: path.dirname(require.resolve('@babel/runtime/package')),
absoluteRuntime: path.dirname(
require.resolve('@babel/runtime/package')
),
},
],
],
Expand All @@ -57,8 +58,8 @@ module.exports = function() {
const v = process.versions.node.split('.');
if ((v[0] >= 7 && v[1] >= 6) || v[0] >= 8) {
preset.presets[0].exclude = [
'babel-plugin-transform-regenerator',
'transform-async-to-generator',
'@babel/plugin-transform-regenerator',
'@babel/transform-async-to-generator',
];
}
if (process.env.NODE_ENV === 'test' || process.env.BABEL_ENV === 'test') {
Expand Down
22 changes: 11 additions & 11 deletions packages/babel-preset-backpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
"index.js"
],
"dependencies": {
"@babel/core": "^7.0.0-beta.37",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.37",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.37",
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.37",
"@babel/plugin-transform-parameters": "^7.0.0-beta.37",
"@babel/plugin-transform-regenerator": "^7.0.0-beta.37",
"@babel/plugin-transform-runtime": "^7.0.0-beta.37",
"@babel/preset-env": "^7.0.0-beta.37",
"@babel/runtime": "^7.0.0-beta.37",
"babel-loader": "v8.0.0-beta.0"
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
"@babel/plugin-transform-parameters": "^7.0.0",
"@babel/plugin-transform-regenerator": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"babel-loader": "v8.0.4"
},
"keywords": [
"babel",
"es6",
"node",
"backpack"
]
}
}
2 changes: 1 addition & 1 deletion packages/backpack-core/babel.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('babel-preset-backpack')
module.exports = require('babel-preset-backpack');
10 changes: 5 additions & 5 deletions packages/backpack-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
"backpack": "./bin/backpack"
},
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/core": "^7.1.2",
"babel-loader": "^8.0.2",
"babel-preset-backpack": "^0.5.0",
"babel-preset-backpack": "^0.8.0",
"cross-spawn": "^5.0.1",
"friendly-errors-webpack-plugin": "^1.6.1",
"friendly-errors-webpack-plugin": "^1.7.0",
"json-loader": "^0.5.7",
"nodemon": "^1.11.0",
"ramda": "^0.23.0",
"source-map-support": "^0.4.15",
"webpack": "^4.17.1",
"webpack": "^4.23.1",
"webpack-node-externals": "^1.7.2"
}
}
}
Loading

0 comments on commit 8098180

Please sign in to comment.