diff --git a/.babelrc b/.babelrc deleted file mode 100644 index a248d20409..0000000000 --- a/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"], - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/scm-plugins/scm-git-plugin/.babelrc b/scm-plugins/scm-git-plugin/.babelrc deleted file mode 100644 index a248d20409..0000000000 --- a/scm-plugins/scm-git-plugin/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"], - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index c758d56a13..0238ceaa71 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -10,6 +10,9 @@ "flow-bin": "^0.109.0", "flow-typed": "^2.6.1" }, + "babel": { + "presets": ["@scm-manager/babel-preset"] + }, "jest": { "transform": { "^.+\\.js$": "../../scm-ui/scripts/babelPluginTransformer.js" diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index 9a14977dca..5065e4a5c5 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -6,6 +6,9 @@ "scripts": { "build": "webpack --mode=production" }, + "babel": { + "presets": ["@scm-manager/babel-preset"] + }, "jest": { "transform": { "^.+\\.js$": "../../scm-ui/scripts/babelPluginTransformer.js" diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index c1587f65f5..6c18fb3083 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -6,6 +6,9 @@ "scripts": { "build": "webpack --mode=production" }, + "babel": { + "presets": ["@scm-manager/babel-preset"] + }, "jest": { "transform": { "^.+\\.js$": "../../scm-ui/scripts/babelPluginTransformer.js" diff --git a/scm-plugins/scm-svn-plugin/.babelrc b/scm-plugins/scm-svn-plugin/.babelrc deleted file mode 100644 index a248d20409..0000000000 --- a/scm-plugins/scm-svn-plugin/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"], - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 756a0d001a..e90d9cfe75 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -6,6 +6,9 @@ "scripts": { "build": "webpack --mode=production" }, + "babel": { + "presets": ["@scm-manager/babel-preset"] + }, "jest": { "transform": { "^.+\\.js$": "../../scm-ui/scripts/babelPluginTransformer.js" diff --git a/scm-ui/babel-preset/index.js b/scm-ui/babel-preset/index.js new file mode 100644 index 0000000000..c3c750e59c --- /dev/null +++ b/scm-ui/babel-preset/index.js @@ -0,0 +1,11 @@ +module.exports = () => ({ + presets: [ + require("@babel/preset-env"), + require("@babel/preset-flow"), + require("@babel/preset-react") + ], + plugins: [ + require("@babel/plugin-proposal-class-properties"), + require("@babel/plugin-proposal-optional-chaining") + ] +}); diff --git a/scm-ui/babel-preset/package.json b/scm-ui/babel-preset/package.json new file mode 100644 index 0000000000..ace8afb0ee --- /dev/null +++ b/scm-ui/babel-preset/package.json @@ -0,0 +1,17 @@ +{ + "name": "@scm-manager/babel-preset", + "version": "2.0.0-SNAPSHOT", + "license": "BSD-3-Clause", + "description": "Babel configuration for scm-manager and its plugins", + "main": "index.js", + "author": "Sebastian Sdorra ", + "private": false, + "dependencies": { + "@babel/core": "^7.6.3", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-optional-chaining": "^7.6.0", + "@babel/preset-env": "^7.6.3", + "@babel/preset-flow": "^7.0.0", + "@babel/preset-react": "^7.6.3" + } +} diff --git a/scm-ui/plugin-scripts/package.json b/scm-ui/plugin-scripts/package.json new file mode 100644 index 0000000000..9340c0c830 --- /dev/null +++ b/scm-ui/plugin-scripts/package.json @@ -0,0 +1,12 @@ +{ + "name": "@scm-manager/plugin-scripts", + "version": "2.0.0-SNAPSHOT", + "license": "BSD-3-Clause", + "description": "Plugin scripts", + "author": "Sebastian Sdorra ", + "private": false, + "dependencies": { + "@scm-manager/babel-preset": "2.0.0-SNAPSHOT", + "@scm-manager/eslint-config": "2.0.0-SNAPSHOT" + } +} diff --git a/scm-ui/scripts/webpack.config.js b/scm-ui/scripts/webpack.config.js index a4164874f0..6e473f40a6 100644 --- a/scm-ui/scripts/webpack.config.js +++ b/scm-ui/scripts/webpack.config.js @@ -41,11 +41,8 @@ module.exports = { options: { cacheDirectory: true, presets: [ - "@babel/preset-env", - "@babel/preset-react", - "@babel/preset-flow" - ], - plugins: ["@babel/plugin-proposal-class-properties"] + "@scm-manager/babel-preset" + ] } } ] diff --git a/scm-ui/ui-components/.babelrc b/scm-ui/ui-components/.babelrc deleted file mode 100644 index a248d20409..0000000000 --- a/scm-ui/ui-components/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"], - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index bb4e471e01..b33c06fd83 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -44,6 +44,9 @@ "react-select": "^2.1.2", "react-syntax-highlighter": "^11.0.2" }, + "babel": { + "presets": ["@scm-manager/babel-preset"] + }, "jest": { "transform": { "^.+\\.js$": "../scripts/babelMonoRepoTransformer.js" diff --git a/scm-ui/ui-components/src/storyshots.test.js b/scm-ui/ui-components/src/storyshots.test.js new file mode 100644 index 0000000000..bb126dc23f --- /dev/null +++ b/scm-ui/ui-components/src/storyshots.test.js @@ -0,0 +1,5 @@ +import initStoryshots from "@storybook/addon-storyshots"; + +initStoryshots({ + /* configuration options */ +}); diff --git a/scm-ui/ui-types/.babelrc b/scm-ui/ui-types/.babelrc deleted file mode 100644 index a248d20409..0000000000 --- a/scm-ui/ui-types/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"], - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/scm-ui/ui-types/package.json b/scm-ui/ui-types/package.json index 793aefc62f..a8d85a6594 100644 --- a/scm-ui/ui-types/package.json +++ b/scm-ui/ui-types/package.json @@ -15,5 +15,8 @@ }, "devDependencies": { "flow-bin": "^0.109.0" + }, + "babel": { + "presets": ["@scm-manager/babel-preset"] } } diff --git a/scm-ui/ui-webapp/.babelrc b/scm-ui/ui-webapp/.babelrc deleted file mode 100644 index a248d20409..0000000000 --- a/scm-ui/ui-webapp/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"], - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/scm-ui/ui-webapp/package.json b/scm-ui/ui-webapp/package.json index d065701f05..7359a60023 100644 --- a/scm-ui/ui-webapp/package.json +++ b/scm-ui/ui-webapp/package.json @@ -61,6 +61,9 @@ "redux-mock-store": "^1.5.3", "systemjs": "0.21.6" }, + "babel": { + "presets": ["@scm-manager/babel-preset"] + }, "jest": { "transform": { "^.+\\.js$": "../scripts/babelMonoRepoTransformer.js" diff --git a/yarn.lock b/yarn.lock index 543257a993..8ffcbad267 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,7 +29,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.6.2": +"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.6.2", "@babel/core@^7.6.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.3.tgz#44de824e89eaa089bb12da7337bc9bdff2ab68f9" integrity sha512-QfQ5jTBgXLzJuo7Mo8bZK/ePywmgNRgk/UQykiKwEtZPiFIn8ZqE6jB+AnD1hbB1S2xQyL4//it5vuAUOVAMTw== @@ -323,6 +323,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" +"@babel/plugin-proposal-optional-chaining@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.6.0.tgz#e9bf1f9b9ba10c77c033082da75f068389041af8" + integrity sha512-kj4gkZ6qUggkprRq3Uh5KP8XnE1MdIO0J7MhdDX8+rAbB6dJ2UrensGIS+0NPZAaaJ1Vr0PN6oLUgXMU1uMcSg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex@^7.4.4", "@babel/plugin-proposal-unicode-property-regex@^7.6.2": version "7.6.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.6.2.tgz#05413762894f41bfe42b9a5e80919bd575dcc802" @@ -388,6 +396,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-optional-chaining@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff" + integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-typescript@^7.2.0": version "7.3.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" @@ -780,7 +795,7 @@ js-levenshtein "^1.1.3" semver "^5.5.0" -"@babel/preset-env@^7.4.5", "@babel/preset-env@^7.6.2": +"@babel/preset-env@^7.4.5", "@babel/preset-env@^7.6.2", "@babel/preset-env@^7.6.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.6.3.tgz#9e1bf05a2e2d687036d24c40e4639dc46cef2271" integrity sha512-CWQkn7EVnwzlOdR5NOm2+pfgSNEZmvGjOhlCHBDq0J8/EStr+G+FvPEiz9B56dR6MoiUFjXhfE4hjLoAKKJtIQ== @@ -855,7 +870,7 @@ "@babel/plugin-transform-react-jsx-self" "^7.0.0" "@babel/plugin-transform-react-jsx-source" "^7.0.0" -"@babel/preset-react@^7.0.0": +"@babel/preset-react@^7.0.0", "@babel/preset-react@^7.6.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.6.3.tgz#d5242c828322520205ae4eda5d4f4f618964e2f6" integrity sha512-07yQhmkZmRAfwREYIQgW0HEwMY9GBJVuPY4Q12UC72AbfaawuupVWa8zQs2tlL+yun45Nv/1KreII/0PLfEsgA==