fantonangeli commented on code in PR #2551:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2551#discussion_r1741031307


##########
packages/data-index-webapp/package.json:
##########
@@ -0,0 +1,35 @@
+{
+  "private": true,

Review Comment:
   ```suggestion
   ```



##########
packages/data-index-webapp/package.json:
##########
@@ -0,0 +1,35 @@
+{
+  "private": true,
+  "name": "@kie-tools/data-index-webapp",
+  "version": "1.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools";,
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git";
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues";
+  },
+  "types": "./dist/index.d.ts",
+  "main": "dist/index.js",
+  "scripts": {
+    "build:dev": "rimraf dist && webpack --config webpack.config.ts dev",
+    "build:prod": "pnpm lint && pnpm test && rimraf dist && webpack && pnpm 
test-e2e",

Review Comment:
   ```suggestion
       "build:dev": "rimraf dist && webpack --env dev",
       "build:prod": "pnpm lint && pnpm test && rimraf dist && webpack",
       "test": "run-script-if --ignore-errors \"$(build-env 
tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest 
--silent --verbose --passWithNoTests\"",
   
   ```
   - `--config webpack.config.ts` points to a configuration which is not in the 
package
   - the other updates are to make the command `pnpm -F data-index-webapp -r 
build:prod` to run without the error: `Command "test" not found`



##########
packages/data-index-webapp/package.json:
##########
@@ -0,0 +1,35 @@
+{
+  "private": true,
+  "name": "@kie-tools/data-index-webapp",
+  "version": "1.0.0",

Review Comment:
   ```suggestion
     "version": "0.0.0",
   ```
   It's better to follow the same version of other kie-tools packages



##########
packages/data-index-webapp/src/styles.css:
##########
@@ -0,0 +1,120 @@
+/* Default light mode */
+.body {
+  margin: 0px;
+  padding: 0px;
+}
+
+.maindiv {
+  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
+  background-color: #fff;
+  color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 100vh;
+}
+
+.container {
+  text-align: center;
+  background-color: #fff;
+  max-width: 700px;
+}
+
+.logo img {
+  width: 80px;
+  height: auto;
+}
+
+h1 {
+  font-size: 48px;
+  color: #e44c3b;
+  padding-left: 15px;
+}
+
+h4 {
+  font-size: 30px;
+  color: #c94848;
+  margin-top: 10px;
+}
+
+p {
+  font-size: 16px;
+  color: #1f1e1e;
+  margin-top: 5px;
+  margin-bottom: 40px;
+}
+
+.btn {
+  padding: 10px 20px;
+  background-color: #e44c3b;
+  color: #fff;
+  text-decoration: none;
+  border-radius: 5px;
+  font-size: 16px;
+  transition: background-color 0.3s;
+}
+
+.btn:hover {
+  background-color: #c73828;
+}
+
+/* Dark mode */
+@media (prefers-color-scheme: dark) {

Review Comment:
   Please reduce this media query to change only the colors without overriding 
fonts and sizes 



##########
packages/data-index-webapp/webpack.config.js:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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 path = require("path");
+const CopyPlugin = require("copy-webpack-plugin");
+const TerserPlugin = require("terser-webpack-plugin");
+const { merge } = require("webpack-merge");
+const common = require("@kie-tools-core/webpack-base/webpack.common.config");
+
+module.exports = async (env = {}) =>
+  merge(common(env), {
+    entry: {},
+    optimization: {
+      minimizer: [
+        new TerserPlugin({
+          terserOptions: {
+            format: {
+              comments: false,
+            },
+          },
+          extractComments: false,
+        }),
+      ],
+    },
+    plugins: [
+      new CopyPlugin({
+        patterns: [
+          { from: "./src/index.html", to: "./index.html" },
+          { from: "./src/styles.css", to: "./styles.css" },
+          { from: "./static/favicon.svg", to: "./favicon.svg" },
+        ],
+      }),
+    ],
+    module: {},
+    resolve: {
+      fallback: {
+        http: require.resolve("stream-http"),
+      },
+    },
+    ignoreWarnings: [/Failed to parse source map/],
+  });

Review Comment:
   Here we can configure the devServer following other packages. 
   To configure `buildEnv.dataIndexWebapp` you can start from the file:
   `packages/sonataflow-deployment-webapp/env/index.js`
   and choose a port which is not used by other packages.
   See also `packages/sonataflow-deployment-webapp/webpack.config.js:98` as an 
example usage.
   
   ```suggestion
       devServer: {
         static: {
           directory: "./dist",
         },
         port: buildEnv.dataIndexWebapp.dev.port,
       },
     });
   ```



##########
packages/data-index-webapp/src/index.html:
##########
@@ -0,0 +1,49 @@
+<!--
+  ~ 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.      
+-->
+
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Data Index Webapp</title>
+    <link rel="stylesheet" href="styles.css" />

Review Comment:
   ```suggestion
       <link rel="stylesheet" href="styles.css" />
       <link rel="shortcut icon" type="image/x-icon" href="favicon.svg" />
   ```



##########
packages/data-index-webapp/webpack.config.js:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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 path = require("path");

Review Comment:
   Please after removing the unneeded part of `webpack.config.js`, remove the 
unused requires from here and from the `package.json`



##########
packages/data-index-webapp/src/styles.css:
##########
@@ -0,0 +1,120 @@
+/* Default light mode */
+.body {
+  margin: 0px;
+  padding: 0px;
+}

Review Comment:
   Please remove this unused css block.
   You can use Chrome DevTools to discover unused blocks:
   https://developer.chrome.com/docs/devtools/coverage



##########
packages/data-index-webapp/src/styles.css:
##########
@@ -0,0 +1,120 @@
+/* Default light mode */
+.body {
+  margin: 0px;
+  padding: 0px;
+}
+
+.maindiv {
+  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

Review Comment:
   ```suggestion
     font-family: "RedHatText", "Overpass", overpass, helvetica, arial, 
sans-serif;
   ```
   I think It's better to follow other SonataFlow packages fonts and avoid 
license issues



##########
packages/data-index-webapp/src/index.html:
##########
@@ -0,0 +1,49 @@
+<!--
+  ~ 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.      
+-->
+
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Data Index Webapp</title>
+    <link rel="stylesheet" href="styles.css" />
+  </head>
+  <body>
+    <div class="maindiv">
+      <div class="container">
+        <div class="logo" style="display: flex; justify-content: center">
+          <img src="favicon.svg" alt="KIE Logo" />
+          <h1>Data Index Service</h1>
+        </div>
+        <div>
+          <h4>Your Data Index service is up and working!</h4>
+        </div>
+        <p>
+          Data Index service is a dedicated supporting service that stores the 
data related to the workflow and process
+          instances and their associated jobs. This service provides a GraphQL 
endpoint allowing users to query and
+          modify that data.
+        </p>
+        <div>
+          <a href="https://graphql.org/learn/"; class="btn">GraphQL docs</a>

Review Comment:
   Please open this link in a new window



##########
packages/data-index-webapp/webpack.config.js:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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 path = require("path");
+const CopyPlugin = require("copy-webpack-plugin");
+const TerserPlugin = require("terser-webpack-plugin");
+const { merge } = require("webpack-merge");
+const common = require("@kie-tools-core/webpack-base/webpack.common.config");
+
+module.exports = async (env = {}) =>
+  merge(common(env), {
+    entry: {},
+    optimization: {
+      minimizer: [
+        new TerserPlugin({
+          terserOptions: {
+            format: {
+              comments: false,
+            },
+          },
+          extractComments: false,
+        }),
+      ],
+    },
+    plugins: [
+      new CopyPlugin({
+        patterns: [
+          { from: "./src/index.html", to: "./index.html" },
+          { from: "./src/styles.css", to: "./styles.css" },
+          { from: "./static/favicon.svg", to: "./favicon.svg" },
+        ],
+      }),
+    ],
+    module: {},
+    resolve: {
+      fallback: {
+        http: require.resolve("stream-http"),
+      },
+    },

Review Comment:
   This configuration is to interact with apis, which is not the case of 
data-index-webapp and we can remove it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to