You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2024/03/31 16:18:38 UTC

(streampipes) 01/07: Fix build config, add proxy config, remove webpack

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch bump-angular-eslint
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 31b0969f8ed6a330dfa4fa629fabed21633fd3c7
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sat Mar 30 23:13:16 2024 +0100

    Fix build config, add proxy config, remove webpack
---
 ui/.gitignore                        |   2 +-
 ui/Dockerfile                        |   2 +-
 ui/angular.json                      |   2 +-
 ui/deployment/prebuild.js            |   4 +-
 ui/deployment/proxy.conf.json        |   6 ++
 ui/deployment/webpack.partial.dev.js |  60 ------------
 ui/src/index.html                    |   1 +
 ui/webpack.partial.base.js           | 177 -----------------------------------
 ui/webpack.partial.js                |  21 -----
 ui/webpack.partial.prod.js           |  24 -----
 10 files changed, 12 insertions(+), 287 deletions(-)

diff --git a/ui/.gitignore b/ui/.gitignore
index 3b6533dc98..56d8c0dade 100644
--- a/ui/.gitignore
+++ b/ui/.gitignore
@@ -30,7 +30,7 @@ src/app/core/components/base-navigation.component.ts
 src/assets/img/sp/logo.png
 src/assets/img/sp/logo-navigation.png
 src/assets/img/favicon/favicon-96x96.png
-webpack.partial.dev.js
+src/proxy.conf.json
 src/scss/_variables.scss
 # compiled output
 /dist
diff --git a/ui/Dockerfile b/ui/Dockerfile
index 4b82c1bd17..a6b1c6aa74 100644
--- a/ui/Dockerfile
+++ b/ui/Dockerfile
@@ -15,7 +15,7 @@
 
 FROM nginx:mainline-alpine3.18
 
-COPY dist/streampipes/ui/ /usr/share/nginx/html/
+COPY dist/streampipes/ui/browser/ /usr/share/nginx/html/
 
 #Store a copy to have a version if the other is hidden in the volume. Required for migration from 0.93.0 to 0.95.0. Could be removed after the release of 0.95.0.
 RUN mkdir -p /etc/opt/nginx/
diff --git a/ui/angular.json b/ui/angular.json
index 2d2f4b7a83..17b7a423cc 100644
--- a/ui/angular.json
+++ b/ui/angular.json
@@ -35,7 +35,7 @@
           "builder": "@angular-devkit/build-angular:application",
           "options": {
             "browser": "src/main.ts",
-            "outputPath": "dist/app",
+            "outputPath": "dist/streampipes/ui",
             "index": "src/index.html",
             "tsConfig": "src/tsconfig.app.json",
             "polyfills": ["src/polyfills.ts", "es-module-shims"],
diff --git a/ui/deployment/prebuild.js b/ui/deployment/prebuild.js
index 1500b0e225..460ecd1624 100644
--- a/ui/deployment/prebuild.js
+++ b/ui/deployment/prebuild.js
@@ -150,8 +150,8 @@ fs.writeFileSync(
 console.log('Moved: styling variables file');
 
 fs.writeFileSync(
-    'webpack.partial.dev.js',
-    fs.readFileSync('deployment/webpack.partial.dev.js', 'utf8'),
+    'src/proxy.conf.json',
+    fs.readFileSync('deployment/proxy.conf.json', 'utf8'),
 );
 console.log('Moved: webpack dev config');
 
diff --git a/ui/deployment/proxy.conf.json b/ui/deployment/proxy.conf.json
new file mode 100644
index 0000000000..3b0f6fcd73
--- /dev/null
+++ b/ui/deployment/proxy.conf.json
@@ -0,0 +1,6 @@
+{
+  "/streampipes-backend": {
+    "target": "http://localhost:8030",
+    "secure": false
+  }
+}
diff --git a/ui/deployment/webpack.partial.dev.js b/ui/deployment/webpack.partial.dev.js
deleted file mode 100644
index 6bd35b3f59..0000000000
--- a/ui/deployment/webpack.partial.dev.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements.  See the NOTICE file distributed with
- *   this work for additional information regarding copyright ownership.
- *   The ASF licenses this file to You under the Apache License, Version 2.0
- *   (the "License"); you may not use this file except in compliance with
- *   the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- */
-
-/**
- *
- * Note: to change this file, change webpack.partial.dev.js in deployment folder
- * changes in the root folder will be overridden by prebuild script
- *
- */
-
-const { merge } = require('webpack-merge');
-const baseConfig = require('./webpack.partial.base.js');
-
-module.exports = merge(baseConfig, {
-    devServer: {
-        compress: true,
-        port: 8082,
-        proxy: {
-            '/streampipes-connect': {
-                target: 'http://localhost:8030',
-                // pathRewrite: { '^/streampipes-connect': '' },
-                secure: false,
-            },
-            '/streampipes-backend': {
-                target: 'http://localhost:8030',
-                secure: false,
-            },
-            '/visualizablepipeline': {
-                target: 'http://localhost:5984',
-                secure: false,
-            },
-            '/dashboard': {
-                target: 'http://localhost:5984',
-                secure: false,
-            },
-            '/widget': {
-                target: 'http://localhost:5984',
-                secure: false,
-            },
-            '/pipeline': {
-                target: 'http://localhost:5984',
-                secure: false,
-            },
-        },
-    },
-});
diff --git a/ui/src/index.html b/ui/src/index.html
index f7da8f4fb0..29afac290e 100644
--- a/ui/src/index.html
+++ b/ui/src/index.html
@@ -16,6 +16,7 @@
   ~
   -->
 
+<!doctype html>
 <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <base href="/" />
diff --git a/ui/webpack.partial.base.js b/ui/webpack.partial.base.js
deleted file mode 100644
index 2aca2e2fe4..0000000000
--- a/ui/webpack.partial.base.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements.  See the NOTICE file distributed with
- *   this work for additional information regarding copyright ownership.
- *   The ASF licenses this file to You under the Apache License, Version 2.0
- *   (the "License"); you may not use this file except in compliance with
- *   the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- */
-
-const webpack = require('webpack');
-const path = require('path');
-
-const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
-const mf = require('@angular-architects/module-federation/webpack');
-const share = mf.share;
-
-const sharedMappings = new mf.SharedMappings();
-sharedMappings.register(path.join(__dirname, 'tsconfig.json'), [
-    /* mapped paths to share */
-]);
-
-module.exports = {
-    module: {
-        rules: [{ test: /\.html$/, loader: 'raw-loader' }],
-    },
-    experiments: {
-        outputModule: true,
-    },
-    resolve: {
-        alias: {
-            npm: path.join(__dirname, 'node_modules'),
-            legacy: path.join(__dirname, 'src', 'assets', 'lib'),
-        },
-        fallback: {
-            assert: false,
-            stream: require.resolve('stream-browserify'),
-        },
-    },
-    plugins: [
-        new webpack.ProvidePlugin({
-            process: 'process/browser',
-        }),
-        new ModuleFederationPlugin({
-            library: { type: 'module' },
-
-            name: 'sp',
-            filename: 'remoteEntry.js',
-            exposes: {},
-
-            shared: share({
-                '@angular/core': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/common': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/common/http': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/forms': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/router': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/cdk': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/cdk/overlay': {
-                    singleton: true,
-                    strictVersion: false,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/cdk/portal': {
-                    singleton: true,
-                    strictVersion: false,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material/core': {
-                    singleton: true,
-                    strictVersion: false,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material/menu': {
-                    singleton: true,
-                    strictVersion: false,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material/tooltip': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material/dialog': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material/select': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@angular/material/form-field': {
-                    singleton: true,
-                    strictVersion: true,
-                    requiredVersion: 'auto',
-                    eager: true,
-                },
-                '@streampipes/shared-ui': {
-                    singleton: true,
-                    strictVersion: true,
-                    version: '0.0.1',
-                    eager: true,
-                },
-                '@streampipes/platform-services': {
-                    singleton: true,
-                    strictVersion: true,
-                    version: '0.0.1',
-                    eager: true,
-                },
-                'ngx-echarts': {
-                    singleton: true,
-                    strictVersion: true,
-                    eager: true,
-                },
-                'echarts': {
-                    singleton: true,
-                    strictVersion: true,
-                    eager: true,
-                },
-
-                ...sharedMappings.getDescriptors(),
-            }),
-        }),
-        sharedMappings.getPlugin(),
-    ],
-};
diff --git a/ui/webpack.partial.js b/ui/webpack.partial.js
deleted file mode 100644
index c0325d959c..0000000000
--- a/ui/webpack.partial.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-module.exports = env => {
-    return require(`./webpack.partial.${env}.js`);
-};
diff --git a/ui/webpack.partial.prod.js b/ui/webpack.partial.prod.js
deleted file mode 100644
index e52d601bdc..0000000000
--- a/ui/webpack.partial.prod.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements.  See the NOTICE file distributed with
- *   this work for additional information regarding copyright ownership.
- *   The ASF licenses this file to You under the Apache License, Version 2.0
- *   (the "License"); you may not use this file except in compliance with
- *   the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- */
-
-const CompressionPlugin = require('compression-webpack-plugin');
-const { merge } = require('webpack-merge');
-const baseConfig = require('./webpack.partial.base.js');
-
-module.exports = merge(baseConfig, {
-    plugins: [new CompressionPlugin()],
-});