From 09eebd7985c5873f101d4748a1e4e8ecf2ee2eef Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 15 Oct 2019 13:07:22 +0200 Subject: [PATCH] use ui-scripts to build the core plugins --- scm-plugins/scm-git-plugin/.flowconfig | 5 ++ scm-plugins/scm-git-plugin/package.json | 32 +++++++-- scm-plugins/scm-git-plugin/pom.xml | 1 - .../scm-git-plugin/src/main/js/index.test.js | 1 + scm-plugins/scm-git-plugin/webpack.config.js | 71 ------------------- scm-plugins/scm-hg-plugin/.flowconfig | 2 + scm-plugins/scm-hg-plugin/package.json | 28 +++++++- scm-plugins/scm-hg-plugin/webpack.config.js | 71 ------------------- scm-plugins/scm-legacy-plugin/.flowconfig | 2 + scm-plugins/scm-legacy-plugin/package.json | 28 +++++++- .../scm-legacy-plugin/webpack.config.js | 65 ----------------- scm-plugins/scm-svn-plugin/.flowconfig | 2 + scm-plugins/scm-svn-plugin/package.json | 31 ++++++-- scm-plugins/scm-svn-plugin/webpack.config.js | 65 ----------------- 14 files changed, 114 insertions(+), 290 deletions(-) delete mode 100644 scm-plugins/scm-git-plugin/webpack.config.js delete mode 100644 scm-plugins/scm-hg-plugin/webpack.config.js delete mode 100644 scm-plugins/scm-legacy-plugin/webpack.config.js delete mode 100644 scm-plugins/scm-svn-plugin/webpack.config.js diff --git a/scm-plugins/scm-git-plugin/.flowconfig b/scm-plugins/scm-git-plugin/.flowconfig index b32e51ad47..c071c692b4 100644 --- a/scm-plugins/scm-git-plugin/.flowconfig +++ b/scm-plugins/scm-git-plugin/.flowconfig @@ -1,11 +1,16 @@ [declarations] ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* +../../scm-ui/ui-tests/.* + [include] ./src/** ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* +../../scm-ui/ui-tests/.* [options] module.system.node.resolve_dirname=../../node_modules diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index 21374b986e..158c85fcc3 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -1,22 +1,40 @@ { "name": "@scm-manager/scm-git-plugin", + "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", + "main": "src/main/js/index.js", "scripts": { "build": "ui-scripts plugin", "watch": "ui-scripts plugin-watch", "test": "jest" }, - "devDependencies": { - "@scm-manager/ui-scripts": "2.0.0-SNAPSHOT", - "flow-bin": "^0.109.0", - "flow-typed": "^2.6.1" - }, "babel": { - "presets": ["@scm-manager/babel-preset"] + "presets": [ + "@scm-manager/babel-preset" + ] }, "jest": { "preset": "@scm-manager/jest-preset" }, - "prettier": "@scm-manager/prettier-config" + "prettier": "@scm-manager/prettier-config", + "dependencies": { + "@scm-manager/ui-components": "2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "2.0.0-SNAPSHOT", + "@scm-manager/ui-types": "2.0.0-SNAPSHOT", + "react": "^16.10.2", + "react-i18next": "^10.13.1", + "styled-components": "^4.4.0" + }, + "devDependencies": { + "@scm-manager/babel-preset": "2.0.0-SNAPSHOT", + "@scm-manager/eslint-config": "2.0.0-SNAPSHOT", + "@scm-manager/jest-preset": "2.0.0-SNAPSHOT", + "@scm-manager/prettier-config": "2.0.0-SNAPSHOT", + "@scm-manager/ui-scripts": "2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "2.0.0-SNAPSHOT", + "flow-bin": "^0.109.0", + "flow-typed": "^2.6.1", + "jest": "^24.9.0" + } } diff --git a/scm-plugins/scm-git-plugin/pom.xml b/scm-plugins/scm-git-plugin/pom.xml index 094955fd05..0456370c99 100644 --- a/scm-plugins/scm-git-plugin/pom.xml +++ b/scm-plugins/scm-git-plugin/pom.xml @@ -51,7 +51,6 @@ true true - false diff --git a/scm-plugins/scm-git-plugin/src/main/js/index.test.js b/scm-plugins/scm-git-plugin/src/main/js/index.test.js index 514ed33860..c35b6fb525 100644 --- a/scm-plugins/scm-git-plugin/src/main/js/index.test.js +++ b/scm-plugins/scm-git-plugin/src/main/js/index.test.js @@ -1,4 +1,5 @@ // @flow +import "@scm-manager/ui-tests/i18n"; import { gitPredicate } from "./index"; describe("test git predicate", () => { diff --git a/scm-plugins/scm-git-plugin/webpack.config.js b/scm-plugins/scm-git-plugin/webpack.config.js deleted file mode 100644 index e15132a86f..0000000000 --- a/scm-plugins/scm-git-plugin/webpack.config.js +++ /dev/null @@ -1,71 +0,0 @@ -const path = require("path"); - -module.exports = { - entry: { - "scm-git-plugin": "./src/main/js/index.js" - }, - devtool: "source-map", - target: "web", - node: { - fs: "empty", - net: "empty", - tls: "empty" - }, - externals: [ - "react", - "react-dom", - "react-i18next", - "react-router-dom", - "styled-components", - "@scm-manager/ui-types", - "@scm-manager/ui-extensions", - "@scm-manager/ui-components" - ], - module: { - rules: [ - { - parser: { - system: false, - systemjs: false - } - }, - { - test: /\.(js|jsx)$/, - // exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - presets: ["@scm-manager/babel-preset"] - } - } - }, - { - test: /\.(css|scss|sass)$/i, - use: [ - // Creates `style` nodes from JS strings - "style-loader", - // Translates CSS into CommonJS - "css-loader", - // Compiles Sass to CSS - "sass-loader" - ] - }, - { - test: /\.(png|svg|jpg|gif|woff2?|eot|ttf)$/, - use: ["file-loader"] - } - ] - }, - output: { - path: path.join( - __dirname, - "target", - "scm-git-plugin-2.0.0-SNAPSHOT", - "webapp", - "assets" - ), - filename: "[name].bundle.js", - library: "scm-git-plugin", - libraryTarget: "amd" - } -}; diff --git a/scm-plugins/scm-hg-plugin/.flowconfig b/scm-plugins/scm-hg-plugin/.flowconfig index b32e51ad47..3571550c07 100644 --- a/scm-plugins/scm-hg-plugin/.flowconfig +++ b/scm-plugins/scm-hg-plugin/.flowconfig @@ -1,11 +1,13 @@ [declarations] ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* [include] ./src/** ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* [options] module.system.node.resolve_dirname=../../node_modules diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index e5ea74ef57..b887269e72 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -1,16 +1,38 @@ { "name": "@scm-manager/scm-hg-plugin", + "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", "main": "src/main/js/index.js", "scripts": { - "build": "webpack --mode=production" + "build": "ui-scripts plugin", + "watch": "ui-scripts plugin-watch" }, "babel": { - "presets": ["@scm-manager/babel-preset"] + "presets": [ + "@scm-manager/babel-preset" + ] }, "jest": { "preset": "@scm-manager/jest-preset" }, - "prettier": "@scm-manager/prettier-config" + "prettier": "@scm-manager/prettier-config", + "dependencies": { + "@scm-manager/ui-components": "2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "2.0.0-SNAPSHOT", + "@scm-manager/ui-types": "2.0.0-SNAPSHOT", + "react": "^16.10.2", + "react-i18next": "^10.13.1" + }, + "devDependencies": { + "@scm-manager/babel-preset": "2.0.0-SNAPSHOT", + "@scm-manager/eslint-config": "2.0.0-SNAPSHOT", + "@scm-manager/jest-preset": "2.0.0-SNAPSHOT", + "@scm-manager/prettier-config": "2.0.0-SNAPSHOT", + "@scm-manager/ui-scripts": "2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "2.0.0-SNAPSHOT", + "flow-bin": "^0.109.0", + "flow-typed": "^2.6.1", + "jest": "^24.9.0" + } } diff --git a/scm-plugins/scm-hg-plugin/webpack.config.js b/scm-plugins/scm-hg-plugin/webpack.config.js deleted file mode 100644 index 3245ef7160..0000000000 --- a/scm-plugins/scm-hg-plugin/webpack.config.js +++ /dev/null @@ -1,71 +0,0 @@ -const path = require("path"); - -module.exports = { - entry: { - "scm-hg-plugin": "./src/main/js/index.js" - }, - devtool: "source-map", - target: "web", - node: { - fs: "empty", - net: "empty", - tls: "empty" - }, - externals: [ - "react", - "react-dom", - "react-i18next", - "react-router-dom", - "styled-components", - "@scm-manager/ui-types", - "@scm-manager/ui-extensions", - "@scm-manager/ui-components" - ], - module: { - rules: [ - { - parser: { - system: false, - systemjs: false - } - }, - { - test: /\.(js|jsx)$/, - // exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - presets: ["@scm-manager/babel-preset"] - } - } - }, - { - test: /\.(css|scss|sass)$/i, - use: [ - // Creates `style` nodes from JS strings - "style-loader", - // Translates CSS into CommonJS - "css-loader", - // Compiles Sass to CSS - "sass-loader" - ] - }, - { - test: /\.(png|svg|jpg|gif|woff2?|eot|ttf)$/, - use: ["file-loader"] - } - ] - }, - output: { - path: path.join( - __dirname, - "target", - "scm-hg-plugin-2.0.0-SNAPSHOT", - "webapp", - "assets" - ), - filename: "[name].bundle.js", - library: "scm-hg-plugin", - libraryTarget: "amd" - } -}; diff --git a/scm-plugins/scm-legacy-plugin/.flowconfig b/scm-plugins/scm-legacy-plugin/.flowconfig index b32e51ad47..3571550c07 100644 --- a/scm-plugins/scm-legacy-plugin/.flowconfig +++ b/scm-plugins/scm-legacy-plugin/.flowconfig @@ -1,11 +1,13 @@ [declarations] ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* [include] ./src/** ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* [options] module.system.node.resolve_dirname=../../node_modules diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index 0219fa905e..15afc1fb14 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -1,16 +1,38 @@ { "name": "@scm-manager/legacy-plugin", + "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", "main": "src/main/js/index.js", "scripts": { - "build": "webpack --mode=production" + "build": "ui-scripts plugin", + "watch": "ui-scripts plugin-watch" }, "babel": { - "presets": ["@scm-manager/babel-preset"] + "presets": [ + "@scm-manager/babel-preset" + ] }, "jest": { "preset": "@scm-manager/jest-preset" }, - "prettier": "@scm-manager/prettier-config" + "prettier": "@scm-manager/prettier-config", + "dependencies": { + "@scm-manager/ui-components": "2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "2.0.0-SNAPSHOT", + "@scm-manager/ui-types": "2.0.0-SNAPSHOT", + "react": "^16.10.2", + "react-router-dom": "^5.1.2" + }, + "devDependencies": { + "@scm-manager/babel-preset": "2.0.0-SNAPSHOT", + "@scm-manager/eslint-config": "2.0.0-SNAPSHOT", + "@scm-manager/jest-preset": "2.0.0-SNAPSHOT", + "@scm-manager/prettier-config": "2.0.0-SNAPSHOT", + "@scm-manager/ui-scripts": "2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "2.0.0-SNAPSHOT", + "flow-bin": "^0.109.0", + "flow-typed": "^2.6.1", + "jest": "^24.9.0" + } } diff --git a/scm-plugins/scm-legacy-plugin/webpack.config.js b/scm-plugins/scm-legacy-plugin/webpack.config.js deleted file mode 100644 index f3401635d6..0000000000 --- a/scm-plugins/scm-legacy-plugin/webpack.config.js +++ /dev/null @@ -1,65 +0,0 @@ -const path = require("path"); - -module.exports = { - entry: { - "scm-legacy-plugin": "./src/main/js/index.js" - }, - devtool: "source-map", - target: "web", - node: { - fs: "empty", - net: "empty", - tls: "empty" - }, - externals: [ - "react", - "react-dom", - "react-i18next", - "react-router-dom", - "styled-components", - "@scm-manager/ui-types", - "@scm-manager/ui-extensions", - "@scm-manager/ui-components" - ], - module: { - rules: [ - { - parser: { - system: false, - systemjs: false - } - }, - { - test: /\.(js|jsx)$/, - // exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - presets: ["@scm-manager/babel-preset"] - } - } - }, - { - test: /\.(css|scss|sass)$/i, - use: [ - // Creates `style` nodes from JS strings - "style-loader", - // Translates CSS into CommonJS - "css-loader", - // Compiles Sass to CSS - "sass-loader" - ] - }, - { - test: /\.(png|svg|jpg|gif|woff2?|eot|ttf)$/, - use: ["file-loader"] - } - ] - }, - output: { - path: path.join(__dirname, "target", "scm-legacy-plugin-2.0.0-SNAPSHOT", "webapp", "assets"), - filename: "[name].bundle.js", - library: "scm-legacy-plugin", - libraryTarget: "amd" - } -}; diff --git a/scm-plugins/scm-svn-plugin/.flowconfig b/scm-plugins/scm-svn-plugin/.flowconfig index b32e51ad47..3571550c07 100644 --- a/scm-plugins/scm-svn-plugin/.flowconfig +++ b/scm-plugins/scm-svn-plugin/.flowconfig @@ -1,11 +1,13 @@ [declarations] ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* [include] ./src/** ../../scm-ui/ui-types/.* ../../scm-ui/ui-components/.* +../../scm-ui/ui-extensions/.* [options] module.system.node.resolve_dirname=../../node_modules diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 806839b903..0cc5b124bc 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -1,16 +1,39 @@ { "name": "@scm-manager/scm-svn-plugin", - "main": "src/main/js/index.js", + "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", + "main": "src/main/js/index.js", "scripts": { - "build": "webpack --mode=production" + "build": "ui-scripts plugin", + "watch": "ui-scripts plugin-watch" }, "babel": { - "presets": ["@scm-manager/babel-preset"] + "presets": [ + "@scm-manager/babel-preset" + ] }, "jest": { "preset": "@scm-manager/jest-preset" }, - "prettier": "@scm-manager/prettier-config" + "prettier": "@scm-manager/prettier-config", + "dependencies": { + "@scm-manager/ui-components": "2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "2.0.0-SNAPSHOT", + "@scm-manager/ui-types": "2.0.0-SNAPSHOT", + "react": "^16.10.2", + "react-i18next": "^10.13.1", + "styled-components": "^4.4.0" + }, + "devDependencies": { + "@scm-manager/babel-preset": "2.0.0-SNAPSHOT", + "@scm-manager/eslint-config": "2.0.0-SNAPSHOT", + "@scm-manager/jest-preset": "2.0.0-SNAPSHOT", + "@scm-manager/prettier-config": "2.0.0-SNAPSHOT", + "@scm-manager/ui-scripts": "2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "2.0.0-SNAPSHOT", + "flow-bin": "^0.109.0", + "flow-typed": "^2.6.1", + "jest": "^24.9.0" + } } diff --git a/scm-plugins/scm-svn-plugin/webpack.config.js b/scm-plugins/scm-svn-plugin/webpack.config.js deleted file mode 100644 index 37c89bd2f7..0000000000 --- a/scm-plugins/scm-svn-plugin/webpack.config.js +++ /dev/null @@ -1,65 +0,0 @@ -const path = require("path"); - -module.exports = { - entry: { - "scm-svn-plugin": "./src/main/js/index.js" - }, - devtool: "source-map", - target: "web", - node: { - fs: "empty", - net: "empty", - tls: "empty" - }, - externals: [ - "react", - "react-dom", - "react-i18next", - "react-router-dom", - "styled-components", - "@scm-manager/ui-types", - "@scm-manager/ui-extensions", - "@scm-manager/ui-components" - ], - module: { - rules: [ - { - parser: { - system: false, - systemjs: false - } - }, - { - test: /\.(js|jsx)$/, - // exclude: /node_modules/, - use: { - loader: "babel-loader", - options: { - presets: ["@scm-manager/babel-preset"] - } - } - }, - { - test: /\.(css|scss|sass)$/i, - use: [ - // Creates `style` nodes from JS strings - "style-loader", - // Translates CSS into CommonJS - "css-loader", - // Compiles Sass to CSS - "sass-loader" - ] - }, - { - test: /\.(png|svg|jpg|gif|woff2?|eot|ttf)$/, - use: ["file-loader"] - } - ] - }, - output: { - path: path.join(__dirname, "target", "scm-svn-plugin-2.0.0-SNAPSHOT", "webapp", "assets"), - filename: "[name].bundle.js", - library: "scm-svn-plugin", - libraryTarget: "amd" - } -};