Update babel-typescript config (#53108)

* Update babel-typescript config

* Add @babel/preset-react
This commit is contained in:
patrykkopycinski 2019-12-16 19:28:54 +01:00 committed by GitHub
parent 5ec3b03a67
commit 4d50442acc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 28 deletions

View file

@ -37,20 +37,9 @@ const plugins = [
];
module.exports = {
presets: [require.resolve('@babel/preset-typescript'), require.resolve('@babel/preset-react')],
plugins,
overrides: [
{
// Babel 7 don't support the namespace feature on typescript code.
// With namespaces only used for type declarations, we can securely
// strip them off for babel on x-pack infra/siem plugins
//
// See https://github.com/babel/babel/issues/8244#issuecomment-466548733
test: [
/x-pack[\/\\]legacy[\/\\]plugins[\/\\]infra[\/\\].*[\/\\]graphql/,
/x-pack[\/\\]legacy[\/\\]plugins[\/\\]siem[\/\\].*[\/\\]graphql/,
],
plugins: [[require.resolve('babel-plugin-typescript-strip-namespaces')]],
},
presets: [
[require.resolve('@babel/preset-typescript'), { allowNamespaces: true }],
require.resolve('@babel/preset-react'),
],
plugins,
};

View file

@ -10,12 +10,11 @@
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-modules-commonjs": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@babel/preset-react": "^7.7.4",
"@babel/preset-typescript": "^7.7.4",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-filter-imports": "^4.0.0",
"babel-plugin-styled-components": "^1.10.6",
"babel-plugin-transform-define": "^2.0.0",
"babel-plugin-typescript-strip-namespaces": "^1.1.1"
"babel-plugin-transform-define": "^2.0.0"
}
}

View file

@ -14,7 +14,7 @@
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/preset-env": "^7.7.6",
"@babel/preset-typescript": "^7.3.3",
"@babel/preset-typescript": "^7.7.4",
"@types/cmd-shim": "^2.0.0",
"@types/cpy": "^5.1.0",
"@types/dedent": "^0.7.0",

View file

@ -62,6 +62,10 @@
packageNames: [
'core-js',
'@types/core-js',
'@babel/preset-react',
'@types/babel__preset-react',
'@babel/preset-typescript',
'@types/babel__preset-typescript',
],
},
{

View file

@ -78,7 +78,7 @@ export const RENOVATE_PACKAGE_GROUPS: PackageGroup[] = [
{
name: 'babel',
packageWords: ['babel'],
packageNames: ['core-js'],
packageNames: ['core-js', '@babel/preset-react', '@babel/preset-typescript'],
},
{

View file

@ -799,6 +799,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-typescript@^7.7.4":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz#5d037ffa10f3b25a16f32570ebbe7a8c2efa304b"
integrity sha512-77blgY18Hud4NM1ggTA8xVT/dBENQf17OpiToSa2jSmEY3fWXD2jwrdVlO4kq5yzUTeF15WSQ6b4fByNvJcjpQ==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-arrow-functions@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550"
@ -1421,6 +1428,15 @@
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-typescript" "^7.2.0"
"@babel/plugin-transform-typescript@^7.7.4":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz#2974fd05f4e85c695acaf497f432342de9fc0636"
integrity sha512-X8e3tcPEKnwwPVG+vP/vSqEShkwODOEeyQGod82qrIuidwIrfnsGn11qPM1jBLF4MqguTXXYzm58d0dY+/wdpg==
dependencies:
"@babel/helper-create-class-features-plugin" "^7.7.4"
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-typescript" "^7.7.4"
"@babel/plugin-transform-unicode-regex@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f"
@ -1626,7 +1642,7 @@
"@babel/plugin-transform-react-jsx-self" "^7.0.0"
"@babel/plugin-transform-react-jsx-source" "^7.0.0"
"@babel/preset-react@^7.7.0":
"@babel/preset-react@^7.7.0", "@babel/preset-react@^7.7.4":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.7.4.tgz#3fe2ea698d8fb536d8e7881a592c3c1ee8bf5707"
integrity sha512-j+vZtg0/8pQr1H8wKoaJyGL2IEk3rG/GIvua7Sec7meXVIvGycihlGMx5xcU00kqCJbwzHs18xTu3YfREOqQ+g==
@ -1637,7 +1653,7 @@
"@babel/plugin-transform-react-jsx-self" "^7.7.4"
"@babel/plugin-transform-react-jsx-source" "^7.7.4"
"@babel/preset-typescript@7.3.3", "@babel/preset-typescript@^7.3.3":
"@babel/preset-typescript@7.3.3":
version "7.3.3"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz#88669911053fa16b2b276ea2ede2ca603b3f307a"
integrity sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg==
@ -1645,6 +1661,14 @@
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-typescript" "^7.3.2"
"@babel/preset-typescript@^7.7.4":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.7.4.tgz#780059a78e6fa7f7a4c87f027292a86b31ce080a"
integrity sha512-rqrjxfdiHPsnuPur0jKrIIGQCIgoTWMTjlbWE69G4QJ6TIOVnnRnIJhUxNTL/VwDmEAVX08Tq3B1nirer5341w==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-transform-typescript" "^7.7.4"
"@babel/register@^7.7.4":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.7.4.tgz#45a4956471a9df3b012b747f5781cc084ee8f128"
@ -7016,11 +7040,6 @@ babel-plugin-transform-undefined-to-void@^6.9.4:
resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280"
integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=
babel-plugin-typescript-strip-namespaces@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-typescript-strip-namespaces/-/babel-plugin-typescript-strip-namespaces-1.1.1.tgz#160433b17e424b57cf72e3b4d8f08195ad28d7fd"
integrity sha512-dVB9caEANbEVwUylL8g3lsYU5JjaXE2KNIVLib3KVcGJF32QunxvQqP6kf+lzW/fyDed/zWD/e/hdyimyc/79Q==
babel-polyfill@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153"