diff --git a/.gitignore b/.gitignore index c576e0b3e03..36b72acc3a7 100644 --- a/.gitignore +++ b/.gitignore @@ -236,6 +236,8 @@ packages/sonataflow-operator/e2e-test-report.xml # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +/.idea + # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml @@ -266,14 +268,14 @@ packages/sonataflow-operator/e2e-test-report.xml # When using Gradle or Maven with auto-import, you should exclude module files, # since they will be recreated, and may cause churn. Uncomment if using # auto-import. -.idea/artifacts -.idea/compiler.xml -.idea/jarRepositories.xml -.idea/modules.xml -.idea/*.iml -.idea/modules -*.iml -*.ipr +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr # CMake cmake-build-*/ @@ -341,3 +343,7 @@ packages/python-venv/venv # turbo .turbo turbo.json + +# IntelliJ projects should be on _intellij-projects folder, never on specific packages. +packages/*/.idea +examples/*/.idea diff --git a/.idea/copyright/Red_Hat.xml b/.idea/copyright/Red_Hat.xml deleted file mode 100644 index 4ffcd20ab21..00000000000 --- a/.idea/copyright/Red_Hat.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 6e23ff1abfb..00000000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 33b47361d92..00000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/.prettierignore b/.prettierignore index 5505f5cedd0..a835f1679c4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,3 +10,7 @@ pnpm-lock.yaml packages/xml-parser-ts-codegen/src/schemas/xsd/HFP.xsd packages/xml-parser-ts-codegen/src/schemas/xsd-incomplete--manually-written/HFP.xsd packages/xml-parser-ts-codegen/src/schemas/xsd-incomplete--manually-written/XSD.xsd + +# @prettier/parser-xml shouldn't mess with auto-generated IntelliJ files +_intellij-project +*.iml \ No newline at end of file diff --git a/.syncpackrc.json b/.syncpackrc.json index 7abf816f386..28fc3e2026b 100644 --- a/.syncpackrc.json +++ b/.syncpackrc.json @@ -3,8 +3,8 @@ { "dependencies": ["prettier"], "packages": [ - "@kie-tools/uniforms-bootstrap4-codegen", - "@kie-tools/uniforms-patternfly-codegen", + "@kie-tools/form-code-generator-bootstrap4-theme", + "@kie-tools/form-code-generator-patternfly-theme", "@kie-tools/yaml-language-server" ] }, diff --git a/DISCLAIMER b/DISCLAIMER-WIP similarity index 100% rename from DISCLAIMER rename to DISCLAIMER-WIP diff --git a/_intellij-project/.idea/.gitignore b/_intellij-project/.idea/.gitignore new file mode 100644 index 00000000000..46ff3f43c45 --- /dev/null +++ b/_intellij-project/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +/encodings.xml +/compiler.xml diff --git a/_intellij-project/.idea/eclipseCodeFormatter.xml b/_intellij-project/.idea/eclipseCodeFormatter.xml new file mode 100644 index 00000000000..288defe8262 --- /dev/null +++ b/_intellij-project/.idea/eclipseCodeFormatter.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/_intellij-project/.idea/jarRepositories.xml b/_intellij-project/.idea/jarRepositories.xml new file mode 100644 index 00000000000..75311d7a1f6 --- /dev/null +++ b/_intellij-project/.idea/jarRepositories.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_intellij-project/.idea/misc.xml b/_intellij-project/.idea/misc.xml new file mode 100644 index 00000000000..ba7d67621f7 --- /dev/null +++ b/_intellij-project/.idea/misc.xml @@ -0,0 +1,29 @@ + + + + + + + + + + \ No newline at end of file diff --git a/_intellij-project/.idea/modules.xml b/_intellij-project/.idea/modules.xml new file mode 100644 index 00000000000..6588a1bb1d8 --- /dev/null +++ b/_intellij-project/.idea/modules.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_intellij-project/.idea/vcs.xml b/_intellij-project/.idea/vcs.xml new file mode 100644 index 00000000000..2b2fd6e5002 --- /dev/null +++ b/_intellij-project/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/_intellij-project/README.md b/_intellij-project/README.md new file mode 100644 index 00000000000..743278e227b --- /dev/null +++ b/_intellij-project/README.md @@ -0,0 +1,53 @@ + + +# KIE Tools @ IntelliJ IDEA + +To make it easier for developing Java-, Maven-based packages, this folder contains an IntelliJ IDEA project configured for select packages. It currently includes all Maven-based packages of KIE Tools. Two additional IntelliJ IDEA project modules are included too, given their "global" nature on the KIE Tools repository -- `scripts` and `root-env`. + +### Importing this project on IntelliJ IDEA + +After cloning `kie-tools` locally: +1. Bootstrap the repository with `pnpm bootstrap [pnpm-filter?]` command to wire everything together and configure `.mvn/maven.config` files for all packages. You only need to do it once per clone or when you change the dependency graph on `package.json` files. +2. Build the repository in development mode with `pnpm [pnpm-filter?] build:dev` to make sure your local Maven repository (Usually `~/.m2/repository`) is populated. + +It's recommended to that before opening IntelliJ IDEA to make indexing faster once you do. + +Once prompted by IntelliJ IDEA, select "Open" and choose this folder. + +Open +Select folder + +--- + +After you're done importing the project, please also configure the code formatter (or Code Style, in IntelliJ IDEA terminology.) + +Apache KIE Tools uses an Eclipse Formatter XML, so please install https://plugins.jetbrains.com/plugin/6546-adapter-for-eclipse-code-formatter and configure it like in the screenshot below: + +Configure Eclipse formatter + + +--- + +You should now be able to develop all Java- and Maven-based projects normally. + +--- + +> For more information on Maven-based packages on KIE Tools, please refere to the [KIE Tools :: Manual](../repo/docs/MANUAL.md). + + + diff --git a/_intellij-project/docs/intellij-eclipse-formatter-config.png b/_intellij-project/docs/intellij-eclipse-formatter-config.png new file mode 100644 index 00000000000..ac46d1a9b47 Binary files /dev/null and b/_intellij-project/docs/intellij-eclipse-formatter-config.png differ diff --git a/_intellij-project/docs/intellij-open.png b/_intellij-project/docs/intellij-open.png new file mode 100644 index 00000000000..4807f4a485e Binary files /dev/null and b/_intellij-project/docs/intellij-open.png differ diff --git a/_intellij-project/docs/intellij-select-folder.png b/_intellij-project/docs/intellij-select-folder.png new file mode 100644 index 00000000000..16c2444d527 Binary files /dev/null and b/_intellij-project/docs/intellij-select-folder.png differ diff --git a/_intellij-project/eclipse-format.xml b/_intellij-project/eclipse-format.xml new file mode 100644 index 00000000000..c48884688b6 --- /dev/null +++ b/_intellij-project/eclipse-format.xml @@ -0,0 +1,341 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_intellij-project/eclipse.importorder b/_intellij-project/eclipse.importorder new file mode 100644 index 00000000000..edb1aaa6a95 --- /dev/null +++ b/_intellij-project/eclipse.importorder @@ -0,0 +1,27 @@ +# +# 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. +# + +#Organize Import Order +#Wed Jan 23 12:03:29 AEDT 2019 +0=java +1=javax +2=org +3=com +4=io +5=# \ No newline at end of file diff --git a/_intellij-project/maven-based-packages-@-kie-tools.iml b/_intellij-project/maven-based-packages-@-kie-tools.iml new file mode 100644 index 00000000000..9338e35f37b --- /dev/null +++ b/_intellij-project/maven-based-packages-@-kie-tools.iml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/examples/base64png-editor-chrome-extension/webpack.config.js b/examples/base64png-editor-chrome-extension/webpack.config.js index fcf400e6526..03d867152e0 100644 --- a/examples/base64png-editor-chrome-extension/webpack.config.js +++ b/examples/base64png-editor-chrome-extension/webpack.config.js @@ -25,12 +25,11 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { merge } = require("webpack-merge"); const { EnvironmentPlugin } = require("webpack"); const { env } = require("./env"); -const buildEnv = env; -module.exports = (env) => { - const router_targetOrigin = `https://localhost:${buildEnv.exampleChromeExtension.envelope.port}`; +module.exports = (webpackEnv) => { + const router_targetOrigin = `https://localhost:${env.exampleChromeExtension.envelope.port}`; - return merge(common(env), { + return merge(common(webpackEnv), { entry: { contentscript: "./src/contentscript.ts", "envelope/index": "./src/envelope/index.ts", @@ -38,7 +37,7 @@ module.exports = (env) => { devServer: { compress: true, https: true, - port: buildEnv.exampleChromeExtension.envelope.port, + port: env.exampleChromeExtension.envelope.port, }, plugins: [ new CopyPlugin({ diff --git a/examples/base64png-editor-vscode-extension/webpack.config.js b/examples/base64png-editor-vscode-extension/webpack.config.js index a894e79f3d1..40755ee3aaf 100644 --- a/examples/base64png-editor-vscode-extension/webpack.config.js +++ b/examples/base64png-editor-vscode-extension/webpack.config.js @@ -21,8 +21,8 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { merge } = require("webpack-merge"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "VsCodePackSimpleReact", libraryTarget: "umd", @@ -33,15 +33,15 @@ const commonConfig = (env) => }, }); -module.exports = (env) => [ - merge(commonConfig(env), { +module.exports = (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { extension: "./src/extension.ts", }, plugins: [], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "envelope/index": "./src/envelope/index.ts", diff --git a/examples/dmn-editor-standalone-examples/webpack.config.js b/examples/dmn-editor-standalone-examples/webpack.config.js index f6dead2bfa1..88e671c525c 100644 --- a/examples/dmn-editor-standalone-examples/webpack.config.js +++ b/examples/dmn-editor-standalone-examples/webpack.config.js @@ -24,10 +24,9 @@ const path = require("path"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const { ProvidePlugin } = require("webpack"); const { env } = require("./env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { output: { path: path.join(__dirname, "dist"), filename: "[name].js", @@ -68,7 +67,7 @@ module.exports = (env) => static: [{ directory: path.join(__dirname, "./dist") }], compress: true, https: false, - port: buildEnv.dmnEditorStandaloneExamples.port, + port: env.dmnEditorStandaloneExamples.port, client: { overlay: false, }, diff --git a/examples/drools-process-usertasks-quarkus-example/drools-process-usertasks-quarkus-example.iml b/examples/drools-process-usertasks-quarkus-example/drools-process-usertasks-quarkus-example.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/examples/drools-process-usertasks-quarkus-example/drools-process-usertasks-quarkus-example.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/drools-process-usertasks-quarkus-example/install.js b/examples/drools-process-usertasks-quarkus-example/install.js index 9102bb3b499..9047ff62eb3 100644 --- a/examples/drools-process-usertasks-quarkus-example/install.js +++ b/examples/drools-process-usertasks-quarkus-example/install.js @@ -17,9 +17,10 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.droolsProcessUsertasksQuarkusExample.version} +setupMavenConfigFile(` + -Drevision=${env.droolsProcessUsertasksQuarkusExample.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/examples/drools-process-usertasks-quarkus-example/package.json b/examples/drools-process-usertasks-quarkus-example/package.json index 15f3d1c84c3..69e5cb74f1e 100644 --- a/examples/drools-process-usertasks-quarkus-example/package.json +++ b/examples/drools-process-usertasks-quarkus-example/package.json @@ -32,7 +32,6 @@ "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/examples/drools-process-usertasks-quarkus-example/pom.xml b/examples/drools-process-usertasks-quarkus-example/pom.xml index 3ab00e2fc76..d36d3324e38 100644 --- a/examples/drools-process-usertasks-quarkus-example/pom.xml +++ b/examples/drools-process-usertasks-quarkus-example/pom.xml @@ -29,21 +29,12 @@ ${revision} ./node_modules/@kie-tools/maven-base/pom.xml + drools-process-usertasks-quarkus-example - Kie-Tools Example :: Process with Usertasks Quarkus - Kogito user tasks orchestration - Quarkus + ${revision} - - - - org.jbpm - jbpm-quarkus-devui-bom - ${project.version} - pom - import - - - + KIE Tools :: Example :: Process with Usertasks Quarkus + Kogito user tasks orchestration - Quarkus @@ -58,10 +49,6 @@ org.jbpm jbpm-with-drools-quarkus - - org.jbpm - jbpm-quarkus-devui - io.quarkus quarkus-smallrye-openapi @@ -89,13 +76,42 @@ kie-addons-quarkus-process-svg + + + + include-1st-party-dependencies + + + kieTools.do-not-use-this-property.ignore1stPartyDependencies + !true + + + + + + org.jbpm + jbpm-quarkus-devui-bom + ${project.version} + pom + import + + + + + + org.jbpm + jbpm-quarkus-devui + + + + + ${project.artifactId} - ${quarkus.platform.group-id} + io.quarkus quarkus-maven-plugin - ${quarkus-plugin.version} diff --git a/examples/jbpm-compact-architecture-example/install.js b/examples/jbpm-compact-architecture-example/install.js index 47e591480b5..fea906ae027 100644 --- a/examples/jbpm-compact-architecture-example/install.js +++ b/examples/jbpm-compact-architecture-example/install.js @@ -17,19 +17,20 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup, setPomProperty } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, setPomProperty, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.jbpmCompactArchitectureExample.version} +setupMavenConfigFile(` + -Drevision=${env.jbpmCompactArchitectureExample.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); setPomProperty({ key: "kogito.management-console.image", - value: buildEnv.env.jbpmCompactArchitectureExample.kogitoManagementConsoleImage, + value: env.jbpmCompactArchitectureExample.kogitoManagementConsoleImage, }); setPomProperty({ key: "kogito.task-console.image", - value: buildEnv.env.jbpmCompactArchitectureExample.kogitoTaskConsoleImage, + value: env.jbpmCompactArchitectureExample.kogitoTaskConsoleImage, }); diff --git a/examples/jbpm-compact-architecture-example/jbpm-compact-architecture-quarkus-example.iml b/examples/jbpm-compact-architecture-example/jbpm-compact-architecture-quarkus-example.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/examples/jbpm-compact-architecture-example/jbpm-compact-architecture-quarkus-example.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/jbpm-compact-architecture-example/package.json b/examples/jbpm-compact-architecture-example/package.json index c343328e50e..0798fce2a16 100644 --- a/examples/jbpm-compact-architecture-example/package.json +++ b/examples/jbpm-compact-architecture-example/package.json @@ -42,7 +42,6 @@ "devDependencies": { "@kie-tools/kogito-management-console": "workspace:*", "@kie-tools/kogito-task-console": "workspace:*", - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/examples/jbpm-compact-architecture-example/pom.xml b/examples/jbpm-compact-architecture-example/pom.xml index 10fb11ac96b..f335dd56525 100644 --- a/examples/jbpm-compact-architecture-example/pom.xml +++ b/examples/jbpm-compact-architecture-example/pom.xml @@ -31,7 +31,9 @@ jbpm-compact-architecture-quarkus-example - Kie-Tools Example :: jBPM Compact Architecture Quarkus Example + ${revision} + + KIE Tools :: Example :: jBPM Compact Architecture Quarkus Example org.kie - kogito-addons-quarkus-data-index-postgresql + kogito-addons-quarkus-data-index-jpa @@ -106,7 +108,7 @@ org.kie.kogito - jobs-service-postgresql-common + jobs-service-storage-jpa @@ -154,6 +156,10 @@ org.jbpm jbpm-quarkus-devui + + io.quarkus + quarkus-jdbc-h2 + @@ -162,9 +168,8 @@ ${project.artifactId} - ${quarkus.platform.group-id} + io.quarkus quarkus-maven-plugin - ${quarkus-plugin.version} diff --git a/examples/jbpm-compact-architecture-example/src/main/resources/application.properties b/examples/jbpm-compact-architecture-example/src/main/resources/application.properties index 895d72d580f..a26cd8c296d 100644 --- a/examples/jbpm-compact-architecture-example/src/main/resources/application.properties +++ b/examples/jbpm-compact-architecture-example/src/main/resources/application.properties @@ -18,20 +18,19 @@ kogito.jobs-service.url=http://0.0.0.0:8080 kogito.data-index.url=http://0.0.0.0:8080 # run create tables scripts -quarkus.flyway.migrate-at-start=true -quarkus.flyway.baseline-on-migrate=true -quarkus.flyway.baseline-version=0.0 -quarkus.flyway.locations=classpath:/db/migration,classpath:/db/jobs-service,classpath:/db/data-audit/postgresql -quarkus.flyway.table=FLYWAY_RUNTIME_SERVICE +kie.flyway.enabled=true kogito.persistence.type=jdbc +# Default application datasource properties quarkus.datasource.db-kind=postgresql -%prod.quarkus.datasource.username=kogito-user -%prod.quarkus.datasource.password=kogito-pass -%prod.quarkus.datasource.jdbc.url=${QUARKUS_DATASOURCE_JDBC_URL:jdbc:postgresql://0.0.0.0:5432/kogito} -%prod.quarkus.datasource.reactive.url=${QUARKUS_DATASOURCE_REACTIVE_URL:postgresql://0.0.0.0:5432/kogito} - -quarkus.native.native-image-xmx=8g +quarkus.datasource.username=kogito-user +quarkus.datasource.password=kogito-pass +quarkus.datasource.jdbc.url=${QUARKUS_DATASOURCE_JDBC_URL:jdbc:postgresql://0.0.0.0:5432/kogito} +quarkus.datasource.reactive.url=${QUARKUS_DATASOURCE_REACTIVE_URL:postgresql://0.0.0.0:5432/kogito} +# Development application datasource properties +%dev.quarkus.datasource.db-kind=h2 +%dev.quarkus.datasource.username=kogito +%dev.quarkus.datasource.jdbc.url=jdbc:h2:mem:default;NON_KEYWORDS=VALUE,KEY # profile to pack this example into a container, to use it execute activate the maven container profile, -Pcontainer %container.quarkus.container-image.build=true diff --git a/examples/sonataflow-greeting-quarkus-example/install.js b/examples/sonataflow-greeting-quarkus-example/install.js index 7230ea08fa9..74492cbf7ec 100644 --- a/examples/sonataflow-greeting-quarkus-example/install.js +++ b/examples/sonataflow-greeting-quarkus-example/install.js @@ -17,9 +17,10 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.sonataflowGreetingQuarkus.version} +setupMavenConfigFile(` + -Drevision=${env.sonataflowGreetingQuarkus.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/examples/sonataflow-greeting-quarkus-example/package.json b/examples/sonataflow-greeting-quarkus-example/package.json index 425d90edd4c..8bbc73a79cf 100644 --- a/examples/sonataflow-greeting-quarkus-example/package.json +++ b/examples/sonataflow-greeting-quarkus-example/package.json @@ -32,7 +32,6 @@ "@kie-tools/sonataflow-quarkus-devui": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/examples/sonataflow-greeting-quarkus-example/pom.xml b/examples/sonataflow-greeting-quarkus-example/pom.xml index 8b500cfc5a3..6dc457af1f4 100644 --- a/examples/sonataflow-greeting-quarkus-example/pom.xml +++ b/examples/sonataflow-greeting-quarkus-example/pom.xml @@ -35,21 +35,9 @@ sonataflow-greeting-quarkus-example ${revision} - KIE Tools Example :: SonataFlow Greeting :: Quarkus + KIE Tools :: Example :: SonataFlow Greeting :: Quarkus SonataFlow Example - Quarkus - - - - org.apache.kie.sonataflow - sonataflow-quarkus-devui-bom - ${project.version} - pom - import - - - - org.apache.kie.sonataflow @@ -67,10 +55,6 @@ io.quarkus quarkus-jsonp - - org.apache.kie.sonataflow - sonataflow-quarkus-devui - org.kie kie-addons-quarkus-source-files @@ -95,15 +79,13 @@ maven-compiler-plugin - ${compiler-plugin.version} ${maven.compiler.release} - ${quarkus.platform.group-id} + io.quarkus quarkus-maven-plugin - ${quarkus-plugin.version} @@ -114,7 +96,6 @@ maven-failsafe-plugin - ${version.failsafe.plugin} org.jboss.logmanager.LogManager @@ -133,6 +114,32 @@ + + include-1st-party-dependencies + + + kieTools.do-not-use-this-property.ignore1stPartyDependencies + !true + + + + + + org.apache.kie.sonataflow + sonataflow-quarkus-devui-bom + ${project.version} + pom + import + + + + + + org.apache.kie.sonataflow + sonataflow-quarkus-devui + + + container diff --git a/examples/sonataflow-greeting-quarkus-example/sonataflow-greeting-quarkus-example.iml b/examples/sonataflow-greeting-quarkus-example/sonataflow-greeting-quarkus-example.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/examples/sonataflow-greeting-quarkus-example/sonataflow-greeting-quarkus-example.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/todo-list-view-vscode-extension/webpack.config.js b/examples/todo-list-view-vscode-extension/webpack.config.js index a894e79f3d1..40755ee3aaf 100644 --- a/examples/todo-list-view-vscode-extension/webpack.config.js +++ b/examples/todo-list-view-vscode-extension/webpack.config.js @@ -21,8 +21,8 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { merge } = require("webpack-merge"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "VsCodePackSimpleReact", libraryTarget: "umd", @@ -33,15 +33,15 @@ const commonConfig = (env) => }, }); -module.exports = (env) => [ - merge(commonConfig(env), { +module.exports = (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { extension: "./src/extension.ts", }, plugins: [], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "envelope/index": "./src/envelope/index.ts", diff --git a/examples/uniforms-patternfly/webpack.config.js b/examples/uniforms-patternfly/webpack.config.js index 39c07801bb8..d9b22fcd1aa 100644 --- a/examples/uniforms-patternfly/webpack.config.js +++ b/examples/uniforms-patternfly/webpack.config.js @@ -23,10 +23,9 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { merge } = require("webpack-merge"); const { env } = require("./env"); -const buildEnv = env; -module.exports = (env) => [ - merge(common(env), { +module.exports = (webpackEnv) => [ + merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, @@ -45,7 +44,7 @@ module.exports = (env) => [ historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }, { directory: path.join(__dirname, "./static") }], compress: true, - port: buildEnv.exampleUniformsPatternflyPort.port, + port: env.exampleUniformsPatternflyPort.port, }, ignoreWarnings: [/Failed to parse source map/], }), diff --git a/examples/webapp/webpack.config.js b/examples/webapp/webpack.config.js index 0d146655c2b..0fbcd914a74 100644 --- a/examples/webapp/webpack.config.js +++ b/examples/webapp/webpack.config.js @@ -25,10 +25,9 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { merge } = require("webpack-merge"); const stunnerEditors = require("@kie-tools/stunner-editors"); const { env } = require("./env"); -const buildEnv = env; -module.exports = (env) => [ - merge(common(env), { +module.exports = (webpackEnv) => [ + merge(common(webpackEnv), { entry: { index: "./src/index.tsx", "envelope/base64-editor": "./src/envelope/base64-editor.ts", @@ -72,7 +71,7 @@ module.exports = (env) => [ historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }, { directory: path.join(__dirname, "./static") }], compress: true, - port: buildEnv.exampleWebapp.port, + port: env.exampleWebapp.port, }, ignoreWarnings: [/Failed to parse source map/], }), diff --git a/packages/boxed-expression-component/package.json b/packages/boxed-expression-component/package.json index a39d3184569..c298c340c1b 100644 --- a/packages/boxed-expression-component/package.json +++ b/packages/boxed-expression-component/package.json @@ -7,7 +7,7 @@ "scripts": { "build:dev": "rimraf dist && pnpm copy:css && tsc -p tsconfig.json", "build:prod": "rimraf dist && pnpm copy:css && pnpm lint && tsc -p tsconfig.json && pnpm test && pnpm test-e2e", - "build:storybook": "storybook build -o dist-storybook", + "build:storybook": "rimraf dist-storybook && NODE_ENV=development storybook build -o dist-storybook", "copy:css": "copyfiles -u 1 \"src/**/*.{sass,scss,css}\" dist/", "deploy": "gh-pages -d dist-dev", "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", diff --git a/packages/boxed-expression-component/playwright.config.ts b/packages/boxed-expression-component/playwright.config.ts index 5868527ee5c..cd6c4b9b826 100644 --- a/packages/boxed-expression-component/playwright.config.ts +++ b/packages/boxed-expression-component/playwright.config.ts @@ -20,9 +20,9 @@ import { defineConfig } from "@playwright/test"; import playwirghtBaseConfig from "@kie-tools/playwright-base/playwright.config"; import merge from "lodash/merge"; -import { env } from "./env"; -const buildEnv: any = env; +import { env } from "./env"; +const buildEnv: any = env; // build-env is not typed const customConfig = defineConfig({ use: { @@ -40,7 +40,7 @@ const customConfig = defineConfig({ toHaveScreenshot: { // An acceptable ratio of pixels that are different to the // total amount of pixels, between 0 and 1. - maxDiffPixelRatio: 0.001, + maxDiffPixelRatio: 0.1, }, }, }); diff --git a/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionExpression.tsx b/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionExpression.tsx index a7d5fa29bf2..0ed16bae669 100644 --- a/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionExpression.tsx +++ b/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionExpression.tsx @@ -156,7 +156,10 @@ export function useFunctionExpressionParametersColumnHeader( const expressionParametersContent = useMemo( () => ( -
+

{_.isEmpty(formalParameters) ? ( i18n.editParameters diff --git a/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionKindSelector.tsx b/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionKindSelector.tsx index 9d60253a627..a6df997e684 100644 --- a/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionKindSelector.tsx +++ b/packages/boxed-expression-component/src/expressions/FunctionExpression/FunctionKindSelector.tsx @@ -74,7 +74,11 @@ export const FunctionKindSelector: React.FunctionComponent

{_.first(selectedFunctionKind)}
, + () => ( +
+ {_.first(selectedFunctionKind)} +
+ ), [selectedFunctionKind] ); diff --git a/packages/boxed-expression-component/src/selection/BeeTableSelectionContext.tsx b/packages/boxed-expression-component/src/selection/BeeTableSelectionContext.tsx index 40c5c20afb6..56744e90f23 100644 --- a/packages/boxed-expression-component/src/selection/BeeTableSelectionContext.tsx +++ b/packages/boxed-expression-component/src/selection/BeeTableSelectionContext.tsx @@ -1019,6 +1019,10 @@ export function useBeeTableSelectableCell( const onMouseDown = useCallback( (e: React.MouseEvent) => { + if (document.activeElement instanceof HTMLInputElement) { + // See https://github.com/apache/incubator-kie-issues/issues/1158 + (document.activeElement as any)?.blur?.(); + } e.stopPropagation(); if ( diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png new file mode 100644 index 00000000000..55fbf6b8d2b Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png new file mode 100644 index 00000000000..1fb7974759a Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png new file mode 100644 index 00000000000..fc3d654f7d1 Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png new file mode 100644 index 00000000000..63a012c7aea Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/Google-Chrome/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png new file mode 100644 index 00000000000..55fbf6b8d2b Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png new file mode 100644 index 00000000000..1fb7974759a Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png new file mode 100644 index 00000000000..fc3d654f7d1 Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png new file mode 100644 index 00000000000..63a012c7aea Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/chromium/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png new file mode 100644 index 00000000000..0bb2f75e93b Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/boxed-decision-table-commit-annotation-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/decision-table-routing.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/decision-table-routing.png index 4e1f42129da..df828b88626 100644 Binary files a/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/decision-table-routing.png and b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/decisionTable/decision-table-routing.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png new file mode 100644 index 00000000000..b088277953b Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/every/boxed-every-commit-variable-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png new file mode 100644 index 00000000000..9d73f50749a Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/invocation/boxed-invocation-commit-function-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png new file mode 100644 index 00000000000..e080db5a145 Binary files /dev/null and b/packages/boxed-expression-component/tests-e2e/__screenshots__/webkit/boxedExpressions/some/boxed-some-commit-variable-by-cell-click.png differ diff --git a/packages/boxed-expression-component/tests-e2e/api/annotationCell.ts b/packages/boxed-expression-component/tests-e2e/api/annotationCell.ts new file mode 100644 index 00000000000..42b64c57370 --- /dev/null +++ b/packages/boxed-expression-component/tests-e2e/api/annotationCell.ts @@ -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. + */ + +import { Locator } from "@playwright/test"; +import { ContextMenu } from "./expressionContainer"; + +export class AnnotationCell { + constructor(private locator: Locator) {} + + public async open() { + await this.locator.nth(0).click(); + } + + public async getPopoverMenu() { + return this.locator.page().getByTestId("kie-tools--bee--expression-popover-menu"); + } + + public async setName(params: { name: string; close: boolean }) { + await this.locator.click(); + await this.locator.getByRole("textbox").fill(params.name); + if (params.close) { + await this.locator.getByRole("textbox").press("Enter"); + } + } + + public async getName() { + return await this.locator.getByTestId("kie-tools--bee--expression-info-name").nth(0).innerText(); + } + public async select() { + // Uses the 1,1 to avoid problems by clicking on the element corner + await this.content.click({ position: { x: 1, y: 1 } }); + } + + get content() { + return this.locator.nth(0); + } + + get contextMenu() { + return new ContextMenu(this.locator); + } +} diff --git a/packages/boxed-expression-component/tests-e2e/api/expressions/contextExpressionElement.ts b/packages/boxed-expression-component/tests-e2e/api/expressions/contextExpressionElement.ts index b6539eab88b..7e7b05f7e0a 100644 --- a/packages/boxed-expression-component/tests-e2e/api/expressions/contextExpressionElement.ts +++ b/packages/boxed-expression-component/tests-e2e/api/expressions/contextExpressionElement.ts @@ -21,6 +21,7 @@ import { Locator } from "@playwright/test"; import { Monaco } from "../../__fixtures__/monaco"; import { ChildExpression } from "../expressionContainer"; import { NameAndDataTypeCell } from "../nameAndDataTypeCell"; +import { NameAndDataTypeWithStandalonePopoverCell as VariableDescriptionCell } from "../nameAndDataTypeWithStandalonePopoverCell"; export class ContextExpressionElement { constructor( @@ -102,7 +103,7 @@ export class ContextExpressionEntry { } get variable() { - return new NameAndDataTypeCell(this.locator.getByRole("cell").nth(0)); + return new VariableDescriptionCell(this.locator.getByRole("cell").nth(0)); } public async getPopoverMenu() { diff --git a/packages/boxed-expression-component/tests-e2e/api/expressions/decisionTableExpressionElement.ts b/packages/boxed-expression-component/tests-e2e/api/expressions/decisionTableExpressionElement.ts index 2ce6a761d49..84f6438e1de 100644 --- a/packages/boxed-expression-component/tests-e2e/api/expressions/decisionTableExpressionElement.ts +++ b/packages/boxed-expression-component/tests-e2e/api/expressions/decisionTableExpressionElement.ts @@ -21,6 +21,7 @@ import { Locator } from "@playwright/test"; import { Monaco } from "../../__fixtures__/monaco"; import { ExpressionCell } from "../expressionContainer"; import { NameAndDataTypeCell } from "../nameAndDataTypeCell"; +import { AnnotationCell } from "../annotationCell"; export class DecisionTableExpressionElement { constructor( @@ -284,7 +285,7 @@ export class DecisionTableExpressionElement { } public annotationHeaderAt(index: number) { - return new NameAndDataTypeCell(this.locator.getByTestId("kie-tools--bee--table-header-annotation").nth(index)); + return new AnnotationCell(this.locator.getByTestId("kie-tools--bee--table-header-annotation").nth(index)); } get expressionHeaderCell() { diff --git a/packages/boxed-expression-component/tests-e2e/api/expressions/functionExpressionElement.ts b/packages/boxed-expression-component/tests-e2e/api/expressions/functionExpressionElement.ts index c5e6fe64004..9ee626c964d 100644 --- a/packages/boxed-expression-component/tests-e2e/api/expressions/functionExpressionElement.ts +++ b/packages/boxed-expression-component/tests-e2e/api/expressions/functionExpressionElement.ts @@ -20,6 +20,7 @@ import { Locator } from "@playwright/test"; import { Monaco } from "../../__fixtures__/monaco"; import { ChildExpression } from "../expressionContainer"; +import { FunctionTypeCell } from "../functionType"; export class FunctionExpressionElement { constructor( @@ -32,7 +33,49 @@ export class FunctionExpressionElement { await this.locator.getByRole("cell", { name: "1" }).nth(0).locator("svg").click(); } + public async addParameter(args: { name?: string; dataType?: string; closeAs?: "Escape" | "Click" }) { + // open parameters popover + await this.parameters.click(); + await this.locator.page().getByRole("button", { name: "Add parameter" }).click(); + if (args.name) { + await this.locator.page().getByPlaceholder("Parameter Name").last().fill(args.name); + + // WORKAROUND_DUE_TO "https://github.com/apache/incubator-kie-issues/issues/540", + await this.locator.page().keyboard.press("Tab"); + } + if (args.dataType) { + await this.locator.page().getByLabel("").last().click(); + await this.locator.page().getByRole("option", { name: args.dataType }).click(); + } + + // close parameters popover + if (args.closeAs === "Escape") { + await this.locator.page().keyboard.press("Escape"); + } else { + await this.parameters.click(); + } + } + + public async deleteParameter(args: { nth: number }) { + // open parameters popover + await this.parameters.click(); + + // delete parameter + await this.locator.page().getByRole("button", { name: "", exact: true }).nth(args.nth).click(); + + // close parameters popover + await this.parameters.click(); + } + public entry(index: number) { return new ChildExpression(this.locator.getByTestId(`kie-tools--bee--expression-row-${index}`).nth(0), this.monaco); } + + get functionType() { + return new FunctionTypeCell(this.locator.getByTestId("kie-tools--bee--selected-function-kind")); + } + + get parameters() { + return this.locator.getByTestId("kie-tools--bee--parameters-list"); + } } diff --git a/packages/boxed-expression-component/tests-e2e/api/expressions/invocationExpressionElement.ts b/packages/boxed-expression-component/tests-e2e/api/expressions/invocationExpressionElement.ts index 4e52faeca56..3ecf8c99679 100644 --- a/packages/boxed-expression-component/tests-e2e/api/expressions/invocationExpressionElement.ts +++ b/packages/boxed-expression-component/tests-e2e/api/expressions/invocationExpressionElement.ts @@ -21,6 +21,7 @@ import { Locator } from "@playwright/test"; import { Monaco } from "../../__fixtures__/monaco"; import { ChildExpression } from "../expressionContainer"; import { NameAndDataTypeCell } from "../nameAndDataTypeCell"; +import { NameAndDataTypeWithStandalonePopoverCell as ParameterDescriptionCell } from "../nameAndDataTypeWithStandalonePopoverCell"; export class InvocationExpressionElement { constructor( @@ -102,7 +103,7 @@ class InvocationParameter { } get descriptionCell() { - return new NameAndDataTypeCell(this.locator.getByTestId(`kie-tools--bee--expression-column-1`).nth(0)); + return new ParameterDescriptionCell(this.locator.getByTestId(`kie-tools--bee--expression-column-1`).nth(0)); } get elementCell() { diff --git a/packages/form-generation-tool/src/generation/fs/checks.ts b/packages/boxed-expression-component/tests-e2e/api/functionType.ts similarity index 50% rename from packages/form-generation-tool/src/generation/fs/checks.ts rename to packages/boxed-expression-component/tests-e2e/api/functionType.ts index 5c369d36723..cc290fd16e7 100644 --- a/packages/form-generation-tool/src/generation/fs/checks.ts +++ b/packages/boxed-expression-component/tests-e2e/api/functionType.ts @@ -17,29 +17,34 @@ * under the License. */ -import fs from "fs"; -import path from "path"; -import { ERROR_INVALID_FOLDER, ERROR_NOT_DIRECTORY, ERROR_NOT_MVN_PROJECT } from "./loadProjectSchemas"; -import { FORM_STORAGE_FOLDER } from "./storeFormAsset"; - -export function checkKogitoProjectStructure(projectPath: string) { - if (!fs.existsSync(projectPath)) { - throw new Error(ERROR_INVALID_FOLDER); +import { Locator } from "@playwright/test"; +import { ContextMenu } from "./expressionContainer"; + +export class FunctionTypeCell { + constructor(private locator: Locator) {} + + public async open() { + await this.locator.nth(0).click(); } - const sourceStat = fs.statSync(projectPath); + public async getPopoverMenu() { + return this.locator.page().getByTestId("kie-tools--bee--expression-popover-menu"); + } - if (!sourceStat.isDirectory()) { - throw new Error(ERROR_NOT_DIRECTORY); + public async setType(args: { type: "FEEL" | "Java" | "PMML" }) { + await this.locator.page().getByTestId("kie-tools--bee--expression-popover-menu").getByText(args.type).click(); } - if (!fs.existsSync(`${projectPath}/pom.xml`)) { - throw new Error(ERROR_NOT_MVN_PROJECT); + public async select() { + // Uses the 1,1 to avoid problems by clicking on the element corner + await this.content.click({ position: { x: 1, y: 1 } }); } -} -export function checkKogitoProjectHasForms(projectPath: string) { - const formsPath = path.join(projectPath, FORM_STORAGE_FOLDER); + get content() { + return this.locator.nth(0); + } - return fs.existsSync(formsPath); + get contextMenu() { + return new ContextMenu(this.locator); + } } diff --git a/packages/boxed-expression-component/tests-e2e/api/nameAndDataTypeWithStandalonePopoverCell.ts b/packages/boxed-expression-component/tests-e2e/api/nameAndDataTypeWithStandalonePopoverCell.ts new file mode 100644 index 00000000000..6ecbc2d12fe --- /dev/null +++ b/packages/boxed-expression-component/tests-e2e/api/nameAndDataTypeWithStandalonePopoverCell.ts @@ -0,0 +1,74 @@ +/* + * 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. + */ + +import { Locator } from "@playwright/test"; +import { ContextMenu } from "./expressionContainer"; + +export class NameAndDataTypeWithStandalonePopoverCell { + constructor(private locator: Locator) {} + + public async open() { + await this.locator.nth(0).click(); + } + + public async getPopoverMenu() { + return this.locator.page().getByTestId("kie-tools--bee--expression-popover-menu"); + } + + public async setName({ name, commit = false }: { name: string; commit?: boolean }) { + await (await this.getPopoverMenu()).getByRole("textbox").fill(name); + if (commit) { + await (await this.getPopoverMenu()).getByRole("textbox").press("Enter"); + } + } + + public async setDataType({ dataType, commit = false }: { dataType: string; commit?: boolean }) { + const popoverMenu = await this.getPopoverMenu(); + await popoverMenu.getByTestId("kie-tools--bee--edit-expression-data-type").click(); + await popoverMenu.getByPlaceholder("Choose...").nth(0).fill(dataType); + await popoverMenu.getByRole("group").nth(0).getByRole("option").nth(0).click(); + if (commit) { + await popoverMenu.page().keyboard.press("Enter"); + } + } + + public async getName() { + return await (await this.getPopoverMenu()).getByTestId("kie-tools--bee--expression-info-name").nth(0).innerText(); + } + + public async getDataType() { + return await (await this.getPopoverMenu()) + .getByTestId("kie-tools--bee--expression-info-data-type") + .nth(0) + .innerText(); + } + + public async select() { + // Uses the 1,1 to avoid problems by clicking on the element corner + await this.content.click({ position: { x: 1, y: 1 } }); + } + + get content() { + return this.locator.nth(0); + } + + get contextMenu() { + return new ContextMenu(this.locator); + } +} diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/context/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/context/populate.spec.ts index 57c1359304d..42c7ce77b89 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/context/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/context/populate.spec.ts @@ -21,51 +21,54 @@ import { expect, test } from "../../__fixtures__/base"; import { TestAnnotations } from "@kie-tools/playwright-base/annotations"; test.describe("Populate Boxed Context", () => { - test("should correctly create pre-bureau risk category boxed context", async ({ - page, - stories, - bee, - resizing, - monaco, - }) => { + test("should correctly create pre-bureau risk category boxed context", async ({ page, stories, bee, resizing }) => { await stories.openBoxedContext(); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Pre-bureau risk category calculation"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asContext().expressionHeaderCell.open(); + await bee.expression + .asContext() + .expressionHeaderCell.setName({ name: "Pre-bureau risk category calculation", close: false }); + await bee.expression.asContext().expressionHeaderCell.setDataType({ dataType: "number", close: true }); await bee.expression.asContext().entry(0).selectExpressionMenu.selectLiteral(); - await page.getByRole("cell", { name: "ContextEntry-1 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Existing Customer"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); - await monaco.fill({ monacoParentLocator: page, content: "Applicant data.ExistingCustomer" }); + await bee.expression.asContext().entry(0).variable.open(); + await bee.expression.asContext().entry(0).variable.setName({ name: "Existing Customer" }); + await bee.expression.asContext().entry(0).variable.setDataType({ dataType: "boolean", commit: true }); + await bee.expression.asContext().entry(0).expression.asLiteral().fill("Applicant data.ExistingCustomer"); await bee.expression.asContext().result.selectExpressionMenu.selectDecisionTable(); - await page.getByRole("columnheader", { name: "input-1 ()" }).hover({ position: { x: 0, y: 0 } }); - await page.getByRole("columnheader", { name: "input-1 ()" }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).hover(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); + await bee.expression.asContext().result.expression.asDecisionTable().addInputAtEnd(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); + await bee.expression.asContext().result.expression.asDecisionTable().addRowAtTop(); - await page.getByRole("columnheader", { name: "input-2 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Existing customer"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); - await page.getByRole("columnheader", { name: "input-1 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Application risk score"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asContext().result.expression.asDecisionTable().inputHeaderAt(0).open(); + await bee.expression + .asContext() + .result.expression.asDecisionTable() + .inputHeaderAt(0) + .setName({ name: "Existing customer", close: false }); + await bee.expression + .asContext() + .result.expression.asDecisionTable() + .inputHeaderAt(0) + .setDataType({ dataType: "boolean", close: true }); + + await bee.expression.asContext().result.expression.asDecisionTable().inputHeaderAt(1).open(); + await bee.expression + .asContext() + .result.expression.asDecisionTable() + .inputHeaderAt(1) + .setName({ name: "Application risk score", close: false }); + await bee.expression + .asContext() + .result.expression.asDecisionTable() + .inputHeaderAt(1) + .setDataType({ dataType: "number", close: true }); await bee.expression.asDecisionTable().fill({ startAtCell: 1, diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/decisionTableExpression.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/decisionTableExpression.spec.ts index 5fde3fce110..8d2b4bded27 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/decisionTableExpression.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/decisionTableExpression.spec.ts @@ -17,6 +17,7 @@ * under the License. */ +import { TestAnnotations } from "@kie-tools/playwright-base/annotations"; import { expect, test } from "../../__fixtures__/base"; test.describe("Create Decision table", () => { @@ -112,4 +113,21 @@ test.describe("Create Decision table", () => { } }); }); + + test("should commit annotation by cell click", async ({ bee }) => { + test.info().annotations.push({ + type: TestAnnotations.REGRESSION, + description: "https://github.com/apache/incubator-kie-issues/issues/1158", + }); + + await bee.expression + .asDecisionTable() + .annotationHeaderAt(0) + .setName({ name: "Changed Annotation Name", close: false }); + + // commit a change by a click to another cell + await bee.expression.asDecisionTable().cellAt({ row: 1, column: 1 }).content.click(); + + await expect(bee.getContainer()).toHaveScreenshot("boxed-decision-table-commit-annotation-by-cell-click.png"); + }); }); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/populate.spec.ts index b437c9a8816..966d6bf8c35 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/decisionTable/populate.spec.ts @@ -24,47 +24,39 @@ test.describe("Populate Decision table", () => { test("should correctly create a routing decision table", async ({ stories, page, bee, resizing }) => { await stories.openDecisionTable(); - await page.getByRole("columnheader", { name: "input-1 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Post-bureau risk category"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "string" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asDecisionTable().inputHeaderAt(0).open(); + await bee.expression + .asDecisionTable() + .inputHeaderAt(0) + .setName({ name: "Post-bureau risk category", close: false }); + await bee.expression.asDecisionTable().inputHeaderAt(0).setDataType({ dataType: "string", close: true }); await resizing.reset(page.getByRole("columnheader", { name: "Post-bureau risk category (string)" })); - await page - .getByRole("columnheader", { name: "Post-bureau risk category (string)" }) - .hover({ position: { x: 0, y: 0 } }); - await page.getByRole("row", { name: "Post-bureau risk category (string)" }).locator("svg").click(); + await bee.expression.asDecisionTable().addInputAtStart(); - await page.getByRole("columnheader", { name: "input-2 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Post-bureau affordability"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asDecisionTable().inputHeaderAt(0).open(); + await bee.expression + .asDecisionTable() + .inputHeaderAt(0) + .setName({ name: "Post-bureau affordability", close: false }); + await bee.expression.asDecisionTable().inputHeaderAt(0).setDataType({ dataType: "boolean", close: true }); await resizing.reset(page.getByRole("columnheader", { name: "Post-bureau affordability (boolean)" })); - await page - .getByRole("columnheader", { name: "Post-bureau affordability (boolean)" }) - .hover({ position: { x: 0, y: 0 } }); - await page.getByRole("row", { name: "Post-bureau affordability (boolean)" }).locator("svg").click(); + await bee.expression.asDecisionTable().addInputAtStart(); - await page.getByRole("columnheader", { name: "input-3 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Credit Score"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); - await page.getByRole("columnheader", { name: "Credit Score (number)" }).hover({ position: { x: 0, y: 0 } }); - await page.getByRole("row", { name: "Credit Score (number)" }).locator("svg").click(); + await bee.expression.asDecisionTable().inputHeaderAt(0).open(); + await bee.expression.asDecisionTable().inputHeaderAt(0).setName({ name: "Credit Score", close: false }); + await bee.expression.asDecisionTable().inputHeaderAt(0).setDataType({ dataType: "number", close: true }); + await resizing.reset(page.getByRole("columnheader", { name: "Credit Score (number)" })); + await bee.expression.asDecisionTable().addInputAtStart(); - await page.getByRole("columnheader", { name: "input-4 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Bankrupt"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asDecisionTable().inputHeaderAt(0).open(); + await bee.expression.asDecisionTable().inputHeaderAt(0).setName({ name: "Bankrupt", close: false }); + await bee.expression.asDecisionTable().inputHeaderAt(0).setDataType({ dataType: "boolean", close: true }); + await resizing.reset(page.getByRole("columnheader", { name: "Bankrupt (boolean)" })); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Routing"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "string" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asDecisionTable().outputHeaderAt(0).open(); + await bee.expression.asDecisionTable().outputHeaderAt(0).setName({ name: "Routing", close: false }); + await bee.expression.asDecisionTable().outputHeaderAt(0).setDataType({ dataType: "string", close: true }); + await resizing.reset(page.getByRole("columnheader", { name: "Routing (string)" })); test.info().annotations.push({ type: TestAnnotations.WORKAROUND_DUE_TO, @@ -81,11 +73,10 @@ test.describe("Populate Decision table", () => { await page.getByRole("columnheader", { name: "Bankrupt (boolean)" }).hover({ position: { x: 0, y: 0 } }); await page.getByRole("columnheader", { name: "Routing (string)" }).hover({ position: { x: 0, y: 0 } }); - await page.getByRole("cell", { name: "1" }).hover(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); + await bee.expression.asDecisionTable().addRowAtBottomOfIndex(1); + await bee.expression.asDecisionTable().addRowAtBottomOfIndex(2); + await bee.expression.asDecisionTable().addRowAtBottomOfIndex(3); + await bee.expression.asDecisionTable().addRowAtBottomOfIndex(4); await bee.expression.asDecisionTable().fill({ startAtCell: 0, diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/every/everyExpression.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/every/everyExpression.spec.ts index bf02d48d7cb..7ee73a8b847 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/every/everyExpression.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/every/everyExpression.spec.ts @@ -45,4 +45,18 @@ test.describe("Create Boxed Every", () => { expect((await jsonModel.getEveryExpression()).in["@_id"]).not.toBeUndefined(); expect((await jsonModel.getEveryExpression()).satisfies["@_id"]).not.toBeUndefined(); }); + + test("should commit variable by cell click", async ({ bee }) => { + test.info().annotations.push({ + type: TestAnnotations.REGRESSION, + description: "https://github.com/apache/incubator-kie-issues/issues/1158", + }); + + await bee.expression.asEvery().variable.fill("Changed Variable Name"); + + // commit a change by a click to another cell + await bee.expression.asEvery().in.elementCell.click(); + + await expect(bee.getContainer()).toHaveScreenshot("boxed-every-commit-variable-by-cell-click.png"); + }); }); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/filterExpression.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/filterExpression.spec.ts index 0490d1ef39a..2c0ce70f4d4 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/filterExpression.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/filterExpression.spec.ts @@ -21,23 +21,20 @@ import { expect, test } from "../../__fixtures__/base"; import { TestAnnotations } from "@kie-tools/playwright-base/annotations"; test.describe("Create Boxed Filter", () => { - test("should rename a filter", async ({ page, stories }) => { + test("should rename a filter", async ({ bee, page, stories }) => { await stories.openBoxedFilter("base"); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Filter Expression Name"); - await page.keyboard.press("Enter"); + await bee.expression.asFilter().expressionHeaderCell.open(); + await bee.expression.asFilter().expressionHeaderCell.setName({ name: "Filter Expression Name", close: true }); await expect(page.getByRole("columnheader", { name: "Filter Expression Name ()" })).toBeVisible(); }); - test("should change a filter data type", async ({ page, stories }) => { + test("should change a filter data type", async ({ bee, page, stories }) => { await stories.openBoxedFilter("base"); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asFilter().expressionHeaderCell.open(); + await bee.expression.asFilter().expressionHeaderCell.setDataType({ dataType: "boolean", close: true }); await expect(page.getByRole("columnheader", { name: "Expression Name (boolean)" })).toBeVisible(); }); @@ -117,8 +114,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Context Expression", async ({ bee, - page, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -133,8 +128,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Decision Table", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -149,8 +142,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - List", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -165,8 +156,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Invocation", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -181,8 +170,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Function", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -197,8 +184,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Conditional", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -213,8 +198,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - For", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -229,8 +212,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Every", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -245,8 +226,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Some", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, @@ -261,8 +240,6 @@ test.describe("Create Boxed Filter", () => { test("should correctly fill the 'in' cell when the 'match' cell is larger than the 'in' cell - Filter", async ({ bee, - jsonModel, - stories, }) => { test.info().annotations.push({ type: TestAnnotations.REGRESSION, diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/populate.spec.ts index b957939644f..32a5cc7b79c 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/filter/populate.spec.ts @@ -20,13 +20,12 @@ import { test, expect } from "../../__fixtures__/base"; test.describe("Populate Boxed Filter", () => { - test("should correctly create a Rebooked Flights filter", async ({ stories, page, bee }) => { + test("should correctly create a Rebooked Flights filter", async ({ stories, bee }) => { await stories.openBoxedFilter("base"); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Rebooked Flights"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "Any" }).click(); - await page.keyboard.press("Enter"); + + await bee.expression.asFilter().expressionHeaderCell.open(); + await bee.expression.asFilter().expressionHeaderCell.setName({ name: "Rebooked Flights", close: false }); + await bee.expression.asFilter().expressionHeaderCell.setDataType({ dataType: "Any", close: true }); // Prepare empty Filter 'in' and 'match' cells await bee.expression.asFilter().in.selectExpressionMenu.selectLiteral(); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/functionExpression.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/functionExpression.spec.ts index ae799d2ee72..14ec119105e 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/functionExpression.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/functionExpression.spec.ts @@ -26,8 +26,8 @@ test.describe("Create Boxed Function", () => { test("should render FEEL function expression correctly", async ({ bee, page }) => { await expect(page.getByRole("columnheader", { name: "Expression Name ()" })).toBeAttached(); - await expect(page.getByRole("columnheader", { name: "F", exact: true })).toBeAttached(); - await expect(page.getByRole("columnheader", { name: "Edit parameters" })).toBeAttached(); + await expect(await bee.expression.asFunction().functionType.content.textContent()).toEqual("F"); + await expect(await bee.expression.asFunction().parameters.textContent()).toEqual("Edit parameters"); await expect(page.getByText("Select expression")).toHaveCount(1); await expect(page.getByRole("columnheader")).toHaveCount(3); await expect(page.getByRole("cell")).toHaveCount(2); @@ -35,13 +35,13 @@ test.describe("Create Boxed Function", () => { }); test("should render Java function expression correctly", async ({ bee, page }) => { - await page.getByRole("columnheader", { name: "F", exact: true }).click(); - await page.getByRole("menuitem", { name: "Java" }).click(); + await bee.expression.asFunction().functionType.open(); + await bee.expression.asFunction().functionType.setType({ type: "Java" }); await expect(bee.getContainer()).toHaveScreenshot("boxed-java-function.png"); - await expect(page.getByRole("columnheader", { name: "J", exact: true })).toBeAttached(); + await expect(await bee.expression.asFunction().functionType.content.textContent()).toEqual("J"); // the "onmouseenter" events triggers if the mouse was outside of the element before it appears on screen. - await page.getByRole("columnheader", { name: "J", exact: true }).hover(); + await bee.expression.asFunction().functionType.content.hover(); await page.getByText("Class name(string)").hover(); await expect(page.getByRole("cell", { name: "Class name (string)" }).locator("svg")).toBeAttached(); await page.getByText("Method signature(string)").hover(); @@ -53,8 +53,8 @@ test.describe("Create Boxed Function", () => { }); test("should render PMML function expression correctly", async ({ bee, page }) => { - await page.getByRole("columnheader", { name: "F", exact: true }).click(); - await page.getByRole("menuitem", { name: "PMML" }).click(); + await bee.expression.asFunction().functionType.open(); + await bee.expression.asFunction().functionType.setType({ type: "PMML" }); await expect(bee.getContainer()).toHaveScreenshot("boxed-pmml-function.png"); await expect(page.getByRole("columnheader", { name: "P", exact: true })).toBeAttached(); @@ -88,8 +88,8 @@ test.describe("Create Boxed Function", () => { }); test.describe("Change function type", () => { - test.beforeEach(async ({ page }) => { - await page.getByRole("columnheader", { name: "F", exact: true }).click(); + test.beforeEach(async ({ bee }) => { + await bee.expression.asFunction().functionType.open(); }); const functioTypes = [ @@ -99,37 +99,24 @@ test.describe("Create Boxed Function", () => { ]; for (const [functionName, abbreviation] of functioTypes) { - test(`should change function type to ${functionName}`, async ({ page }) => { + test(`should change function type to ${functionName}`, async ({ bee, page }) => { await page.getByRole("menuitem", { name: functionName }).hover(); await expect(page.getByLabel(`${functionName}-help`)).toBeAttached(); - await page.getByRole("menuitem", { name: functionName }).click(); + await bee.expression.asFunction().functionType.setType({ type: functionName as "FEEL" | "Java" | "PMML" }); await expect(page.getByRole("columnheader", { name: abbreviation, exact: true })).toBeAttached(); }); } }); - test("should edit function parameters", async ({ page }) => { - await page.getByRole("columnheader", { name: "Edit parameters" }).click(); - await expect(page.getByRole("button", { name: "Add parameter" })).toBeAttached(); - - await page.getByRole("button", { name: "Add parameter" }).click(); - await expect(page.getByRole("button", { name: "Add parameter" })).toBeAttached(); - await expect(page.getByRole("columnheader", { name: "(p-1: ())" })).toBeAttached(); - - await page.getByRole("textbox").click(); - await page.getByRole("textbox").press("Control+a"); - await page.getByRole("textbox").fill("test"); - await page.getByRole("textbox").press("Tab"); - - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await expect(page.getByRole("columnheader", { name: "(test: (boolean))" })).toBeAttached(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await expect(page.getByRole("columnheader", { name: "(test: (boolean), p-2: ())" })).toBeAttached(); - await page.getByLabel("", { exact: true }).getByRole("button").nth(2).click(); - await expect(page.getByRole("columnheader", { name: "(p-2: ())" })).toBeAttached(); - - await page.getByLabel("", { exact: true }).getByRole("button").nth(2).click(); - await expect(page.getByRole("columnheader", { name: "Edit parameters" })).toBeAttached(); + test("should edit function parameters", async ({ bee }) => { + await bee.expression.asFunction().addParameter({ name: "test", dataType: "boolean" }); + await bee.expression.asFunction().addParameter({}); + + expect(await bee.expression.asFunction().parameters.textContent()).toEqual("(test: (boolean), p-2: ())"); + + await bee.expression.asFunction().deleteParameter({ nth: 1 }); + await bee.expression.asFunction().deleteParameter({ nth: 0 }); + + expect(await bee.expression.asFunction().parameters.textContent()).toEqual("Edit parameters"); }); }); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/parameters.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/parameters.spec.ts index a28077082cc..ab1689f476e 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/parameters.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/parameters.spec.ts @@ -18,87 +18,37 @@ */ import { test, expect } from "../../__fixtures__/base"; -import { TestAnnotations } from "@kie-tools/playwright-base/annotations"; test.describe("Boxed Function parameters", () => { - test("should add a function parameter and change its name and type", async ({ stories, page }) => { + test("should add a function parameter and change its name and type", async ({ bee, stories }) => { await stories.openBoxedFunction(); - await page.getByRole("columnheader", { name: "Edit parameters" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter Name").fill("name"); + await bee.expression.asFunction().addParameter({ name: "name", dataType: "string", closeAs: "Escape" }); - test.info().annotations.push({ - type: TestAnnotations.WORKAROUND_DUE_TO, - description: "https://github.com/apache/incubator-kie-issues/issues/540", - }); - await page.keyboard.press("Tab"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "string" }).click(); - await page.keyboard.press("Escape"); - - await expect(page.getByRole("columnheader", { name: "(name: (string))" })).toBeAttached(); + expect(await bee.expression.asFunction().parameters.textContent()).toEqual("(name: (string))"); }); - test("should multiple function parameter and change its name and type", async ({ stories, page }) => { + test("should multiple function parameter and change its name and type", async ({ bee, stories }) => { await stories.openBoxedFunction(); - await page.getByRole("columnheader", { name: "Edit parameters" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - test.info().annotations.push({ - type: TestAnnotations.WORKAROUND_DUE_TO, - description: "https://github.com/apache/incubator-kie-issues/issues/540", - }); - // WORKAROUD: TAB EVENT - await page.getByPlaceholder("Parameter Name").nth(0).fill("name"); - await page.keyboard.press("Tab"); - await page.getByPlaceholder("Parameter Name").nth(1).fill("age"); - await page.keyboard.press("Tab"); - await page.getByPlaceholder("Parameter Name").nth(2).fill("maried"); - await page.keyboard.press("Tab"); - - await page.getByRole("button", { name: "options menu" }).nth(0).click(); - await page.getByRole("option", { name: "string" }).click(); - await page.getByRole("button", { name: "options menu" }).nth(1).click(); - await page.getByRole("option", { name: "number" }).click(); - await page.getByRole("button", { name: "options menu" }).nth(2).click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Escape"); + await bee.expression.asFunction().addParameter({ name: "name", dataType: "string" }); + await bee.expression.asFunction().addParameter({ name: "age", dataType: "number" }); + await bee.expression.asFunction().addParameter({ name: "maried", dataType: "boolean" }); - await expect( - page.getByRole("columnheader", { name: "(name: (string), age: (number), maried: (boolean))" }) - ).toBeAttached(); + expect(await bee.expression.asFunction().parameters.textContent()).toEqual( + "(name: (string), age: (number), maried: (boolean))" + ); }); - test("should add function parameters and delete them", async ({ stories, page }) => { + test("should add function parameters and delete them", async ({ bee, stories }) => { await stories.openBoxedFunction(); - await page.getByRole("columnheader", { name: "Edit parameters" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter Name").nth(0).fill("name"); - test.info().annotations.push({ - type: TestAnnotations.WORKAROUND_DUE_TO, - description: "https://github.com/apache/incubator-kie-issues/issues/540", - }); - // WORKAROUD: TAB EVENT - await page.keyboard.press("Tab"); - await page.getByPlaceholder("Parameter Name").nth(1).fill("age"); - await page.keyboard.press("Tab"); - await page.getByPlaceholder("Parameter Name").nth(2).fill("maried"); - await page.keyboard.press("Tab"); - await page.getByRole("button", { name: "options menu" }).nth(0).click(); - await page.getByRole("option", { name: "string" }).click(); - await page.getByRole("button", { name: "options menu" }).nth(1).click(); - await page.getByRole("option", { name: "number" }).click(); - await page.getByRole("button", { name: "options menu" }).nth(2).click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.getByRole("button", { name: "", exact: true }).nth(0).click(); - await page.keyboard.press("Escape"); + await bee.expression.asFunction().addParameter({ name: "name", dataType: "string" }); + await bee.expression.asFunction().addParameter({ name: "age", dataType: "number" }); + await bee.expression.asFunction().addParameter({ name: "maried", dataType: "boolean" }); + + await bee.expression.asFunction().deleteParameter({ nth: 0 }); - await expect(page.getByRole("columnheader", { name: "(age: (number), maried: (boolean))" })).toBeAttached(); + expect(await bee.expression.asFunction().parameters.textContent()).toEqual("(age: (number), maried: (boolean))"); }); }); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/populate.spec.ts index 07649f2f730..ed995046508 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/function/populate.spec.ts @@ -30,58 +30,41 @@ test.describe("Populate Boxed Function", () => { await page.getByRole("option", { name: "boolean" }).click(); await page.keyboard.press("Enter"); - await page.getByText("Edit parameters").click(); - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter name").nth(0).click(); - await page.getByPlaceholder("Parameter name").nth(0).fill("Monthly Income"); - await page.keyboard.press("Tab"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter name").nth(1).click(); - await page.getByPlaceholder("Parameter name").nth(1).fill("Monthly Repayments"); - await page.keyboard.press("Tab"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter name").nth(2).click(); - await page.getByPlaceholder("Parameter name").nth(2).fill("Monthly Expenses"); - await page.keyboard.press("Tab"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter name").nth(3).click(); - await page.getByPlaceholder("Parameter name").nth(3).fill("Risk Category"); - await page.keyboard.press("Tab"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "string" }).click(); - - await page.getByRole("button", { name: "Add parameter" }).click(); - await page.getByPlaceholder("Parameter name").nth(4).click(); - await page.getByPlaceholder("Parameter name").nth(4).fill("Required Monthly Income"); - await page.keyboard.press("Tab"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Escape"); + await bee.expression.asFunction().addParameter({ name: "Monthly Income", dataType: "number" }); + await bee.expression.asFunction().addParameter({ name: "Monthly Repayments", dataType: "number" }); + await bee.expression.asFunction().addParameter({ name: "Monthly Expenses", dataType: "number" }); + await bee.expression.asFunction().addParameter({ name: "Risk Category", dataType: "string" }); + await bee.expression.asFunction().addParameter({ name: "Required Monthly Income", dataType: "number" }); await bee.expression.asFunction().entry(0).selectExpressionMenu.selectContext(); - await page.getByRole("cell", { name: "ContextEntry-1 ()", exact: true }).hover(); - await page.getByRole("cell", { name: "ContextEntry-1 ()", exact: true }).locator("svg").click(); - - await page.getByRole("cell", { name: "ContextEntry-1 ()", exact: true }).click(); - await page.getByPlaceholder("Expression Name").fill("Disposable income"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asFunction().entry(0).expression.asContext().addEntryBelowOfEntryAtIndex(0); + await bee.expression.asFunction().entry(0).expression.asContext().entry(0).variable.open(); + await bee.expression + .asFunction() + .entry(0) + .expression.asContext() + .entry(0) + .variable.setName({ name: "Disposable income" }); + await bee.expression + .asFunction() + .entry(0) + .expression.asContext() + .entry(0) + .variable.setDataType({ dataType: "number", commit: true }); - await page.getByRole("cell", { name: "ContextEntry-2 ()", exact: true }).click(); - await page.getByPlaceholder("Expression Name").fill("Credit contingency factor"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asFunction().entry(0).expression.asContext().entry(1).variable.open(); + await bee.expression + .asFunction() + .entry(0) + .expression.asContext() + .entry(1) + .variable.setName({ name: "Credit contingency factor" }); + await bee.expression + .asFunction() + .entry(0) + .expression.asContext() + .entry(1) + .variable.setDataType({ dataType: "number", commit: true }); await resizing.reset(page.getByRole("cell", { name: "Credit contingency factor (number)", exact: true })); @@ -99,9 +82,21 @@ test.describe("Populate Boxed Function", () => { content: "Monthly Income - (Monthly Repayments + Monthly Expenses)", }); - await page.getByRole("cell", { name: "1", exact: true }).nth(1).hover(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); - await page.getByRole("cell", { name: "1", exact: true }).locator("svg").click(); + await bee.expression + .asFunction() + .entry(0) + .expression.asContext() + .entry(1) + .expression.asDecisionTable() + .addRowAtBottomOfIndex(1); + + await bee.expression + .asFunction() + .entry(0) + .expression.asContext() + .entry(1) + .expression.asDecisionTable() + .addRowAtBottomOfIndex(1); await page.getByRole("columnheader", { name: "input-1 ()" }).click(); await page.getByPlaceholder("Expression Name").fill("Risk category"); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/invocationExpression.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/invocationExpression.spec.ts index 4f4f29acc14..9e257dcb175 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/invocationExpression.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/invocationExpression.spec.ts @@ -17,17 +17,37 @@ * under the License. */ +import { TestAnnotations } from "@kie-tools/playwright-base/annotations"; import { test, expect } from "../../__fixtures__/base"; test.describe("Create Boxed Invocation", () => { test("should render expression correctly", async ({ bee, stories, page }) => { await stories.openBoxedInvocation(); - await expect(page.getByRole("columnheader", { name: "Expression Name ()" })).toBeAttached(); - await expect(page.getByRole("columnheader", { name: "FUNCTION" })).toBeAttached(); + expect(await bee.expression.asInvocation().expressionHeaderCell.getName()).toEqual("Expression Name"); + expect(await bee.expression.asInvocation().expressionHeaderCell.getDataType()).toEqual("()"); + await expect(bee.expression.asInvocation().invokedFunctionNameCell).toBeAttached(); await expect(page.getByRole("cell", { name: "p-1" })).toBeAttached(); await expect(page.getByText("Select expression")).toHaveCount(1); await expect(page.getByRole("columnheader")).toHaveCount(2); await expect(page.getByRole("cell")).toHaveCount(2); await expect(bee.getContainer()).toHaveScreenshot("boxed-invocation.png"); }); + + test("should commit invoked function by cell click", async ({ bee, stories, page }) => { + test.info().annotations.push({ + type: TestAnnotations.REGRESSION, + description: "https://github.com/apache/incubator-kie-issues/issues/1158", + }); + + await stories.openBoxedInvocation(); + + // click to start editing and type new value + await bee.expression.asInvocation().invokedFunctionNameCell.click(); + await page.keyboard.type("Changed Invoked Function Name"); + + // commit a change by a click to another cell + await bee.expression.asInvocation().parameter(0).descriptionCell.select(); + + await expect(bee.getContainer()).toHaveScreenshot("boxed-invocation-commit-function-by-cell-click.png"); + }); }); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/populate.spec.ts index 8c93bbab6a8..e46496e3018 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/invocation/populate.spec.ts @@ -29,56 +29,43 @@ test.describe("Populate Boxed Invocation", () => { }) => { await stories.openBoxedInvocation(); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Installment calculation"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asInvocation().expressionHeaderCell.open(); + await bee.expression.asInvocation().expressionHeaderCell.setName({ name: "Installment calculation", close: false }); + await bee.expression.asInvocation().expressionHeaderCell.setDataType({ dataType: "number", close: true }); - await page.getByRole("cell", { name: "p-1 ()" }).hover(); - await page.getByRole("cell", { name: "p-1 ()" }).locator("svg").click(); - await page.getByRole("cell", { name: "p-1 ()" }).locator("svg").click(); - await page.getByRole("cell", { name: "p-1 ()" }).locator("svg").click(); - await page.getByRole("cell", { name: "p-1 ()" }).locator("svg").click(); + await bee.expression.asInvocation().addParameterBelowOfEntryAtIndex(0); + await bee.expression.asInvocation().addParameterBelowOfEntryAtIndex(0); + await bee.expression.asInvocation().addParameterBelowOfEntryAtIndex(0); + await bee.expression.asInvocation().addParameterBelowOfEntryAtIndex(0); await bee.expression.asInvocation().parameter(0).selectExpressionMenu.selectLiteral(); - await page.getByRole("cell", { name: "p-1 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Monthly income"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asInvocation().parameter(0).descriptionCell.open(); + await bee.expression.asInvocation().parameter(0).descriptionCell.setName({ name: "Monthly income" }); + await bee.expression.asInvocation().parameter(0).descriptionCell.setDataType({ dataType: "number", commit: true }); - await bee.expression.asInvocation().parameter(4).selectExpressionMenu.selectLiteral(); - await page.getByRole("cell", { name: "p-5 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Monthly repayments"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); - - await bee.expression.asInvocation().parameter(3).selectExpressionMenu.selectLiteral(); - await page.getByRole("cell", { name: "p-4 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Monthly expenses"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asInvocation().parameter(1).selectExpressionMenu.selectLiteral(); + await bee.expression.asInvocation().parameter(1).descriptionCell.open(); + await bee.expression.asInvocation().parameter(1).descriptionCell.setName({ name: "Monthly repayments" }); + await bee.expression.asInvocation().parameter(1).descriptionCell.setDataType({ dataType: "number", commit: true }); await bee.expression.asInvocation().parameter(2).selectExpressionMenu.selectLiteral(); - await page.getByRole("cell", { name: "p-3 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Risk category"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asInvocation().parameter(2).descriptionCell.open(); + await bee.expression.asInvocation().parameter(2).descriptionCell.setName({ name: "Monthly expenses" }); + await bee.expression.asInvocation().parameter(2).descriptionCell.setDataType({ dataType: "number", commit: true }); - await bee.expression.asInvocation().parameter(1).selectExpressionMenu.selectLiteral(); - await page.getByRole("cell", { name: "p-2 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Required monthly installment"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asInvocation().parameter(3).selectExpressionMenu.selectLiteral(); + await bee.expression.asInvocation().parameter(3).descriptionCell.open(); + await bee.expression.asInvocation().parameter(3).descriptionCell.setName({ name: "Risk category" }); + await bee.expression.asInvocation().parameter(3).descriptionCell.setDataType({ dataType: "number", commit: true }); + + await bee.expression.asInvocation().parameter(4).selectExpressionMenu.selectLiteral(); + await bee.expression.asInvocation().parameter(4).descriptionCell.open(); + await bee.expression.asInvocation().parameter(4).descriptionCell.setName({ name: "Required monthly installment" }); + await bee.expression.asInvocation().parameter(4).descriptionCell.setDataType({ dataType: "number", commit: true }); await resizing.reset(page.getByRole("cell", { name: "Required monthly installment" })); - await page.getByRole("columnheader", { name: "FUNCTION NAME" }).click(); + await bee.expression.asInvocation().invokedFunctionNameCell.click(); await page.keyboard.type(`Affordability calculation`); await page.keyboard.press("Enter"); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/list/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/list/populate.spec.ts index 152f463d285..7760a26c68d 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/list/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/list/populate.spec.ts @@ -22,11 +22,11 @@ import { test, expect } from "../../__fixtures__/base"; test.describe("Populate Boxed List", () => { test("should correctly create an age group boxed list", async ({ stories, bee, page, monaco }) => { await stories.openBoxedList(); - await page.getByRole("cell", { name: "1" }).hover(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); + + await bee.expression.asList().addEntryAtTop(); + await bee.expression.asList().addEntryAtTop(); + await bee.expression.asList().addEntryAtTop(); + await bee.expression.asList().addEntryAtTop(); await bee.expression.asList().row(0).selectExpressionMenu.selectLiteral(); await bee.expression.asList().row(1).selectExpressionMenu.selectLiteral(); @@ -34,11 +34,9 @@ test.describe("Populate Boxed List", () => { await bee.expression.asList().row(3).selectExpressionMenu.selectLiteral(); await bee.expression.asList().row(4).selectExpressionMenu.selectLiteral(); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Age groups"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asList().expressionHeaderCell.open(); + await bee.expression.asList().expressionHeaderCell.setName({ name: "Age groups", close: false }); + await bee.expression.asList().expressionHeaderCell.setDataType({ dataType: "number", close: true }); await monaco.fill({ monacoParentLocator: page, nth: 0, content: "<18" }); await monaco.fill({ monacoParentLocator: page, nth: 1, content: "[18..30)" }); diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/literal/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/literal/populate.spec.ts index 740028b74b2..442cb97221d 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/literal/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/literal/populate.spec.ts @@ -22,11 +22,9 @@ import { test, expect } from "../../__fixtures__/base"; test.describe("Populate Boxed Literal", () => { test("should correctly create a can drive boxed literal", async ({ stories, page, bee, resizing, monaco }) => { await stories.openBoxedLiteral(); - await page.getByRole("columnheader", { name: "Expression Name ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Can drive?"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asLiteral().expressionHeaderCell.open(); + await bee.expression.asLiteral().expressionHeaderCell.setName({ name: "Can drive?", close: false }); + await bee.expression.asLiteral().expressionHeaderCell.setDataType({ dataType: "boolean", close: true }); await monaco.fill({ monacoParentLocator: page, nth: 0, content: "Age >= 18 then true else false" }); await resizing.resizeCell( diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/relation/populate.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/relation/populate.spec.ts index 423a42b6cfd..b0966f0543a 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/relation/populate.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/relation/populate.spec.ts @@ -24,40 +24,29 @@ test.describe("Populate Relation", () => { test("should correctly create a people relation", async ({ stories, page, bee, resizing }) => { await stories.openRelation(); - await page.getByRole("columnheader", { name: "column-1 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Name"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "string" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asRelation().columnHeaderAtIndex(1).open(); + await bee.expression.asRelation().columnHeaderAtIndex(1).setName({ name: "Name", close: false }); + await bee.expression.asRelation().columnHeaderAtIndex(1).setDataType({ dataType: "string", close: true }); await resizing.resizeCell( page.getByRole("columnheader", { name: "Name (string)" }), { x: 0, y: 0 }, { x: 40, y: 0 } ); - await page.getByRole("columnheader", { name: "Name (string)" }).hover(); - await page.getByRole("row", { name: "Name (string)" }).locator("svg").click(); + await bee.expression.asRelation().addColumnAtRightOfIndex(1); - await page.getByRole("columnheader", { name: "column-2 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Age"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "number" }).click(); - await page.keyboard.press("Enter"); - await page.getByRole("columnheader", { name: "Age (number)" }).hover(); - await page.getByRole("row", { name: "Age (number)" }).locator("svg").click(); + await bee.expression.asRelation().columnHeaderAtIndex(2).open(); + await bee.expression.asRelation().columnHeaderAtIndex(2).setName({ name: "Age", close: false }); + await bee.expression.asRelation().columnHeaderAtIndex(2).setDataType({ dataType: "number", close: true }); + await bee.expression.asRelation().addColumnAtRightOfIndex(2); - await page.getByRole("columnheader", { name: "column-3 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Country"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "string" }).click(); - await page.keyboard.press("Enter"); - await page.getByRole("columnheader", { name: "Country (string)" }).hover(); - await page.getByRole("row", { name: "Country (string)" }).locator("svg").click(); + await bee.expression.asRelation().columnHeaderAtIndex(3).open(); + await bee.expression.asRelation().columnHeaderAtIndex(3).setName({ name: "Country", close: false }); + await bee.expression.asRelation().columnHeaderAtIndex(3).setDataType({ dataType: "string", close: true }); + await bee.expression.asRelation().addColumnAtRightOfIndex(3); - await page.getByRole("columnheader", { name: "column-4 ()" }).click(); - await page.getByPlaceholder("Expression Name").fill("Married"); - await page.getByLabel("").click(); - await page.getByRole("option", { name: "boolean" }).click(); - await page.keyboard.press("Enter"); + await bee.expression.asRelation().columnHeaderAtIndex(4).open(); + await bee.expression.asRelation().columnHeaderAtIndex(4).setName({ name: "Married", close: false }); + await bee.expression.asRelation().columnHeaderAtIndex(4).setDataType({ dataType: "boolean", close: true }); test.info().annotations.push({ type: TestAnnotations.WORKAROUND_DUE_TO, @@ -73,9 +62,8 @@ test.describe("Populate Relation", () => { await page.getByPlaceholder("Expression Name").fill("People"); await page.keyboard.press("Enter"); - await page.getByRole("cell", { name: "1" }).hover(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); - await page.getByRole("cell", { name: "1" }).locator("svg").click(); + await bee.expression.asRelation().addRowAtBellowOfRowAtIndex(1); + await bee.expression.asRelation().addRowAtBellowOfRowAtIndex(1); await bee.expression.asRelation().fill({ startAtCell: 0, diff --git a/packages/boxed-expression-component/tests-e2e/boxedExpressions/some/someExpression.spec.ts b/packages/boxed-expression-component/tests-e2e/boxedExpressions/some/someExpression.spec.ts index 2cd2cc1202b..a1ab18d1482 100644 --- a/packages/boxed-expression-component/tests-e2e/boxedExpressions/some/someExpression.spec.ts +++ b/packages/boxed-expression-component/tests-e2e/boxedExpressions/some/someExpression.spec.ts @@ -45,4 +45,18 @@ test.describe("Create Boxed Some", () => { expect((await jsonModel.getSomeExpression()).in["@_id"]).not.toBeUndefined(); expect((await jsonModel.getSomeExpression()).satisfies["@_id"]).not.toBeUndefined(); }); + + test("should commit variable by cell click", async ({ bee }) => { + test.info().annotations.push({ + type: TestAnnotations.REGRESSION, + description: "https://github.com/apache/incubator-kie-issues/issues/1158", + }); + + await bee.expression.asSome().variable.fill("Changed Variable Name"); + + // commit a change by a click to another cell + await bee.expression.asSome().in.elementCell.click(); + + await expect(bee.getContainer()).toHaveScreenshot("boxed-some-commit-variable-by-cell-click.png"); + }); }); diff --git a/packages/bpmn-vscode-extension/webpack.config.js b/packages/bpmn-vscode-extension/webpack.config.js index cd4e0fc77bd..d9ca1930a78 100644 --- a/packages/bpmn-vscode-extension/webpack.config.js +++ b/packages/bpmn-vscode-extension/webpack.config.js @@ -25,8 +25,8 @@ const { merge } = require("webpack-merge"); const { ProvidePlugin } = require("webpack"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "BpmnEditor", libraryTarget: "umd", @@ -38,14 +38,14 @@ const commonConfig = (env) => }, }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension": "./src/extension/extension.ts", }, }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "webworker", entry: { "extension/extensionWeb": "./src/extension/extension.ts", @@ -57,7 +57,7 @@ module.exports = async (env) => [ }), ], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "webview/BpmnEditorEnvelopeApp": "./src/webview/BpmnEditorEnvelopeApp.ts", diff --git a/packages/chrome-extension-pack-kogito-kie-editors/install.js b/packages/chrome-extension-pack-kogito-kie-editors/install.js index 68e55a1da19..f835ce2a1bb 100644 --- a/packages/chrome-extension-pack-kogito-kie-editors/install.js +++ b/packages/chrome-extension-pack-kogito-kie-editors/install.js @@ -17,7 +17,7 @@ * under the License. */ -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const fs = require("fs"); const prettier = require("prettier"); @@ -32,7 +32,7 @@ async function updateChromeExtensionManifest(version, manifestFilePath) { async function main() { console.info("[chrome-extension-pack-kogito-kie-editors-install] Updating manifest files..."); - const version = buildEnv.env.chromeExtension.version; + const version = env.chromeExtension.version; await updateChromeExtensionManifest(version, path.resolve("manifest.dev.json")); await updateChromeExtensionManifest(version, path.resolve("manifest.prod.json")); console.info("[chrome-extension-pack-kogito-kie-editors-install] Done."); diff --git a/packages/chrome-extension-pack-kogito-kie-editors/webpack.config.js b/packages/chrome-extension-pack-kogito-kie-editors/webpack.config.js index 42551f3d7b1..2d1f6dc382e 100644 --- a/packages/chrome-extension-pack-kogito-kie-editors/webpack.config.js +++ b/packages/chrome-extension-pack-kogito-kie-editors/webpack.config.js @@ -27,11 +27,10 @@ const stunnerEditors = require("@kie-tools/stunner-editors"); const { EnvironmentPlugin, ProvidePlugin } = require("webpack"); const path = require("path"); const { env } = require("./env"); -const buildEnv = env; function getRouterArgs() { - const targetOrigin = buildEnv.chromeExtension.routerTargetOrigin; - const relativePath = buildEnv.chromeExtension.routerRelativePath; + const targetOrigin = env.chromeExtension.routerTargetOrigin; + const relativePath = env.chromeExtension.routerRelativePath; console.info(`Chrome Extension :: Router target origin: ${targetOrigin}`); console.info(`Chrome Extension :: Router relative path: ${relativePath}`); @@ -40,8 +39,8 @@ function getRouterArgs() { } function getOnlineEditorArgs() { - const onlineEditorUrl = buildEnv.chromeExtension.onlineEditorUrl; - const manifestFile = buildEnv.chromeExtension.manifestFile; + const onlineEditorUrl = env.chromeExtension.onlineEditorUrl; + const manifestFile = env.chromeExtension.manifestFile; console.info(`Chrome Extension :: Online Editor URL: ${onlineEditorUrl}`); console.info(`Chrome Extension :: Manifest file: ${manifestFile}`); @@ -49,11 +48,11 @@ function getOnlineEditorArgs() { return [onlineEditorUrl, manifestFile]; } -module.exports = async (env) => { - const [router_targetOrigin, router_relativePath] = getRouterArgs(env); - const [onlineEditor_url, manifestFile] = getOnlineEditorArgs(env); +module.exports = async (webpackEnv) => { + const [router_targetOrigin, router_relativePath] = getRouterArgs(webpackEnv); + const [onlineEditor_url, manifestFile] = getOnlineEditorArgs(webpackEnv); - return merge(common(env), { + return merge(common(webpackEnv), { entry: { "content_scripts/github": "./src/github-content-script.ts", background: "./src/background.ts", @@ -65,7 +64,7 @@ module.exports = async (env) => { static: [{ directory: path.join(__dirname, "./dist") }], compress: true, https: true, - port: buildEnv.chromeExtension.dev.port, + port: env.chromeExtension.dev.port, }, plugins: [ new ProvidePlugin({ diff --git a/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfFullScreenTest.ts b/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfFullScreenTest.ts index 5a2c5837864..00cc94e1cff 100644 --- a/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfFullScreenTest.ts +++ b/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfFullScreenTest.ts @@ -23,15 +23,15 @@ import GitHubEditorPage from "@kie-tools/chrome-extension-test-helper/dist/frame import GitHubRepoPage from "@kie-tools/chrome-extension-test-helper/dist/framework/github-repo/GitHubRepoPage"; import Tools from "@kie-tools/chrome-extension-test-helper/dist/utils/Tools"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { env } from "../../env"; +const buildEnv: any = env; // build-env is not typed const TEST_NAME = "SwfFullScreenTest"; let tools: Tools; -const buildEnv: any = env; - beforeEach(async () => { tools = await Tools.init(TEST_NAME); diff --git a/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfTest.ts b/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfTest.ts index 8ccb6e805fa..e7c63c37268 100644 --- a/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfTest.ts +++ b/packages/chrome-extension-serverless-workflow-editor/e2e-tests/tests/SwfTest.ts @@ -24,15 +24,15 @@ import GitHubEditorPage from "@kie-tools/chrome-extension-test-helper/dist/frame import GitHubRepoPage from "@kie-tools/chrome-extension-test-helper/dist/framework/github-repo/GitHubRepoPage"; import SwfEditor from "@kie-tools/chrome-extension-test-helper/dist/framework/editor/swf/SwfEditor"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { env } from "../../env"; +const buildEnv: any = env; // build-env is not typed const TEST_NAME = "SwfTest"; let tools: Tools; -const buildEnv: any = env; - beforeEach(async () => { tools = await Tools.init(TEST_NAME); diff --git a/packages/chrome-extension-serverless-workflow-editor/install.js b/packages/chrome-extension-serverless-workflow-editor/install.js index 5251ff2f1cc..a1e1b494c65 100644 --- a/packages/chrome-extension-serverless-workflow-editor/install.js +++ b/packages/chrome-extension-serverless-workflow-editor/install.js @@ -17,7 +17,7 @@ * under the License. */ -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const fs = require("fs"); const prettier = require("prettier"); @@ -32,7 +32,7 @@ async function updateChromeExtensionManifest(version, manifestFilePath) { async function main() { console.info("[chrome-extension-serverless-workflow-editor-install] Updating manifest files..."); - const version = buildEnv.env.swfChromeExtension.version; + const version = env.swfChromeExtension.version; await updateChromeExtensionManifest(version, path.resolve("manifest.dev.json")); await updateChromeExtensionManifest(version, path.resolve("manifest.prod.json")); console.info("[chrome-extension-serverless-workflow-editor-install] Done."); diff --git a/packages/chrome-extension-serverless-workflow-editor/webpack.config.js b/packages/chrome-extension-serverless-workflow-editor/webpack.config.js index 447dc1bbf27..f8588fdd691 100644 --- a/packages/chrome-extension-serverless-workflow-editor/webpack.config.js +++ b/packages/chrome-extension-serverless-workflow-editor/webpack.config.js @@ -28,11 +28,10 @@ const path = require("path"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const swEditorAssets = require("@kie-tools/serverless-workflow-diagram-editor-assets"); const { env } = require("./env"); -const buildEnv = env; function getRouterArgs() { - const targetOrigin = buildEnv.swfChromeExtension.routerTargetOrigin; - const relativePath = buildEnv.swfChromeExtension.routerRelativePath; + const targetOrigin = env.swfChromeExtension.routerTargetOrigin; + const relativePath = env.swfChromeExtension.routerRelativePath; console.info(`SWF Chrome Extension :: Router target origin: ${targetOrigin}`); console.info(`SWF Chrome Extension :: Router relative path: ${relativePath}`); @@ -41,18 +40,18 @@ function getRouterArgs() { } function getManifestFile() { - const manifestFile = buildEnv.swfChromeExtension.manifestFile; + const manifestFile = env.swfChromeExtension.manifestFile; console.info(`SWF Chrome Extension :: Manifest file: ${manifestFile}`); return manifestFile; } -module.exports = async (env) => { - const [router_targetOrigin, router_relativePath] = getRouterArgs(env); - const manifestFile = getManifestFile(env); +module.exports = async (webpackEnv) => { + const [router_targetOrigin, router_relativePath] = getRouterArgs(webpackEnv); + const manifestFile = getManifestFile(webpackEnv); - return merge(common(env), { + return merge(common(webpackEnv), { entry: { "content_scripts/github": "./src/github-content-script.ts", background: "./src/background.ts", @@ -64,7 +63,7 @@ module.exports = async (env) => { static: [{ directory: path.join(__dirname, "./dist") }], compress: true, https: true, - port: buildEnv.swfChromeExtension.dev.port, + port: env.swfChromeExtension.dev.port, client: { overlay: false, }, diff --git a/packages/cors-proxy/webpack.config.js b/packages/cors-proxy/webpack.config.js index 8b54b923d1a..50f4700501a 100644 --- a/packages/cors-proxy/webpack.config.js +++ b/packages/cors-proxy/webpack.config.js @@ -20,8 +20,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -module.exports = (env, argv) => [ - merge(common(env, argv), { +module.exports = (webpackEnv, webpackArgv) => [ + merge(common(webpackEnv, webpackArgv), { entry: { index: "./src/index.ts", }, diff --git a/packages/dashbuilder-component-assembler/webpack.config.js b/packages/dashbuilder-component-assembler/webpack.config.js index dc1a5346a64..5d36c8a29cf 100644 --- a/packages/dashbuilder-component-assembler/webpack.config.js +++ b/packages/dashbuilder-component-assembler/webpack.config.js @@ -22,7 +22,7 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -module.exports = async (env) => { +module.exports = async (webpackEnv) => { const components = ["uniforms", "table", "echarts", "svg-heatmap", "timeseries", "victory-charts", "map"]; const copyResources = []; @@ -33,7 +33,7 @@ module.exports = async (env) => { }); }); - return merge(common(env), { + return merge(common(webpackEnv), { entry: {}, plugins: [ new CopyPlugin({ diff --git a/packages/dashbuilder-component-echarts/dev-webapp/webpack.config.js b/packages/dashbuilder-component-echarts/dev-webapp/webpack.config.js index c9eab447dac..439f4293c98 100644 --- a/packages/dashbuilder-component-echarts/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-echarts/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-echarts/webpack.config.js b/packages/dashbuilder-component-echarts/webpack.config.js index 3b2b5444f30..4df292e506f 100644 --- a/packages/dashbuilder-component-echarts/webpack.config.js +++ b/packages/dashbuilder-component-echarts/webpack.config.js @@ -23,8 +23,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-component-map/dev-webapp/webpack.config.js b/packages/dashbuilder-component-map/dev-webapp/webpack.config.js index a594a80dd11..74ccf723185 100644 --- a/packages/dashbuilder-component-map/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-map/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-map/webpack.config.js b/packages/dashbuilder-component-map/webpack.config.js index 8e8fda5c3ca..bca775f9807 100644 --- a/packages/dashbuilder-component-map/webpack.config.js +++ b/packages/dashbuilder-component-map/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-component-svg-heatmap/dev-webapp/webpack.config.js b/packages/dashbuilder-component-svg-heatmap/dev-webapp/webpack.config.js index aab157735c8..e2fa732a92d 100644 --- a/packages/dashbuilder-component-svg-heatmap/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-svg-heatmap/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-svg-heatmap/webpack.config.js b/packages/dashbuilder-component-svg-heatmap/webpack.config.js index 3b2b5444f30..4df292e506f 100644 --- a/packages/dashbuilder-component-svg-heatmap/webpack.config.js +++ b/packages/dashbuilder-component-svg-heatmap/webpack.config.js @@ -23,8 +23,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-component-table/dev-webapp/webpack.config.js b/packages/dashbuilder-component-table/dev-webapp/webpack.config.js index 6c327943344..5f19de17f8d 100644 --- a/packages/dashbuilder-component-table/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-table/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-table/webpack.config.js b/packages/dashbuilder-component-table/webpack.config.js index 0da36ff1f6c..87a5c270f20 100644 --- a/packages/dashbuilder-component-table/webpack.config.js +++ b/packages/dashbuilder-component-table/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-component-timeseries/dev-webapp/webpack.config.js b/packages/dashbuilder-component-timeseries/dev-webapp/webpack.config.js index ce9b52bdce8..48b9ea7dfac 100644 --- a/packages/dashbuilder-component-timeseries/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-timeseries/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-timeseries/webpack.config.js b/packages/dashbuilder-component-timeseries/webpack.config.js index 3b2b5444f30..4df292e506f 100644 --- a/packages/dashbuilder-component-timeseries/webpack.config.js +++ b/packages/dashbuilder-component-timeseries/webpack.config.js @@ -23,8 +23,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-component-uniforms/dev-webapp/webpack.config.js b/packages/dashbuilder-component-uniforms/dev-webapp/webpack.config.js index 0ef2b80b5d1..1c75455b61c 100644 --- a/packages/dashbuilder-component-uniforms/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-uniforms/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-uniforms/webpack.config.js b/packages/dashbuilder-component-uniforms/webpack.config.js index 3b2b5444f30..4df292e506f 100644 --- a/packages/dashbuilder-component-uniforms/webpack.config.js +++ b/packages/dashbuilder-component-uniforms/webpack.config.js @@ -23,8 +23,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-component-victory-charts/dev-webapp/webpack.config.js b/packages/dashbuilder-component-victory-charts/dev-webapp/webpack.config.js index c9eab447dac..439f4293c98 100644 --- a/packages/dashbuilder-component-victory-charts/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-component-victory-charts/dev-webapp/webpack.config.js @@ -24,8 +24,8 @@ const CopyPlugin = require("copy-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-component-victory-charts/webpack.config.js b/packages/dashbuilder-component-victory-charts/webpack.config.js index f7e358134f0..b46313754e3 100644 --- a/packages/dashbuilder-component-victory-charts/webpack.config.js +++ b/packages/dashbuilder-component-victory-charts/webpack.config.js @@ -24,8 +24,8 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dashbuilder-editor/dev-webapp/webpack.config.js b/packages/dashbuilder-editor/dev-webapp/webpack.config.js index ef4891c5900..33f51e3a20f 100644 --- a/packages/dashbuilder-editor/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-editor/dev-webapp/webpack.config.js @@ -23,10 +23,9 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); -const webpack = require("webpack"); -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder-viewer-deployment-webapp/webpack.config.js b/packages/dashbuilder-viewer-deployment-webapp/webpack.config.js index 313f22b8418..603ae40a0e0 100644 --- a/packages/dashbuilder-viewer-deployment-webapp/webpack.config.js +++ b/packages/dashbuilder-viewer-deployment-webapp/webpack.config.js @@ -23,11 +23,10 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { env } = require("./env"); -const buildEnv = env; const dashbuilderClient = require("@kie-tools/dashbuilder-client"); -module.exports = async (env) => - merge(common(env), { +module.exports = async (webpackEnv) => + merge(common(webpackEnv), { entry: { index: "./src/index.tsx", "dashbuilder-viewer-envelope-app": "./src/envelope/DashbuilderViewerEnvelopeApp.ts", @@ -63,6 +62,6 @@ module.exports = async (env) => historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }, { directory: path.join(__dirname, "./static") }], compress: true, - port: buildEnv.dashbuilderViewerDeploymentWebApp.dev.port, + port: env.dashbuilderViewerDeploymentWebApp.dev.port, }, }); diff --git a/packages/dashbuilder-viewer/dev-webapp/webpack.config.js b/packages/dashbuilder-viewer/dev-webapp/webpack.config.js index c765d701907..54a13f6b236 100644 --- a/packages/dashbuilder-viewer/dev-webapp/webpack.config.js +++ b/packages/dashbuilder-viewer/dev-webapp/webpack.config.js @@ -23,8 +23,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), diff --git a/packages/dashbuilder/dashbuilder-bom/pom.xml b/packages/dashbuilder/dashbuilder-bom/pom.xml index 3b70647f621..4362921a3b8 100644 --- a/packages/dashbuilder/dashbuilder-bom/pom.xml +++ b/packages/dashbuilder/dashbuilder-bom/pom.xml @@ -33,9 +33,9 @@ dashbuilder-bom pom - DashBuilder BOM (Bill Of Materials) + Dashbuilder BOM (Bill Of Materials) - Import this BOM in your dependencyManagement if you want to depend on multiple DashBuilder artifacts. + Import this BOM in your dependencyManagement if you want to depend on multiple Dashbuilder artifacts. 2021 diff --git a/packages/dashbuilder/dashbuilder-parent.iml b/packages/dashbuilder/dashbuilder-parent.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/dashbuilder/dashbuilder-parent.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/dashbuilder/install.js b/packages/dashbuilder/install.js index d21b9e3744c..52aa21aa461 100644 --- a/packages/dashbuilder/install.js +++ b/packages/dashbuilder/install.js @@ -17,9 +17,10 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.dashbuilder.version} +setupMavenConfigFile(` + -Drevision=${env.dashbuilder.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/packages/dashbuilder/package.json b/packages/dashbuilder/package.json index cbae8ac612e..3de94808ce1 100644 --- a/packages/dashbuilder/package.json +++ b/packages/dashbuilder/package.json @@ -41,7 +41,6 @@ }, "devDependencies": { "@kie-tools/dashbuilder-component-assembler": "workspace:*", - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "copyfiles": "^2.4.1", "rimraf": "^3.0.2", diff --git a/packages/dashbuilder/pom.xml b/packages/dashbuilder/pom.xml index fa92a1e0b90..b48ee3d0583 100644 --- a/packages/dashbuilder/pom.xml +++ b/packages/dashbuilder/pom.xml @@ -34,9 +34,9 @@ dashbuilder-parent pom - Dashbuilder parent + KIE Tools :: Dashbuilder - The parent contains all metadata (including plugins) and also dependency versions for all DashBuilder modules + The parent contains all metadata (including plugins) and also dependency versions for all Dashbuilder modules 2021 @@ -111,7 +111,6 @@ 3.2.0 3.2.3 3.1.1 - 2.8.2 2.5.2 3.8.2 1.8 @@ -1136,41 +1135,14 @@ maven-checkstyle-plugin ${version.checkstyle.plugin} - - org.apache.maven.plugins - maven-deploy-plugin - ${version.deploy.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-site-plugin - ${version.site.plugin} - org.apache.maven.plugins maven-antrun-plugin ${version.antrun.plugin} - - org.apache.maven.plugins - maven-dependency-plugin - ${version.org.apache.maven.plugins.dependency} - - - maven-dependency-plugin - ${version.org.maven.dependency.plugin} - - - maven-dependency-plugin - maven-enforcer-plugin @@ -1293,18 +1265,9 @@ - - org.apache.maven.plugins - maven-failsafe-plugin - - - org.apache.maven.plugins - maven-source-plugin - org.codehaus.mojo flatten-maven-plugin - 1.6.0 true resolveCiFriendliesOnly diff --git a/packages/data-index-webapp/webpack.config.js b/packages/data-index-webapp/webpack.config.js index ef01f3ecc63..ede2d67e989 100644 --- a/packages/data-index-webapp/webpack.config.js +++ b/packages/data-index-webapp/webpack.config.js @@ -21,10 +21,9 @@ const CopyPlugin = require("copy-webpack-plugin"); const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { env } = require("./env"); -const buildEnv = env; -module.exports = async (env) => - merge(common(env), { +module.exports = async (webpackEnv) => + merge(common(webpackEnv), { entry: {}, plugins: [ new CopyPlugin({ @@ -40,6 +39,6 @@ module.exports = async (env) => static: { directory: "./dist", }, - port: buildEnv.dataIndexWebapp.dev.port, + port: env.dataIndexWebapp.dev.port, }, }); diff --git a/packages/dev-deployment-base-image/install.js b/packages/dev-deployment-base-image/install.js index 5c348fae2e2..4300132e652 100644 --- a/packages/dev-deployment-base-image/install.js +++ b/packages/dev-deployment-base-image/install.js @@ -17,9 +17,12 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.devDeploymentBaseImage.version} +setupMavenConfigFile(` + -Drevision=${env.devDeploymentBaseImage.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); + +installMvnw(); diff --git a/packages/dev-deployment-base-image/package.json b/packages/dev-deployment-base-image/package.json index 56b915c3594..9d6682fba97 100644 --- a/packages/dev-deployment-base-image/package.json +++ b/packages/dev-deployment-base-image/package.json @@ -24,10 +24,7 @@ "create-test-image:minikube": "kie-tools--image-builder minikube -r \"$(build-env devDeploymentBaseImage.registry)\" -a \"$(build-env devDeploymentBaseImage.account)\" -n \"$(build-env devDeploymentBaseImage.name)\" -t \"$(build-env devDeploymentBaseImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentBaseImage.builderImage)\"", "create-test-image:openshift": "kie-tools--image-builder openshift -r \"$(build-env devDeploymentBaseImage.registry)\" -a \"$(build-env devDeploymentBaseImage.account)\" -n \"$(build-env devDeploymentBaseImage.name)\" -t \"$(build-env devDeploymentBaseImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentBaseImage.builderImage)\"", "image:docker:build": "kie-tools--image-builder build -r \"$(build-env devDeploymentBaseImage.registry)\" -a \"$(build-env devDeploymentBaseImage.account)\" -n \"$(build-env devDeploymentBaseImage.name)\" -t \"$(build-env devDeploymentBaseImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentBaseImage.builderImage)\" --build-arg USER_ID_ARG=\"$(build-env devDeploymentBaseImage.userId)\" --build-arg HOME_PATH_ARG=\"$(build-env devDeploymentBaseImage.homePath)\"", - "install": "node install.js && pnpm install:mvnw", - "install:mvnw": "run-script-os", - "install:mvnw:darwin:linux": "mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper", - "install:mvnw:win32": "pnpm powershell \"mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper\"", + "install": "node install.js", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "dependencies": { @@ -36,7 +33,6 @@ "devDependencies": { "@kie-tools/dev-deployment-upload-service": "workspace:*", "@kie-tools/image-builder": "workspace:*", - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "rimraf": "^3.0.2", "run-script-os": "^1.1.6" diff --git a/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml b/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml index a96b5f74450..454b179cea0 100644 --- a/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml +++ b/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml @@ -37,18 +37,31 @@ 0.0.0 - 3.13.0 - true 17 17 UTF-8 UTF-8 - 3.5.0 - 3.12.1 - 3.2.0 - 3.4.1 - 4.13.2 + + + 3.4.1 + 3.13.0 + 3.2.0 + 3.0.0-M7 + 3.5.0 + 3.1.2 + 3.12.1 + 3.6.1 + 3.4.1 + 3.2.0 + 3.4.0 + 1.6.0 + + + true true + + + 4.13.2 1.26.1 0.5 @@ -58,7 +71,7 @@ io.quarkus quarkus-bom - ${quarkus.platform.version} + ${version.quarkus} pom import @@ -146,7 +159,7 @@ org.apache.maven.plugins maven-site-plugin - ${maven.site.plugin.version} + ${version.maven.site.plugin} org.apache.commons @@ -163,7 +176,7 @@ org.apache.maven.plugins maven-remote-resources-plugin - ${maven.remote.resources.plugin.version} + ${version.maven.remote.resources.plugin} org.apache.commons @@ -180,7 +193,7 @@ org.apache.maven.plugins maven-jar-plugin - ${maven.jar.plugin.version} + ${version.maven.jar.plugin} org.iq80.snappy @@ -192,7 +205,7 @@ org.apache.maven.plugins maven-surefire-plugin - ${surefire-plugin.version} + ${version.maven.surefire.plugin} org.iq80.snappy @@ -212,7 +225,7 @@ io.quarkus quarkus-maven-plugin - ${quarkus.platform.version} + ${version.quarkus} true @@ -224,14 +237,14 @@ maven-compiler-plugin - ${compiler-plugin.version} + ${version.maven.compiler.plugin} ${maven.compiler.parameters} maven-surefire-plugin - ${surefire-plugin.version} + ${version.maven.surefire.plugin} org.jboss.logmanager.LogManager @@ -242,7 +255,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.6.0 + ${version.codehaus.flatten.plugin} true resolveCiFriendliesOnly diff --git a/packages/dev-deployment-dmn-form-webapp/dev-webapp/start.js b/packages/dev-deployment-dmn-form-webapp/dev-webapp/start.js index ab44038f1fc..73ed20d8758 100644 --- a/packages/dev-deployment-dmn-form-webapp/dev-webapp/start.js +++ b/packages/dev-deployment-dmn-form-webapp/dev-webapp/start.js @@ -21,8 +21,6 @@ const { spawn } = require("node:child_process"); const path = require("path"); const { env } = require("../env"); -const buildEnv = env; - const mvn = spawn( "mvn", [ @@ -31,10 +29,10 @@ const mvn = spawn( "clean", "quarkus:dev", "-Dmaven.test.skip", - `-Dquarkus.platform.version=${buildEnv.quarkusPlatform.version}`, - `-Dversion.org.kie.kogito=${buildEnv.kogitoRuntime.version}`, - `-Dquarkus.http.port=${buildEnv.devDeploymentDmnFormWebapp.dev.quarkusPort}`, - `-Dkogito.service.url=http://localhost:${buildEnv.devDeploymentDmnFormWebapp.dev.quarkusPort}`, + `-Dversion.quarkus=${env.versions.quarkus}`, + `-Dversion.org.kie.kogito=${env.versions.kogito}`, + `-Dquarkus.http.port=${env.devDeploymentDmnFormWebapp.dev.quarkusPort}`, + `-Dkogito.service.url=http://localhost:${env.devDeploymentDmnFormWebapp.dev.quarkusPort}`, "-Dquarkus.http.root-path=/", ], { shell: true } @@ -74,13 +72,13 @@ const webpack = spawn( "--env", mode, "--port", - buildEnv.devDeploymentDmnFormWebapp.dev.webpackPort, + env.devDeploymentDmnFormWebapp.dev.webpackPort, ], { shell: true, env: { ...process.env, // contains PATH which is needed to find the commands - DEV_DEPLOYMENT_DMN_FORM_WEBAPP__quarkusAppOrigin: `http://localhost:${buildEnv.devDeploymentDmnFormWebapp.dev.quarkusPort}`, + DEV_DEPLOYMENT_DMN_FORM_WEBAPP__quarkusAppOrigin: `http://localhost:${env.devDeploymentDmnFormWebapp.dev.quarkusPort}`, DEV_DEPLOYMENT_DMN_FORM_WEBAPP__quarkusAppPath: "", }, } diff --git a/packages/dev-deployment-dmn-form-webapp/webpack.config.ts b/packages/dev-deployment-dmn-form-webapp/webpack.config.ts index 29ced85de8a..edbcd8d7e36 100644 --- a/packages/dev-deployment-dmn-form-webapp/webpack.config.ts +++ b/packages/dev-deployment-dmn-form-webapp/webpack.config.ts @@ -26,8 +26,8 @@ import { ProvidePlugin } from "webpack"; import NodePolyfillPlugin from "node-polyfill-webpack-plugin"; import { defaultEnvJson } from "./build/defaultEnvJson"; -export default async (env: any, argv: any) => { - return merge(common(env), { +export default async (webpackEnv: any, webpackArgv: any) => { + return merge(common(webpackEnv), { entry: { index: "./src/index.tsx", }, diff --git a/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile b/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile index 37cd0daa263..9fad06ed812 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile +++ b/packages/dev-deployment-kogito-quarkus-blank-app-image/Containerfile @@ -30,7 +30,7 @@ COPY --chown=$USER_ID:$USER_ID dist-dev/quarkus-app $HOME_PATH/app/ COPY --chown=$USER_ID:$USER_ID dist-dev/settings.xml /tmp/kogito/.m2/settings.xml # Pre-populate local Maven repository for faster startup -RUN ./mvnw clean package -B --settings /tmp/kogito/.m2/settings.xml -Dmaven.test.skip -Dmaven.repo.local=/tmp/kogito/.m2/repository -Dquarkus.http.non-application-root-path=${ROOT_PATH}/q -Dquarkus.http.root-path=${ROOT_PATH} \ +RUN ./mvnw clean package -B -nsu --settings /tmp/kogito/.m2/settings.xml -Dmaven.test.skip -Dmaven.repo.local=/tmp/kogito/.m2/repository -Dquarkus.http.non-application-root-path=${ROOT_PATH}/q -Dquarkus.http.root-path=${ROOT_PATH} \ && chgrp -R 0 $HOME_PATH/app && chmod -R g=u $HOME_PATH/app && chgrp -R 0 /tmp/kogito && chmod -R g=u /tmp/kogito && chgrp -R 0 /.m2 && chmod -R g=u /.m2 USER $USER_ID diff --git a/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js b/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js index 7087fb761c4..62353539324 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js +++ b/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js @@ -51,10 +51,6 @@ module.exports = composeEnv([rootEnv], { default: rootEnv.env.root.streamName, description: "Tag version of this image. E.g., `main` or `10.0.x` or `10.0.0", }, - DEV_DEPLOYMENT_KOGITO_QUARKUS_BLANK_APP_IMAGE__mavenM2RepoViaHttpImage: { - default: `${mavenM2RepoViaHttpImageEnv.registry}/${mavenM2RepoViaHttpImageEnv.account}/${mavenM2RepoViaHttpImageEnv.name}:${mavenM2RepoViaHttpImageEnv.buildTag}`, - description: "The image tag for the Maven M2 Repo via HTTP. Used during the build only.", - }, }), get env() { return { @@ -66,9 +62,7 @@ module.exports = composeEnv([rootEnv], { buildTag: getOrDefault(this.vars.DEV_DEPLOYMENT_KOGITO_QUARKUS_BLANK_APP_IMAGE__buildTag), version: require("../package.json").version, dev: { - mavenM2RepoViaHttpImage: getOrDefault( - this.vars.DEV_DEPLOYMENT_KOGITO_QUARKUS_BLANK_APP_IMAGE__mavenM2RepoViaHttpImage - ), + mavenM2RepoViaHttpImage: `${mavenM2RepoViaHttpImageEnv.registry}/${mavenM2RepoViaHttpImageEnv.account}/${mavenM2RepoViaHttpImageEnv.name}:${mavenM2RepoViaHttpImageEnv.buildTag}`, }, }, }; diff --git a/packages/dev-deployment-kogito-quarkus-blank-app-image/package.json b/packages/dev-deployment-kogito-quarkus-blank-app-image/package.json index 9ef24001763..7ac8c1a05e2 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app-image/package.json +++ b/packages/dev-deployment-kogito-quarkus-blank-app-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy:assets\" \"pnpm image:docker:build\" --finally \"pnpm m2-repo-via-http:container:kill\"", + "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy:assets\" \"pnpm image:docker:build\" --finally \"pnpm m2-repo-via-http:container:kill\" \"rimraf ./dist/tmp-m2\"", "build:dev": "pnpm build", "build:prod": "pnpm build", "copy:assets": "rimraf dist-dev && mkdir -p ./dist-dev && pnpm copy:quarkus-app && pnpm copy:maven-m2-repo-via-http-image--settings-xml", @@ -28,9 +28,9 @@ "create-test-image:minikube": "kie-tools--image-builder minikube -r \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.registry)\" -a \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.account)\" -n \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.name)\" -t \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentKogitoQuarkusBlankAppImage.builderImage)\" --build-arg ROOT_PATH=/", "create-test-image:openshift": "kie-tools--image-builder openshift -r \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.registry)\" -a \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.account)\" -n \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.name)\" -t \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentKogitoQuarkusBlankAppImage.builderImage)\" --build-arg ROOT_PATH=/", "image:docker:build": "kie-tools--image-builder build --allowHostNetworkAccess -r \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.registry)\" -a \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.account)\" -n \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.name)\" -t \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentKogitoQuarkusBlankAppImage.builderImage)\" --build-arg ROOT_PATH=/", - "install": "node install.js", "m2-repo-via-http:container:kill": "(docker container kill m2-repo-via-http || true) && (docker container rm m2-repo-via-http || true)", - "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && docker run --name m2-repo-via-http -v \"$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout):/var/www/html\" -dit $(build-env devDeploymentKogitoQuarkusBlankAppImage.dev.mavenM2RepoViaHttpImage)", + "m2-repo-via-http:container:prepare-m2-repo-volume": "node -e 'require(`@kie-tools/maven-base`).prepareHardLinkedM2ForPackage(`./dist/tmp-m2/repository`, `./node_modules/@kie-tools/dev-deployment-kogito-quarkus-blank-app`)'", + "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && pnpm m2-repo-via-http:container:prepare-m2-repo-volume && docker run -p 8888:80 --name m2-repo-via-http -v \"./dist/tmp-m2/repository:/var/www/html\" -dit $(build-env devDeploymentKogitoQuarkusBlankAppImage.dev.mavenM2RepoViaHttpImage)", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "dependencies": { @@ -39,7 +39,7 @@ }, "devDependencies": { "@kie-tools/image-builder": "workspace:*", - "@kie-tools/maven-config-setup-helper": "workspace:*", + "@kie-tools/maven-base": "workspace:*", "@kie-tools/maven-m2-repo-via-http-image": "workspace:*", "@kie-tools/root-env": "workspace:*", "rimraf": "^3.0.2", diff --git a/packages/dev-deployment-kogito-quarkus-blank-app/dev-deployment-kogito-quarkus-blank-app.iml b/packages/dev-deployment-kogito-quarkus-blank-app/dev-deployment-kogito-quarkus-blank-app.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/dev-deployment-kogito-quarkus-blank-app/dev-deployment-kogito-quarkus-blank-app.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/dev-deployment-kogito-quarkus-blank-app/install.js b/packages/dev-deployment-kogito-quarkus-blank-app/install.js index 8484cdd6bfa..61f0e221a7b 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app/install.js +++ b/packages/dev-deployment-kogito-quarkus-blank-app/install.js @@ -17,11 +17,19 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.devDeploymentQuarkusApp.version} - -Dquarkus.platform.version=${buildEnv.env.quarkusPlatform.version} - -Dversion.org.kie.kogito=${buildEnv.env.kogitoRuntime.version} -`); +setupMavenConfigFile( + ` + --batch-mode + -Dstyle.color=always + -Drevision=${env.devDeploymentQuarkusApp.version} + -Dversion.quarkus=${env.versions.quarkus} + -Dversion.org.kie.kogito=${env.versions.kogito} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} +`, + { ignoreDefault: true } // Can't have special configuration that only works inside this repo. +); + +installMvnw(); diff --git a/packages/dev-deployment-kogito-quarkus-blank-app/package.json b/packages/dev-deployment-kogito-quarkus-blank-app/package.json index 358afb27bc7..2435014a4d3 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app/package.json +++ b/packages/dev-deployment-kogito-quarkus-blank-app/package.json @@ -19,19 +19,18 @@ "build:prod": "pnpm lint && run-script-os", "build:prod:darwin:linux": "mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)", "build:prod:win32": "pnpm powershell \"mvn clean install `-DskipTests=$(build-env tests.run --not) `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)\"", - "install": "node install.js && pnpm install:mvnw", - "install:mvnw": "run-script-os", - "install:mvnw:darwin:linux": "mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper", - "install:mvnw:win32": "pnpm powershell \"mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper\"", + "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command", "quarkus:dev": "run-script-os", "quarkus:dev:darwin:linux": "mvn clean package quarkus:dev -DskipTests", "quarkus:dev:win32": "mvn clean package quarkus:dev `-DskipTests" }, - "dependencies": {}, + "dependencies": { + "@kie-tools/jbpm-quarkus-devui": "workspace:*", + "@kie-tools/maven-base": "workspace:*" + }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml b/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml index 259bc458762..b2f9abac4cd 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml +++ b/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml @@ -36,19 +36,35 @@ dev-deployment-kogito-quarkus-blank-app ${revision} + KIE Tools :: KIE Sandbox :: Dev deployment Kogito Quarkus blank app + - 3.13.0 - true 17 17 UTF-8 UTF-8 - 3.5.0 - 3.12.1 - 3.2.0 - 3.4.1 - 4.13.2 + + + 3.4.1 + 3.13.0 + 3.2.0 + 3.0.0-M7 + 3.5.0 + 3.1.3 + 3.1.2 + 3.12.1 + 3.6.1 + 3.4.1 + 3.2.0 + 3.4.0 + 1.6.0 + + + true true + + + 4.13.2 1.26.1 0.5 @@ -58,7 +74,7 @@ io.quarkus quarkus-bom - ${quarkus.platform.version} + ${version.quarkus} pom import @@ -117,13 +133,6 @@ - - - io.quarkus quarkus-junit5 @@ -142,6 +151,60 @@ + + + include-1st-party-dependencies + + + kieTools.do-not-use-this-property.ignore1stPartyDependencies + !true + + + + + + org.jbpm + jbpm-quarkus-devui-bom + ${project.version} + pom + import + + + + + + org.jbpm + jbpm-quarkus-devui + + + + + + + + use-maven-repo-local-tail + + + kieTools.do-not-use-this-property.ignoreMavenRepoLocalTail + !true + + + + + + + org.apache.maven.plugins + maven-install-plugin + + true + + + + + + + + @@ -153,7 +216,7 @@ org.apache.maven.plugins maven-site-plugin - ${maven.site.plugin.version} + ${version.maven.site.plugin} org.apache.commons @@ -170,7 +233,7 @@ org.apache.maven.plugins maven-remote-resources-plugin - ${maven.remote.resources.plugin.version} + ${version.maven.remote.resources.plugin} org.apache.commons @@ -187,7 +250,7 @@ org.apache.maven.plugins maven-jar-plugin - ${maven.jar.plugin.version} + ${version.maven.jar.plugin} org.iq80.snappy @@ -199,7 +262,7 @@ org.apache.maven.plugins maven-surefire-plugin - ${surefire-plugin.version} + ${version.maven.surefire.plugin} org.iq80.snappy @@ -219,7 +282,7 @@ io.quarkus quarkus-maven-plugin - ${quarkus.platform.version} + ${version.quarkus} true @@ -231,14 +294,14 @@ maven-compiler-plugin - ${compiler-plugin.version} + ${version.maven.compiler.plugin} ${maven.compiler.parameters} maven-surefire-plugin - ${surefire-plugin.version} + ${version.maven.surefire.plugin} org.jboss.logmanager.LogManager @@ -249,7 +312,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.6.0 + ${version.codehaus.flatten.plugin} true resolveCiFriendliesOnly diff --git a/packages/dev-deployment-upload-service/scripts/runTestServers.js b/packages/dev-deployment-upload-service/scripts/runTestServers.js index 411e2bf0651..d789e879f4d 100644 --- a/packages/dev-deployment-upload-service/scripts/runTestServers.js +++ b/packages/dev-deployment-upload-service/scripts/runTestServers.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const { argv } = require("process"); const version = require("../package.json").version; -const buildEnv = require("../env"); +const { env } = require("../env"); const network = "ddus-network"; const builder = "ddus-builder"; @@ -38,9 +38,9 @@ const imagesNames = { }; const containersPorts = { - fileserver: buildEnv.env.devDeploymentUploadService.dev.fileServerPort, - buildtimeInstall: buildEnv.env.devDeploymentUploadService.dev.buildTimePort, - runTimeInstall: buildEnv.env.devDeploymentUploadService.dev.runtTimePort, + fileserver: env.devDeploymentUploadService.dev.fileServerPort, + buildtimeInstall: env.devDeploymentUploadService.dev.buildTimePort, + runTimeInstall: env.devDeploymentUploadService.dev.runtTimePort, }; function runCommand(command, returnResult = false) { diff --git a/packages/dev-deployment-upload-service/tests/integrationTest.test.js b/packages/dev-deployment-upload-service/tests/integrationTest.test.js index 8c1164b4b9a..cca909dbbdd 100644 --- a/packages/dev-deployment-upload-service/tests/integrationTest.test.js +++ b/packages/dev-deployment-upload-service/tests/integrationTest.test.js @@ -19,15 +19,15 @@ const { execSync, execFileSync } = require("child_process"); const path = require("path"); -const buildEnv = require("../env"); +const { env } = require("../env"); const version = require("../package.json").version; const filePath = path.join(process.cwd(), "tests/test.zip"); const containersPorts = { - fileserver: buildEnv.env.devDeploymentUploadService.dev.fileServerPort, - buildtimeInstall: buildEnv.env.devDeploymentUploadService.dev.buildTimePort, - runTimeInstall: buildEnv.env.devDeploymentUploadService.dev.runtTimePort, + fileserver: env.devDeploymentUploadService.dev.fileServerPort, + buildtimeInstall: env.devDeploymentUploadService.dev.buildTimePort, + runTimeInstall: env.devDeploymentUploadService.dev.runtTimePort, }; const dockerInfo = JSON.parse(execSync(`docker info --format '{{ json . }}'`).toString().trim()); diff --git a/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx b/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx index d1c5bc75c47..6388a6b4a11 100644 --- a/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx +++ b/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx @@ -21,16 +21,10 @@ import * as __path from "path"; import * as React from "react"; import { useCallback, useEffect, useMemo, useState } from "react"; import * as DmnEditor from "@kie-tools/dmn-editor/dist/DmnEditor"; -import { normalize, Normalized } from "@kie-tools/dmn-editor/dist/normalization/normalize"; +import { normalize, Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { DMN_LATEST_VERSION, DmnLatestModel, DmnMarshaller, getMarshaller } from "@kie-tools/dmn-marshaller"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; -import { - ContentType, - ResourceContent, - SearchType, - WorkspaceChannelApi, - WorkspaceEdit, -} from "@kie-tools-core/workspace/dist/api"; +import { ResourceContent, SearchType, WorkspaceChannelApi, WorkspaceEdit } from "@kie-tools-core/workspace/dist/api"; import { DMN15_SPEC } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; import { domParser } from "@kie-tools/xml-parser-ts"; import { ns as dmn15ns } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/meta"; diff --git a/packages/dmn-editor-standalone/webpack.config.js b/packages/dmn-editor-standalone/webpack.config.js index 43e2e93035f..fbe77d9ea13 100644 --- a/packages/dmn-editor-standalone/webpack.config.js +++ b/packages/dmn-editor-standalone/webpack.config.js @@ -23,10 +23,9 @@ const path = require("path"); const { env } = require("./env"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const { ProvidePlugin } = require("webpack"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { output: { path: path.join(__dirname, "dist"), filename: "[name].js", @@ -65,7 +64,7 @@ module.exports = (env) => historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }], compress: true, - port: buildEnv.dmnEditorStandalone.dev.port, + port: env.dmnEditorStandalone.dev.port, }, performance: { hints: false, diff --git a/packages/dmn-editor-standalone/webpack.envelope-config.js b/packages/dmn-editor-standalone/webpack.envelope-config.js index b74a1fcaff1..d41d8e00481 100644 --- a/packages/dmn-editor-standalone/webpack.envelope-config.js +++ b/packages/dmn-editor-standalone/webpack.envelope-config.js @@ -23,8 +23,8 @@ const path = require("path"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const { ProvidePlugin } = require("webpack"); -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { output: { path: path.join(__dirname, "dist"), filename: "[name].js", diff --git a/packages/dmn-editor/package.json b/packages/dmn-editor/package.json index a7328dac98e..3441696ef18 100644 --- a/packages/dmn-editor/package.json +++ b/packages/dmn-editor/package.json @@ -19,7 +19,7 @@ "scripts": { "build:dev": "rimraf dist && pnpm copy:css && tsc -p tsconfig.json", "build:prod": "rimraf dist && pnpm copy:css && pnpm lint && tsc -p tsconfig.json && pnpm test-e2e && pnpm test", - "build:storybook": "storybook build -o dist-storybook", + "build:storybook": "rimraf dist-storybook && NODE_ENV=development storybook build -o dist-storybook", "copy:css": "copyfiles -u 1 \"src/**/*.{sass,scss,css}\" dist/", "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", "start": "run-script-os", @@ -54,7 +54,7 @@ "fast-deep-equal": "^3.1.3", "immer": "^10.0.3", "moment": "^2.29.4", - "react-error-boundary": "^4.0.11", + "react-error-boundary": "^4.0.13", "reactflow": "^11.8.3", "uuid": "^8.3.2", "zustand": "^4.4.2" diff --git a/packages/dmn-editor/playwright.config.ts b/packages/dmn-editor/playwright.config.ts index b5d633ac630..f7b047a8455 100644 --- a/packages/dmn-editor/playwright.config.ts +++ b/packages/dmn-editor/playwright.config.ts @@ -20,9 +20,9 @@ import { defineConfig } from "@playwright/test"; import playwirghtBaseConfig from "@kie-tools/playwright-base/playwright.config"; import merge from "lodash/merge"; -import { env } from "./env"; -const buildEnv: any = env; +import { env } from "./env"; +const buildEnv: any = env; // build-env is not typed const customConfig = defineConfig({ use: { diff --git a/packages/dmn-editor/src/DmnEditor.tsx b/packages/dmn-editor/src/DmnEditor.tsx index 766c08146cb..3a1b18aa288 100644 --- a/packages/dmn-editor/src/DmnEditor.tsx +++ b/packages/dmn-editor/src/DmnEditor.tsx @@ -28,6 +28,7 @@ import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState import { original } from "immer"; import { PMML } from "@kie-tools/pmml-editor-marshaller"; import { DmnLatestModel, AllDmnMarshallers } from "@kie-tools/dmn-marshaller"; +import { Normalized, normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { FileIcon } from "@patternfly/react-icons/dist/js/icons/file-icon"; import { InfrastructureIcon } from "@patternfly/react-icons/dist/js/icons/infrastructure-icon"; import { PficonTemplateIcon } from "@patternfly/react-icons/dist/js/icons/pficon-template-icon"; @@ -38,7 +39,6 @@ import { BoxedExpressionScreen } from "./boxedExpressions/BoxedExpressionScreen" import { DataTypes } from "./dataTypes/DataTypes"; import { Diagram, DiagramRef } from "./diagram/Diagram"; import { DmnVersionLabel } from "./diagram/DmnVersionLabel"; -import { Normalized, normalize } from "./normalization/normalize"; import { BoxedExpressionPropertiesPanel } from "./propertiesPanel/BoxedExpressionPropertiesPanel"; import { DmnEditorContextProvider, useDmnEditor } from "./DmnEditorContext"; import { DmnEditorErrorFallback } from "./DmnEditorErrorFallback"; diff --git a/packages/dmn-editor/src/DmnEditorContext.tsx b/packages/dmn-editor/src/DmnEditorContext.tsx index e90381f8bd9..21c8e4bf4bc 100644 --- a/packages/dmn-editor/src/DmnEditorContext.tsx +++ b/packages/dmn-editor/src/DmnEditorContext.tsx @@ -21,7 +21,6 @@ import * as React from "react"; import { useContext, useMemo, useRef } from "react"; import { DmnEditorProps } from "./DmnEditor"; import { DmnLatestModel } from "@kie-tools/dmn-marshaller"; -import { Normalized } from "./normalization/normalize"; export type DmnEditorContextProviderProps = Pick< DmnEditorProps, diff --git a/packages/dmn-editor/src/autolayout/autoLayoutInfo.ts b/packages/dmn-editor/src/autolayout/autoLayoutInfo.ts index 74cd1b79ba2..4a3ca0a88f3 100644 --- a/packages/dmn-editor/src/autolayout/autoLayoutInfo.ts +++ b/packages/dmn-editor/src/autolayout/autoLayoutInfo.ts @@ -19,6 +19,7 @@ import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { DC__Bounds } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { addNamespaceToHref, parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import ELK, * as Elk from "elkjs/lib/elk.bundled.js"; import { Edge, Node } from "reactflow"; import { NodeType } from "../diagram/connections/graphStructure"; @@ -29,7 +30,6 @@ import { DEFAULT_NODE_SIZES, MIN_NODE_SIZES } from "../diagram/nodes/DefaultSize import { DmnDiagramNodeData } from "../diagram/nodes/Nodes"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; import { SnapGrid } from "../store/Store"; -import { addNamespaceToHref, parseXmlHref } from "../xml/xmlHrefs"; const elk = new ELK(); diff --git a/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx b/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx index 5e4fb2ab5e9..72a355eb9a2 100644 --- a/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx +++ b/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx @@ -32,6 +32,7 @@ import { DMN15__tDecision, DMN15__tItemDefinition, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { PMMLDocumentData } from "@kie-tools/pmml-editor-marshaller/dist/api"; import { PMMLFieldData } from "@kie-tools/pmml-editor-marshaller/dist/api/PMMLFieldData"; import { PMMLModelData } from "@kie-tools/pmml-editor-marshaller/dist/api/PMMLModelData"; @@ -79,7 +80,6 @@ import { DmnEditorTab } from "../store/Store"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { getDefaultColumnWidth } from "./getDefaultColumnWidth"; import { getDefaultBoxedExpression } from "./getDefaultBoxedExpression"; -import { Normalized } from "../normalization/normalize"; import { useSettings } from "../settings/DmnEditorSettingsContext"; export function BoxedExpressionScreen({ container }: { container: React.RefObject }) { diff --git a/packages/dmn-editor/src/boxedExpressions/boxedExpressionIndex.ts b/packages/dmn-editor/src/boxedExpressions/boxedExpressionIndex.ts index 6e8618d40e8..11b4bd3f6fb 100644 --- a/packages/dmn-editor/src/boxedExpressions/boxedExpressionIndex.ts +++ b/packages/dmn-editor/src/boxedExpressions/boxedExpressionIndex.ts @@ -30,8 +30,8 @@ import { DMN15__tQuantified, DMN15__tRelation, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { AllExpressionTypes, AllExpressions, AllExpressionsWithoutTypes } from "../dataTypes/DataTypeSpec"; -import { Normalized } from "../normalization/normalize"; interface PathType { type: AllExpressionTypes; diff --git a/packages/dmn-editor/src/boxedExpressions/getDefaultBoxedExpression.tsx b/packages/dmn-editor/src/boxedExpressions/getDefaultBoxedExpression.tsx index e47a3e687d8..0d2cb791a05 100644 --- a/packages/dmn-editor/src/boxedExpressions/getDefaultBoxedExpression.tsx +++ b/packages/dmn-editor/src/boxedExpressions/getDefaultBoxedExpression.tsx @@ -55,7 +55,7 @@ import { DMN15__tContextEntry, DMN15__tOutputClause, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; export function getDefaultBoxedExpression({ logicType, diff --git a/packages/dmn-editor/src/clipboard/Clipboard.ts b/packages/dmn-editor/src/clipboard/Clipboard.ts index 8704f2c5999..08306871139 100644 --- a/packages/dmn-editor/src/clipboard/Clipboard.ts +++ b/packages/dmn-editor/src/clipboard/Clipboard.ts @@ -25,6 +25,9 @@ import { DMNDI15__DMNEdge, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; +import { getNewDmnIdRandomizer } from "@kie-tools/dmn-marshaller/dist/idRandomizer/dmnIdRandomizer"; import { Unpacked } from "../tsExt/tsExt"; import * as RF from "reactflow"; import { State } from "../store/Store"; @@ -35,9 +38,6 @@ import { DmnDiagramEdgeData } from "../diagram/edges/Edges"; import { KIE, Namespaced } from "@kie-tools/dmn-marshaller/dist/kie-extensions"; import { KIE__tComponentWidths } from "@kie-tools/dmn-marshaller/dist/schemas/kie-1_0/ts-gen/types"; import { DataType } from "../dataTypes/DataTypes"; -import { parseXmlHref } from "../xml/xmlHrefs"; -import { getNewDmnIdRandomizer } from "../idRandomizer/dmnIdRandomizer"; -import { Normalized } from "../normalization/normalize"; export const DMN_EDITOR_DIAGRAM_CLIPBOARD_MIME_TYPE = "application/json+kie-dmn-editor--diagram" as const; export const DMN_EDITOR_BOXED_EXPRESSION_CLIPBOARD_MIME_TYPE = diff --git a/packages/dmn-editor/src/dataTypes/Constraints.tsx b/packages/dmn-editor/src/dataTypes/Constraints.tsx index 9c2bd764d1b..5146bedf3ac 100644 --- a/packages/dmn-editor/src/dataTypes/Constraints.tsx +++ b/packages/dmn-editor/src/dataTypes/Constraints.tsx @@ -24,6 +24,7 @@ import { DMN15__tItemDefinition, DMN15__tUnaryTests, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { DmnBuiltInDataType, generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { ConstraintsEnum, isEnum } from "./ConstraintsEnum"; import { ConstraintsRange, isRange } from "./ConstraintsRange"; @@ -50,7 +51,6 @@ import { useDmnEditorStore } from "../store/StoreContext"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; import { UniqueNameIndex } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; import { builtInFeelTypeNames } from "./BuiltInFeelTypes"; -import { Normalized } from "../normalization/normalize"; export type TypeHelper = { check: (value: string) => boolean; diff --git a/packages/dmn-editor/src/dataTypes/DataTypeName.tsx b/packages/dmn-editor/src/dataTypes/DataTypeName.tsx index f10279dd739..b816e114925 100644 --- a/packages/dmn-editor/src/dataTypes/DataTypeName.tsx +++ b/packages/dmn-editor/src/dataTypes/DataTypeName.tsx @@ -20,6 +20,7 @@ import * as React from "react"; import { useCallback } from "react"; import { DMN15__tItemDefinition } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { Flex } from "@patternfly/react-core/dist/js/layouts/Flex"; import { EditableNodeLabel, useEditableNodeLabel } from "../diagram/nodes/EditableNodeLabel"; import { TypeRefLabel } from "./TypeRefLabel"; @@ -31,7 +32,6 @@ import { InlineFeelNameInput, OnInlineFeelNameRenamed } from "../feel/InlineFeel import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; import { State } from "../store/Store"; import { DmnBuiltInDataType } from "@kie-tools/boxed-expression-component/dist/api"; -import { Normalized } from "../normalization/normalize"; export function DataTypeName({ isReadOnly, diff --git a/packages/dmn-editor/src/dataTypes/DataTypeSpec.ts b/packages/dmn-editor/src/dataTypes/DataTypeSpec.ts index d53e5039992..c139483fff4 100644 --- a/packages/dmn-editor/src/dataTypes/DataTypeSpec.ts +++ b/packages/dmn-editor/src/dataTypes/DataTypeSpec.ts @@ -35,9 +35,9 @@ import { DMN15__tRelation, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { DMN15_SPEC } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { DataTypeIndex } from "./DataTypes"; import { KIE__tConstraintType } from "@kie-tools/dmn-marshaller/dist/schemas/kie-1_0/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; export function findDataTypeById({ definitions, diff --git a/packages/dmn-editor/src/dataTypes/DataTypes.tsx b/packages/dmn-editor/src/dataTypes/DataTypes.tsx index 02dbd0e0b9c..fa4ea17a36b 100644 --- a/packages/dmn-editor/src/dataTypes/DataTypes.tsx +++ b/packages/dmn-editor/src/dataTypes/DataTypes.tsx @@ -20,6 +20,8 @@ import * as React from "react"; import { useCallback, useMemo, useState } from "react"; import { DMN15__tItemDefinition } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { getNewDmnIdRandomizer } from "@kie-tools/dmn-marshaller/dist/idRandomizer/dmnIdRandomizer"; import { Drawer, DrawerContent, @@ -53,11 +55,8 @@ import { DmnEditorDataTypesClipboard, getClipboard, } from "../clipboard/Clipboard"; -import { getNewDmnIdRandomizer } from "../idRandomizer/dmnIdRandomizer"; import { addTopLevelItemDefinition as _addTopLevelItemDefinition } from "../mutations/addTopLevelItemDefinition"; -import { DmnBuiltInDataType } from "@kie-tools/boxed-expression-component/dist/api"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; -import { Normalized } from "../normalization/normalize"; import { useSettings } from "../settings/DmnEditorSettingsContext"; export type DataType = { diff --git a/packages/dmn-editor/src/dataTypes/ItemComponentsTable.tsx b/packages/dmn-editor/src/dataTypes/ItemComponentsTable.tsx index 0183f458297..8a4ec8c3fad 100644 --- a/packages/dmn-editor/src/dataTypes/ItemComponentsTable.tsx +++ b/packages/dmn-editor/src/dataTypes/ItemComponentsTable.tsx @@ -51,17 +51,16 @@ import { DmnEditorDataTypesClipboard, getClipboard, } from "../clipboard/Clipboard"; -import { getNewDmnIdRandomizer } from "../idRandomizer/dmnIdRandomizer"; +import { getNewDmnIdRandomizer } from "@kie-tools/dmn-marshaller/dist/idRandomizer/dmnIdRandomizer"; import { isEnum } from "./ConstraintsEnum"; import { isRange } from "./ConstraintsRange"; import { constraintTypeHelper, recursivelyGetRootItemDefinition } from "./Constraints"; import { builtInFeelTypeNames } from "./BuiltInFeelTypes"; import { useDmnEditor } from "../DmnEditorContext"; import { DMN15__tItemDefinition } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { resolveTypeRef } from "./resolveTypeRef"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; -import { Normalized } from "../normalization/normalize"; -import { useSettings } from "../settings/DmnEditorSettingsContext"; export const BRIGHTNESS_DECREASE_STEP_IN_PERCENTAGE_PER_NESTING_LEVEL = 5; export const STARTING_BRIGHTNESS_LEVEL_IN_PERCENTAGE = 95; diff --git a/packages/dmn-editor/src/dataTypes/TypeRefLabel.tsx b/packages/dmn-editor/src/dataTypes/TypeRefLabel.tsx index 03da2f7e40a..301a4d5386c 100644 --- a/packages/dmn-editor/src/dataTypes/TypeRefLabel.tsx +++ b/packages/dmn-editor/src/dataTypes/TypeRefLabel.tsx @@ -22,8 +22,8 @@ import { useMemo } from "react"; import { DmnBuiltInDataType, generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { buildFeelQNameFromXmlQName } from "../feel/buildFeelQName"; import { buildXmlQName, parseXmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; +import { getXmlNamespaceDeclarationName } from "@kie-tools/dmn-marshaller/dist/xml/xmlNamespaceDeclarations"; import { useDmnEditorStore } from "../store/StoreContext"; -import { getXmlNamespaceDeclarationName } from "../xml/xmlNamespaceDeclarations"; import { parseFeelQName } from "../feel/parseFeelQName"; import { builtInFeelTypeNames } from "./BuiltInFeelTypes"; diff --git a/packages/dmn-editor/src/diagram/Diagram.tsx b/packages/dmn-editor/src/diagram/Diagram.tsx index 9dbd0fe75a2..c42760aa796 100644 --- a/packages/dmn-editor/src/diagram/Diagram.tsx +++ b/packages/dmn-editor/src/diagram/Diagram.tsx @@ -28,6 +28,8 @@ import { DMN15__tDecisionService, DMN15__tDefinitions, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized, normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref, parseXmlHref, xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml"; import { buildXmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button"; import { @@ -71,7 +73,6 @@ import { OverlaysPanel } from "../overlaysPanel/OverlaysPanel"; import { DiagramLhsPanel, SnapGrid, State } from "../store/Store"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { Unpacked } from "../tsExt/tsExt"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; import { DiagramContainerContextProvider } from "./DiagramContainerContext"; import { MIME_TYPE_FOR_DMN_EDITOR_DRG_NODE } from "./DrgNodesPanel"; import { MIME_TYPE_FOR_DMN_EDITOR_NEW_NODE_FROM_PALETTE, Palette } from "./Palette"; @@ -110,7 +111,6 @@ import { UnknownNode, } from "./nodes/Nodes"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; -import { xmlHrefToQName } from "../xml/xmlHrefToQName"; import { addAutoGeneratedDecisionServiceToDrd, addConflictingDecisionServiceToDrd, @@ -123,7 +123,6 @@ import { updateExpressionWidths } from "../mutations/updateExpressionWidths"; import { DiagramCommands } from "./DiagramCommands"; import { getAutoLayoutedInfo } from "../autolayout/autoLayoutInfo"; import { autoGenerateDrd } from "../normalization/autoGenerateDrd"; -import { normalize, Normalized } from "../normalization/normalize"; import OptimizeIcon from "@patternfly/react-icons/dist/js/icons/optimize-icon"; import { applyAutoLayoutToDrd } from "../mutations/applyAutoLayoutToDrd"; import { useSettings } from "../settings/DmnEditorSettingsContext"; diff --git a/packages/dmn-editor/src/diagram/DiagramCommands.tsx b/packages/dmn-editor/src/diagram/DiagramCommands.tsx index e7354f80d9f..d99d4adf271 100644 --- a/packages/dmn-editor/src/diagram/DiagramCommands.tsx +++ b/packages/dmn-editor/src/diagram/DiagramCommands.tsx @@ -26,7 +26,8 @@ import { buildClipboardFromDiagram, getClipboard, } from "../clipboard/Clipboard"; -import { getNewDmnIdRandomizer } from "../idRandomizer/dmnIdRandomizer"; +import { buildXmlHref, parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; +import { getNewDmnIdRandomizer } from "@kie-tools/dmn-marshaller/dist/idRandomizer/dmnIdRandomizer"; import { NodeNature, nodeNatures } from "../mutations/NodeNature"; import { addOrGetDrd } from "../mutations/addOrGetDrd"; import { addStandaloneNode } from "../mutations/addStandaloneNode"; @@ -40,7 +41,6 @@ import { NODE_TYPES } from "./nodes/NodeTypes"; import { DmnDiagramNodeData } from "./nodes/Nodes"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; import { NodeType } from "./connections/graphStructure"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; import { DEFAULT_VIEWPORT } from "./Diagram"; import { useCommands } from "../commands/CommandsContextProvider"; diff --git a/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx b/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx index 2391eda1e09..9fa53445919 100644 --- a/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx +++ b/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx @@ -18,6 +18,8 @@ */ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button/Button"; import { SearchInput } from "@patternfly/react-core/dist/js/components/SearchInput"; import { Text, TextContent } from "@patternfly/react-core/dist/js/components/Text"; @@ -29,13 +31,11 @@ import { DmnObjectListItem } from "../externalNodes/DmnObjectListItem"; import { DiagramLhsPanel } from "../store/Store"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { Unpacked } from "../tsExt/tsExt"; -import { buildXmlHref } from "../xml/xmlHrefs"; import { Divider } from "@patternfly/react-core/dist/js/components/Divider"; import { computeContainingDecisionServiceHrefsByDecisionHrefs } from "../store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts"; import { EmptyState, EmptyStateBody, EmptyStateIcon } from "@patternfly/react-core/dist/js/components/EmptyState"; import { Title } from "@patternfly/react-core/dist/js/components/Title"; import CubesIcon from "@patternfly/react-icons/dist/js/icons/cubes-icon"; -import { Normalized } from "../normalization/normalize"; export const MIME_TYPE_FOR_DMN_EDITOR_DRG_NODE = "kie-dmn-editor--drg-node"; diff --git a/packages/dmn-editor/src/diagram/SnapGrid.ts b/packages/dmn-editor/src/diagram/SnapGrid.ts index 8696e856672..6508ab4429f 100644 --- a/packages/dmn-editor/src/diagram/SnapGrid.ts +++ b/packages/dmn-editor/src/diagram/SnapGrid.ts @@ -23,8 +23,8 @@ import { DC__Point, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { SnapGrid } from "../store/Store"; -import { Normalized } from "../normalization/normalize"; export function snapShapePosition(snapGrid: SnapGrid, shape: Normalized) { return snapBoundsPosition(snapGrid, shape["dc:Bounds"]); diff --git a/packages/dmn-editor/src/diagram/edges/Edges.tsx b/packages/dmn-editor/src/diagram/edges/Edges.tsx index 4a16054bdbf..3cf2fcf0733 100644 --- a/packages/dmn-editor/src/diagram/edges/Edges.tsx +++ b/packages/dmn-editor/src/diagram/edges/Edges.tsx @@ -17,10 +17,11 @@ * under the License. */ -import { DMNDI15__DMNEdge, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import * as React from "react"; import { useRef } from "react"; import * as RF from "reactflow"; +import { DMNDI15__DMNEdge, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { DrgEdge } from "../graph/graph"; import { DEFAULT_INTRACTION_WIDTH } from "../maths/DmnMaths"; import { propsHaveSameValuesDeep } from "../memoization/memoization"; @@ -29,7 +30,6 @@ import { PotentialWaypoint, Waypoints } from "./Waypoints"; import { useAlwaysVisibleEdgeUpdatersAtNodeBorders } from "./useAlwaysVisibleEdgeUpdatersAtNodeBorders"; import { useKieEdgePath } from "./useKieEdgePath"; import { usePotentialWaypointControls } from "./usePotentialWaypointControls"; -import { Normalized } from "../../normalization/normalize"; import { useSettings } from "../../settings/DmnEditorSettingsContext"; export type DmnDiagramEdgeData = { diff --git a/packages/dmn-editor/src/diagram/edges/getSnappedMultiPointAnchoredEdgePath.tsx b/packages/dmn-editor/src/diagram/edges/getSnappedMultiPointAnchoredEdgePath.tsx index 44c9386a5c4..10b020ab0d9 100644 --- a/packages/dmn-editor/src/diagram/edges/getSnappedMultiPointAnchoredEdgePath.tsx +++ b/packages/dmn-editor/src/diagram/edges/getSnappedMultiPointAnchoredEdgePath.tsx @@ -17,12 +17,13 @@ * under the License. */ +import * as RF from "reactflow"; import { DC__Point, DMNDI15__DMNEdge, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import * as RF from "reactflow"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { switchExpression } from "@kie-tools-core/switch-expression-ts"; import { snapPoint } from "../SnapGrid"; import { PositionalNodeHandleId } from "../connections/PositionalNodeHandles"; @@ -31,7 +32,6 @@ import { getBoundsCenterPoint } from "../maths/Maths"; import { Bounds, getDiscretelyAutoPositionedEdgeParams } from "../maths/Maths"; import { AutoPositionedEdgeMarker } from "./AutoPositionedEdgeMarker"; import { SnapGrid } from "../../store/Store"; -import { Normalized } from "../../normalization/normalize"; export function getSnappedMultiPointAnchoredEdgePath({ snapGrid, diff --git a/packages/dmn-editor/src/diagram/edges/usePotentialWaypointControls.ts b/packages/dmn-editor/src/diagram/edges/usePotentialWaypointControls.ts index d63d5014afd..b2f36fcef13 100644 --- a/packages/dmn-editor/src/diagram/edges/usePotentialWaypointControls.ts +++ b/packages/dmn-editor/src/diagram/edges/usePotentialWaypointControls.ts @@ -23,6 +23,7 @@ import { addEdgeWaypoint } from "../../mutations/addEdgeWaypoint"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { snapPoint } from "../SnapGrid"; import { DC__Point } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefToQName"; import { DmnDiagramNodeData } from "../nodes/Nodes"; import { DmnDiagramEdgeData } from "./Edges"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; @@ -30,7 +31,6 @@ import { addEdge } from "../../mutations/addEdge"; import { EdgeType, NodeType } from "../connections/graphStructure"; import { PositionalNodeHandleId } from "../connections/PositionalNodeHandles"; import { getHandlePosition } from "../maths/DmnMaths"; -import { xmlHrefToQName } from "../../xml/xmlHrefToQName"; export function usePotentialWaypointControls( waypoints: DC__Point[], diff --git a/packages/dmn-editor/src/diagram/graph/graph.ts b/packages/dmn-editor/src/diagram/graph/graph.ts index 72ff4f72de5..73797975b81 100644 --- a/packages/dmn-editor/src/diagram/graph/graph.ts +++ b/packages/dmn-editor/src/diagram/graph/graph.ts @@ -18,8 +18,8 @@ */ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { Unpacked } from "../../tsExt/tsExt"; -import { Normalized } from "../../normalization/normalize"; export type AdjMatrix = Record< string, diff --git a/packages/dmn-editor/src/diagram/maths/DmnMaths.ts b/packages/dmn-editor/src/diagram/maths/DmnMaths.ts index 12690dfa78e..7dc80b30c57 100644 --- a/packages/dmn-editor/src/diagram/maths/DmnMaths.ts +++ b/packages/dmn-editor/src/diagram/maths/DmnMaths.ts @@ -24,6 +24,7 @@ import { DC__Point, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { SnapGrid } from "../../store/Store"; import { snapBoundsDimensions, snapBoundsPosition } from "../SnapGrid"; import { PositionalNodeHandleId } from "../connections/PositionalNodeHandles"; @@ -31,7 +32,6 @@ import { AutoPositionedEdgeMarker } from "../edges/AutoPositionedEdgeMarker"; import { NODE_TYPES } from "../nodes/NodeTypes"; import { NodeDmnObjects } from "../nodes/Nodes"; import { getCenter } from "./Maths"; -import { Normalized } from "../../normalization/normalize"; export const DEFAULT_INTRACTION_WIDTH = 40; export const CONTAINER_NODES_DESIRABLE_PADDING = 60; diff --git a/packages/dmn-editor/src/diagram/nodes/DataTypeNodePanel.tsx b/packages/dmn-editor/src/diagram/nodes/DataTypeNodePanel.tsx index d0cd47d90fb..1359832a425 100644 --- a/packages/dmn-editor/src/diagram/nodes/DataTypeNodePanel.tsx +++ b/packages/dmn-editor/src/diagram/nodes/DataTypeNodePanel.tsx @@ -22,12 +22,11 @@ import { DMN15__tInformationItem, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { DmnBuiltInDataType } from "@kie-tools/boxed-expression-component/dist/api"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore } from "../../store/StoreContext"; import { OnCreateDataType, OnToggle, OnTypeRefChange, TypeRefSelector } from "../../dataTypes/TypeRefSelector"; import { useDmnEditor } from "../../DmnEditorContext"; import { useResolvedTypeRef } from "../../dataTypes/useResolvedTypeRef"; -import { Normalized } from "../../normalization/normalize"; function stopPropagation(e: React.MouseEvent | React.KeyboardEvent) { e.stopPropagation(); diff --git a/packages/dmn-editor/src/diagram/nodes/EditableNodeLabel.tsx b/packages/dmn-editor/src/diagram/nodes/EditableNodeLabel.tsx index f86959e5b29..ab4b8365f52 100644 --- a/packages/dmn-editor/src/diagram/nodes/EditableNodeLabel.tsx +++ b/packages/dmn-editor/src/diagram/nodes/EditableNodeLabel.tsx @@ -25,6 +25,7 @@ import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContex import { UniqueNameIndex } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; import { buildFeelQNameFromXmlQName } from "../../feel/buildFeelQName"; import { DMN15__tNamedElement } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { Truncate } from "@patternfly/react-core/dist/js/components/Truncate"; import { DMN15_SPEC } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; import { invalidInlineFeelNameStyle } from "../../feel/InlineFeelNameInput"; @@ -34,7 +35,6 @@ import { flushSync } from "react-dom"; import { NodeLabelPosition } from "./NodeSvgs"; import { State } from "../../store/Store"; import "./EditableNodeLabel.css"; -import { Normalized } from "../../normalization/normalize"; import { useSettings } from "../../settings/DmnEditorSettingsContext"; export type OnEditableNodeLabelChange = (value: string | undefined) => void; diff --git a/packages/dmn-editor/src/diagram/nodes/NodeStyle.ts b/packages/dmn-editor/src/diagram/nodes/NodeStyle.ts index c1730ab46d7..94a569a66e2 100644 --- a/packages/dmn-editor/src/diagram/nodes/NodeStyle.ts +++ b/packages/dmn-editor/src/diagram/nodes/NodeStyle.ts @@ -19,10 +19,10 @@ import React, { useMemo } from "react"; import { DMNDI15__DMNStyle } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { NodeType } from "../connections/graphStructure"; import { NODE_TYPES } from "./NodeTypes"; import { NodeLabelPosition } from "./NodeSvgs"; -import { Normalized } from "../../normalization/normalize"; export interface NodeStyle { fontCssProperties: React.CSSProperties; diff --git a/packages/dmn-editor/src/diagram/nodes/Nodes.tsx b/packages/dmn-editor/src/diagram/nodes/Nodes.tsx index 9da807bfcc8..51c673e6388 100644 --- a/packages/dmn-editor/src/diagram/nodes/Nodes.tsx +++ b/packages/dmn-editor/src/diagram/nodes/Nodes.tsx @@ -30,6 +30,7 @@ import { DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { XmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { drag } from "d3-drag"; import { select } from "d3-selection"; import * as React from "react"; @@ -71,7 +72,6 @@ import { OutgoingStuffNodePanel } from "./OutgoingStuffNodePanel"; import { propsHaveSameValuesDeep } from "../memoization/memoization"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; import { NODE_LAYERS } from "../../store/computed/computeDiagramData"; -import { Normalized } from "../../normalization/normalize"; import { useSettings } from "../../settings/DmnEditorSettingsContext"; export type ElementFilter = E extends any diff --git a/packages/dmn-editor/src/externalNodes/DmnObjectListItem.tsx b/packages/dmn-editor/src/externalNodes/DmnObjectListItem.tsx index b21e543428b..aae8422ef7f 100644 --- a/packages/dmn-editor/src/externalNodes/DmnObjectListItem.tsx +++ b/packages/dmn-editor/src/externalNodes/DmnObjectListItem.tsx @@ -20,6 +20,7 @@ import * as React from "react"; import { useMemo } from "react"; import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { Unpacked } from "../tsExt/tsExt"; import { TypeRefLabel } from "../dataTypes/TypeRefLabel"; import { NodeIcon } from "../icons/Icons"; @@ -30,7 +31,6 @@ import { DmnBuiltInDataType, generateUuid } from "@kie-tools/boxed-expression-co import { useDmnEditorStore } from "../store/StoreContext"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; import { DMN15_SPEC } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; -import { Normalized } from "../normalization/normalize"; import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; diff --git a/packages/dmn-editor/src/externalNodes/ExternalNodesPanel.tsx b/packages/dmn-editor/src/externalNodes/ExternalNodesPanel.tsx index 2cb1ceb5dbf..0d3f0cc9e54 100644 --- a/packages/dmn-editor/src/externalNodes/ExternalNodesPanel.tsx +++ b/packages/dmn-editor/src/externalNodes/ExternalNodesPanel.tsx @@ -19,10 +19,10 @@ import * as React from "react"; import { useCallback, useState } from "react"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { DiagramLhsPanel, DmnEditorTab } from "../store/Store"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { Flex } from "@patternfly/react-core/dist/js/layouts/Flex"; -import { buildXmlHref } from "../xml/xmlHrefs"; import { EmptyState, EmptyStateBody, diff --git a/packages/dmn-editor/src/feel/buildFeelQName.ts b/packages/dmn-editor/src/feel/buildFeelQName.ts index 41b8a75c8d1..a8ab5c34616 100644 --- a/packages/dmn-editor/src/feel/buildFeelQName.ts +++ b/packages/dmn-editor/src/feel/buildFeelQName.ts @@ -18,9 +18,9 @@ */ import { DMN15__tImport, DMN15__tNamedElement } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { XmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; import { XmlParserTsRootElementBaseType } from "@kie-tools/xml-parser-ts"; -import { Normalized } from "../normalization/normalize"; export type FeelQNameBuild = { full: string; diff --git a/packages/dmn-editor/src/includedModels/IncludedModels.tsx b/packages/dmn-editor/src/includedModels/IncludedModels.tsx index cb929054328..efb1034f059 100644 --- a/packages/dmn-editor/src/includedModels/IncludedModels.tsx +++ b/packages/dmn-editor/src/includedModels/IncludedModels.tsx @@ -21,6 +21,7 @@ import * as React from "react"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { ns as dmn12ns } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_2/ts-gen/meta"; import { DMN15__tImport } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button"; import { Card, CardActions, CardBody, CardHeader, CardTitle } from "@patternfly/react-core/dist/js/components/Card"; import { Divider } from "@patternfly/react-core/dist/js/components/Divider"; @@ -56,7 +57,6 @@ import { useInViewSelect } from "../responsiveness/useInViewSelect"; import { useCancelableEffect } from "@kie-tools-core/react-hooks/dist/useCancelableEffect"; import { State } from "../store/Store"; import "./IncludedModels.css"; -import { Normalized } from "../normalization/normalize"; import { Popover, PopoverPosition } from "@patternfly/react-core/dist/js/components/Popover"; import { AlertActionCloseButton, AlertActionLink } from "@patternfly/react-core/dist/js/components/Alert"; import { useSettings } from "../settings/DmnEditorSettingsContext"; diff --git a/packages/dmn-editor/src/includedModels/importNamespaces.ts b/packages/dmn-editor/src/includedModels/importNamespaces.ts index e8345f98916..7b6afba97b5 100644 --- a/packages/dmn-editor/src/includedModels/importNamespaces.ts +++ b/packages/dmn-editor/src/includedModels/importNamespaces.ts @@ -19,8 +19,8 @@ import { DMN15__tImport } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { allDmnImportNamespaces } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { allPmmlImportNamespaces, getPmmlNamespaceFromDmnImport } from "../pmml/pmml"; -import { Normalized } from "../normalization/normalize"; export function getNamespaceOfDmnImport({ dmnImport }: { dmnImport: Normalized }) { if (allDmnImportNamespaces.has(dmnImport["@_importType"])) { diff --git a/packages/dmn-editor/src/mutations/addConnectedNode.ts b/packages/dmn-editor/src/mutations/addConnectedNode.ts index 6bd26ba3173..ebb78db6dd6 100644 --- a/packages/dmn-editor/src/mutations/addConnectedNode.ts +++ b/packages/dmn-editor/src/mutations/addConnectedNode.ts @@ -17,7 +17,7 @@ * under the License. */ -import { DmnBuiltInDataType, generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; +import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { DC__Bounds, DMN15__tAuthorityRequirement, @@ -26,6 +26,8 @@ import { DMN15__tInformationRequirement, DMN15__tKnowledgeRequirement, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { EdgeType, NodeType } from "../diagram/connections/graphStructure"; import { AutoPositionedEdgeMarker } from "../diagram/edges/AutoPositionedEdgeMarker"; import { EDGE_TYPES } from "../diagram/edges/EdgeTypes"; @@ -36,8 +38,6 @@ import { NodeNature, nodeNatures } from "./NodeNature"; import { addOrGetDrd } from "./addOrGetDrd"; import { getCentralizedDecisionServiceDividerLine } from "./updateDecisionServiceDividerLine"; import { repopulateInputDataAndDecisionsOnAllDecisionServices } from "./repopulateInputDataAndDecisionsOnDecisionService"; -import { buildXmlHref } from "../xml/xmlHrefs"; -import { Normalized } from "../normalization/normalize"; import { ExternalModelsIndex } from "../DmnEditor"; export function addConnectedNode({ diff --git a/packages/dmn-editor/src/mutations/addDecisionToDecisionService.ts b/packages/dmn-editor/src/mutations/addDecisionToDecisionService.ts index 18c45243d80..12b6efc2dd7 100644 --- a/packages/dmn-editor/src/mutations/addDecisionToDecisionService.ts +++ b/packages/dmn-editor/src/mutations/addDecisionToDecisionService.ts @@ -18,17 +18,15 @@ */ import { DMN15__tDefinitions, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { parseXmlHref, xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml"; import { getContainmentRelationship, getDecisionServiceDividerLineLocalY } from "../diagram/maths/DmnMaths"; import { addOrGetDrd } from "./addOrGetDrd"; import { repopulateInputDataAndDecisionsOnDecisionService } from "./repopulateInputDataAndDecisionsOnDecisionService"; import { SnapGrid } from "../store/Store"; import { MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; -import { Normalized } from "../normalization/normalize"; import { ExternalModelsIndex } from "../DmnEditor"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; -import { DmnLatestModel } from "@kie-tools/dmn-marshaller/dist"; -import { xmlHrefToQName } from "../xml/xmlHrefToQName"; export function addDecisionToDecisionService({ definitions, diff --git a/packages/dmn-editor/src/mutations/addEdge.ts b/packages/dmn-editor/src/mutations/addEdge.ts index b45591a26a9..41bf1979ec3 100644 --- a/packages/dmn-editor/src/mutations/addEdge.ts +++ b/packages/dmn-editor/src/mutations/addEdge.ts @@ -28,6 +28,7 @@ import { DMN15__tKnowledgeRequirement, DMNDI15__DMNEdge, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { PositionalNodeHandleId } from "../diagram/connections/PositionalNodeHandles"; import { EdgeType, NodeType } from "../diagram/connections/graphStructure"; import { _checkIsValidConnection } from "../diagram/connections/isValidConnection"; @@ -39,7 +40,6 @@ import { Unpacked } from "../tsExt/tsExt"; import { repopulateInputDataAndDecisionsOnAllDecisionServices } from "./repopulateInputDataAndDecisionsOnDecisionService"; import { DmnDiagramNodeData } from "../diagram/nodes/Nodes"; import { AutoPositionedEdgeMarker } from "../diagram/edges/AutoPositionedEdgeMarker"; -import { Normalized } from "../normalization/normalize"; import { ExternalModelsIndex } from "../DmnEditor"; export function addEdge({ diff --git a/packages/dmn-editor/src/mutations/addEdgeWaypoint.ts b/packages/dmn-editor/src/mutations/addEdgeWaypoint.ts index 8331ed9ca56..41cf6489b25 100644 --- a/packages/dmn-editor/src/mutations/addEdgeWaypoint.ts +++ b/packages/dmn-editor/src/mutations/addEdgeWaypoint.ts @@ -18,8 +18,8 @@ */ import { DC__Point, DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { addOrGetDrd } from "./addOrGetDrd"; -import { Normalized } from "../normalization/normalize"; export function addEdgeWaypoint({ definitions, diff --git a/packages/dmn-editor/src/mutations/addExistingDecisionServiceToDrd.ts b/packages/dmn-editor/src/mutations/addExistingDecisionServiceToDrd.ts index dd7ab5281a9..743facddf49 100644 --- a/packages/dmn-editor/src/mutations/addExistingDecisionServiceToDrd.ts +++ b/packages/dmn-editor/src/mutations/addExistingDecisionServiceToDrd.ts @@ -22,18 +22,17 @@ import { DMN15__tDecisionService, DMN15__tDefinitions, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref, parseXmlHref, xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml"; import { ExternalModelsIndex } from "../DmnEditor"; import { getAutoLayoutedInfo } from "../autolayout/autoLayoutInfo"; import { DECISION_SERVICE_COLLAPSED_DIMENSIONS, MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; -import { Normalized } from "../normalization/normalize"; import { Computed, SnapGrid, State } from "../store/Store"; import { computeContainingDecisionServiceHrefsByDecisionHrefs } from "../store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts"; import { computeDiagramData } from "../store/computed/computeDiagramData"; import { computeDirectlyIncludedExternalModelsByNamespace } from "../store/computed/computeDirectlyIncludedExternalModelsByNamespace"; import { computeIndexedDrd } from "../store/computed/computeIndexes"; -import { xmlHrefToQName } from "../xml/xmlHrefToQName"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; import { addOrGetDrd } from "./addOrGetDrd"; import { addShape } from "./addShape"; import { applyAutoLayoutToDrd } from "./applyAutoLayoutToDrd"; diff --git a/packages/dmn-editor/src/mutations/addImport.ts b/packages/dmn-editor/src/mutations/addImport.ts index 2e802dfafe1..58f9ddbd022 100644 --- a/packages/dmn-editor/src/mutations/addImport.ts +++ b/packages/dmn-editor/src/mutations/addImport.ts @@ -19,7 +19,7 @@ import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { DMN15__tDefinitions, DMN15__tImport } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; export function addImport({ definitions, diff --git a/packages/dmn-editor/src/mutations/addMissingImportNamespaces.ts b/packages/dmn-editor/src/mutations/addMissingImportNamespaces.ts deleted file mode 100644 index 253623ccb4c..00000000000 --- a/packages/dmn-editor/src/mutations/addMissingImportNamespaces.ts +++ /dev/null @@ -1,53 +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. - */ - -import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; - -export function addMissingImportNamespaces(definitions: Normalized) { - if (definitions.import === undefined) { - return; - } - - // Collect all declared namespaces - const definedNamespaces = new Set( - Object.keys(definitions) - .filter((keys: keyof DMN15__tDefinitions) => String(keys).startsWith("@_xmlns:")) - .map((xmlnsKey: keyof DMN15__tDefinitions) => definitions[xmlnsKey]) - ); - - // Add missing import namespace declarations as `xmlns:included*` - let includedIndex = 0; - for (let index = 0; index < definitions.import.length; index++) { - const importedModelNamespace = definitions.import[index]["@_namespace"]; - - // Check if namespace is already declared - if (definedNamespaces.has(importedModelNamespace)) { - // Ignore namespaces that are already declared - continue; - } - - // Get next available `included*` namespace declaration name - while (definitions[`@_xmlns:included${includedIndex}`]) { - includedIndex++; - } - - definitions[`@_xmlns:included${includedIndex}`] = importedModelNamespace; - } -} diff --git a/packages/dmn-editor/src/mutations/addOrGetDrd.ts b/packages/dmn-editor/src/mutations/addOrGetDrd.ts index 6cf19f7928c..cdeaa54ef70 100644 --- a/packages/dmn-editor/src/mutations/addOrGetDrd.ts +++ b/packages/dmn-editor/src/mutations/addOrGetDrd.ts @@ -19,7 +19,7 @@ import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; export function getDefaultDrdName({ drdIndex }: { drdIndex: number }) { return drdIndex === 0 ? "Default DRD" : "Unnamed DRD"; diff --git a/packages/dmn-editor/src/mutations/addShape.ts b/packages/dmn-editor/src/mutations/addShape.ts index f81585b9106..8204be4086a 100644 --- a/packages/dmn-editor/src/mutations/addShape.ts +++ b/packages/dmn-editor/src/mutations/addShape.ts @@ -22,9 +22,9 @@ import { DMN15__tDefinitions, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { NodeType } from "../diagram/connections/graphStructure"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; -import { Normalized } from "../normalization/normalize"; import { addOrGetDrd } from "./addOrGetDrd"; import { getCentralizedDecisionServiceDividerLine } from "./updateDecisionServiceDividerLine"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; diff --git a/packages/dmn-editor/src/mutations/addStandaloneNode.ts b/packages/dmn-editor/src/mutations/addStandaloneNode.ts index ce78b8b3ac9..e400c667ace 100644 --- a/packages/dmn-editor/src/mutations/addStandaloneNode.ts +++ b/packages/dmn-editor/src/mutations/addStandaloneNode.ts @@ -20,14 +20,14 @@ import { switchExpression } from "@kie-tools-core/switch-expression-ts"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { DC__Bounds, DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { NodeType } from "../diagram/connections/graphStructure"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; import { NodeNature, nodeNatures } from "./NodeNature"; import { addOrGetDrd as getDefaultDiagram } from "./addOrGetDrd"; import { getCentralizedDecisionServiceDividerLine } from "./updateDecisionServiceDividerLine"; import { repopulateInputDataAndDecisionsOnAllDecisionServices } from "./repopulateInputDataAndDecisionsOnDecisionService"; -import { buildXmlHref } from "../xml/xmlHrefs"; -import { Normalized } from "../normalization/normalize"; import { ExternalModelsIndex } from "../DmnEditor"; export function addStandaloneNode({ diff --git a/packages/dmn-editor/src/mutations/addTopLevelItemDefinition.ts b/packages/dmn-editor/src/mutations/addTopLevelItemDefinition.ts index f1ab338af15..a65d6cbfc56 100644 --- a/packages/dmn-editor/src/mutations/addTopLevelItemDefinition.ts +++ b/packages/dmn-editor/src/mutations/addTopLevelItemDefinition.ts @@ -21,8 +21,8 @@ import { DMN15__tDefinitions, DMN15__tItemDefinition, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { getNewItemDefinition } from "../dataTypes/DataTypeSpec"; -import { Normalized } from "../normalization/normalize"; export function addTopLevelItemDefinition({ definitions, diff --git a/packages/dmn-editor/src/mutations/applyAutoLayoutToDrd.ts b/packages/dmn-editor/src/mutations/applyAutoLayoutToDrd.ts index baf78e2994e..26ddb0f9c3b 100644 --- a/packages/dmn-editor/src/mutations/applyAutoLayoutToDrd.ts +++ b/packages/dmn-editor/src/mutations/applyAutoLayoutToDrd.ts @@ -18,6 +18,7 @@ */ import { DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { XmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; import * as Elk from "elkjs/lib/elk.bundled.js"; import * as RF from "reactflow"; @@ -30,7 +31,6 @@ import { addEdge } from "../mutations/addEdge"; import { repositionNode } from "../mutations/repositionNode"; import { resizeNode } from "../mutations/resizeNode"; import { updateDecisionServiceDividerLine } from "../mutations/updateDecisionServiceDividerLine"; -import { Normalized } from "../normalization/normalize"; import { State } from "../store/Store"; import { AutolayoutParentNode, FAKE_MARKER, visitNodeAndNested } from "../autolayout/autoLayoutInfo"; import { ExternalDmnsIndex, ExternalModelsIndex } from "../DmnEditor"; diff --git a/packages/dmn-editor/src/mutations/deleteDecisionFromDecisionService.ts b/packages/dmn-editor/src/mutations/deleteDecisionFromDecisionService.ts index 81f09c3c518..0893b42d317 100644 --- a/packages/dmn-editor/src/mutations/deleteDecisionFromDecisionService.ts +++ b/packages/dmn-editor/src/mutations/deleteDecisionFromDecisionService.ts @@ -18,9 +18,9 @@ */ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { repopulateInputDataAndDecisionsOnDecisionService } from "./repopulateInputDataAndDecisionsOnDecisionService"; -import { Normalized } from "../normalization/normalize"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; import { ExternalModelsIndex } from "../DmnEditor"; export function deleteDecisionFromDecisionService({ diff --git a/packages/dmn-editor/src/mutations/deleteEdge.ts b/packages/dmn-editor/src/mutations/deleteEdge.ts index 38846da5c73..ceaec6adee9 100644 --- a/packages/dmn-editor/src/mutations/deleteEdge.ts +++ b/packages/dmn-editor/src/mutations/deleteEdge.ts @@ -23,11 +23,11 @@ import { DMN15__tDefinitions, DMNDI15__DMNEdge, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefToQName"; import { addOrGetDrd } from "./addOrGetDrd"; import { DmnDiagramEdgeData } from "../diagram/edges/Edges"; import { repopulateInputDataAndDecisionsOnAllDecisionServices } from "./repopulateInputDataAndDecisionsOnDecisionService"; -import { Normalized } from "../normalization/normalize"; -import { xmlHrefToQName } from "../xml/xmlHrefToQName"; import { ExternalModelsIndex } from "../DmnEditor"; export enum EdgeDeletionMode { diff --git a/packages/dmn-editor/src/mutations/deleteEdgeWaypoint.ts b/packages/dmn-editor/src/mutations/deleteEdgeWaypoint.ts index ca03b38b03f..e8b77624d90 100644 --- a/packages/dmn-editor/src/mutations/deleteEdgeWaypoint.ts +++ b/packages/dmn-editor/src/mutations/deleteEdgeWaypoint.ts @@ -18,8 +18,8 @@ */ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { addOrGetDrd } from "./addOrGetDrd"; -import { Normalized } from "../normalization/normalize"; export function deleteEdgeWaypoint({ definitions, diff --git a/packages/dmn-editor/src/mutations/deleteImport.ts b/packages/dmn-editor/src/mutations/deleteImport.ts index 4195c39afa2..5ab74798b7e 100644 --- a/packages/dmn-editor/src/mutations/deleteImport.ts +++ b/packages/dmn-editor/src/mutations/deleteImport.ts @@ -18,8 +18,8 @@ */ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { getXmlNamespaceDeclarationName } from "../xml/xmlNamespaceDeclarations"; -import { Normalized } from "../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { getXmlNamespaceDeclarationName } from "@kie-tools/dmn-marshaller/dist/xml/xmlNamespaceDeclarations"; import { computeDiagramData } from "../store/computed/computeDiagramData"; import { deleteNode, NodeDeletionMode } from "./deleteNode"; import { nodeNatures } from "./NodeNature"; diff --git a/packages/dmn-editor/src/mutations/deleteNode.ts b/packages/dmn-editor/src/mutations/deleteNode.ts index 5782ec13b86..0133ee02200 100644 --- a/packages/dmn-editor/src/mutations/deleteNode.ts +++ b/packages/dmn-editor/src/mutations/deleteNode.ts @@ -18,19 +18,18 @@ */ import { DMN15__tDefinitions, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { getNewDmnIdRandomizer } from "@kie-tools/dmn-marshaller/dist/idRandomizer/dmnIdRandomizer"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref, xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml"; import { NodeNature } from "./NodeNature"; import { addOrGetDrd } from "./addOrGetDrd"; import { repopulateInputDataAndDecisionsOnAllDecisionServices } from "./repopulateInputDataAndDecisionsOnDecisionService"; import { XmlQName, buildXmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; -import { getNewDmnIdRandomizer } from "../idRandomizer/dmnIdRandomizer"; -import { buildXmlHref } from "../xml/xmlHrefs"; import { Unpacked } from "../tsExt/tsExt"; import { DrgEdge } from "../diagram/graph/graph"; import { EdgeDeletionMode, deleteEdge } from "./deleteEdge"; import { Computed } from "../store/Store"; import { computeContainingDecisionServiceHrefsByDecisionHrefs } from "../store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts"; -import { xmlHrefToQName } from "../xml/xmlHrefToQName"; -import { Normalized } from "../normalization/normalize"; import { ExternalDmnsIndex, ExternalModelsIndex } from "../DmnEditor"; export enum NodeDeletionMode { diff --git a/packages/dmn-editor/src/mutations/renameImport.ts b/packages/dmn-editor/src/mutations/renameImport.ts index 5b2821f18fd..b10dc6f9cd2 100644 --- a/packages/dmn-editor/src/mutations/renameImport.ts +++ b/packages/dmn-editor/src/mutations/renameImport.ts @@ -22,6 +22,7 @@ import { DMN15__tFunctionDefinition, DMN15__tLiteralExpression, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { traverseExpressionsInExpressionHolders, traverseItemDefinitions, @@ -31,7 +32,6 @@ import { buildFeelQName, parseFeelQName } from "../feel/parseFeelQName"; import { DataTypeIndex } from "../dataTypes/DataTypes"; import { DMN15__tContext } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { DMN15_SPEC } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; -import { Normalized } from "../normalization/normalize"; export function renameImport({ definitions, diff --git a/packages/dmn-editor/src/mutations/renameItemDefinition.ts b/packages/dmn-editor/src/mutations/renameItemDefinition.ts index 8de71e9be32..e6048862f30 100644 --- a/packages/dmn-editor/src/mutations/renameItemDefinition.ts +++ b/packages/dmn-editor/src/mutations/renameItemDefinition.ts @@ -23,8 +23,8 @@ import { traverseItemDefinitions, traverseTypeRefedInExpressionHolders, } from "../dataTypes/DataTypeSpec"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { DataTypeIndex } from "../dataTypes/DataTypes"; -import { Normalized } from "../normalization/normalize"; export function renameItemDefinition({ definitions, diff --git a/packages/dmn-editor/src/mutations/renameNode.ts b/packages/dmn-editor/src/mutations/renameNode.ts index bc15f5246c6..43ccb802c18 100644 --- a/packages/dmn-editor/src/mutations/renameNode.ts +++ b/packages/dmn-editor/src/mutations/renameNode.ts @@ -22,7 +22,7 @@ import { DMN15__tGroup, DMN15__tTextAnnotation, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; export function renameDrgElement({ diff --git a/packages/dmn-editor/src/mutations/repopulateInputDataAndDecisionsOnDecisionService.ts b/packages/dmn-editor/src/mutations/repopulateInputDataAndDecisionsOnDecisionService.ts index 35f4e6c2102..47e51225e88 100644 --- a/packages/dmn-editor/src/mutations/repopulateInputDataAndDecisionsOnDecisionService.ts +++ b/packages/dmn-editor/src/mutations/repopulateInputDataAndDecisionsOnDecisionService.ts @@ -21,9 +21,9 @@ import { DMN15__tDecisionService, DMN15__tDefinitions, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref, parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { ExternalModelsIndex } from "../DmnEditor"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; export function repopulateInputDataAndDecisionsOnAllDecisionServices({ definitions, diff --git a/packages/dmn-editor/src/mutations/repositionEdgeWaypoint.ts b/packages/dmn-editor/src/mutations/repositionEdgeWaypoint.ts index c577b2f4926..21e7375b969 100644 --- a/packages/dmn-editor/src/mutations/repositionEdgeWaypoint.ts +++ b/packages/dmn-editor/src/mutations/repositionEdgeWaypoint.ts @@ -18,8 +18,8 @@ */ import { DC__Point, DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { addOrGetDrd } from "./addOrGetDrd"; -import { Normalized } from "../normalization/normalize"; export function repositionEdgeWaypoint({ definitions, diff --git a/packages/dmn-editor/src/mutations/repositionNode.ts b/packages/dmn-editor/src/mutations/repositionNode.ts index 2e27f1497f8..7ead8953bd0 100644 --- a/packages/dmn-editor/src/mutations/repositionNode.ts +++ b/packages/dmn-editor/src/mutations/repositionNode.ts @@ -23,11 +23,11 @@ import { DMNDI15__DMNEdge, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { NodeType } from "../diagram/connections/graphStructure"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; import { addOrGetDrd } from "./addOrGetDrd"; import { getCentralizedDecisionServiceDividerLine } from "./updateDecisionServiceDividerLine"; -import { Normalized } from "../normalization/normalize"; export function repositionNode({ definitions, diff --git a/packages/dmn-editor/src/mutations/resizeNode.ts b/packages/dmn-editor/src/mutations/resizeNode.ts index ee991a1cc90..bbccba8048a 100644 --- a/packages/dmn-editor/src/mutations/resizeNode.ts +++ b/packages/dmn-editor/src/mutations/resizeNode.ts @@ -24,6 +24,7 @@ import { DMNDI15__DMNEdge, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { snapShapeDimensions, snapShapePosition } from "../diagram/SnapGrid"; import { PositionalNodeHandleId } from "../diagram/connections/PositionalNodeHandles"; import { NodeType } from "../diagram/connections/graphStructure"; @@ -33,7 +34,6 @@ import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; import { SnapGrid } from "../store/Store"; import { addOrGetDrd } from "./addOrGetDrd"; import { DECISION_SERVICE_DIVIDER_LINE_PADDING } from "./updateDecisionServiceDividerLine"; -import { Normalized } from "../normalization/normalize"; import { ExternalDmnsIndex } from "../DmnEditor"; export function resizeNode({ diff --git a/packages/dmn-editor/src/mutations/updateDecisionServiceDividerLine.ts b/packages/dmn-editor/src/mutations/updateDecisionServiceDividerLine.ts index 3461fd68fe5..daebac4cb93 100644 --- a/packages/dmn-editor/src/mutations/updateDecisionServiceDividerLine.ts +++ b/packages/dmn-editor/src/mutations/updateDecisionServiceDividerLine.ts @@ -24,14 +24,14 @@ import { DMNDI15__DMNDecisionServiceDividerLine, DMNDI15__DMNShape, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { addNamespaceToHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { addOrGetDrd } from "./addOrGetDrd"; import { snapShapeDimensions, snapShapePosition } from "../diagram/SnapGrid"; import { MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes"; import { SnapGrid } from "../store/Store"; import { NODE_TYPES } from "../diagram/nodes/NodeTypes"; -import { Normalized } from "../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; -import { addNamespaceToHref } from "../xml/xmlHrefs"; import { ExternalDmnsIndex } from "../DmnEditor"; export const DECISION_SERVICE_DIVIDER_LINE_PADDING = 100; diff --git a/packages/dmn-editor/src/mutations/updateExpression.ts b/packages/dmn-editor/src/mutations/updateExpression.ts index f81bc318ed3..5087508a22c 100644 --- a/packages/dmn-editor/src/mutations/updateExpression.ts +++ b/packages/dmn-editor/src/mutations/updateExpression.ts @@ -22,8 +22,8 @@ import { DMN15__tDefinitions, DMN15__tFunctionDefinition, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { renameDrgElement } from "./renameNode"; -import { Normalized } from "../normalization/normalize"; export function updateExpression({ definitions, diff --git a/packages/dmn-editor/src/mutations/updateExpressionWidths.ts b/packages/dmn-editor/src/mutations/updateExpressionWidths.ts index 51574efcec8..a49923cea8a 100644 --- a/packages/dmn-editor/src/mutations/updateExpressionWidths.ts +++ b/packages/dmn-editor/src/mutations/updateExpressionWidths.ts @@ -18,8 +18,8 @@ */ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { addOrGetDrd } from "./addOrGetDrd"; -import { Normalized } from "../normalization/normalize"; export function updateExpressionWidths({ definitions, diff --git a/packages/dmn-editor/src/normalization/autoGenerateDrd.ts b/packages/dmn-editor/src/normalization/autoGenerateDrd.ts index 5b2ef11a65e..0ed052a1ce8 100644 --- a/packages/dmn-editor/src/normalization/autoGenerateDrd.ts +++ b/packages/dmn-editor/src/normalization/autoGenerateDrd.ts @@ -25,14 +25,14 @@ import { MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes"; import { getNodeTypeFromDmnObject } from "../diagram/maths/DmnMaths"; import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { DmnLatestModel } from "@kie-tools/dmn-marshaller"; -import { parseXmlHref } from "../xml/xmlHrefs"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { computeIndexedDrd } from "../store/computed/computeIndexes"; import { getDefaultDrdName } from "../mutations/addOrGetDrd"; import { addShape } from "../mutations/addShape"; import { addEdge } from "../mutations/addEdge"; import { EdgeType, NodeType } from "../diagram/connections/graphStructure"; import { PositionalNodeHandleId } from "../diagram/connections/PositionalNodeHandles"; -import { Normalized } from "./normalize"; export async function autoGenerateDrd(args: { model: State["dmn"]["model"]; diff --git a/packages/dmn-editor/src/pmml/pmml.ts b/packages/dmn-editor/src/pmml/pmml.ts index 5fed0e6df35..7b3c647eb06 100644 --- a/packages/dmn-editor/src/pmml/pmml.ts +++ b/packages/dmn-editor/src/pmml/pmml.ts @@ -18,9 +18,9 @@ */ import { DMN15__tImport } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { buildXmlHref } from "../xml/xmlHrefs"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import * as __path from "path"; -import { Normalized } from "../normalization/normalize"; export const KIE_PMML_NAMESPACE = "https://kie.org/pmml"; diff --git a/packages/dmn-editor/src/propertiesPanel/BeePropertiesPanel.tsx b/packages/dmn-editor/src/propertiesPanel/BeePropertiesPanel.tsx index 5707a3ed75f..7f28ab97209 100644 --- a/packages/dmn-editor/src/propertiesPanel/BeePropertiesPanel.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BeePropertiesPanel.tsx @@ -24,9 +24,9 @@ import { DrawerHead, DrawerPanelContent, } from "@patternfly/react-core/dist/js/components/Drawer"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { useMemo } from "react"; -import { buildXmlHref } from "../xml/xmlHrefs"; import { SingleNodeProperties } from "./SingleNodeProperties"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; diff --git a/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx b/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx index dc91036dc27..a46e4522655 100644 --- a/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx @@ -19,6 +19,7 @@ import * as React from "react"; import { DMN15__tBusinessKnowledgeModel } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; @@ -30,7 +31,6 @@ import { InlineFeelNameInput } from "../feel/InlineFeelNameInput"; import { useDmnEditor } from "../DmnEditorContext"; import { useResolvedTypeRef } from "../dataTypes/useResolvedTypeRef"; import { useCallback } from "react"; -import { Normalized } from "../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { useSettings } from "../settings/DmnEditorSettingsContext"; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanel.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanel.tsx index 6c676742955..b0584882d8f 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanel.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanel.tsx @@ -25,7 +25,7 @@ import { DrawerPanelContent, } from "@patternfly/react-core/dist/js/components/Drawer"; import { useMemo } from "react"; -import { buildXmlHref } from "../xml/xmlHrefs"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { SingleNodeProperties } from "./SingleNodeProperties"; import { generateBoxedExpressionIndex } from "../boxedExpressions/boxedExpressionIndex"; import { Form, FormSection } from "@patternfly/react-core/dist/js/components/Form"; @@ -35,7 +35,6 @@ import { DecisionTableOutputHeaderCell } from "./BoxedExpressionPropertiesPanelC import { LiteralExpressionContentCell } from "./BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell"; import { ExpressionRootCell } from "./BoxedExpressionPropertiesPanelComponents/ExpressionRootCell"; import { DecisionTableInputRule } from "./BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell"; -import { AllExpressions } from "../dataTypes/DataTypeSpec"; import { DecisionTableRootCell } from "./BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell"; import { InvocationFunctionCallCell } from "./BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell"; import { FunctionDefinitionParameterCell } from "./BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell"; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ContextInformationItemCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ContextInformationItemCell.tsx index 4bc7ed0cac8..ec91b469980 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ContextInformationItemCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ContextInformationItemCell.tsx @@ -21,10 +21,10 @@ import * as React from "react"; import { useMemo } from "react"; import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionIndex"; import { DMN15__tContext, DMN15__tInformationItem } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { InformationItemCell } from "./InformationItemCell"; import { useDmnEditorStore } from "../../store/StoreContext"; -import { Normalized } from "../../normalization/normalize"; export function ContextInformationItemCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx index af49cd0d7fc..7dbe7d13a1f 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx @@ -23,8 +23,9 @@ import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionInde import { ContentField, DescriptionField, ExpressionLanguageField, NameField, TypeRefField } from "./Fields"; import { FormGroup, FormSection } from "@patternfly/react-core/dist/js/components/Form"; import { DMN15__tInputClause } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditor } from "../../DmnEditorContext"; -import { DmnBuiltInDataType, generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; +import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { PropertiesPanelHeader } from "../PropertiesPanelHeader"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; @@ -32,7 +33,6 @@ import { ConstraintsFromTypeConstraintAttribute } from "../../dataTypes/Constrai import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; import { State } from "../../store/Store"; -import { Normalized } from "../../normalization/normalize"; export function DecisionTableInputHeaderCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx index 00b416f197d..c7b49b928df 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx @@ -22,6 +22,7 @@ import { useMemo } from "react"; import { DescriptionField, ExpressionLanguageField, TypeRefField } from "./Fields"; import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionIndex"; import { DMN15__tDecisionTable, DMN15__tUnaryTests } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; @@ -30,7 +31,6 @@ import { ConstraintsFromTypeConstraintAttribute } from "../../dataTypes/Constrai import { useDmnEditor } from "../../DmnEditorContext"; import { DmnBuiltInDataType } from "@kie-tools/boxed-expression-component/dist/api"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; -import { Normalized } from "../../normalization/normalize"; export function DecisionTableInputRule(props: { boxedExpressionIndex?: BoxedExpressionIndex; isReadOnly: boolean }) { const dmnEditorStoreApi = useDmnEditorStoreApi(); diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx index 3168c723aad..46dca185da5 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx @@ -23,6 +23,8 @@ import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionInde import { ContentField, DescriptionField, ExpressionLanguageField, NameField, TypeRefField } from "./Fields"; import { FormGroup, FormSection } from "@patternfly/react-core/dist/js/components/Form"; import { DMN15__tDecision, DMN15__tOutputClause } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { PropertiesPanelHeader } from "../PropertiesPanelHeader"; import { BoxedDecisionTable, generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { useDmnEditor } from "../../DmnEditorContext"; @@ -32,9 +34,7 @@ import { ConstraintsFromTypeConstraintAttribute } from "../../dataTypes/Constrai import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; import { State } from "../../store/Store"; -import { Normalized } from "../../normalization/normalize"; import { renameDrgElement } from "../../mutations/renameNode"; -import { buildXmlHref } from "../../xml/xmlHrefs"; export function DecisionTableOutputHeaderCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx index 593b9d7ce8d..c65bad38d39 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx @@ -25,6 +25,7 @@ import { DMN15__tDecisionTable, DMN15__tLiteralExpression, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; @@ -33,7 +34,6 @@ import { BoxedDecisionTable, DmnBuiltInDataType } from "@kie-tools/boxed-express import { useDmnEditor } from "../../DmnEditorContext"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; -import { Normalized } from "../../normalization/normalize"; export function DecisionTableOutputRuleCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx index 22bca2440df..bbc22e5fb58 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx @@ -22,11 +22,11 @@ import { useMemo } from "react"; import { DescriptionField, TextField, TextFieldType } from "./Fields"; import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionIndex"; import { DMN15__tDecisionTable } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { useDmnEditorStore } from "../../store/StoreContext"; -import { Normalized } from "../../normalization/normalize"; type DecisionTableRoot = Pick< Normalized, diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx index 445cf834c05..d946840c174 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx @@ -29,13 +29,13 @@ import { DMN15__tFunctionDefinition, DMN15__tInformationItem, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { PropertiesPanelHeader } from "../PropertiesPanelHeader"; import { Text } from "@patternfly/react-core/dist/js/components/Text"; import { ConstraintsFromTypeConstraintAttribute } from "../../dataTypes/Constraints"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; import { State } from "../../store/Store"; -import { Normalized } from "../../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; export function FunctionDefinitionParameterCell(props: { diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx index 6a3c0f91aa7..4d85f287b9d 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx @@ -25,8 +25,8 @@ import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { DMN15__tFunctionDefinition } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore } from "../../store/StoreContext"; -import { Normalized } from "../../normalization/normalize"; type FunctionDefinitionRoot = Pick< Normalized, diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx index 812559ffafe..9e6f0181466 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx @@ -22,15 +22,14 @@ import { useCallback, useMemo } from "react"; import { DescriptionField, NameField, TypeRefField } from "./Fields"; import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionIndex"; import { DMN15__tInformationItem } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; -import { DmnBuiltInDataType } from "@kie-tools/boxed-expression-component/dist/api"; import { useDmnEditor } from "../../DmnEditorContext"; -import { Constraints, ConstraintsFromTypeConstraintAttribute } from "../../dataTypes/Constraints"; +import { ConstraintsFromTypeConstraintAttribute } from "../../dataTypes/Constraints"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; import { State } from "../../store/Store"; -import { Normalized } from "../../normalization/normalize"; export function InformationItemCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx index 3bf809756d9..49af9d91377 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx @@ -24,7 +24,7 @@ import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionInde import { useDmnEditorStore } from "../../store/StoreContext"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { DMN15__tLiteralExpression } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; export function InvocationFunctionCallCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationInformationItemCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationInformationItemCell.tsx index 71d9917cbe4..7069529f9e5 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationInformationItemCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationInformationItemCell.tsx @@ -24,10 +24,10 @@ import { DMN15__tInformationItem, DMN15__tInvocation, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore } from "../../store/StoreContext"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { InformationItemCell } from "./InformationItemCell"; -import { Normalized } from "../../normalization/normalize"; export function InvocationInformationItemCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx index 036026ed35d..62844db0930 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx @@ -24,7 +24,7 @@ import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionInde import { useDmnEditorStore } from "../../store/StoreContext"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { DMN15__tIterator } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; -import { Normalized } from "../../normalization/normalize"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; export function IteratorVariableCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; isReadOnly: boolean }) { const selectedObjectId = useDmnEditorStore((s) => s.boxedExpressionEditor.selectedObjectId); diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx index e0c1413ca06..320e163f353 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx @@ -22,11 +22,11 @@ import { useMemo } from "react"; import { DescriptionField, ExpressionLanguageField } from "./Fields"; import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionIndex"; import { DMN15__tLiteralExpression } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore } from "../../store/StoreContext"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; -import { Normalized } from "../../normalization/normalize"; export function LiteralExpressionContentCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/RelationInformationItemCell.tsx b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/RelationInformationItemCell.tsx index 9b35db2b365..bf12fa4de1a 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/RelationInformationItemCell.tsx +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/RelationInformationItemCell.tsx @@ -21,10 +21,10 @@ import * as React from "react"; import { useMemo } from "react"; import { BoxedExpressionIndex } from "../../boxedExpressions/boxedExpressionIndex"; import { DMN15__tInformationItem } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore } from "../../store/StoreContext"; import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater"; import { InformationItemCell } from "./InformationItemCell"; -import { Normalized } from "../../normalization/normalize"; export function RelationInformationItemCell(props: { boxedExpressionIndex?: BoxedExpressionIndex; diff --git a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/useBoxedExpressionUpdater.ts b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/useBoxedExpressionUpdater.ts index 1b4ab772cba..75c07a63f44 100644 --- a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/useBoxedExpressionUpdater.ts +++ b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/useBoxedExpressionUpdater.ts @@ -23,11 +23,11 @@ import { DMN15__tBusinessKnowledgeModel, DMN15__tDecision, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../../store/StoreContext"; -import { buildXmlHref } from "../../xml/xmlHrefs"; import { AllExpressionsWithoutTypes } from "../../dataTypes/DataTypeSpec"; import { useExternalModels } from "../../includedModels/DmnEditorDependenciesContext"; -import { Normalized } from "../../normalization/normalize"; export function useBoxedExpressionUpdater( expressionPath: ExpressionPath[] | undefined diff --git a/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx b/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx index dad07ad505a..a48ddfec3aa 100644 --- a/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx @@ -19,6 +19,7 @@ import * as React from "react"; import { DMN15__tDecision } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; @@ -30,7 +31,6 @@ import { InlineFeelNameInput } from "../feel/InlineFeelNameInput"; import { useDmnEditor } from "../DmnEditorContext"; import { useResolvedTypeRef } from "../dataTypes/useResolvedTypeRef"; import { useCallback } from "react"; -import { Normalized } from "../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { useSettings } from "../settings/DmnEditorSettingsContext"; diff --git a/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx b/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx index 39822a2f402..19102553b35 100644 --- a/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx @@ -25,6 +25,8 @@ import { DMN15__tInputData, DMN15__tDefinitions, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref, parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; @@ -32,7 +34,6 @@ import { DocumentationLinksFormGroup } from "./DocumentationLinksFormGroup"; import { TypeRefSelector } from "../dataTypes/TypeRefSelector"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { useCallback, useMemo } from "react"; -import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; import { DmnObjectListItem } from "../externalNodes/DmnObjectListItem"; import { renameDrgElement } from "../mutations/renameNode"; import { InlineFeelNameInput } from "../feel/InlineFeelNameInput"; @@ -43,7 +44,6 @@ import { useExternalModels } from "../includedModels/DmnEditorDependenciesContex import { DragAndDrop, Draggable } from "../draggable/Draggable"; import { buildFeelQNameFromNamespace } from "../feel/buildFeelQName"; import { Alert, AlertVariant } from "@patternfly/react-core/dist/js/components/Alert/Alert"; -import { Normalized } from "../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { ExternalDmn } from "../DmnEditor"; import { Unpacked } from "../tsExt/tsExt"; diff --git a/packages/dmn-editor/src/propertiesPanel/FontOptions.tsx b/packages/dmn-editor/src/propertiesPanel/FontOptions.tsx index fdd067c5386..ff3229e8d19 100644 --- a/packages/dmn-editor/src/propertiesPanel/FontOptions.tsx +++ b/packages/dmn-editor/src/propertiesPanel/FontOptions.tsx @@ -18,6 +18,7 @@ */ import { DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button"; import { FormSection } from "@patternfly/react-core/dist/js/components/Form"; import { NumberInput } from "@patternfly/react-core/dist/js/components/NumberInput"; @@ -36,7 +37,6 @@ import { ColorPicker } from "./ColorPicker"; import { PropertiesPanelHeader } from "./PropertiesPanelHeader"; import "./FontOptions.css"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; -import { Normalized } from "../normalization/normalize"; import { useSettings } from "../settings/DmnEditorSettingsContext"; // https://www.w3schools.com/cssref/css_websafe_fonts.php diff --git a/packages/dmn-editor/src/propertiesPanel/GroupProperties.tsx b/packages/dmn-editor/src/propertiesPanel/GroupProperties.tsx index aa496c3110a..b18d32d55e5 100644 --- a/packages/dmn-editor/src/propertiesPanel/GroupProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/GroupProperties.tsx @@ -19,13 +19,13 @@ import * as React from "react"; import { DMN15__tGroup } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; import { TextInput } from "@patternfly/react-core/dist/js/components/TextInput"; import { useDmnEditorStoreApi } from "../store/StoreContext"; import { renameGroupNode } from "../mutations/renameNode"; -import { Normalized } from "../normalization/normalize"; import { useSettings } from "../settings/DmnEditorSettingsContext"; export function GroupProperties({ group, index }: { group: Normalized; index: number }) { diff --git a/packages/dmn-editor/src/propertiesPanel/InputDataProperties.tsx b/packages/dmn-editor/src/propertiesPanel/InputDataProperties.tsx index cc8f0de3efd..e3baada963f 100644 --- a/packages/dmn-editor/src/propertiesPanel/InputDataProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/InputDataProperties.tsx @@ -19,6 +19,7 @@ import * as React from "react"; import { DMN15__tInputData } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; @@ -30,7 +31,6 @@ import { InlineFeelNameInput } from "../feel/InlineFeelNameInput"; import { useDmnEditor } from "../DmnEditorContext"; import { useResolvedTypeRef } from "../dataTypes/useResolvedTypeRef"; import { useCallback } from "react"; -import { Normalized } from "../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { useSettings } from "../settings/DmnEditorSettingsContext"; diff --git a/packages/dmn-editor/src/propertiesPanel/KnowledgeSourceProperties.tsx b/packages/dmn-editor/src/propertiesPanel/KnowledgeSourceProperties.tsx index 35806a36ee9..3c1586c84e8 100644 --- a/packages/dmn-editor/src/propertiesPanel/KnowledgeSourceProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/KnowledgeSourceProperties.tsx @@ -19,6 +19,7 @@ import * as React from "react"; import { DMN15__tKnowledgeSource } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; @@ -28,7 +29,6 @@ import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { renameDrgElement } from "../mutations/renameNode"; import { InlineFeelNameInput } from "../feel/InlineFeelNameInput"; import { useCallback } from "react"; -import { Normalized } from "../normalization/normalize"; import { useSettings } from "../settings/DmnEditorSettingsContext"; export function KnowledgeSourceProperties({ diff --git a/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx b/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx index 9bfa883ded1..f2808c3ec28 100644 --- a/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx +++ b/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx @@ -24,6 +24,7 @@ import { TextInput } from "@patternfly/react-core/dist/js/components/TextInput"; import { CubeIcon } from "@patternfly/react-icons/dist/js/icons/cube-icon"; import { PropertiesPanelHeader } from "./PropertiesPanelHeader"; import { DC__Bounds, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { State } from "../store/Store"; import { useDmnEditorStore, useDmnEditorStoreApi } from "../store/StoreContext"; import { addOrGetDrd } from "../mutations/addOrGetDrd"; @@ -39,7 +40,6 @@ import { MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes"; import { NodeType } from "../diagram/connections/graphStructure"; import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button"; import { DC__Dimension } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_2/ts-gen/types"; -import { Normalized } from "../normalization/normalize"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { useSettings } from "../settings/DmnEditorSettingsContext"; diff --git a/packages/dmn-editor/src/propertiesPanel/SingleNodeProperties.tsx b/packages/dmn-editor/src/propertiesPanel/SingleNodeProperties.tsx index 2be84cd41d7..2e1060e7273 100644 --- a/packages/dmn-editor/src/propertiesPanel/SingleNodeProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/SingleNodeProperties.tsx @@ -41,6 +41,7 @@ import { DMN15__tKnowledgeSource, DMN15__tTextAnnotation, } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { getNodeTypeFromDmnObject } from "../diagram/maths/DmnMaths"; import { NodeIcon } from "../icons/Icons"; import { GroupProperties } from "./GroupProperties"; @@ -50,7 +51,6 @@ import { PropertiesPanelHeader } from "./PropertiesPanelHeader"; import { UnknownProperties } from "./UnknownProperties"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; import "./SingleNodeProperties.css"; -import { Normalized } from "../normalization/normalize"; export function SingleNodeProperties({ nodeId }: { nodeId: string }) { const dmnEditorStoreApi = useDmnEditorStoreApi(); diff --git a/packages/dmn-editor/src/propertiesPanel/TextAnnotationProperties.tsx b/packages/dmn-editor/src/propertiesPanel/TextAnnotationProperties.tsx index d0dc580df6d..f5857e4cffd 100644 --- a/packages/dmn-editor/src/propertiesPanel/TextAnnotationProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/TextAnnotationProperties.tsx @@ -19,13 +19,13 @@ import * as React from "react"; import { DMN15__tTextAnnotation } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { ClipboardCopy } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; import { FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea"; import { TextInput } from "@patternfly/react-core/dist/js/components/TextInput"; import { useDmnEditorStoreApi } from "../store/StoreContext"; import { updateTextAnnotation } from "../mutations/renameNode"; -import { Normalized } from "../normalization/normalize"; import { useSettings } from "../settings/DmnEditorSettingsContext"; export function TextAnnotationProperties({ diff --git a/packages/dmn-editor/src/propertiesPanel/UnknownProperties.tsx b/packages/dmn-editor/src/propertiesPanel/UnknownProperties.tsx index 32782b41c2e..1addbafad04 100644 --- a/packages/dmn-editor/src/propertiesPanel/UnknownProperties.tsx +++ b/packages/dmn-editor/src/propertiesPanel/UnknownProperties.tsx @@ -20,6 +20,7 @@ import * as React from "react"; import { Alert, AlertVariant } from "@patternfly/react-core/dist/js/components/Alert/Alert"; import { DMN15__tDefinitions, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { useDmnEditorStore } from "../store/StoreContext"; import { useMemo } from "react"; import { Unpacked } from "../tsExt/tsExt"; @@ -28,7 +29,6 @@ import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components import { useDmnEditor } from "../DmnEditorContext"; import { Divider } from "@patternfly/react-core/dist/js/components/Divider"; import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; -import { Normalized } from "../normalization/normalize"; export function UnknownProperties(props: { shape: Normalized; dmnElementRefQName: XmlQName }) { const thisDmn = useDmnEditorStore((s) => s.dmn); diff --git a/packages/dmn-editor/src/store/Store.ts b/packages/dmn-editor/src/store/Store.ts index 702fb19b3ec..aa9658991aa 100644 --- a/packages/dmn-editor/src/store/Store.ts +++ b/packages/dmn-editor/src/store/Store.ts @@ -18,6 +18,7 @@ */ import { DmnLatestModel } from "@kie-tools/dmn-marshaller"; +import { normalize, Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { DMN15__tImport } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { enableMapSet } from "immer"; import * as RF from "reactflow"; @@ -25,7 +26,6 @@ import { create } from "zustand"; import { immer } from "zustand/middleware/immer"; import { ExternalModelsIndex } from "../DmnEditor"; import { DmnDiagramNodeData } from "../diagram/nodes/Nodes"; -import { normalize, Normalized } from "../normalization/normalize"; import { ComputedStateCache } from "./ComputedStateCache"; import { computeAllFeelVariableUniqueNames } from "./computed/computeAllFeelVariableUniqueNames"; import { computeDataTypes } from "./computed/computeDataTypes"; diff --git a/packages/dmn-editor/src/store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts.ts b/packages/dmn-editor/src/store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts.ts index 3ab2a584842..534f24e9af8 100644 --- a/packages/dmn-editor/src/store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts.ts +++ b/packages/dmn-editor/src/store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts.ts @@ -18,7 +18,7 @@ */ import { getDecisionServicePropertiesRelativeToThisDmn } from "../../mutations/addExistingDecisionServiceToDrd"; -import { buildXmlHref } from "../../xml/xmlHrefs"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { State } from "../Store"; export function computeContainingDecisionServiceHrefsByDecisionHrefs({ diff --git a/packages/dmn-editor/src/store/computed/computeDataTypes.ts b/packages/dmn-editor/src/store/computed/computeDataTypes.ts index 4670400ad60..704448fb005 100644 --- a/packages/dmn-editor/src/store/computed/computeDataTypes.ts +++ b/packages/dmn-editor/src/store/computed/computeDataTypes.ts @@ -19,12 +19,12 @@ import { DMN15__tImport, DMN15__tItemDefinition } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { UniqueNameIndex } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { builtInFeelTypeNames } from "../../dataTypes/BuiltInFeelTypes"; import { DataType, DataTypeIndex } from "../../dataTypes/DataTypes"; import { buildFeelQNameFromNamespace } from "../../feel/buildFeelQName"; import { TypeOrReturnType } from "../ComputedStateCache"; import { Computed, State } from "../Store"; -import { Normalized } from "../../normalization/normalize"; export function computeDataTypes( namespace: State["dmn"]["model"]["definitions"]["@_namespace"], diff --git a/packages/dmn-editor/src/store/computed/computeDiagramData.ts b/packages/dmn-editor/src/store/computed/computeDiagramData.ts index 6205dc4c921..c5722448786 100644 --- a/packages/dmn-editor/src/store/computed/computeDiagramData.ts +++ b/packages/dmn-editor/src/store/computed/computeDiagramData.ts @@ -21,6 +21,8 @@ import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn- import { XmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; import * as RF from "reactflow"; import { KIE_DMN_UNKNOWN_NAMESPACE } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref, parseXmlHref, xmlHrefToQName } from "@kie-tools/dmn-marshaller/dist/xml"; import { snapShapeDimensions, snapShapePosition } from "../../diagram/SnapGrid"; import { EdgeType, NodeType } from "../../diagram/connections/graphStructure"; import { EDGE_TYPES } from "../../diagram/edges/EdgeTypes"; @@ -32,13 +34,10 @@ import { ___NASTY_HACK_FOR_SAFARI_to_force_redrawing_svgs_and_avoid_repaint_glit import { NODE_TYPES } from "../../diagram/nodes/NodeTypes"; import { DmnDiagramNodeData, NodeDmnObjects } from "../../diagram/nodes/Nodes"; import { Unpacked } from "../../tsExt/tsExt"; -import { buildXmlHref, parseXmlHref } from "../../xml/xmlHrefs"; import { TypeOrReturnType } from "../ComputedStateCache"; import { Computed, State } from "../Store"; import { getDecisionServicePropertiesRelativeToThisDmn } from "../../mutations/addExistingDecisionServiceToDrd"; -import { Normalized } from "../../normalization/normalize"; import { KIE_UNKNOWN_NAMESPACE } from "../../kie/kie"; -import { xmlHrefToQName } from "../../xml/xmlHrefToQName"; export const NODE_LAYERS = { GROUP_NODE: 0, diff --git a/packages/dmn-editor/src/store/computed/computeIndexes.ts b/packages/dmn-editor/src/store/computed/computeIndexes.ts index de381e762ce..dd7867ae53f 100644 --- a/packages/dmn-editor/src/store/computed/computeIndexes.ts +++ b/packages/dmn-editor/src/store/computed/computeIndexes.ts @@ -17,12 +17,12 @@ * under the License. */ -import { DMNDI15__DMNEdge, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { XmlQName, parseXmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; +import { DMNDI15__DMNEdge, DMNDI15__DMNShape } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { KIE_DMN_UNKNOWN_NAMESPACE } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec"; -import { buildXmlHref } from "../../xml/xmlHrefs"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { buildXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs"; import { Computed, State } from "../Store"; -import { Normalized } from "../../normalization/normalize"; export function computeIndexedDrd( thisDmnsNamespace: string, diff --git a/packages/dmn-editor/stories/dev/DevWebApp.stories.tsx b/packages/dmn-editor/stories/dev/DevWebApp.stories.tsx index 56d74dee53c..3d9922f2118 100644 --- a/packages/dmn-editor/stories/dev/DevWebApp.stories.tsx +++ b/packages/dmn-editor/stories/dev/DevWebApp.stories.tsx @@ -24,7 +24,7 @@ import "@patternfly/react-core/dist/styles/base.css"; import { Flex, FlexItem } from "@patternfly/react-core/dist/js/layouts/Flex"; import { Page, PageSection } from "@patternfly/react-core/dist/js/components/Page"; import { DmnLatestModel, DmnMarshaller, getMarshaller } from "@kie-tools/dmn-marshaller"; -import { normalize, Normalized } from "@kie-tools/dmn-editor/dist/normalization/normalize"; +import { normalize, Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { availableModelsByPath, modelsByNamespace } from "./availableModelsToInclude"; import { generateEmptyDmn15 } from "../misc/empty/Empty.stories"; import { loanPreQualificationDmn } from "../useCases/loanPreQualification/LoanPreQualification.stories"; diff --git a/packages/dmn-editor/stories/dev/availableModelsToInclude.ts b/packages/dmn-editor/stories/dev/availableModelsToInclude.ts index a2cace85153..bca1dd1eb59 100644 --- a/packages/dmn-editor/stories/dev/availableModelsToInclude.ts +++ b/packages/dmn-editor/stories/dev/availableModelsToInclude.ts @@ -18,7 +18,7 @@ */ import { getMarshaller } from "@kie-tools/dmn-marshaller"; -import { normalize } from "@kie-tools/dmn-editor/dist/normalization/normalize"; +import { normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { XML2PMML } from "@kie-tools/pmml-editor-marshaller"; import * as DmnEditor from "../../src/DmnEditor"; import { getPmmlNamespace } from "../../src/pmml/pmml"; diff --git a/packages/dmn-editor/stories/dmnEditorStoriesWrapper.tsx b/packages/dmn-editor/stories/dmnEditorStoriesWrapper.tsx index 17b58fc7283..25191c97e9e 100644 --- a/packages/dmn-editor/stories/dmnEditorStoriesWrapper.tsx +++ b/packages/dmn-editor/stories/dmnEditorStoriesWrapper.tsx @@ -22,7 +22,7 @@ import { useCallback, useState, useRef, useMemo, useEffect } from "react"; import { useArgs } from "@storybook/preview-api"; import { DmnEditor, DmnEditorProps, DmnEditorRef, EvaluationResults, ValidationMessages } from "../src/DmnEditor"; import { DmnLatestModel, getMarshaller } from "@kie-tools/dmn-marshaller"; -import { normalize } from "@kie-tools/dmn-editor/dist/normalization/normalize"; +import { normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { diff } from "deep-object-diff"; import { generateEmptyDmn15 } from "./misc/empty/Empty.stories"; diff --git a/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/EmptyWithAvailableExternalModels.stories.tsx b/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/EmptyWithAvailableExternalModels.stories.tsx index 388de3a4ff7..7bd165e1b8b 100644 --- a/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/EmptyWithAvailableExternalModels.stories.tsx +++ b/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/EmptyWithAvailableExternalModels.stories.tsx @@ -32,9 +32,9 @@ import { OnRequestExternalModelsAvailableToInclude, OnDmnModelChange, } from "@kie-tools/dmn-editor/dist/DmnEditor"; -import { normalize, Normalized } from "@kie-tools/dmn-editor/dist/normalization/normalize"; +import { normalize, Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; -import { DmnEditorWrapper, StorybookDmnEditorProps } from "../../dmnEditorStoriesWrapper"; +import { DmnEditorWrapper } from "../../dmnEditorStoriesWrapper"; import { availableModelsByPath, modelsByNamespace } from "./availableModelsToInclude"; diff --git a/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/availableModelsToInclude.ts b/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/availableModelsToInclude.ts index 46bb7291be0..a46faf4fd42 100644 --- a/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/availableModelsToInclude.ts +++ b/packages/dmn-editor/stories/misc/emptyWithAvailableExternalModels/availableModelsToInclude.ts @@ -18,7 +18,7 @@ */ import { getMarshaller } from "@kie-tools/dmn-marshaller"; -import { normalize } from "@kie-tools/dmn-editor/dist/normalization/normalize"; +import { normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { XML2PMML } from "@kie-tools/pmml-editor-marshaller"; import * as DmnEditor from "@kie-tools/dmn-editor/dist/DmnEditor"; import { getPmmlNamespace } from "@kie-tools/dmn-editor/dist/pmml/pmml"; diff --git a/packages/dmn-editor/stories/useCases/loanPreQualification/LoanPreQualification.stories.tsx b/packages/dmn-editor/stories/useCases/loanPreQualification/LoanPreQualification.stories.tsx index 01285c05d15..131be55e62a 100644 --- a/packages/dmn-editor/stories/useCases/loanPreQualification/LoanPreQualification.stories.tsx +++ b/packages/dmn-editor/stories/useCases/loanPreQualification/LoanPreQualification.stories.tsx @@ -792,7 +792,6 @@ const model = marshaller.parser.parse(); export const LoanPreQualification: Story = { render: Empty.render, args: { - ...Empty.args, model: model, xml: marshaller.builder.build(model), }, diff --git a/packages/dmn-editor/tests/mutations/updateExpressionWidth.test.ts b/packages/dmn-editor/tests/mutations/updateExpressionWidth.test.ts index a7ab7490158..17c60cd24dc 100644 --- a/packages/dmn-editor/tests/mutations/updateExpressionWidth.test.ts +++ b/packages/dmn-editor/tests/mutations/updateExpressionWidth.test.ts @@ -17,10 +17,10 @@ * under the License. */ -import { Normalized } from "@kie-tools/dmn-editor/dist/normalization/normalize"; import { DMN15__tDefinitions } from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types"; import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; import { KIE__tComponentsWidthsExtension } from "@kie-tools/dmn-marshaller/dist/schemas/kie-1_0/ts-gen/types"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { updateExpressionWidths } from "@kie-tools/dmn-editor/dist/mutations/updateExpressionWidths"; describe("updateExpressionWidth", () => { diff --git a/packages/dmn-marshaller-backend-compatibility-tester/dmn-marshaller-backend-compatibility-tester.iml b/packages/dmn-marshaller-backend-compatibility-tester/dmn-marshaller-backend-compatibility-tester.iml new file mode 100644 index 00000000000..48550c5c8e1 --- /dev/null +++ b/packages/dmn-marshaller-backend-compatibility-tester/dmn-marshaller-backend-compatibility-tester.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/dmn-marshaller-backend-compatibility-tester/src/index.ts b/packages/dmn-marshaller-backend-compatibility-tester/src/index.ts index bc3ccc2f505..00c77f548bd 100644 --- a/packages/dmn-marshaller-backend-compatibility-tester/src/index.ts +++ b/packages/dmn-marshaller-backend-compatibility-tester/src/index.ts @@ -18,7 +18,7 @@ */ import * as path from "path"; -const buildEnv = require("../env"); +const { env } = require("../env"); const jbang = require("@jbangdev/jbang"); const parentScriptPath = path.join(__dirname, "..", "src", "DmnMarshallerBackendCompatibilityTesterScript.java"); @@ -81,7 +81,7 @@ function executeScript(scriptPath: string, args?: string[]) { const quoteChar = isWindowsPath ? '"' : "'"; const jbangArgs = [] as string[]; - jbangArgs.push("-Dkogito-runtime.version=" + buildEnv.env.kogitoRuntime.version); + jbangArgs.push("-Dkogito-runtime.version=" + env.versions.kogito); jbangArgs.push(scriptPath); args?.forEach((arg) => jbangArgs.push(quoteChar + arg + quoteChar)); diff --git a/packages/dmn-marshaller/package.json b/packages/dmn-marshaller/package.json index da8c37a3140..e33a18a59fb 100644 --- a/packages/dmn-marshaller/package.json +++ b/packages/dmn-marshaller/package.json @@ -33,7 +33,8 @@ "test": "rimraf dist-tests && run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" }, "dependencies": { - "@kie-tools/xml-parser-ts": "workspace:*" + "@kie-tools/xml-parser-ts": "workspace:*", + "uuid": "^8.3.2" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -49,6 +50,7 @@ "@types/jest": "^29.5.12", "@types/jest-when": "^3.5.5", "@types/react": "^17.0.6", + "@types/uuid": "^8.3.0", "jest": "^29.7.0", "jest-junit": "^16.0.0", "jest-when": "^3.6.0", diff --git a/packages/dmn-editor/src/idRandomizer/dmnIdRandomizer.tsx b/packages/dmn-marshaller/src/idRandomizer/dmnIdRandomizer.ts similarity index 88% rename from packages/dmn-editor/src/idRandomizer/dmnIdRandomizer.tsx rename to packages/dmn-marshaller/src/idRandomizer/dmnIdRandomizer.ts index b5e6e7c06b3..50a3fe9ce58 100644 --- a/packages/dmn-editor/src/idRandomizer/dmnIdRandomizer.tsx +++ b/packages/dmn-marshaller/src/idRandomizer/dmnIdRandomizer.ts @@ -17,19 +17,16 @@ * under the License. */ -import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; -import { - elements as dmn15elements, - meta as dmn15meta, -} from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/meta"; +import { v4 as uuid } from "uuid"; import { XmlParserTsIdRandomizer, XmlParserTsIdRandomizerMatcher } from "@kie-tools/xml-parser-ts/dist/idRandomizer"; +import { elements as dmn15elements, meta as dmn15meta } from "../schemas/dmn-1_5/ts-gen/meta"; import { buildXmlHref, parseXmlHref } from "../xml/xmlHrefs"; export function getNewDmnIdRandomizer() { return new XmlParserTsIdRandomizer({ meta: dmn15meta, elements: dmn15elements, - newIdGenerator: generateUuid, + newIdGenerator: () => `_${uuid()}`.toLocaleUpperCase(), matchers: [tDmnElementReferenceIdRandomizerMatcher], }); } diff --git a/packages/dmn-editor/src/normalization/normalize.ts b/packages/dmn-marshaller/src/normalization/normalize.ts similarity index 62% rename from packages/dmn-editor/src/normalization/normalize.ts rename to packages/dmn-marshaller/src/normalization/normalize.ts index 4aa6a64ab9a..0c043610665 100644 --- a/packages/dmn-editor/src/normalization/normalize.ts +++ b/packages/dmn-marshaller/src/normalization/normalize.ts @@ -17,10 +17,9 @@ * under the License. */ -import { DmnLatestModel } from "@kie-tools/dmn-marshaller"; +import { DmnLatestModel } from ".."; import { getNewDmnIdRandomizer } from "../idRandomizer/dmnIdRandomizer"; -import { addMissingImportNamespaces } from "../mutations/addMissingImportNamespaces"; -import { State } from "../store/Store"; +import { DMN15__tDefinitions } from "../schemas/dmn-1_5/ts-gen/types"; export type Normalized = WithRequiredDeep; @@ -32,7 +31,7 @@ type WithRequiredDeep = T extends undefined ? { [P in K]-?: NonNullable> } : T); -export function normalize(model: DmnLatestModel): State["dmn"]["model"] { +export function normalize(model: DmnLatestModel): Normalized { getNewDmnIdRandomizer() .ack({ json: model.definitions.drgElement, @@ -67,3 +66,35 @@ export function normalize(model: DmnLatestModel): State["dmn"]["model"] { return normalizedModel; } + +function addMissingImportNamespaces(definitions: Normalized) { + if (definitions.import === undefined) { + return; + } + + // Collect all declared namespaces + const definedNamespaces = new Set( + Object.keys(definitions) + .filter((keys: keyof DMN15__tDefinitions) => String(keys).startsWith("@_xmlns:")) + .map((xmlnsKey: keyof DMN15__tDefinitions) => definitions[xmlnsKey]) + ); + + // Add missing import namespace declarations as `xmlns:included*` + let includedIndex = 0; + for (let index = 0; index < definitions.import.length; index++) { + const importedModelNamespace = definitions.import[index]["@_namespace"]; + + // Check if namespace is already declared + if (definedNamespaces.has(importedModelNamespace)) { + // Ignore namespaces that are already declared + continue; + } + + // Get next available `included*` namespace declaration name + while (definitions[`@_xmlns:included${includedIndex}`]) { + includedIndex++; + } + + definitions[`@_xmlns:included${includedIndex}`] = importedModelNamespace; + } +} diff --git a/packages/form-generation-tool/src/index.ts b/packages/dmn-marshaller/src/xml/index.ts similarity index 88% rename from packages/form-generation-tool/src/index.ts rename to packages/dmn-marshaller/src/xml/index.ts index 1fe8e566468..a934b9b8c31 100644 --- a/packages/form-generation-tool/src/index.ts +++ b/packages/dmn-marshaller/src/xml/index.ts @@ -17,6 +17,6 @@ * under the License. */ -import * as cli from "./cli"; - -cli.run(); +export * from "./xmlHrefs"; +export * from "./xmlHrefToQName"; +export * from "./xmlNamespaceDeclarations"; diff --git a/packages/dmn-editor/src/xml/xmlHrefToQName.ts b/packages/dmn-marshaller/src/xml/xmlHrefToQName.ts similarity index 100% rename from packages/dmn-editor/src/xml/xmlHrefToQName.ts rename to packages/dmn-marshaller/src/xml/xmlHrefToQName.ts index cda3d3b46fa..d5affd84a00 100644 --- a/packages/dmn-editor/src/xml/xmlHrefToQName.ts +++ b/packages/dmn-marshaller/src/xml/xmlHrefToQName.ts @@ -18,9 +18,9 @@ */ import { buildXmlQName } from "@kie-tools/xml-parser-ts/dist/qNames"; +import { XmlParserTsRootElementBaseType } from "@kie-tools/xml-parser-ts"; import { parseXmlHref } from "./xmlHrefs"; import { getXmlNamespaceDeclarationName } from "./xmlNamespaceDeclarations"; -import { XmlParserTsRootElementBaseType } from "@kie-tools/xml-parser-ts"; export function xmlHrefToQName(hrefString: string, rootElement: XmlParserTsRootElementBaseType | undefined) { const href = parseXmlHref(hrefString); diff --git a/packages/dmn-editor/src/xml/xmlHrefs.ts b/packages/dmn-marshaller/src/xml/xmlHrefs.ts similarity index 100% rename from packages/dmn-editor/src/xml/xmlHrefs.ts rename to packages/dmn-marshaller/src/xml/xmlHrefs.ts diff --git a/packages/dmn-editor/src/xml/xmlNamespaceDeclarations.ts b/packages/dmn-marshaller/src/xml/xmlNamespaceDeclarations.ts similarity index 100% rename from packages/dmn-editor/src/xml/xmlNamespaceDeclarations.ts rename to packages/dmn-marshaller/src/xml/xmlNamespaceDeclarations.ts diff --git a/packages/dmn-testing-models/dmn-testing-models.iml b/packages/dmn-testing-models/dmn-testing-models.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/dmn-testing-models/dmn-testing-models.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/dmn-testing-models/index.js b/packages/dmn-testing-models/index.js deleted file mode 100644 index e3745dd42a2..00000000000 --- a/packages/dmn-testing-models/index.js +++ /dev/null @@ -1,20 +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. - */ - -/** Empty Entrypoint of this module - No TS/JS code here, it just holds DMN files for testing purposes */ diff --git a/packages/dmn-testing-models/install.js b/packages/dmn-testing-models/install.js index 1e1c38e2b32..15bebecbd51 100644 --- a/packages/dmn-testing-models/install.js +++ b/packages/dmn-testing-models/install.js @@ -17,9 +17,10 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.dmnTestingModels.version} +setupMavenConfigFile(` + -Drevision=${env.dmnTestingModels.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/packages/dmn-testing-models/package.json b/packages/dmn-testing-models/package.json index 99540911e69..fdd013cd448 100644 --- a/packages/dmn-testing-models/package.json +++ b/packages/dmn-testing-models/package.json @@ -27,7 +27,6 @@ "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "copyfiles": "^2.4.1", "rimraf": "^3.0.2", diff --git a/packages/dmn-testing-models/pom.xml b/packages/dmn-testing-models/pom.xml index c54c2efa9c2..8f6b31ae6d5 100644 --- a/packages/dmn-testing-models/pom.xml +++ b/packages/dmn-testing-models/pom.xml @@ -33,7 +33,7 @@ org.kie.tools dmn-testing-models - DMN Testing Models + KIE Tools :: DMN Testing Models Testing models for DMN marshaller @@ -44,21 +44,6 @@ - - 3.6.1 - - - - - - org.kie - kie-dmn-test-resources - ${version.org.kie.kogito} - tests - - - - org.kie @@ -71,9 +56,7 @@ - org.apache.maven.plugins maven-dependency-plugin - ${dependency-plugin.version} unpack diff --git a/packages/dmn-vscode-extension/webpack.config.js b/packages/dmn-vscode-extension/webpack.config.js index 2d4f0da6919..be947339e93 100644 --- a/packages/dmn-vscode-extension/webpack.config.js +++ b/packages/dmn-vscode-extension/webpack.config.js @@ -25,8 +25,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { ProvidePlugin } = require("webpack"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "DmnEditor", libraryTarget: "umd", @@ -44,14 +44,14 @@ const commonConfig = (env) => }, }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension": "./src/extension/extension.ts", }, }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "webworker", entry: { "extension/extensionWeb": "./src/extension/extension.ts", @@ -63,7 +63,7 @@ module.exports = async (env) => [ }), ], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "webview/DmnEditorEnvelopeApp": "./src/webview/DmnEditorEnvelopeApp.ts", diff --git a/packages/extended-services-java/extended-services-java.iml b/packages/extended-services-java/extended-services-java.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/extended-services-java/extended-services-java.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/extended-services-java/install.js b/packages/extended-services-java/install.js index 35b3e03912e..18e441ce239 100644 --- a/packages/extended-services-java/install.js +++ b/packages/extended-services-java/install.js @@ -17,11 +17,12 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.extendedServicesJava.version} - -Dquarkus.http.port=${buildEnv.env.extendedServicesJava.port} - -Dquarkus.http.host=${buildEnv.env.extendedServicesJava.host} +setupMavenConfigFile(` + -Drevision=${env.extendedServicesJava.version} + -Dquarkus.http.port=${env.extendedServicesJava.port} + -Dquarkus.http.host=${env.extendedServicesJava.host} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/packages/extended-services-java/package.json b/packages/extended-services-java/package.json index eb924c5c1b2..f61235142aa 100644 --- a/packages/extended-services-java/package.json +++ b/packages/extended-services-java/package.json @@ -38,7 +38,6 @@ "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "copyfiles": "^2.4.1", "rimraf": "^3.0.2", diff --git a/packages/extended-services-java/pom.xml b/packages/extended-services-java/pom.xml index 7eb6467d1da..2b9f30df4c4 100644 --- a/packages/extended-services-java/pom.xml +++ b/packages/extended-services-java/pom.xml @@ -33,8 +33,9 @@ org.kie.tools extended-services-java - Extended Services - Java - Extended Services - Java + KIE Tools :: KIE Sandbox :: Extended Services Quarkus app + Quarkus-based application that wraps Kogito JIT Executor for consumption as a KIE Sandbox backend. @@ -53,12 +54,10 @@ org.kie.kogito jitexecutor-bpmn - ${version.org.kie.kogito} org.kie.kogito jitexecutor-dmn - ${version.org.kie.kogito} io.quarkus @@ -86,7 +85,6 @@ io.quarkus quarkus-maven-plugin - ${quarkus.platform.version} true @@ -100,14 +98,12 @@ maven-compiler-plugin - ${compiler-plugin.version} ${maven.compiler.parameters} maven-surefire-plugin - ${surefire-plugin.version} org.jboss.logmanager.LogManager @@ -116,7 +112,6 @@ maven-failsafe-plugin - ${surefire-plugin.version} diff --git a/packages/extended-services-vscode-extension/webpack.config.js b/packages/extended-services-vscode-extension/webpack.config.js index 3d9f05537b0..d52f1fb6e7c 100644 --- a/packages/extended-services-vscode-extension/webpack.config.js +++ b/packages/extended-services-vscode-extension/webpack.config.js @@ -20,8 +20,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "ExtendedServices", libraryTarget: "umd", @@ -34,14 +34,14 @@ const commonConfig = (env) => plugins: [], }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension-main": "./src/extension/extension-main.ts", }, }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "extension/extension-browser": "./src/extension/extension-browser.ts", diff --git a/packages/extended-services/env/index.js b/packages/extended-services/env/index.js index dc69b156cb2..bb197a7d373 100644 --- a/packages/extended-services/env/index.js +++ b/packages/extended-services/env/index.js @@ -40,15 +40,15 @@ module.exports = composeEnv([rootEnv], { description: "HTTP port", }, EXTENDED_SERVICES__nativeBinaryPath_macOS: { - default: `./dist-dev/jitexecutor-native-darwin-${rootEnv.env.kogitoRuntime.version}-runner`, + default: `./dist-dev/jitexecutor-native-darwin-${rootEnv.env.versions.kogito}-runner`, description: "", }, EXTENDED_SERVICES__nativeBinaryPath_linux: { - default: `./dist-dev/jitexecutor-native-linux-${rootEnv.env.kogitoRuntime.version}-runner`, + default: `./dist-dev/jitexecutor-native-linux-${rootEnv.env.versions.kogito}-runner`, description: "", }, EXTENDED_SERVICES__nativeBinaryPath_win32: { - default: `.\\dist-dev\\jitexecutor-native-win32-${rootEnv.env.kogitoRuntime.version}-runner.exe`, + default: `.\\dist-dev\\jitexecutor-native-win32-${rootEnv.env.versions.kogito}-runner.exe`, description: "", }, }), diff --git a/packages/extended-services/package.json b/packages/extended-services/package.json index 18463b0268c..ff25bdd3a75 100644 --- a/packages/extended-services/package.json +++ b/packages/extended-services/package.json @@ -34,9 +34,9 @@ "copy-jitexecutor-linux-headless:linux": "cp $(build-env extendedServices.jitexecutor.nativeBinaryPath.linux) jitexecutor && chmod +x jitexecutor", "copy-jitexecutor-linux-headless:win32": "pnpm powershell \"Copy-Item $(build-env extendedServices.jitexecutor.nativeBinaryPath.win32) jitexecutor\"", "download:mvn:jitexecutor-native": "run-script-os", - "download:mvn:jitexecutor-native:darwin": "mvn dependency:get -Dartifact=\"org.kie.kogito:jitexecutor-native-darwin:$(build-env kogitoRuntime.version):jar:binaries\"", - "download:mvn:jitexecutor-native:linux": "mvn dependency:get -Dartifact=\"org.kie.kogito:jitexecutor-native-linux:$(build-env kogitoRuntime.version):jar:binaries\"", - "download:mvn:jitexecutor-native:win32": "pnpm powershell \"mvn dependency:get `-Dartifact=org.kie.kogito:jitexecutor-native-win32:$(build-env kogitoRuntime.version):jar:binaries\"", + "download:mvn:jitexecutor-native:darwin": "mvn dependency:get -Dartifact=\"org.kie.kogito:jitexecutor-native-darwin:$(build-env versions.kogito):jar:binaries\"", + "download:mvn:jitexecutor-native:linux": "mvn dependency:get -Dartifact=\"org.kie.kogito:jitexecutor-native-linux:$(build-env versions.kogito):jar:binaries\"", + "download:mvn:jitexecutor-native:win32": "pnpm powershell \"mvn dependency:get `-Dartifact=org.kie.kogito:jitexecutor-native-win32:$(build-env versions.kogito):jar:binaries\"", "install": "go mod tidy && pnpm download:mvn:jitexecutor-native && pnpm unpack:mvn:jitexecutor-native", "pack-app": "run-script-os", "pack-app:darwin": "cd ./scripts/macos && ./build.sh", @@ -45,9 +45,9 @@ "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command", "start": "cross-env ENV=dev make start", "unpack:mvn:jitexecutor-native": "run-script-os", - "unpack:mvn:jitexecutor-native:darwin": "mvn dependency:unpack -DoutputDirectory=dist-dev -Dartifact=\"org.kie.kogito:jitexecutor-native-darwin:$(build-env kogitoRuntime.version):jar:binaries\"", - "unpack:mvn:jitexecutor-native:linux": "mvn dependency:unpack -DoutputDirectory=dist-dev -Dartifact=\"org.kie.kogito:jitexecutor-native-linux:$(build-env kogitoRuntime.version):jar:binaries\"", - "unpack:mvn:jitexecutor-native:win32": "pnpm powershell \"mvn dependency:unpack `-DoutputDirectory=dist-dev `-Dartifact=org.kie.kogito:jitexecutor-native-win32:$(build-env kogitoRuntime.version):jar:binaries\"" + "unpack:mvn:jitexecutor-native:darwin": "mvn dependency:unpack -DoutputDirectory=dist-dev -Dartifact=\"org.kie.kogito:jitexecutor-native-darwin:$(build-env versions.kogito):jar:binaries\"", + "unpack:mvn:jitexecutor-native:linux": "mvn dependency:unpack -DoutputDirectory=dist-dev -Dartifact=\"org.kie.kogito:jitexecutor-native-linux:$(build-env versions.kogito):jar:binaries\"", + "unpack:mvn:jitexecutor-native:win32": "pnpm powershell \"mvn dependency:unpack `-DoutputDirectory=dist-dev `-Dartifact=org.kie.kogito:jitexecutor-native-win32:$(build-env versions.kogito):jar:binaries\"" }, "devDependencies": { "@kie-tools/root-env": "workspace:*", diff --git a/packages/feel-input-component/showcase/webpack.config.js b/packages/feel-input-component/showcase/webpack.config.js index 9b6c56db64c..89561d4f17a 100644 --- a/packages/feel-input-component/showcase/webpack.config.js +++ b/packages/feel-input-component/showcase/webpack.config.js @@ -24,10 +24,9 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const { EnvironmentPlugin } = require("webpack"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), @@ -40,7 +39,7 @@ module.exports = (env) => patterns: [{ from: path.resolve(__dirname, "./static"), to: "./" }], }), new EnvironmentPlugin({ - WEBPACK_REPLACE__FEEL_INPUT_COMPONENT_DEV_WEBAPP__feelServerUrl: buildEnv.feelInputComponent.dev.feelServerUrl, + WEBPACK_REPLACE__FEEL_INPUT_COMPONENT_DEV_WEBAPP__feelServerUrl: env.feelInputComponent.dev.feelServerUrl, }), ], module: { @@ -63,7 +62,7 @@ module.exports = (env) => devServer: { historyApiFallback: true, compress: true, - port: buildEnv.feelInputComponent.dev.port, + port: env.feelInputComponent.dev.port, open: false, hot: true, client: { diff --git a/packages/uniforms-bootstrap4-codegen/LICENSE b/packages/form-code-generator-bootstrap4-theme/LICENSE similarity index 100% rename from packages/uniforms-bootstrap4-codegen/LICENSE rename to packages/form-code-generator-bootstrap4-theme/LICENSE diff --git a/packages/form-code-generator-bootstrap4-theme/README.md b/packages/form-code-generator-bootstrap4-theme/README.md new file mode 100644 index 00000000000..46e7ba68974 --- /dev/null +++ b/packages/form-code-generator-bootstrap4-theme/README.md @@ -0,0 +1,76 @@ + + +## Form Code Generator Bootstrap4 Theme + +This package is the Bootstrap4 theme for the [form-code-generator](../form-code-generator/README.md) package. + +## How it works? + +This package generates the form code of a [Uniforms](https://uniforms.tools/) form using the Bootstrap4 style. [Uniforms](https://uniforms.tools/) is a library that autogenerates forms based on schemas and supports multiple themes. This package makes its own theme, describing the code that each field should have. After it, the form is rendered using `ReactDOMServer.renderToString` getting the form code. + +## Usage + +You can consume this package in two ways: + +1. The `dist/theme.ts` file exports the `bootstrap4FormCodeGeneratorTheme` which is a theme for the `form-code-generator` package. This theme implements the `FormCodeGeneratorTheme` interface, and its `generate` function uses JSON Schemas to generate the form code. + +2. You can create your own theme, and implement the `FormCodeGeneratorTheme` interface, and make the `generate` fucntion use another type of schema that is supported by [Uniforms](https://uniforms.tools/). To do so, you must use the `dist/uniforms/renderForm` function, which will receive a [Uniforms Bridge](https://uniforms.tools/docs/api-bridges/) and some parameters: + +```ts +{ + id: string; // The form id + sanitizedId: string; // The form id, any # is replaced by _ + disabled?: boolean; // Enable/disable form (read only) + placeholder?: boolean; // Enable/disable placeholders + schema: Bridge; // A Uniforms Bridge instance +} +``` + +## Build + +In order to build the library you must run the following command in the root folder of the repository: + +```shell script +pnpm -F @kie-tools/form-code-generator-bootstrap4-theme... build:prod +``` + +--- + +Apache KIE (incubating) is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is +required of all newly accepted projects until a further review indicates that +the infrastructure, communications, and decision making process have stabilized +in a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the ASF. + +Some of the incubating project’s releases may not be fully compliant with ASF +policy. For example, releases may have incomplete or un-reviewed licensing +conditions. What follows is a list of known issues the project is currently +aware of (note that this list, by definition, is likely to be incomplete): + +- Hibernate, an LGPL project, is being used. Hibernate is in the process of + relicensing to ASL v2 +- Some files, particularly test files, and those not supporting comments, may + be missing the ASF Licensing Header + +If you are planning to incorporate this work into your product/project, please +be aware that you will need to conduct a thorough licensing review to determine +the overall implications of including this work. For the current status of this +project through the Apache Incubator visit: +https://incubator.apache.org/projects/kie.html diff --git a/packages/form-generation-tool/env/index.js b/packages/form-code-generator-bootstrap4-theme/env/index.js similarity index 100% rename from packages/form-generation-tool/env/index.js rename to packages/form-code-generator-bootstrap4-theme/env/index.js diff --git a/packages/uniforms-bootstrap4-codegen/jest.config.js b/packages/form-code-generator-bootstrap4-theme/jest.config.js similarity index 100% rename from packages/uniforms-bootstrap4-codegen/jest.config.js rename to packages/form-code-generator-bootstrap4-theme/jest.config.js diff --git a/packages/uniforms-bootstrap4-codegen/package.json b/packages/form-code-generator-bootstrap4-theme/package.json similarity index 91% rename from packages/uniforms-bootstrap4-codegen/package.json rename to packages/form-code-generator-bootstrap4-theme/package.json index c01019caf36..9004cc19e6b 100644 --- a/packages/uniforms-bootstrap4-codegen/package.json +++ b/packages/form-code-generator-bootstrap4-theme/package.json @@ -1,5 +1,5 @@ { - "name": "@kie-tools/uniforms-bootstrap4-codegen", + "name": "@kie-tools/form-code-generator-bootstrap4-theme", "version": "0.0.0", "description": "", "license": "Apache-2.0", @@ -22,11 +22,12 @@ "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" }, "dependencies": { + "@kie-tools/form-code-generator": "workspace:*", "lodash": "^4.17.21", "prettier": "^2.8.8", "underscore": "^1.13.1", "uniforms": "^3.10.2", - "uniforms-bridge-simple-schema-2": "^3.10.2" + "uniforms-bridge-json-schema": "^3.10.2" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -57,6 +58,7 @@ "simpl-schema": "^1.12.0", "ts-jest": "^29.1.5", "typescript": "^5.5.3", + "uniforms-bridge-simple-schema-2": "^3.10.2", "webpack": "^5.94.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0", diff --git a/packages/uniforms-bootstrap4-codegen/src/api/index.ts b/packages/form-code-generator-bootstrap4-theme/src/api/index.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/api/index.ts rename to packages/form-code-generator-bootstrap4-theme/src/api/index.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/api/types.ts b/packages/form-code-generator-bootstrap4-theme/src/api/types.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/api/types.ts rename to packages/form-code-generator-bootstrap4-theme/src/api/types.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/index.ts b/packages/form-code-generator-bootstrap4-theme/src/index.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/index.ts rename to packages/form-code-generator-bootstrap4-theme/src/index.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/raw-content.d.ts b/packages/form-code-generator-bootstrap4-theme/src/raw-content.d.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/raw-content.d.ts rename to packages/form-code-generator-bootstrap4-theme/src/raw-content.d.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/getCheckboxGroupValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/getCheckboxGroupValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/getCheckboxGroupValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/getCheckboxGroupValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/getMultipleSelectValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/getMultipleSelectValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/getMultipleSelectValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/getMultipleSelectValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/getRadioGroupValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/getRadioGroupValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/getRadioGroupValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/getRadioGroupValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/resources.d.ts b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/resources.d.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/resources.d.ts rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/resources.d.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setCheckboxGroupValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setCheckboxGroupValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setCheckboxGroupValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setCheckboxGroupValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setRadioGroupValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setRadioGroupValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setRadioGroupValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setRadioGroupValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setSelecMultipletValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setSelecMultipletValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setSelecMultipletValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setSelecMultipletValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setSelectValue.txt b/packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setSelectValue.txt similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/staticCode/setSelectValue.txt rename to packages/form-code-generator-bootstrap4-theme/src/resources/staticCode/setSelectValue.txt diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/checkbox.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkbox.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/checkbox.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkbox.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/checkbox.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkbox.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/checkbox.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkbox.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/checkbox.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkbox.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/checkbox.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkbox.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/checkboxGroup.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkboxGroup.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/checkboxGroup.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkboxGroup.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/checkboxGroup.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkboxGroup.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/checkboxGroup.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkboxGroup.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/checkboxGroup.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkboxGroup.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/checkboxGroup.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/checkboxGroup.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/date.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/date.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/date.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/date.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/date.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/date.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/date.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/date.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/form.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/form.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/form.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/form.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/formGroup.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/formGroup.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/formGroup.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/formGroup.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/input.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/input.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/input.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/input.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/input.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/input.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/input.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/input.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/input.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/input.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/input.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/input.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/nestField.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/nestField.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/nestField.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/nestField.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/nestField.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/nestField.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/nestField.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/nestField.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/nestField.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/nestField.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/nestField.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/nestField.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/number.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/number.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/number.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/number.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/number.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/number.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/number.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/number.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/radioGroup.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/radioGroup.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/radioGroup.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/radioGroup.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/radioGroup.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/radioGroup.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/radioGroup.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/radioGroup.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/radioGroup.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/radioGroup.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/radioGroup.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/radioGroup.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/resources.d.ts b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/resources.d.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/resources.d.ts rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/resources.d.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/select.setModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/select.setModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/select.setModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/select.setModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/select.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/select.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/select.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/select.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/select.writeModelData.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/select.writeModelData.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/select.writeModelData.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/select.writeModelData.template diff --git a/packages/uniforms-bootstrap4-codegen/src/resources/templates/unsupported.template b/packages/form-code-generator-bootstrap4-theme/src/resources/templates/unsupported.template similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/resources/templates/unsupported.template rename to packages/form-code-generator-bootstrap4-theme/src/resources/templates/unsupported.template diff --git a/packages/form-generation-tool/src/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool.ts b/packages/form-code-generator-bootstrap4-theme/src/theme.ts similarity index 50% rename from packages/form-generation-tool/src/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool.ts rename to packages/form-code-generator-bootstrap4-theme/src/theme.ts index 4fb02eb3389..6db8be721cc 100644 --- a/packages/form-generation-tool/src/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool.ts +++ b/packages/form-code-generator-bootstrap4-theme/src/theme.ts @@ -17,58 +17,46 @@ * under the License. */ -import unescape from "lodash/unescape"; -import { FormAssetType, FormAsset, FormStyle, FormConfig, FormGenerationTool, FormSchema } from "../../../types"; - -import { renderForm } from "@kie-tools/uniforms-bootstrap4-codegen/dist"; +import { FormCodeGeneratorTheme, FormAsset } from "@kie-tools/form-code-generator/dist/types"; import JSONSchemaBridge from "uniforms-bridge-json-schema"; -import { getUniformsSchema } from "../utils/UniformsSchemaUtils"; -import { inputSanitizationUtil } from "../utils/InputSanitizationUtil"; +import unescape from "lodash/unescape"; +import { renderForm } from "."; export const BOOTSTRAP4_CSS_URL = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"; export const BOOTSTRAP4_JS_URL = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js"; - export const JQUERY_URL = "https://code.jquery.com/jquery-3.2.1.slim.min.js"; -export class Bootstrap4FormConfig implements FormConfig { - public readonly schema: string; - - constructor(formSchema: any) { - this.schema = JSON.stringify(formSchema); - } - - public resources = { - styles: { - "bootstrap.min.css": BOOTSTRAP4_CSS_URL, - }, - scripts: { - "jquery.js": JQUERY_URL, - "bootstrap.bundle.min.js": BOOTSTRAP4_JS_URL, - }, - }; -} - -export class Bootstrap4FormGenerationTool implements FormGenerationTool { - type: string = FormStyle.BOOTSTRAP; +export const BOOTSTRAP4_FILE_EXT = "html"; - generate(inputSchema: FormSchema): FormAsset { - const uniformsSchema = getUniformsSchema(inputSchema.schema); +export type Bootstrap4FileExt = typeof BOOTSTRAP4_FILE_EXT; +export interface Bootstrap4FormAsset extends FormAsset {} +export const bootstrap4FormCodeGeneratorTheme: FormCodeGeneratorTheme = { + generate: (formSchema) => { const form = renderForm({ - id: inputSchema.name, - sanitizedId: inputSanitizationUtil(inputSchema.name), - schema: new JSONSchemaBridge(uniformsSchema, () => true), + id: formSchema.name, + sanitizedId: formSchema.name, + schema: new JSONSchemaBridge(formSchema.schema, () => true), disabled: false, placeholder: true, }); return { - id: inputSchema.name, - sanitizedId: inputSanitizationUtil(inputSchema.name), - assetName: `${inputSchema.name}.${FormAssetType.HTML}`, - sanitizedAssetName: `${inputSanitizationUtil(inputSchema.name)}.${FormAssetType.HTML}`, - type: FormAssetType.HTML, + id: formSchema.name, + assetName: `${formSchema.name}.${BOOTSTRAP4_FILE_EXT}`, + type: BOOTSTRAP4_FILE_EXT, content: unescape(form), - config: new Bootstrap4FormConfig(inputSchema.schema), + config: { + schema: JSON.stringify(formSchema.schema), + resources: { + styles: { + "bootstrap.min.css": BOOTSTRAP4_CSS_URL, + }, + scripts: { + "jquery.js": JQUERY_URL, + "bootstrap.bundle.min.js": BOOTSTRAP4_JS_URL, + }, + }, + }, }; - } -} + }, +}; diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/AutoField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/AutoField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/AutoField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/AutoField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/AutoFields.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/AutoFields.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/AutoFields.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/AutoFields.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/AutoForm.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/AutoForm.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/AutoForm.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/AutoForm.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/BoolField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/BoolField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/BoolField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/BoolField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/BootstrapCodeGenContext.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/BootstrapCodeGenContext.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/BootstrapCodeGenContext.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/BootstrapCodeGenContext.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/CheckBoxGroupField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/CheckBoxGroupField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/CheckBoxGroupField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/CheckBoxGroupField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/DateField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/DateField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/DateField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/DateField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/NestField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/NestField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/NestField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/NestField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/NumField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/NumField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/NumField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/NumField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/RadioField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/RadioField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/RadioField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/RadioField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/SelectField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/SelectField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/SelectField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/SelectField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/TextField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/TextField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/TextField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/TextField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/UnsupportedField.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/UnsupportedField.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/UnsupportedField.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/UnsupportedField.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/index.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/index.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/index.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/index.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/renderForm.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/renderForm.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/renderForm.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/renderForm.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/FormInputs.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/FormInputs.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/FormInputs.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/FormInputs.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/NestedFieldInput.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/NestedFieldInput.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/NestedFieldInput.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/NestedFieldInput.tsx diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/RenderingUtils.tsx b/packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/RenderingUtils.tsx similarity index 95% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/RenderingUtils.tsx rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/RenderingUtils.tsx index 1773e130aea..a4218892f76 100644 --- a/packages/uniforms-bootstrap4-codegen/src/uniforms/rendering/RenderingUtils.tsx +++ b/packages/form-code-generator-bootstrap4-theme/src/uniforms/rendering/RenderingUtils.tsx @@ -60,5 +60,5 @@ export const renderNestedInputFragmentWithContext = ( }) ); - return codegenCtx.rendered.length == 1 ? codegenCtx.rendered[0] : undefined; + return codegenCtx.rendered.length === 1 ? codegenCtx.rendered[0] : undefined; }; diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/AutoFormTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/AutoFormTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/AutoFormTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/AutoFormTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/BoolFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/BoolFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/BoolFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/BoolFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/CheckboxGroupFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/CheckboxGroupFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/CheckboxGroupFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/CheckboxGroupFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/DateFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/DateFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/DateFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/DateFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/NestFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/NestFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/NestFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/NestFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/NumFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/NumFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/NumFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/NumFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/RadioGroupFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/RadioGroupFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/RadioGroupFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/RadioGroupFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/SelectFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/SelectFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/SelectFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/SelectFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/TextFieldTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/TextFieldTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/TextFieldTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/TextFieldTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/UnsupportedTemplate.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/UnsupportedTemplate.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/UnsupportedTemplate.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/UnsupportedTemplate.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/templates.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/templates.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/templates.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/templates.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/types.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/types.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/types.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/types.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/templates/utils.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/utils.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/templates/utils.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/templates/utils.ts diff --git a/packages/uniforms-bootstrap4-codegen/src/uniforms/utils/Utils.ts b/packages/form-code-generator-bootstrap4-theme/src/uniforms/utils/Utils.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/src/uniforms/utils/Utils.ts rename to packages/form-code-generator-bootstrap4-theme/src/uniforms/utils/Utils.ts diff --git a/packages/uniforms-bootstrap4-codegen/tests/AutoField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/AutoField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/AutoField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/AutoField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/AutoFields.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/AutoFields.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/AutoFields.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/AutoFields.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/AutoForm.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/AutoForm.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/AutoForm.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/AutoForm.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/BoolField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/BoolField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/BoolField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/BoolField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/CheckboxGroupField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/CheckboxGroupField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/CheckboxGroupField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/CheckboxGroupField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/DateField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/DateField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/DateField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/DateField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/NestField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/NestField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/NestField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/NestField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/NumField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/NumField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/NumField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/NumField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/RadioField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/RadioField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/RadioField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/RadioField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/SelectField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/SelectField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/SelectField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/SelectField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/TextField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/TextField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/TextField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/TextField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/UnsupportedField.test.tsx b/packages/form-code-generator-bootstrap4-theme/tests/UnsupportedField.test.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/UnsupportedField.test.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/UnsupportedField.test.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/__mocks__/styleMock.js b/packages/form-code-generator-bootstrap4-theme/tests/__mocks__/styleMock.js similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__mocks__/styleMock.js rename to packages/form-code-generator-bootstrap4-theme/tests/__mocks__/styleMock.js diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/AutoForm.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/AutoForm.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/AutoForm.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/AutoForm.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/BoolField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/BoolField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/BoolField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/BoolField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/CheckboxGroupField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/CheckboxGroupField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/CheckboxGroupField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/CheckboxGroupField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/DateField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/DateField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/DateField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/DateField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/NestField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/NestField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/NestField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/NestField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/NumField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/NumField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/NumField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/NumField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/RadioField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/RadioField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/RadioField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/RadioField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/SelectField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/SelectField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/SelectField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/SelectField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/TextField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/TextField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/TextField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/TextField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/__snapshots__/UnsupportedField.test.tsx.snap b/packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/UnsupportedField.test.tsx.snap similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/__snapshots__/UnsupportedField.test.tsx.snap rename to packages/form-code-generator-bootstrap4-theme/tests/__snapshots__/UnsupportedField.test.tsx.snap diff --git a/packages/uniforms-bootstrap4-codegen/tests/_createContext.ts b/packages/form-code-generator-bootstrap4-theme/tests/_createContext.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/_createContext.ts rename to packages/form-code-generator-bootstrap4-theme/tests/_createContext.ts diff --git a/packages/uniforms-bootstrap4-codegen/tests/_createSchema.ts b/packages/form-code-generator-bootstrap4-theme/tests/_createSchema.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/_createSchema.ts rename to packages/form-code-generator-bootstrap4-theme/tests/_createSchema.ts diff --git a/packages/uniforms-bootstrap4-codegen/tests/_render.tsx b/packages/form-code-generator-bootstrap4-theme/tests/_render.tsx similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/_render.tsx rename to packages/form-code-generator-bootstrap4-theme/tests/_render.tsx diff --git a/packages/form-generation-tool/tests/jest.setup.ts b/packages/form-code-generator-bootstrap4-theme/tests/jest.setup.ts similarity index 100% rename from packages/form-generation-tool/tests/jest.setup.ts rename to packages/form-code-generator-bootstrap4-theme/tests/jest.setup.ts diff --git a/packages/uniforms-bootstrap4-codegen/tests/rawJestTransformer.js b/packages/form-code-generator-bootstrap4-theme/tests/rawJestTransformer.js similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/rawJestTransformer.js rename to packages/form-code-generator-bootstrap4-theme/tests/rawJestTransformer.js diff --git a/packages/uniforms-bootstrap4-codegen/tsconfig.json b/packages/form-code-generator-bootstrap4-theme/tsconfig.json similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tsconfig.json rename to packages/form-code-generator-bootstrap4-theme/tsconfig.json diff --git a/packages/form-generation-tool/tsconfig.tests.json b/packages/form-code-generator-bootstrap4-theme/tsconfig.tests.json similarity index 100% rename from packages/form-generation-tool/tsconfig.tests.json rename to packages/form-code-generator-bootstrap4-theme/tsconfig.tests.json diff --git a/packages/uniforms-bootstrap4-codegen/webpack.config.js b/packages/form-code-generator-bootstrap4-theme/webpack.config.js similarity index 93% rename from packages/uniforms-bootstrap4-codegen/webpack.config.js rename to packages/form-code-generator-bootstrap4-theme/webpack.config.js index 5064b497e5b..feeef0508e9 100644 --- a/packages/uniforms-bootstrap4-codegen/webpack.config.js +++ b/packages/form-code-generator-bootstrap4-theme/webpack.config.js @@ -23,10 +23,11 @@ const nodeExternals = require("webpack-node-externals"); const CopyPlugin = require("copy-webpack-plugin"); const path = require("path"); -module.exports = (env, args) => [ - merge(common(env, args), { +module.exports = (webpackEnv) => [ + merge(common(webpackEnv), { entry: { index: "./src/index.ts", + theme: "./src/theme.ts", }, plugins: [new CopyPlugin({ patterns: [{ from: "./src/resources", to: "./resources" }] })], module: { diff --git a/packages/uniforms-patternfly-codegen/LICENSE b/packages/form-code-generator-patternfly-theme/LICENSE similarity index 100% rename from packages/uniforms-patternfly-codegen/LICENSE rename to packages/form-code-generator-patternfly-theme/LICENSE diff --git a/packages/form-code-generator-patternfly-theme/README.md b/packages/form-code-generator-patternfly-theme/README.md new file mode 100644 index 00000000000..068c7f80731 --- /dev/null +++ b/packages/form-code-generator-patternfly-theme/README.md @@ -0,0 +1,76 @@ + + +## Form Code Generator PatternFly Theme + +This package is the PatternFly theme for the [form-code-generator](../form-code-generator/README.md) package. + +## How it works? + +This package generates the form code of a [Uniforms](https://uniforms.tools/) form using PatternFly components. [Uniforms](https://uniforms.tools/) is a library that autogenerates forms based on schemas and supports multiple themes. This package makes its own theme, describing the code that each field should have. After it, the form is rendered using `ReactDOMServer.renderToString` getting the form code. + +## Usage + +You can consume this package in two ways: + +1. The `dist/theme.ts` file exports the `patternflyFormCodeGeneratorTheme` which is a theme for the `form-code-generator` package. This theme implements the `FormCodeGeneratorTheme` interface, and its `generate` function uses JSON Schemas to generate the form code. + +2. You can create your own theme, and implement the `FormCodeGeneratorTheme` interface, and make the `generate` function use another type of schema that is supported by [Uniforms](https://uniforms.tools/). To do so, you must use the `dist/uniforms/renderForm` function, which will receive a [Uniforms Bridge](https://uniforms.tools/docs/api-bridges/) and some parameters: + +```ts +{ + id: string; // The form id + sanitizedId: string; // The form id, any # is replaced by _ + disabled?: boolean; // Enable/disable form (read only) + placeholder?: boolean; // Enable/disable placeholders + schema: Bridge; // A Uniforms Bridge instance +} +``` + +## Build + +In order to build the library you must run the following command in the root folder of the repository: + +```shell script +pnpm -F @kie-tools/form-code-generator-patternfly-theme... build:prod +``` + +--- + +Apache KIE (incubating) is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is +required of all newly accepted projects until a further review indicates that +the infrastructure, communications, and decision making process have stabilized +in a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the ASF. + +Some of the incubating project’s releases may not be fully compliant with ASF +policy. For example, releases may have incomplete or un-reviewed licensing +conditions. What follows is a list of known issues the project is currently +aware of (note that this list, by definition, is likely to be incomplete): + +- Hibernate, an LGPL project, is being used. Hibernate is in the process of + relicensing to ASL v2 +- Some files, particularly test files, and those not supporting comments, may + be missing the ASF Licensing Header + +If you are planning to incorporate this work into your product/project, please +be aware that you will need to conduct a thorough licensing review to determine +the overall implications of including this work. For the current status of this +project through the Apache Incubator visit: +https://incubator.apache.org/projects/kie.html diff --git a/packages/uniforms-bootstrap4-codegen/env/index.js b/packages/form-code-generator-patternfly-theme/env/index.js similarity index 100% rename from packages/uniforms-bootstrap4-codegen/env/index.js rename to packages/form-code-generator-patternfly-theme/env/index.js diff --git a/packages/uniforms-patternfly-codegen/jest.config.js b/packages/form-code-generator-patternfly-theme/jest.config.js similarity index 100% rename from packages/uniforms-patternfly-codegen/jest.config.js rename to packages/form-code-generator-patternfly-theme/jest.config.js diff --git a/packages/uniforms-patternfly-codegen/package.json b/packages/form-code-generator-patternfly-theme/package.json similarity index 90% rename from packages/uniforms-patternfly-codegen/package.json rename to packages/form-code-generator-patternfly-theme/package.json index bf18199749a..b7bc46a6a04 100644 --- a/packages/uniforms-patternfly-codegen/package.json +++ b/packages/form-code-generator-patternfly-theme/package.json @@ -1,5 +1,5 @@ { - "name": "@kie-tools/uniforms-patternfly-codegen", + "name": "@kie-tools/form-code-generator-patternfly-theme", "version": "0.0.0", "description": "", "license": "Apache-2.0", @@ -22,10 +22,11 @@ "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --verbose --passWithNoTests\"" }, "dependencies": { + "@kie-tools/form-code-generator": "workspace:*", "lodash": "^4.17.21", "prettier": "^2.8.8", "uniforms": "^3.10.2", - "uniforms-bridge-simple-schema-2": "^3.10.2" + "uniforms-bridge-json-schema": "^3.10.2" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -55,6 +56,7 @@ "simpl-schema": "^1.12.0", "ts-jest": "^29.1.5", "typescript": "^5.5.3", + "uniforms-bridge-simple-schema-2": "^3.10.2", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", diff --git a/packages/uniforms-patternfly-codegen/src/api/index.ts b/packages/form-code-generator-patternfly-theme/src/api/index.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/api/index.ts rename to packages/form-code-generator-patternfly-theme/src/api/index.ts diff --git a/packages/uniforms-patternfly-codegen/src/api/types.ts b/packages/form-code-generator-patternfly-theme/src/api/types.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/api/types.ts rename to packages/form-code-generator-patternfly-theme/src/api/types.ts diff --git a/packages/uniforms-patternfly-codegen/src/index.ts b/packages/form-code-generator-patternfly-theme/src/index.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/index.ts rename to packages/form-code-generator-patternfly-theme/src/index.ts diff --git a/packages/uniforms-patternfly-codegen/src/resources/checkboxGroupFunctions.txt b/packages/form-code-generator-patternfly-theme/src/resources/checkboxGroupFunctions.txt similarity index 100% rename from packages/uniforms-patternfly-codegen/src/resources/checkboxGroupFunctions.txt rename to packages/form-code-generator-patternfly-theme/src/resources/checkboxGroupFunctions.txt diff --git a/packages/uniforms-patternfly-codegen/src/resources/dateFunctions.txt b/packages/form-code-generator-patternfly-theme/src/resources/dateFunctions.txt similarity index 100% rename from packages/uniforms-patternfly-codegen/src/resources/dateFunctions.txt rename to packages/form-code-generator-patternfly-theme/src/resources/dateFunctions.txt diff --git a/packages/uniforms-patternfly-codegen/src/resources/multipleSelectFunctions.txt b/packages/form-code-generator-patternfly-theme/src/resources/multipleSelectFunctions.txt similarity index 100% rename from packages/uniforms-patternfly-codegen/src/resources/multipleSelectFunctions.txt rename to packages/form-code-generator-patternfly-theme/src/resources/multipleSelectFunctions.txt diff --git a/packages/uniforms-patternfly-codegen/src/resources/resources.d.ts b/packages/form-code-generator-patternfly-theme/src/resources/resources.d.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/resources/resources.d.ts rename to packages/form-code-generator-patternfly-theme/src/resources/resources.d.ts diff --git a/packages/uniforms-patternfly-codegen/src/resources/selectFunctions.txt b/packages/form-code-generator-patternfly-theme/src/resources/selectFunctions.txt similarity index 100% rename from packages/uniforms-patternfly-codegen/src/resources/selectFunctions.txt rename to packages/form-code-generator-patternfly-theme/src/resources/selectFunctions.txt diff --git a/packages/uniforms-patternfly-codegen/src/resources/timeFunctions.txt b/packages/form-code-generator-patternfly-theme/src/resources/timeFunctions.txt similarity index 100% rename from packages/uniforms-patternfly-codegen/src/resources/timeFunctions.txt rename to packages/form-code-generator-patternfly-theme/src/resources/timeFunctions.txt diff --git a/packages/form-code-generator-patternfly-theme/src/theme.ts b/packages/form-code-generator-patternfly-theme/src/theme.ts new file mode 100644 index 00000000000..470794ef479 --- /dev/null +++ b/packages/form-code-generator-patternfly-theme/src/theme.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +import { FormAsset, FormCodeGeneratorTheme } from "@kie-tools/form-code-generator/dist/types"; +import JSONSchemaBridge from "uniforms-bridge-json-schema"; +import unescape from "lodash/unescape"; +import { renderForm } from "."; + +export const PATTERNFLY_FILE_EXT = "tsx"; + +export type PatternflyFileExt = typeof PATTERNFLY_FILE_EXT; +export interface PatternflyFormAsset extends FormAsset {} + +export const patternflyFormCodeGeneratorTheme: FormCodeGeneratorTheme = { + generate: (formSchema) => { + const form = renderForm({ + id: formSchema.name, + sanitizedId: formSchema.name, + schema: new JSONSchemaBridge(formSchema.schema, () => true), + disabled: false, + placeholder: true, + }); + return { + id: formSchema.name, + assetName: `${formSchema.name}.${PATTERNFLY_FILE_EXT}`, + type: PATTERNFLY_FILE_EXT, + content: unescape(form), + config: { + schema: JSON.stringify(formSchema.schema), + resources: { + styles: {}, + scripts: {}, + }, + }, + }; + }, +}; diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/AutoField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/AutoField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/AutoField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/AutoField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/AutoFields.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/AutoFields.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/AutoFields.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/AutoFields.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/AutoForm.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/AutoForm.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/AutoForm.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/AutoForm.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/BoolField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/BoolField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/BoolField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/BoolField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/CheckBoxGroupField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/CheckBoxGroupField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/CheckBoxGroupField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/CheckBoxGroupField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/CodeGenContext.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/CodeGenContext.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/CodeGenContext.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/CodeGenContext.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/DateField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/DateField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/DateField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/DateField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/NestField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/NestField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/NestField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/NestField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/NumField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/NumField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/NumField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/NumField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/RadioField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/RadioField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/RadioField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/RadioField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/SelectField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/SelectField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/SelectField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/SelectField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/TextField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/TextField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/TextField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/TextField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/UnsupportedField.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/UnsupportedField.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/UnsupportedField.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/UnsupportedField.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/index.ts b/packages/form-code-generator-patternfly-theme/src/uniforms/index.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/index.ts rename to packages/form-code-generator-patternfly-theme/src/uniforms/index.ts diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/renderForm.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/renderForm.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/renderForm.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/renderForm.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/rendering/FormInputs.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/rendering/FormInputs.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/rendering/FormInputs.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/rendering/FormInputs.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/rendering/NestedFieldInput.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/rendering/NestedFieldInput.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/rendering/NestedFieldInput.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/rendering/NestedFieldInput.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/rendering/RenderingUtils.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/rendering/RenderingUtils.tsx similarity index 95% rename from packages/uniforms-patternfly-codegen/src/uniforms/rendering/RenderingUtils.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/rendering/RenderingUtils.tsx index 7a17772f594..dd2d4d0318d 100644 --- a/packages/uniforms-patternfly-codegen/src/uniforms/rendering/RenderingUtils.tsx +++ b/packages/form-code-generator-patternfly-theme/src/uniforms/rendering/RenderingUtils.tsx @@ -60,5 +60,5 @@ export const renderNestedInputFragmentWithContext = ( }) ); - return codegenCtx.rendered.length == 1 ? codegenCtx.rendered[0] : undefined; + return codegenCtx.rendered.length === 1 ? codegenCtx.rendered[0] : undefined; }; diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/staticCode/staticCodeBlocks.ts b/packages/form-code-generator-patternfly-theme/src/uniforms/staticCode/staticCodeBlocks.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/staticCode/staticCodeBlocks.ts rename to packages/form-code-generator-patternfly-theme/src/uniforms/staticCode/staticCodeBlocks.ts diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/utils/Utils.tsx b/packages/form-code-generator-patternfly-theme/src/uniforms/utils/Utils.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/utils/Utils.tsx rename to packages/form-code-generator-patternfly-theme/src/uniforms/utils/Utils.tsx diff --git a/packages/uniforms-patternfly-codegen/src/uniforms/utils/dataTypes.ts b/packages/form-code-generator-patternfly-theme/src/uniforms/utils/dataTypes.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/src/uniforms/utils/dataTypes.ts rename to packages/form-code-generator-patternfly-theme/src/uniforms/utils/dataTypes.ts diff --git a/packages/uniforms-patternfly-codegen/tests/AutoField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/AutoField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/AutoField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/AutoField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/AutoFields.test.tsx b/packages/form-code-generator-patternfly-theme/tests/AutoFields.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/AutoFields.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/AutoFields.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/AutoForm.test.tsx b/packages/form-code-generator-patternfly-theme/tests/AutoForm.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/AutoForm.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/AutoForm.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/BoolField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/BoolField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/BoolField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/BoolField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/CheckBoxGroupField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/CheckBoxGroupField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/CheckBoxGroupField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/CheckBoxGroupField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/DateField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/DateField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/DateField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/DateField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/NestField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/NestField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/NestField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/NestField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/NumField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/NumField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/NumField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/NumField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/RadioField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/RadioField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/RadioField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/RadioField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/SelectField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/SelectField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/SelectField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/SelectField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/TestCodegenContextProvider.tsx b/packages/form-code-generator-patternfly-theme/tests/TestCodegenContextProvider.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/TestCodegenContextProvider.tsx rename to packages/form-code-generator-patternfly-theme/tests/TestCodegenContextProvider.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/TextField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/TextField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/TextField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/TextField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/UnsupportedField.test.tsx b/packages/form-code-generator-patternfly-theme/tests/UnsupportedField.test.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/UnsupportedField.test.tsx rename to packages/form-code-generator-patternfly-theme/tests/UnsupportedField.test.tsx diff --git a/packages/uniforms-patternfly-codegen/tests/__mocks__/styleMock.js b/packages/form-code-generator-patternfly-theme/tests/__mocks__/styleMock.js similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__mocks__/styleMock.js rename to packages/form-code-generator-patternfly-theme/tests/__mocks__/styleMock.js diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/AutoForm.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/AutoForm.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/AutoForm.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/AutoForm.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/BoolField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/BoolField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/BoolField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/BoolField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/CheckBoxGroupField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/CheckBoxGroupField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/CheckBoxGroupField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/CheckBoxGroupField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/DateField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/DateField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/DateField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/DateField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/NestField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/NestField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/NestField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/NestField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/NumField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/NumField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/NumField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/NumField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/RadioField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/RadioField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/RadioField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/RadioField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/SelectField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/SelectField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/SelectField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/SelectField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/TextField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/TextField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/TextField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/TextField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/__snapshots__/UnsupportedField.test.tsx.snap b/packages/form-code-generator-patternfly-theme/tests/__snapshots__/UnsupportedField.test.tsx.snap similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/__snapshots__/UnsupportedField.test.tsx.snap rename to packages/form-code-generator-patternfly-theme/tests/__snapshots__/UnsupportedField.test.tsx.snap diff --git a/packages/uniforms-patternfly-codegen/tests/_createContext.ts b/packages/form-code-generator-patternfly-theme/tests/_createContext.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/_createContext.ts rename to packages/form-code-generator-patternfly-theme/tests/_createContext.ts diff --git a/packages/uniforms-patternfly-codegen/tests/_createSchema.ts b/packages/form-code-generator-patternfly-theme/tests/_createSchema.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/_createSchema.ts rename to packages/form-code-generator-patternfly-theme/tests/_createSchema.ts diff --git a/packages/uniforms-patternfly-codegen/tests/_render.tsx b/packages/form-code-generator-patternfly-theme/tests/_render.tsx similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/_render.tsx rename to packages/form-code-generator-patternfly-theme/tests/_render.tsx diff --git a/packages/uniforms-bootstrap4-codegen/tests/jest.setup.ts b/packages/form-code-generator-patternfly-theme/tests/jest.setup.ts similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tests/jest.setup.ts rename to packages/form-code-generator-patternfly-theme/tests/jest.setup.ts diff --git a/packages/uniforms-patternfly-codegen/tests/rawJestTransformer.js b/packages/form-code-generator-patternfly-theme/tests/rawJestTransformer.js similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/rawJestTransformer.js rename to packages/form-code-generator-patternfly-theme/tests/rawJestTransformer.js diff --git a/packages/uniforms-patternfly-codegen/tsconfig.json b/packages/form-code-generator-patternfly-theme/tsconfig.json similarity index 100% rename from packages/uniforms-patternfly-codegen/tsconfig.json rename to packages/form-code-generator-patternfly-theme/tsconfig.json diff --git a/packages/uniforms-patternfly-codegen/tsconfig.tests.json b/packages/form-code-generator-patternfly-theme/tsconfig.tests.json similarity index 100% rename from packages/uniforms-patternfly-codegen/tsconfig.tests.json rename to packages/form-code-generator-patternfly-theme/tsconfig.tests.json diff --git a/packages/uniforms-patternfly-codegen/webpack.config.js b/packages/form-code-generator-patternfly-theme/webpack.config.js similarity index 91% rename from packages/uniforms-patternfly-codegen/webpack.config.js rename to packages/form-code-generator-patternfly-theme/webpack.config.js index e443c933a6d..08a16c56ab7 100644 --- a/packages/uniforms-patternfly-codegen/webpack.config.js +++ b/packages/form-code-generator-patternfly-theme/webpack.config.js @@ -22,10 +22,11 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const nodeExternals = require("webpack-node-externals"); const CopyPlugin = require("copy-webpack-plugin"); -module.exports = (env) => [ - merge(common(env), { +module.exports = (webpackEnv, webpackArgv) => [ + merge(common(webpackEnv, webpackArgv), { entry: { index: "./src/index.ts", + theme: "./src/theme.ts", }, plugins: [new CopyPlugin({ patterns: [{ from: "./src/resources", to: "./resources" }] })], output: { diff --git a/packages/form-code-generator/README.md b/packages/form-code-generator/README.md new file mode 100644 index 00000000000..f1d5c2fcc9c --- /dev/null +++ b/packages/form-code-generator/README.md @@ -0,0 +1,104 @@ + + +## Form Code Generator + +This library is used to generate the form code based on a schema. It uses different themes, such as the [Bootstrap4](../form-code-generator-bootstrap4-theme/README.md) and [PatternFly](../form-code-generator-patternfly-theme/README.md) or any theme that implements the [FormCodeGeneratorTheme](./src/types.ts) interface. + +## How it works? + +This library provides types and interfaces to be used by themes. The `generateFormCode` function receives a list of schemas where the theme will be applied. The generated code or error are returned to the caller. + +## Usage + +To use it, call the `generateFormCode` function passing your theme to its arguments: + +```ts +import { generateFormCode } from "@kie-tools/form-code-generator/dist/generateFormCode" +import { FormCodeGeneratorTheme } from "@kie-tools/form-code-generator/dist/types" + +const formCode = generateFormCode({ + formSchemas: [ + { + formSchema: { + name: "my form name", // Form name + schema: {}, // My form schema. The theme determines which kind of schema will be supported. + }, + }, + ], + formCodeGeneratorTheme: { + generate: ({ name, schema }) => { ... }; + }, +}); + +formsCode[0]; // FormAsset | FormGenerationError +``` + +Example using the [PatternFly](../form-code-generator-patternfly-theme/README.md) theme: + +```ts +import { generateFormCode } from "@kie-tools/form-code-generator/dist/generateFormCode"; +import { patternflyFormCodeGeneratorTheme } from "@kie-tools/form-code-generator-patternfly-theme/dist/theme"; + +const formsCode = generateFormCode({ + formSchemas: [ + { + formSchema: { + name: "my patternfly form", // Form name + schema: {}, // My form JSON Schema. + }, + }, + ], + formCodeGeneratorTheme: patternflyFormCodeGeneratorTheme, +}); + +formsCode[0]; // FormAsset | FormGenerationError +``` + +## Build + +In order to build the library you must run the following command in the root folder of the repository: + +```shell script +pnpm -F @kie-tools/form-code-generator... build:prod +``` + +--- + +Apache KIE (incubating) is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is +required of all newly accepted projects until a further review indicates that +the infrastructure, communications, and decision making process have stabilized +in a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the ASF. + +Some of the incubating project’s releases may not be fully compliant with ASF +policy. For example, releases may have incomplete or un-reviewed licensing +conditions. What follows is a list of known issues the project is currently +aware of (note that this list, by definition, is likely to be incomplete): + +- Hibernate, an LGPL project, is being used. Hibernate is in the process of + relicensing to ASL v2 +- Some files, particularly test files, and those not supporting comments, may + be missing the ASF Licensing Header + +If you are planning to incorporate this work into your product/project, please +be aware that you will need to conduct a thorough licensing review to determine +the overall implications of including this work. For the current status of this +project through the Apache Incubator visit: +https://incubator.apache.org/projects/kie.html diff --git a/packages/uniforms-patternfly-codegen/env/index.js b/packages/form-code-generator/env/index.js similarity index 100% rename from packages/uniforms-patternfly-codegen/env/index.js rename to packages/form-code-generator/env/index.js diff --git a/packages/form-generation-tool/jest.config.js b/packages/form-code-generator/jest.config.js similarity index 100% rename from packages/form-generation-tool/jest.config.js rename to packages/form-code-generator/jest.config.js diff --git a/packages/form-code-generator/package.json b/packages/form-code-generator/package.json new file mode 100644 index 00000000000..321abcc7865 --- /dev/null +++ b/packages/form-code-generator/package.json @@ -0,0 +1,44 @@ +{ + "name": "@kie-tools/form-code-generator", + "version": "0.0.0", + "description": "", + "license": "Apache-2.0", + "keywords": [], + "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", + "files": [ + "dist" + ], + "scripts": { + "build:dev": "rimraf dist && tsc -p tsconfig.json", + "build:prod": "rimraf dist && tsc -p tsconfig.json && pnpm lint && pnpm test", + "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", + "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" + }, + "devDependencies": { + "@kie-tools/eslint": "workspace:*", + "@kie-tools/jest-base": "workspace:*", + "@kie-tools/root-env": "workspace:*", + "@kie-tools/tsconfig": "workspace:*", + "@testing-library/jest-dom": "^6.4.6", + "@types/jest": "^29.5.12", + "@types/jest-when": "^3.5.5", + "@types/lodash": "^4.14.168", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", + "jest-when": "^3.6.0", + "rimraf": "^3.0.2", + "run-script-os": "^1.1.6", + "ts-jest": "^29.1.5", + "typescript": "^5.5.3" + } +} diff --git a/packages/form-code-generator/src/generateFormCode.ts b/packages/form-code-generator/src/generateFormCode.ts new file mode 100644 index 00000000000..9db2d57ea5f --- /dev/null +++ b/packages/form-code-generator/src/generateFormCode.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +import { FormCodeGeneratorTheme, FormSchema, FormAsset, FormCodeGeneration } from "./types"; + +export interface FormCodeGenerator< + FormThemeFileExt extends string, + CustomFormAsset extends FormAsset, +> { + formCodeGeneratorTheme: FormCodeGeneratorTheme; + formSchemas: FormSchema[]; +} + +/** + * This function receives a theme to be interated over a list of schemas, generating the form code. + */ +export function generateFormCode>({ + formCodeGeneratorTheme: formGeneratorTheme, + formSchemas, +}: FormCodeGenerator) { + return formSchemas.reduce((generatedForms, formSchema) => { + try { + generatedForms.push({ formAsset: formGeneratorTheme.generate(formSchema), formError: undefined }); + } catch (error) { + console.error(`Error generating form: ${error}`); + generatedForms.push({ formAsset: undefined, formError: error }); + } + return generatedForms; + }, [] as FormCodeGeneration[]); +} diff --git a/packages/form-generation-tool/src/generation/types.ts b/packages/form-code-generator/src/types.ts similarity index 65% rename from packages/form-generation-tool/src/generation/types.ts rename to packages/form-code-generator/src/types.ts index 523e30b3892..9943e2cde55 100644 --- a/packages/form-generation-tool/src/generation/types.ts +++ b/packages/form-code-generator/src/types.ts @@ -22,37 +22,36 @@ export interface FormSchema { schema: any; } -export enum FormStyle { - PATTERNFLY = "patternfly", - BOOTSTRAP = "bootstrap", -} - -export enum FormAssetType { - HTML = "html", - TSX = "tsx", -} - export interface FormResources { styles: Record; scripts: Record; } -export interface FormConfig { +export interface FormConfiguration { schema: string; resources: FormResources; } -export interface FormAsset { +export interface FormAsset { id: string; - sanitizedId: string; assetName: string; - sanitizedAssetName: string; content: string; - type: FormAssetType | string; - config: FormConfig; + type: FormThemeFileExt; + config: FormConfiguration; +} + +export interface FormCodeGenerationError { + error: Error; +} + +export interface FormCodeGeneratorTheme< + FormThemeFileExt extends string, + CustomFormAsset = FormAsset, +> { + generate: (formSchema: FormSchema) => CustomFormAsset; } -export interface FormGenerationTool { - type: string; - generate: (schema: FormSchema) => FormAsset; +export interface FormCodeGeneration { + formAsset: FormAsset | undefined; + formError: FormCodeGenerationError | undefined; } diff --git a/packages/form-code-generator/tests/__mocks__/partternfly.ts b/packages/form-code-generator/tests/__mocks__/partternfly.ts new file mode 100644 index 00000000000..d54abc89d91 --- /dev/null +++ b/packages/form-code-generator/tests/__mocks__/partternfly.ts @@ -0,0 +1,151 @@ +/* + * 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. + */ + +import { FormCodeGeneratorTheme, FormSchema } from "../../dist/types"; + +export const dummyPatternflyTheme: FormCodeGeneratorTheme<"tsx"> = { + generate({ schema, name }: FormSchema) { + return { + id: name, + content: name, + type: "tsx", + assetName: `${name}.tsx`, + config: { + schema: JSON.stringify(schema), + resources: { styles: {}, scripts: {} }, + }, + }; + }, +}; + +export const ApplyForVisaSchema = { + $schema: "http://json-schema.org/draft-07/schema#", + type: "object", + properties: { + traveller: { + type: "object", + properties: { + address: { + type: "object", + properties: { + city: { type: "string" }, + country: { type: "string" }, + street: { type: "string" }, + zipCode: { type: "string" }, + }, + }, + email: { type: "string" }, + firstName: { type: "string" }, + lastName: { type: "string" }, + nationality: { type: "string" }, + }, + input: true, + }, + trip: { + type: "object", + properties: { + begin: { type: "string", format: "date-time" }, + city: { type: "string" }, + country: { type: "string" }, + end: { type: "string", format: "date-time" }, + visaRequired: { type: "boolean" }, + }, + input: true, + }, + visaApplication: { + type: "object", + properties: { + approved: { type: "boolean" }, + city: { type: "string" }, + country: { type: "string" }, + duration: { type: "integer" }, + firstName: { type: "string" }, + lastName: { type: "string" }, + nationality: { type: "string" }, + passportNumber: { type: "string" }, + }, + output: true, + }, + }, +}; + +export const ConfirmTravelSchema = { + $schema: "http://json-schema.org/draft-07/schema#", + type: "object", + properties: { + flight: { + type: "object", + properties: { + arrival: { + type: "string", + format: "date-time", + }, + departure: { + type: "string", + format: "date-time", + }, + flightNumber: { + type: "string", + }, + gate: { + type: "string", + }, + seat: { + type: "string", + }, + }, + input: true, + }, + hotel: { + type: "object", + properties: { + address: { + type: "object", + properties: { + city: { + type: "string", + }, + country: { + type: "string", + }, + street: { + type: "string", + }, + zipCode: { + type: "string", + }, + }, + }, + bookingNumber: { + type: "string", + }, + name: { + type: "string", + }, + phone: { + type: "string", + }, + room: { + type: "string", + }, + }, + input: true, + }, + }, +}; diff --git a/packages/form-code-generator/tests/generateFormCode.test.ts b/packages/form-code-generator/tests/generateFormCode.test.ts new file mode 100644 index 00000000000..ca849e5b749 --- /dev/null +++ b/packages/form-code-generator/tests/generateFormCode.test.ts @@ -0,0 +1,152 @@ +/* + * 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. + */ + +import { generateFormCode } from "../dist/generateFormCode"; +import { FormAsset, FormSchema } from "../dist/types"; +import { ApplyForVisaSchema, ConfirmTravelSchema, dummyPatternflyTheme } from "./__mocks__/partternfly"; + +describe("FormCodeGenerator tests", () => { + describe("generateFormCode tests", () => { + it("Generate forms with empty theme", () => { + const formCode = generateFormCode({ + formSchemas: [{ name: "", schema: {} }], + formCodeGeneratorTheme: { + generate: ({ name, schema }) => ({ + assetName: "", + config: { schema: "", resources: { scripts: {}, styles: {} } }, + content: "", + id: "", + type: "", + }), + }, + }); + + expect(formCode).toHaveLength(1); + expect(formCode[0]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "", + assetName: "", + config: { resources: { scripts: {}, styles: {} }, schema: "" }, + type: "", + }), + formError: undefined, + }) + ); + }); + + it("Generate forms for empty schema", () => { + const formCode = generateFormCode({ + formSchemas: [{ name: "test", schema: {} }], + formCodeGeneratorTheme: dummyPatternflyTheme, + }); + + expect(formCode).toHaveLength(1); + expect(formCode[0]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "test", + assetName: "test.tsx", + config: { resources: { scripts: {}, styles: {} }, schema: "{}" }, + type: "tsx", + }), + formError: undefined, + }) + ); + }); + + it("Generate forms project with schemas", () => { + const formCode = generateFormCode({ + formSchemas: [ + { name: "Apply#For#Visa", schema: ApplyForVisaSchema }, + { name: "ConfirmTravel", schema: ConfirmTravelSchema }, + ], + formCodeGeneratorTheme: dummyPatternflyTheme, + }); + + expect(formCode).toHaveLength(2); + expect(formCode[0]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "Apply#For#Visa", + assetName: "Apply#For#Visa.tsx", + config: { resources: { scripts: {}, styles: {} }, schema: JSON.stringify(ApplyForVisaSchema) }, + type: "tsx", + }), + formError: undefined, + }) + ); + expect(formCode[1]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "ConfirmTravel", + assetName: "ConfirmTravel.tsx", + config: { resources: { scripts: {}, styles: {} }, schema: JSON.stringify(ConfirmTravelSchema) }, + type: "tsx", + }), + formError: undefined, + }) + ); + }); + + it("Generate forms project with schemas and one failure", () => { + const formCode = generateFormCode({ + formSchemas: [ + { name: "ApplyForVisa", schema: ApplyForVisaSchema }, + { name: "ConfirmTravel", schema: ConfirmTravelSchema }, + ], + formCodeGeneratorTheme: { + generate(schema: FormSchema): FormAsset<"txt"> { + if (schema.name === "ApplyForVisa") { + throw new Error("Unexpected Error!"); + } + + return { + id: schema.name, + content: schema.name, + type: "txt", + assetName: `${schema.name}.txt`, + config: { + schema: "", + resources: { styles: {}, scripts: {} }, + }, + }; + }, + }, + }); + + expect(formCode).toHaveLength(2); + expect(formCode[0]).toEqual({ + formAsset: undefined, + formError: new Error("Unexpected Error!"), + }); + expect(formCode[1]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "ConfirmTravel", + assetName: "ConfirmTravel.txt", + config: { resources: { scripts: {}, styles: {} }, schema: "" }, + type: "txt", + }), + formError: undefined, + }) + ); + }); + }); +}); diff --git a/packages/uniforms-patternfly-codegen/tests/jest.setup.ts b/packages/form-code-generator/tests/jest.setup.ts similarity index 100% rename from packages/uniforms-patternfly-codegen/tests/jest.setup.ts rename to packages/form-code-generator/tests/jest.setup.ts diff --git a/packages/form-generation-tool/tsconfig.json b/packages/form-code-generator/tsconfig.json similarity index 100% rename from packages/form-generation-tool/tsconfig.json rename to packages/form-code-generator/tsconfig.json diff --git a/packages/uniforms-bootstrap4-codegen/tsconfig.tests.json b/packages/form-code-generator/tsconfig.tests.json similarity index 100% rename from packages/uniforms-bootstrap4-codegen/tsconfig.tests.json rename to packages/form-code-generator/tsconfig.tests.json diff --git a/packages/form-generation-tool/README.md b/packages/form-generation-tool/README.md deleted file mode 100644 index d3b749d0676..00000000000 --- a/packages/form-generation-tool/README.md +++ /dev/null @@ -1,139 +0,0 @@ - - -## Form Generation Tool - -This is a utility CLI to help generating forms in differents formats for BPMN processes and User Tasks in your Kogito projects. - -### How does it work? - -When building a Kogito project, Kogito generates JSON schemas to represent the data models for both Processes and User Tasks. - -This tool locates those JSON Schemas in the project and taking advantage of the [Uniforms](https://uniforms.tools) APIs, processes them and generate static forms as a resources in the project `src/main/resoures/form` folder. - -### Form Types - -There are two types of form supported with differnt styling and output format: - -- **Patternfly**: generates a React (`.tsx`) forms using Patternfly 4 components. Implementation can be found in `@kie-tools/uniforms-patternfly-codegen` - -- **Bootstrap 4**: generates a HTML (`.html`) forms using Bootstrap 4 styling. - -Each generated form consist in two files, the source code (`.tsx` or `.html`) and a companion `.config` file that defines the external resources (`css` / `js`) the form may need. - -## Build - -In order to build the CLI you must run the following command in the root folder of the repository: - -```shell script -pnpm -F @kie-tools/form-generation-tool... build:prod -``` - -After the command has finished, go to `packages/form-generation-tool/dist` folder and you'll find the CLI binary (`form-generation-cli-macos`, `form-generation-cli-linux` or `form-generation-cli-win.exe` depending on your OS). - -## Running the CLI - -If you built the `form-generation-tool` package as described above locally, then in the command line just execute the CLI binary: - -```shell script -./form-generation-cli-linux -``` - -For those, who do not want to build `form-generation-tool` package locally, they can install last published version and then run it: - -```shell script -npm i -g @kie-tools/form-generation-tool -form-generation-tool -``` - -For those, who want to try `form-generation-tool` without instalation they can start it as: - -```shell script -npx @kie-tools/form-generation-tool -``` - -All commands will start a wizard to help you generate the forms: - -1. First set the path to your Kogito Project. - -![Step 1: Set the Kogito Project path](./docs/form-generation-1.png) - -> **ℹ️ NOTE:** Make sure your Kogito project has been compiled, otherwhise the CLI won't be able to find all the form schemas. - -2. Select one of the availables the Form types (Patternfly or Bootstrap 4). - -![Step 2: Select the Form type](./docs/form-generation-2.png) - -3. Confirm Selection to start the Form Generation process. - -![Step 3: Select the Form type](./docs/form-generation-3.png) - -4. If the Form generation process is succesful, you'll get a confirmation message. - -![Form generation succesfully finished](./docs/form-generation-4.png) - -The generated forms will be stored in the `src/main/resources/forms` folder of the Kogito project. - -![List of generated forms in project](./docs/form-generation-5.png) - -## Using the Custom Forms with Runtime Tools Quarkus Extension - -If your project is a Quarkus based Kogito project, you can use and test them by using the **Runtime Tools Quarkus Extension**. - -To do so, just add the following dependency in your project `pom.xml`: - -```xml - - org.kie.kogito - runtime-tools-quarkus-extension - ${version} - -``` - -And start the project in Dev mode with the command: - -```shell script -mvn clean quarkus:dev -``` - -For more information on how to setup the **Runtime Tools Quarkus Extension** in your project look at the oficial Kogito [documentation](https://docs.kogito.kie.org/latest/html_single/#con-runtime-tools-dev-ui_kogito-developing-process-services). - ---- - -Apache KIE (incubating) is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - -Some of the incubating project’s releases may not be fully compliant with ASF -policy. For example, releases may have incomplete or un-reviewed licensing -conditions. What follows is a list of known issues the project is currently -aware of (note that this list, by definition, is likely to be incomplete): - -- Hibernate, an LGPL project, is being used. Hibernate is in the process of - relicensing to ASL v2 -- Some files, particularly test files, and those not supporting comments, may - be missing the ASF Licensing Header - -If you are planning to incorporate this work into your product/project, please -be aware that you will need to conduct a thorough licensing review to determine -the overall implications of including this work. For the current status of this -project through the Apache Incubator visit: -https://incubator.apache.org/projects/kie.html diff --git a/packages/form-generation-tool/docs/form-generation-1.png b/packages/form-generation-tool/docs/form-generation-1.png deleted file mode 100644 index 100536c370c..00000000000 Binary files a/packages/form-generation-tool/docs/form-generation-1.png and /dev/null differ diff --git a/packages/form-generation-tool/docs/form-generation-2.png b/packages/form-generation-tool/docs/form-generation-2.png deleted file mode 100644 index 6df8123505c..00000000000 Binary files a/packages/form-generation-tool/docs/form-generation-2.png and /dev/null differ diff --git a/packages/form-generation-tool/docs/form-generation-3.png b/packages/form-generation-tool/docs/form-generation-3.png deleted file mode 100644 index 7af9e153d32..00000000000 Binary files a/packages/form-generation-tool/docs/form-generation-3.png and /dev/null differ diff --git a/packages/form-generation-tool/docs/form-generation-4.png b/packages/form-generation-tool/docs/form-generation-4.png deleted file mode 100644 index 5e2534b7198..00000000000 Binary files a/packages/form-generation-tool/docs/form-generation-4.png and /dev/null differ diff --git a/packages/form-generation-tool/docs/form-generation-5.png b/packages/form-generation-tool/docs/form-generation-5.png deleted file mode 100644 index 86d9de0393b..00000000000 Binary files a/packages/form-generation-tool/docs/form-generation-5.png and /dev/null differ diff --git a/packages/form-generation-tool/package.json b/packages/form-generation-tool/package.json deleted file mode 100644 index 061d8edc1df..00000000000 --- a/packages/form-generation-tool/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@kie-tools/form-generation-tool", - "version": "0.0.0", - "description": "", - "license": "Apache-2.0", - "keywords": [], - "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" - }, - "bin": { - "form-generation-tool": "bin.js" - }, - "types": "./dist/index.d.ts", - "main": "dist/index.js", - "files": [ - "dist" - ], - "scripts": { - "build:dev": "rimraf dist && webpack --env dev && pnpm build-binaries", - "build:prod": "pnpm lint && pnpm test && rimraf dist && webpack && pnpm build-binaries:darwin && pnpm build-binaries:linux && pnpm build-binaries:win32", - "build:prod:all": "pnpm lint && pnpm test && rimraf dist && webpack && pnpm && pnpm package:prod:linux && pnpm package:prod:darwin && pnpm package:prod:win32", - "build-binaries": "run-script-os", - "build-binaries:darwin": "pkg dist/index.js --output dist/form-generation-cli-macos --target node18-macos-x64", - "build-binaries:linux": "pkg dist/index.js --output dist/form-generation-cli-linux --target node18-linux-x64", - "build-binaries:win32": "pkg dist/index.js --output dist/form-generation-cli-win.exe --target node18-win-x64", - "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", - "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" - }, - "dependencies": { - "@kie-tools/uniforms-bootstrap4-codegen": "workspace:*", - "@kie-tools/uniforms-patternfly-codegen": "workspace:*", - "inquirer": "^8.1.1", - "lodash": "^4.17.21", - "uniforms": "^3.10.2", - "uniforms-bridge-json-schema": "^3.10.2" - }, - "devDependencies": { - "@babel/core": "^7.16.0", - "@babel/preset-env": "^7.16.0", - "@babel/preset-react": "^7.16.0", - "@kie-tools-core/webpack-base": "workspace:*", - "@kie-tools/eslint": "workspace:*", - "@kie-tools/jest-base": "workspace:*", - "@kie-tools/root-env": "workspace:*", - "@kie-tools/tsconfig": "workspace:*", - "@testing-library/jest-dom": "^6.4.6", - "@types/inquirer": "^7.3.2", - "@types/jest": "^29.5.12", - "@types/jest-when": "^3.5.5", - "@types/lodash": "^4.14.168", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", - "jest-junit": "^16.0.0", - "jest-when": "^3.6.0", - "pkg": "^5.8.1", - "rimraf": "^3.0.2", - "run-script-os": "^1.1.6", - "ts-jest": "^29.1.5", - "typescript": "^5.5.3", - "webpack": "^5.94.0", - "webpack-cli": "^4.10.0", - "webpack-dev-server": "^4.15.1", - "webpack-merge": "^5.9.0", - "webpack-node-externals": "^3.0.0" - } -} diff --git a/packages/form-generation-tool/src/cli/cli.ts b/packages/form-generation-tool/src/cli/cli.ts deleted file mode 100644 index 760ab89424f..00000000000 --- a/packages/form-generation-tool/src/cli/cli.ts +++ /dev/null @@ -1,107 +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. - */ - -import inquirer, { Answers } from "inquirer"; - -import { Args, generateForms } from "../generation"; -import { checkKogitoProjectHasForms, checkKogitoProjectStructure } from "../generation/fs"; - -export function run() { - const validateProjectPath = (path: string): string | boolean => { - if (!path || path === "") { - return "Please type a Kogito Project path"; - } - try { - checkKogitoProjectStructure(path); - } catch (err) { - return err.message; - } - - return true; - }; - - const isOverwriteVisible = (answers: Answers): boolean => { - return checkKogitoProjectHasForms(answers.path); - }; - - const execute = (answers: Answers): void => { - const args: Args = { - path: answers.path, - type: answers.type, - overwrite: answers.overwrite, - }; - - const message = - "\nCurrent selection:" + - `\nProject path: ${args.path}` + - `\nForm type: ${args.type}` + - `${args.overwrite !== undefined ? `\nOverwrite existing forms: ${args.overwrite}` : ""}\n`; - - console.log(message); - - inquirer - .prompt({ - name: "confirm", - type: "confirm", - message: "Do you want to continue?", - default: true, - }) - .then((answers) => { - if (answers.confirm) { - generateForms(args); - } - console.log("\nGood bye!"); - }); - }; - - const questions = [ - { - name: "path", - type: "string", - message: "Type your Kogito Project path:", - validate: validateProjectPath, - }, - { - name: "overwrite", - type: "confirm", - message: "The project already contains forms, do you want to overwrite the existing ones?", - default: false, - when: isOverwriteVisible, - }, - { - name: "type", - type: "list", - message: "Select the Form type:", - choices: ["patternfly", "bootstrap"], - default: "patternfly", - }, - ]; - - console.log("Kogito Form Generation CLI"); - console.log("==========================="); - console.log(); - console.log("This tool will help you generate forms for the Processes and User Tasks in your Kogito Projects."); - console.log( - "The tool will search for the User Tasks JSON schemas generated in your project, so make sure the project is build." - ); - console.log("The generated forms will be stored as resources in your project (in src/main/resources/forms folder)."); - console.log(); - - inquirer.prompt(questions).then(execute); -} diff --git a/packages/form-generation-tool/src/generation/formGenerationCommand.ts b/packages/form-generation-tool/src/generation/formGenerationCommand.ts deleted file mode 100644 index 5a914b1cebb..00000000000 --- a/packages/form-generation-tool/src/generation/formGenerationCommand.ts +++ /dev/null @@ -1,59 +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. - */ - -import { lookupFormGenerationTool } from "./tools"; -import { FormGenerationTool, FormSchema, FormAsset } from "./types"; -import { loadProjectSchemas, storeFormAsset } from "./fs"; - -export interface Args { - path: string; - type: string; - overwrite: boolean; -} - -export function generateForms({ path, type, overwrite }: Args) { - console.log("\nStarting Form generation:"); - - try { - const tool: FormGenerationTool = lookupFormGenerationTool(type); - - const forms: FormSchema[] = loadProjectSchemas(path); - - if (forms.length === 0) { - console.log(`\nCouldn't find any form schema in "${path}", check if your project is already built.`); - return; - } - - console.log(`\nFound ${forms.length} schemas`); - - forms.forEach((form) => { - try { - console.log(`\nGenerating form "${form.name}"`); - const output: FormAsset = tool.generate(form); - storeFormAsset(output, path, overwrite); - console.log(`Successfully generated form "${output.sanitizedAssetName}"`); - } catch (err) { - console.log(`Cannot generate form "${form.name}": `, err.message); - } - }); - } catch (err) { - console.log("Error during form generation:"); - console.log(err.message); - } -} diff --git a/packages/form-generation-tool/src/generation/fs/index.ts b/packages/form-generation-tool/src/generation/fs/index.ts deleted file mode 100644 index cf27275ea6e..00000000000 --- a/packages/form-generation-tool/src/generation/fs/index.ts +++ /dev/null @@ -1,22 +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. - */ - -export { checkKogitoProjectStructure, checkKogitoProjectHasForms } from "./checks"; -export { loadProjectSchemas } from "./loadProjectSchemas"; -export { storeFormAsset } from "./storeFormAsset"; diff --git a/packages/form-generation-tool/src/generation/fs/loadProjectSchemas.ts b/packages/form-generation-tool/src/generation/fs/loadProjectSchemas.ts deleted file mode 100644 index 0b6b12b3941..00000000000 --- a/packages/form-generation-tool/src/generation/fs/loadProjectSchemas.ts +++ /dev/null @@ -1,64 +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. - */ - -import fs from "fs"; -import { FormSchema } from "../types"; -import path from "path"; -import { checkKogitoProjectStructure } from "./checks"; - -const JSON_SCHEMA_PATH = "target/classes/META-INF/jsonSchema"; -const JSON_SCHEMA_EXTENSION = ".json"; - -export const ERROR_INVALID_FOLDER = "Path doesn't exist"; -export const ERROR_NOT_DIRECTORY = "Path isn't a directory"; -export const ERROR_NOT_MVN_PROJECT = "Cannot find 'pom.xml' in source folder, are you sure it is a Kogito Project?"; - -function isValidFile(schemasPath: string, file: string): boolean { - if (!file.endsWith(JSON_SCHEMA_EXTENSION)) { - return false; - } - const stat = fs.statSync(`${schemasPath}/${file}`); - return stat.isFile(); -} - -export function loadProjectSchemas(projectPath: string, jsonSchemaPath?: string): FormSchema[] { - checkKogitoProjectStructure(projectPath); - - const schemasPath = `${projectPath}/${jsonSchemaPath || JSON_SCHEMA_PATH}`; - - if (!fs.existsSync(schemasPath)) { - return []; - } - - const files = fs.readdirSync(schemasPath); - - return files - .filter((file) => isValidFile(schemasPath, file)) - .map((file) => { - try { - return { - name: path.parse(file).name, - schema: JSON.parse(fs.readFileSync(`${schemasPath}/${file}`, "utf8")), - }; - } catch (err) { - console.log(`Cannot load form content for "${file}":`, err.message); - } - }) - .filter((formSchema) => formSchema !== undefined) as FormSchema[]; -} diff --git a/packages/form-generation-tool/src/generation/fs/storeFormAsset.ts b/packages/form-generation-tool/src/generation/fs/storeFormAsset.ts deleted file mode 100644 index 70b2c587d06..00000000000 --- a/packages/form-generation-tool/src/generation/fs/storeFormAsset.ts +++ /dev/null @@ -1,64 +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. - */ - -import { FormAsset } from "../types"; -import fs from "fs"; -import path from "path"; - -export const FORM_STORAGE_FOLDER = "src/main/resources/forms"; -export const FORM_CONFIG_EXT = ".config"; - -function getFormsFolder(sourcePath: string): string { - return `${sourcePath}/${FORM_STORAGE_FOLDER}`; -} - -export function getFormAssetPath(sourcePath: string, formAsset: string): string { - return `${getFormsFolder(sourcePath)}/${formAsset}`; -} - -export function getFormConfigAssetPath(source: string, formAsset: FormAsset): string { - return getFormAssetPath(source, `${formAsset.sanitizedId}${FORM_CONFIG_EXT}`); -} - -export function storeFormAsset(formAsset: FormAsset, source: string, overwriteExisting: boolean) { - const storagePath = getFormsFolder(source); - - if (!fs.existsSync(storagePath)) { - fs.mkdirSync(storagePath); - } - - const existingFormAssets = fs.readdirSync(storagePath).filter((file) => { - const extension = path.extname(file); - return path.basename(file, extension) === formAsset.sanitizedId; - }); - - if (existingFormAssets.length > 0) { - if (!overwriteExisting) { - throw new Error(`Form already exists.`); - } - - console.log(`Form "${formAsset.sanitizedId}" already exists. Proceeding to overwrite it.`); - - existingFormAssets.forEach((file) => { - fs.rmSync(getFormAssetPath(source, file)); - }); - } - fs.writeFileSync(getFormAssetPath(source, formAsset.sanitizedAssetName), formAsset.content); - fs.writeFileSync(getFormConfigAssetPath(source, formAsset), JSON.stringify(formAsset.config, null, 4)); -} diff --git a/packages/form-generation-tool/src/generation/tools/formGenerationToolRegistry.ts b/packages/form-generation-tool/src/generation/tools/formGenerationToolRegistry.ts deleted file mode 100644 index ef4b51eb3bf..00000000000 --- a/packages/form-generation-tool/src/generation/tools/formGenerationToolRegistry.ts +++ /dev/null @@ -1,39 +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. - */ - -import { PatternflyFormGenerationTool } from "./uniforms/patternfly/PatternflyFormGenerationTool"; -import { FormGenerationTool } from "../types"; -import { Bootstrap4FormGenerationTool } from "./uniforms/bootstrap4/Bootstrap4FormGenerationTool"; - -const toolsRegistry: Map = new Map(); - -export function registerFormGenerationTool(formGenerationTool: FormGenerationTool) { - toolsRegistry.set(formGenerationTool.type, formGenerationTool); -} - -registerFormGenerationTool(new PatternflyFormGenerationTool()); -registerFormGenerationTool(new Bootstrap4FormGenerationTool()); - -export function lookupFormGenerationTool(type: string): FormGenerationTool { - const tool = toolsRegistry.get(type); - if (tool) { - return tool; - } - throw new Error(`Unsupported form type "${type}"`); -} diff --git a/packages/form-generation-tool/src/generation/tools/index.ts b/packages/form-generation-tool/src/generation/tools/index.ts deleted file mode 100644 index 1cef086b8a3..00000000000 --- a/packages/form-generation-tool/src/generation/tools/index.ts +++ /dev/null @@ -1,20 +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. - */ - -export { registerFormGenerationTool, lookupFormGenerationTool } from "./formGenerationToolRegistry"; diff --git a/packages/form-generation-tool/src/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool.ts b/packages/form-generation-tool/src/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool.ts deleted file mode 100644 index cb8c77ffd01..00000000000 --- a/packages/form-generation-tool/src/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool.ts +++ /dev/null @@ -1,63 +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. - */ - -import unescape from "lodash/unescape"; -import { FormAssetType, FormAsset, FormStyle, FormConfig, FormGenerationTool, FormSchema } from "../../../types"; - -import { renderForm } from "@kie-tools/uniforms-patternfly-codegen/dist"; -import JSONSchemaBridge from "uniforms-bridge-json-schema"; -import { getUniformsSchema } from "../utils/UniformsSchemaUtils"; -import { inputSanitizationUtil } from "../utils/InputSanitizationUtil"; - -export class PatternflyFormConfig implements FormConfig { - public readonly schema: string; - - constructor(formSchema: any) { - this.schema = JSON.stringify(formSchema); - } - - public resources = { - styles: {}, - scripts: {}, - }; -} - -export class PatternflyFormGenerationTool implements FormGenerationTool { - type: string = FormStyle.PATTERNFLY; - - generate(inputSchema: FormSchema): FormAsset { - const uniformsSchema = getUniformsSchema(inputSchema.schema); - const form = renderForm({ - id: inputSchema.name, - sanitizedId: inputSanitizationUtil(inputSchema.name), - schema: new JSONSchemaBridge(uniformsSchema, () => true), - disabled: false, - placeholder: true, - }); - return { - id: inputSchema.name, - sanitizedId: inputSanitizationUtil(inputSchema.name), - assetName: `${inputSchema.name}.${FormAssetType.TSX}`, - sanitizedAssetName: `${inputSanitizationUtil(inputSchema.name)}.${FormAssetType.TSX}`, - type: FormAssetType.TSX, - content: unescape(form), - config: new PatternflyFormConfig(inputSchema.schema), - }; - } -} diff --git a/packages/form-generation-tool/tests/generation/formGenerationCommand.test.ts b/packages/form-generation-tool/tests/generation/formGenerationCommand.test.ts deleted file mode 100644 index 3a5b2e19c0c..00000000000 --- a/packages/form-generation-tool/tests/generation/formGenerationCommand.test.ts +++ /dev/null @@ -1,155 +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. - */ - -import { generateForms } from "../../src/generation"; -import * as fs from "../../src/generation/fs"; -import { FormAsset, FormGenerationTool, FormSchema } from "../../src/generation/types"; -import { ApplyForVisaSchema, ConfirmTravelSchema } from "./tools/uniforms/patternfly/mock"; -import { registerFormGenerationTool } from "../../src/generation/tools"; -import { inputSanitizationUtil } from "../../src/generation/tools/uniforms/utils/InputSanitizationUtil"; - -jest.mock("../../src/generation/fs"); - -describe("formGenerationCommand tests", () => { - const loadProjectSchemasMock = jest.spyOn(fs, "loadProjectSchemas"); - const storeFormAssetsMock = jest.spyOn(fs, "storeFormAsset"); - - const sourcePath = "/a/test/path"; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - it("Generate forms with wrong tool type", () => { - generateForms({ - path: sourcePath, - type: "wrong type", - overwrite: true, - }); - - expect(loadProjectSchemasMock).not.toHaveBeenCalled(); - expect(storeFormAssetsMock).not.toHaveBeenCalled(); - }); - - it("Generate forms for empty project", () => { - loadProjectSchemasMock.mockReturnValueOnce([]); - - generateForms({ - path: sourcePath, - type: "patternfly", - overwrite: true, - }); - - expect(loadProjectSchemasMock).toHaveBeenCalledTimes(1); - expect(storeFormAssetsMock).not.toHaveBeenCalled(); - }); - - it("Generate forms project with schemas", () => { - const schemas: FormSchema[] = [ - { - name: "Apply#For#Visa", - schema: ApplyForVisaSchema, - }, - { - name: "ConfirmTravel", - schema: ConfirmTravelSchema, - }, - ]; - - loadProjectSchemasMock.mockReturnValueOnce(schemas); - - generateForms({ - path: sourcePath, - type: "patternfly", - overwrite: true, - }); - - expect(loadProjectSchemasMock).toHaveBeenCalledTimes(1); - expect(storeFormAssetsMock).toHaveBeenCalledTimes(2); - - const applyForVisaAsset: FormAsset = storeFormAssetsMock.mock.calls[0][0]; - expect(applyForVisaAsset.id).toEqual("Apply#For#Visa"); - expect(applyForVisaAsset.sanitizedId).toEqual("Apply_For_Visa"); - expect(applyForVisaAsset.assetName).toEqual("Apply#For#Visa.tsx"); - expect(applyForVisaAsset.sanitizedAssetName).toEqual("Apply_For_Visa.tsx"); - expect(applyForVisaAsset.content).toContain("const Form__Apply_For_Visa"); - expect(storeFormAssetsMock.mock.calls[0][1]).toEqual(sourcePath); - expect(storeFormAssetsMock.mock.calls[0][2]).toBeTruthy(); - - const confirmTravelAsset: FormAsset = storeFormAssetsMock.mock.calls[1][0]; - expect(confirmTravelAsset.id).toEqual("ConfirmTravel"); - expect(confirmTravelAsset.sanitizedId).toEqual("ConfirmTravel"); - expect(confirmTravelAsset.assetName).toEqual("ConfirmTravel.tsx"); - expect(confirmTravelAsset.sanitizedAssetName).toEqual("ConfirmTravel.tsx"); - expect(confirmTravelAsset.content).toContain("const Form__ConfirmTravel"); - expect(storeFormAssetsMock.mock.calls[1][1]).toEqual(sourcePath); - expect(storeFormAssetsMock.mock.calls[1][2]).toBeTruthy(); - }); - - it("Generate forms project with schemas and one failure", () => { - const ERROR_MESSAGE = "Unexpected Error!"; - - const tool: FormGenerationTool = { - type: "cool tool", - - generate(schema: FormSchema): FormAsset { - if (schema.name === "ApplyForVisa") { - throw new Error(ERROR_MESSAGE); - } - - return { - id: schema.name, - sanitizedId: inputSanitizationUtil(schema.name), - content: schema.name, - type: "txt", - assetName: `${schema.name}.txt`, - sanitizedAssetName: `${inputSanitizationUtil(schema.name)}.txt`, - config: { - schema: "", - resources: { styles: {}, scripts: {} }, - }, - }; - }, - }; - - registerFormGenerationTool(tool); - - const schemas: FormSchema[] = [ - { - name: "ApplyForVisa", - schema: ApplyForVisaSchema, - }, - { - name: "ConfirmTravel", - schema: ConfirmTravelSchema, - }, - ]; - - loadProjectSchemasMock.mockReturnValueOnce(schemas); - - generateForms({ - path: sourcePath, - type: tool.type, - overwrite: true, - }); - - expect(loadProjectSchemasMock).toHaveBeenCalledTimes(1); - expect(storeFormAssetsMock).toHaveBeenCalledTimes(1); - }); -}); diff --git a/packages/form-generation-tool/tests/generation/fs/checks.test.ts b/packages/form-generation-tool/tests/generation/fs/checks.test.ts deleted file mode 100644 index d58988a3046..00000000000 --- a/packages/form-generation-tool/tests/generation/fs/checks.test.ts +++ /dev/null @@ -1,79 +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. - */ - -import * as fs from "fs"; -import { checkKogitoProjectHasForms, checkKogitoProjectStructure } from "../../../src/generation/fs"; -import { - ERROR_INVALID_FOLDER, - ERROR_NOT_DIRECTORY, - ERROR_NOT_MVN_PROJECT, -} from "../../../src/generation/fs/loadProjectSchemas"; - -jest.mock("fs"); - -describe("checks tests", function () { - const mockFs = fs as jest.Mocked; - - const fsExistsSyncMock = jest.fn(); - const fsStatSyncMock = jest.fn(); - - mockFs.existsSync.mockImplementation(fsExistsSyncMock); - mockFs.statSync.mockImplementation(fsStatSyncMock); - - const sourcePath = "/a/test/path"; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - it("Check Project structure with invalid path", () => { - fsExistsSyncMock.mockReturnValueOnce(false); - - expect(() => checkKogitoProjectStructure(sourcePath)).toThrow(ERROR_INVALID_FOLDER); - }); - - it("Check Project structure not a directory", () => { - fsExistsSyncMock.mockReturnValueOnce(true); - fsStatSyncMock.mockReturnValueOnce({ - isDirectory: () => false, - }); - expect(() => checkKogitoProjectStructure(sourcePath)).toThrow(ERROR_NOT_DIRECTORY); - }); - - it("Check Project structure not a mvn project", () => { - fsExistsSyncMock.mockReturnValueOnce(true).mockReturnValueOnce(false); - - fsStatSyncMock.mockReturnValueOnce({ - isDirectory: () => true, - }); - expect(() => checkKogitoProjectStructure(sourcePath)).toThrow(ERROR_NOT_MVN_PROJECT); - }); - - it("Check Project contains forms", () => { - fsExistsSyncMock.mockReturnValueOnce(true); - - expect(checkKogitoProjectHasForms(sourcePath)).toBeTruthy(); - }); - - it("Check Project does not contain forms", () => { - fsExistsSyncMock.mockReturnValueOnce(false); - - expect(checkKogitoProjectHasForms(sourcePath)).toBeFalsy(); - }); -}); diff --git a/packages/form-generation-tool/tests/generation/fs/resources/empty/pom.xml b/packages/form-generation-tool/tests/generation/fs/resources/empty/pom.xml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/form-generation-tool/tests/generation/fs/resources/full/pom.xml b/packages/form-generation-tool/tests/generation/fs/resources/full/pom.xml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/empty.json b/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/empty.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/travels_ApplyForVisa.json b/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/travels_ApplyForVisa.json deleted file mode 100644 index e7d7bc0b500..00000000000 --- a/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/travels_ApplyForVisa.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "traveller": { - "type": "object", - "properties": { - "address": { - "type": "object", - "properties": { - "city": { "type": "string" }, - "country": { "type": "string" }, - "street": { "type": "string" }, - "zipCode": { "type": "string" } - } - }, - "email": { "type": "string" }, - "firstName": { "type": "string" }, - "lastName": { "type": "string" }, - "nationality": { "type": "string" } - }, - "input": true - }, - "trip": { - "type": "object", - "properties": { - "begin": { "type": "string", "format": "date-time" }, - "city": { "type": "string" }, - "country": { "type": "string" }, - "end": { "type": "string", "format": "date-time" }, - "visaRequired": { "type": "boolean" } - }, - "input": true - }, - "visaApplication": { - "type": "object", - "properties": { - "approved": { "type": "boolean" }, - "city": { "type": "string" }, - "country": { "type": "string" }, - "duration": { "type": "integer" }, - "firstName": { "type": "string" }, - "lastName": { "type": "string" }, - "nationality": { "type": "string" }, - "passportNumber": { "type": "string" } - }, - "output": true - } - } -} diff --git a/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/travels_ConfirmTravel.json b/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/travels_ConfirmTravel.json deleted file mode 100644 index 093260b40eb..00000000000 --- a/packages/form-generation-tool/tests/generation/fs/resources/full/schemas/travels_ConfirmTravel.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "flight": { - "type": "object", - "properties": { - "arrival": { - "type": "string", - "format": "date-time" - }, - "departure": { - "type": "string", - "format": "date-time" - }, - "flightNumber": { - "type": "string" - }, - "gate": { - "type": "string" - }, - "seat": { - "type": "string" - } - }, - "input": true - }, - "hotel": { - "type": "object", - "properties": { - "address": { - "type": "object", - "properties": { - "city": { - "type": "string" - }, - "country": { - "type": "string" - }, - "street": { - "type": "string" - }, - "zipCode": { - "type": "string" - } - } - }, - "bookingNumber": { - "type": "string" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "room": { - "type": "string" - } - }, - "input": true - } - } -} diff --git a/packages/form-generation-tool/tests/generation/fs/storeFormAsset.test.ts b/packages/form-generation-tool/tests/generation/fs/storeFormAsset.test.ts deleted file mode 100644 index 66df95e5127..00000000000 --- a/packages/form-generation-tool/tests/generation/fs/storeFormAsset.test.ts +++ /dev/null @@ -1,95 +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. - */ - -import * as fs from "fs"; -import { FormAsset, FormAssetType } from "../../../src/generation/types"; -import { storeFormAsset } from "../../../src/generation/fs"; -import { getFormAssetPath, getFormConfigAssetPath } from "../../../src/generation/fs/storeFormAsset"; -import { PatternflyFormConfig } from "../../../src/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool"; - -jest.mock("fs"); - -describe("storeFormAssets tests", () => { - const mockFs = fs as jest.Mocked; - - const fsRmSyncMock = jest.fn(); - const fsMkDirSyncMock = jest.fn(); - const fsWriteFileSyncMock = jest.fn(); - const fsReaddirSyncMock = jest.fn(); - - mockFs.readdirSync.mockImplementation(fsReaddirSyncMock); - mockFs.rmSync.mockImplementation(fsRmSyncMock); - mockFs.mkdirSync.mockImplementation(fsMkDirSyncMock); - mockFs.writeFileSync.mockImplementation(fsWriteFileSyncMock); - - const sourcePath = "/a/test/path"; - const formAsset: FormAsset = { - id: "test", - sanitizedId: "test", - assetName: "test.tsx", - sanitizedAssetName: "test.tsx", - type: FormAssetType.TSX, - content: "content", - config: new PatternflyFormConfig({}), - }; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - it("Store existing asset without overwrite", () => { - mockFs.existsSync.mockReturnValue(true); - fsReaddirSyncMock.mockReturnValue(["test.tsx", "test.config"]); - - expect(() => storeFormAsset(formAsset, sourcePath, false)).toThrow(`Form already exists.`); - }); - - it("Store existing asset with overwrite", () => { - mockFs.existsSync.mockReturnValue(true); - fsReaddirSyncMock.mockReturnValue(["test.tsx", "test.config"]); - - expect(() => storeFormAsset(formAsset, sourcePath, true)).not.toThrow(); - expect(fsRmSyncMock).toHaveBeenCalledTimes(2); - expect(fsMkDirSyncMock).not.toHaveBeenCalled(); - expect(fsWriteFileSyncMock).toHaveBeenCalledTimes(2); - - expect(fsWriteFileSyncMock.mock.calls[0][0]).toStrictEqual(getFormAssetPath(sourcePath, formAsset.assetName)); - expect(fsWriteFileSyncMock.mock.calls[0][1]).toStrictEqual(formAsset.content); - - expect(fsWriteFileSyncMock.mock.calls[1][0]).toStrictEqual(getFormConfigAssetPath(sourcePath, formAsset)); - expect(fsWriteFileSyncMock.mock.calls[1][1]).toStrictEqual(JSON.stringify(new PatternflyFormConfig({}), null, 4)); - }); - - it("Store asset", () => { - mockFs.existsSync.mockImplementation(() => false); - fsReaddirSyncMock.mockReturnValue([]); - - expect(() => storeFormAsset(formAsset, sourcePath, true)).not.toThrow(); - expect(fsMkDirSyncMock).toHaveBeenCalled(); - expect(fsRmSyncMock).not.toHaveBeenCalled(); - - expect(fsWriteFileSyncMock).toHaveBeenCalledTimes(2); - - expect(fsWriteFileSyncMock.mock.calls[0][0]).toStrictEqual(getFormAssetPath(sourcePath, formAsset.assetName)); - expect(fsWriteFileSyncMock.mock.calls[0][1]).toStrictEqual(formAsset.content); - - expect(fsWriteFileSyncMock.mock.calls[1][0]).toStrictEqual(getFormConfigAssetPath(sourcePath, formAsset)); - expect(fsWriteFileSyncMock.mock.calls[1][1]).toStrictEqual(JSON.stringify(new PatternflyFormConfig({}), null, 4)); - }); -}); diff --git a/packages/form-generation-tool/tests/generation/tools/formGenerationToolsRegistry.test.ts b/packages/form-generation-tool/tests/generation/tools/formGenerationToolsRegistry.test.ts deleted file mode 100644 index 0b1ee6f6d2b..00000000000 --- a/packages/form-generation-tool/tests/generation/tools/formGenerationToolsRegistry.test.ts +++ /dev/null @@ -1,52 +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. - */ - -import { lookupFormGenerationTool, registerFormGenerationTool } from "../../../src/generation/tools"; -import { FormGenerationTool, FormStyle } from "../../../src/generation/types"; - -describe("formGenerationToolsRegistry tests", () => { - it("Lookup existing tool - patternfly", () => { - const tool = lookupFormGenerationTool(FormStyle.PATTERNFLY); - - expect(tool).not.toBeUndefined(); - - expect(tool.type).toStrictEqual(FormStyle.PATTERNFLY); - }); - - it("Lookup wrong tool", () => { - const toolType = "wrong tool type"; - expect(() => lookupFormGenerationTool(toolType)).toThrow(`Unsupported form type "${toolType}"`); - }); - - it("Register tool & lookup", () => { - const tool: FormGenerationTool = { - type: "cool new tool", - generate: jest.fn(), - }; - - registerFormGenerationTool(tool); - - const coolTool = lookupFormGenerationTool(tool.type); - expect(coolTool).not.toBeUndefined(); - expect(coolTool).toStrictEqual(tool); - - const patternfly = lookupFormGenerationTool(FormStyle.PATTERNFLY); - expect(patternfly).not.toBeUndefined(); - }); -}); diff --git a/packages/form-generation-tool/tests/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool.test.ts b/packages/form-generation-tool/tests/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool.test.ts deleted file mode 100644 index 9ce6ab75427..00000000000 --- a/packages/form-generation-tool/tests/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool.test.ts +++ /dev/null @@ -1,45 +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. - */ - -import { FormAsset } from "../../../../../src/generation/types"; -import { ApplyForVisaSchema } from "./mock"; -import { - Bootstrap4FormConfig, - Bootstrap4FormGenerationTool, -} from "../../../../../src/generation/tools/uniforms/bootstrap4/Bootstrap4FormGenerationTool"; - -describe("Bootstrap4FormGenerationTool tests", () => { - it("Generate", () => { - const tool = new Bootstrap4FormGenerationTool(); - - const formAsset: FormAsset = tool.generate({ - name: "ApplyFor#Visa", - schema: ApplyForVisaSchema, - }); - - expect(formAsset).not.toBeUndefined(); - expect(formAsset.id).toStrictEqual("ApplyFor#Visa"); - expect(formAsset.sanitizedId).toStrictEqual("ApplyFor_Visa"); - expect(formAsset.assetName).toStrictEqual("ApplyFor#Visa.html"); - expect(formAsset.sanitizedAssetName).toStrictEqual("ApplyFor_Visa.html"); - expect(formAsset.content).not.toBeUndefined(); - expect(formAsset.config).not.toBeUndefined(); - expect(formAsset.config).toMatchObject(new Bootstrap4FormConfig(ApplyForVisaSchema)); - }); -}); diff --git a/packages/form-generation-tool/tests/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool.test.ts b/packages/form-generation-tool/tests/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool.test.ts deleted file mode 100644 index e8f59869c25..00000000000 --- a/packages/form-generation-tool/tests/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool.test.ts +++ /dev/null @@ -1,47 +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. - */ - -import { - PatternflyFormConfig, - PatternflyFormGenerationTool, -} from "../../../../../src/generation/tools/uniforms/patternfly/PatternflyFormGenerationTool"; -import { FormAsset } from "../../../../../src/generation/types"; -import { ApplyForVisaSchema } from "./mock"; - -describe("PatternflyFormGenerationTool tests", () => { - it("Generate", () => { - const tool = new PatternflyFormGenerationTool(); - - const formAsset: FormAsset = tool.generate({ - name: "ApplyFor#Visa", - schema: ApplyForVisaSchema, - }); - - expect(formAsset).not.toBeUndefined(); - expect(formAsset.id).toStrictEqual("ApplyFor#Visa"); - expect(formAsset.sanitizedId).toStrictEqual("ApplyFor_Visa"); - expect(formAsset.assetName).toStrictEqual("ApplyFor#Visa.tsx"); - expect(formAsset.sanitizedAssetName).toStrictEqual("ApplyFor_Visa.tsx"); - expect(formAsset.content).not.toBeUndefined(); - expect(formAsset.content).toContain("const Form__ApplyFor_Visa"); - expect(formAsset.content).toContain("export default Form__ApplyFor_Visa;"); - expect(formAsset.config).not.toBeUndefined(); - expect(formAsset.config).toMatchObject(new PatternflyFormConfig(ApplyForVisaSchema)); - }); -}); diff --git a/packages/form/src/FormHook.tsx b/packages/form/src/FormHook.tsx index b69b160d9e7..e138033ba08 100644 --- a/packages/form/src/FormHook.tsx +++ b/packages/form/src/FormHook.tsx @@ -99,12 +99,12 @@ export function useForm, Schema extends Record (infos: any, detail: any) => { if (detail.keyword === "type") { // If it's a type error, it's handled by replacing the current value with a undefined value. - const formFieldPath = dataPathToFormFieldPath(detail.dataPath); + const formFieldPath = dataPathToFormFieldPath(detail.instancePath); infos.changes = [...infos.changes, [formFieldPath, undefined]]; return infos; } else if (detail.keyword === "enum") { // A enum error is caused by a type error. - const formFieldPath = dataPathToFormFieldPath(detail.dataPath); + const formFieldPath = dataPathToFormFieldPath(detail.instancePath); infos.changes = [...infos.changes, [formFieldPath, undefined]]; return infos; } diff --git a/packages/image-env-to-json/webpack.config.js b/packages/image-env-to-json/webpack.config.js index 4a6b1b48a69..a8e86a48830 100644 --- a/packages/image-env-to-json/webpack.config.js +++ b/packages/image-env-to-json/webpack.config.js @@ -21,8 +21,8 @@ const nodeExternals = require("webpack-node-externals"); const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -module.exports = (env, argv) => [ - merge(common(env, argv), { +module.exports = (webpackEnv, webpackArgv) => [ + merge(common(webpackEnv, webpackArgv), { entry: { index: "./src/index.ts", }, diff --git a/packages/import-java-classes-component/showcase/webpack.config.js b/packages/import-java-classes-component/showcase/webpack.config.js index c6d339d7ed5..ed4b72ef51d 100644 --- a/packages/import-java-classes-component/showcase/webpack.config.js +++ b/packages/import-java-classes-component/showcase/webpack.config.js @@ -23,10 +23,9 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), @@ -59,7 +58,7 @@ module.exports = (env) => devServer: { historyApiFallback: true, compress: true, - port: buildEnv.importJavaClassesComponent.dev.port, + port: env.importJavaClassesComponent.dev.port, open: false, hot: true, client: { diff --git a/packages/jbpm-form-code-generator-themes/README.md b/packages/jbpm-form-code-generator-themes/README.md new file mode 100644 index 00000000000..625f509bb69 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/README.md @@ -0,0 +1,110 @@ + + +## jBPM Form Code Generator + +This package has two jBPM themes for the [form-code-generator](../form-code-generator/README.md) library. Both themes are extensions of the [Bootstrap4 theme](../form-code-generator-bootstrap4-theme/README.md) and [PatternFly theme](../form-code-generator-patternfly-theme/README.md), resulting in the jBPM Bootstrap4 theme and jBPM PatternFly theme respectively. + +## Usage + +To use it, pass the jBPM theme to the `generateFormCode` function: + +```ts +import { generateFormCode } from "@kie-tools/form-code-generator/dist/generateFormCode"; +import { jbpmPatternflyFormCodeGeneratorTheme } from "@kie-tools/jbpm-form-code-generator-themes/dist/jbpmPatternflyFormCodeGeneratorTheme"; + +const jbpmFormsCode = generateFormCode({ + formCodeGeneratorTheme: jbpmPatternflyFormCodeGeneratorTheme, + formSchemas: [ + { + name: "", + schema: {}, // Your JSON Schema + }, + ], +}); +``` + +The `jbpmFormsCode` will give you the following object: + +```ts +[{ + formAsset: JbpmFormAssets | undefined + formError: FormCodeGenerationError | undefined +}] +``` + +`JbpmFormAssets` is a object with the following properties: + +```ts +{ + id: string, // The form id + sanitizedId: string, // The same value as "id" but any "#" occorrence is replaced by "_" + assetName: string, // The form name + sanitizedAssetName: string, // The same value as "assetName" but any "#" occorrence is replaced by "_" + type: string, // The file extension of the code + content: string, // The unescaped form code + config: { + schema: string, // The stringifyied JSON Schema + resources: { + styles: {}, // Any style that need to be loaded + scripts: {}, // Any script that need to be loaded + }, + }, +} +``` + +`FormCodeGenerationError` is a object with the following properties: + +```ts +{ + error: Error; // The error object that was thrown during the form generation +} +``` + +## Build + +In order to build the library you must run the following command in the root folder of the repository: + +```shell script +pnpm -F @kie-tools/jbpm-form-code-generator-themes... build:prod +``` + +--- + +Apache KIE (incubating) is an effort undergoing incubation at The Apache Software +Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is +required of all newly accepted projects until a further review indicates that +the infrastructure, communications, and decision making process have stabilized +in a manner consistent with other successful ASF projects. While incubation +status is not necessarily a reflection of the completeness or stability of the +code, it does indicate that the project has yet to be fully endorsed by the ASF. + +Some of the incubating project’s releases may not be fully compliant with ASF +policy. For example, releases may have incomplete or un-reviewed licensing +conditions. What follows is a list of known issues the project is currently +aware of (note that this list, by definition, is likely to be incomplete): + +- Hibernate, an LGPL project, is being used. Hibernate is in the process of + relicensing to ASL v2 +- Some files, particularly test files, and those not supporting comments, may + be missing the ASF Licensing Header + +If you are planning to incorporate this work into your product/project, please +be aware that you will need to conduct a thorough licensing review to determine +the overall implications of including this work. For the current status of this +project through the Apache Incubator visit: +https://incubator.apache.org/projects/kie.html diff --git a/packages/dev-deployment-kogito-quarkus-blank-app-image/install.js b/packages/jbpm-form-code-generator-themes/env/index.js similarity index 79% rename from packages/dev-deployment-kogito-quarkus-blank-app-image/install.js rename to packages/jbpm-form-code-generator-themes/env/index.js index ef3dc831446..61bc742bd66 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app-image/install.js +++ b/packages/jbpm-form-code-generator-themes/env/index.js @@ -17,9 +17,11 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env"); -setup(` - -Drevision=${buildEnv.env.devDeploymentKogitoQuarkusBlankAppImage.version} -`); +module.exports = composeEnv([require("@kie-tools/root-env/env")], { + vars: varsWithName({}), + get env() { + return {}; + }, +}); diff --git a/packages/form-generation-tool/bin.js b/packages/jbpm-form-code-generator-themes/jest.config.js old mode 100755 new mode 100644 similarity index 72% rename from packages/form-generation-tool/bin.js rename to packages/jbpm-form-code-generator-themes/jest.config.js index 1428f160016..e8dc87a086b --- a/packages/form-generation-tool/bin.js +++ b/packages/jbpm-form-code-generator-themes/jest.config.js @@ -1,4 +1,3 @@ -#! /usr/bin/env node /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,7 +17,14 @@ * under the License. */ -/** - * This file is used as entry point of the form-generation-tool cli command - */ -require("./dist/index"); +const { config, jestSetupPath, typescriptTransform } = require("@kie-tools/jest-base/jest.config"); + +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + ...config, + testEnvironment: "jsdom", + setupFilesAfterEnv: [jestSetupPath], + transform: { + ...typescriptTransform, + }, +}; diff --git a/packages/jbpm-form-code-generator-themes/package.json b/packages/jbpm-form-code-generator-themes/package.json new file mode 100644 index 00000000000..e68c35313c7 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/package.json @@ -0,0 +1,52 @@ +{ + "name": "@kie-tools/jbpm-form-code-generator-themes", + "version": "0.0.0", + "description": "", + "license": "Apache-2.0", + "keywords": [], + "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", + "files": [ + "dist" + ], + "scripts": { + "build:dev": "rimraf dist && tsc -p tsconfig.json", + "build:prod": "rimraf dist && tsc -p tsconfig.json && pnpm lint && pnpm test", + "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", + "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" + }, + "dependencies": { + "@kie-tools/form-code-generator": "workspace:*", + "@kie-tools/form-code-generator-bootstrap4-theme": "workspace:*", + "@kie-tools/form-code-generator-patternfly-theme": "workspace:*", + "lodash": "^4.17.21", + "uniforms": "^3.10.2", + "uniforms-bridge-json-schema": "^3.10.2" + }, + "devDependencies": { + "@kie-tools/eslint": "workspace:*", + "@kie-tools/jest-base": "workspace:*", + "@kie-tools/root-env": "workspace:*", + "@kie-tools/tsconfig": "workspace:*", + "@testing-library/jest-dom": "^6.4.6", + "@types/jest": "^29.5.12", + "@types/jest-when": "^3.5.5", + "@types/lodash": "^4.14.168", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", + "jest-when": "^3.6.0", + "rimraf": "^3.0.2", + "run-script-os": "^1.1.6", + "ts-jest": "^29.1.5", + "typescript": "^5.5.3" + } +} diff --git a/packages/form-generation-tool/src/generation/tools/uniforms/utils/UniformsSchemaUtils.ts b/packages/jbpm-form-code-generator-themes/src/getUniformsSchema.ts similarity index 88% rename from packages/form-generation-tool/src/generation/tools/uniforms/utils/UniformsSchemaUtils.ts rename to packages/jbpm-form-code-generator-themes/src/getUniformsSchema.ts index e52f0ab188b..7f42bd32bcb 100644 --- a/packages/form-generation-tool/src/generation/tools/uniforms/utils/UniformsSchemaUtils.ts +++ b/packages/jbpm-form-code-generator-themes/src/getUniformsSchema.ts @@ -22,7 +22,12 @@ import get from "lodash/get"; import set from "lodash/set"; import unset from "lodash/unset"; -export const getUniformsSchema = (schema: any): any => { +type Schema = { [x: string]: any }; + +/** + * Removes the `input` and `output` properties and determines if the form field should be disabled + */ +export function getUniformsSchema(schema: Schema) { const schemaClone = cloneDeep(schema); if (schemaClone.properties) { @@ -43,4 +48,4 @@ export const getUniformsSchema = (schema: any): any => { } return schemaClone; -}; +} diff --git a/packages/form-generation-tool/src/generation/tools/uniforms/utils/InputSanitizationUtil.ts b/packages/jbpm-form-code-generator-themes/src/inputSanitizationUtil.ts similarity index 100% rename from packages/form-generation-tool/src/generation/tools/uniforms/utils/InputSanitizationUtil.ts rename to packages/jbpm-form-code-generator-themes/src/inputSanitizationUtil.ts diff --git a/packages/jbpm-form-code-generator-themes/src/jbpmBootstrap4FormCodeGeneratorTheme.ts b/packages/jbpm-form-code-generator-themes/src/jbpmBootstrap4FormCodeGeneratorTheme.ts new file mode 100644 index 00000000000..ad2f0cdbba6 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/src/jbpmBootstrap4FormCodeGeneratorTheme.ts @@ -0,0 +1,68 @@ +/* + * 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. + */ + +import { FormCodeGeneratorTheme, FormAsset } from "@kie-tools/form-code-generator/dist/types"; +import { renderForm } from "@kie-tools/form-code-generator-bootstrap4-theme/dist"; +import { + BOOTSTRAP4_CSS_URL, + BOOTSTRAP4_FILE_EXT, + BOOTSTRAP4_JS_URL, + Bootstrap4FileExt, + JQUERY_URL, +} from "@kie-tools/form-code-generator-bootstrap4-theme/dist/theme"; +import unescape from "lodash/unescape"; +import JSONSchemaBridge from "uniforms-bridge-json-schema"; +import { getUniformsSchema } from "./getUniformsSchema"; +import { inputSanitizationUtil } from "./inputSanitizationUtil"; +import { JbpmFormAssetBase } from "./types"; + +export interface Bootstrap4FormAsset extends FormAsset, JbpmFormAssetBase {} + +export const jbpmBootstrap4FormCodeGeneratorTheme: FormCodeGeneratorTheme = { + generate: (formSchema) => { + const uniformsSchema = getUniformsSchema(formSchema.schema); + const form = renderForm({ + id: formSchema.name, + sanitizedId: inputSanitizationUtil(formSchema.name), + schema: new JSONSchemaBridge(uniformsSchema, () => true), + disabled: false, + placeholder: true, + }); + return { + id: formSchema.name, + sanitizedId: inputSanitizationUtil(formSchema.name), + assetName: `${formSchema.name}.${BOOTSTRAP4_FILE_EXT}`, + sanitizedAssetName: `${inputSanitizationUtil(formSchema.name)}.${BOOTSTRAP4_FILE_EXT}`, + type: BOOTSTRAP4_FILE_EXT, + content: unescape(form), + config: { + schema: JSON.stringify(formSchema.schema), + resources: { + styles: { + "bootstrap.min.css": BOOTSTRAP4_CSS_URL, + }, + scripts: { + "jquery.js": JQUERY_URL, + "bootstrap.bundle.min.js": BOOTSTRAP4_JS_URL, + }, + }, + }, + }; + }, +}; diff --git a/packages/jbpm-form-code-generator-themes/src/jbpmPatternflyFormCodeGeneratorTheme.ts b/packages/jbpm-form-code-generator-themes/src/jbpmPatternflyFormCodeGeneratorTheme.ts new file mode 100644 index 00000000000..e6002898489 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/src/jbpmPatternflyFormCodeGeneratorTheme.ts @@ -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. + */ + +import { FormAsset, FormCodeGeneratorTheme } from "@kie-tools/form-code-generator/dist/types"; +import { renderForm } from "@kie-tools/form-code-generator-patternfly-theme/dist"; +import { PATTERNFLY_FILE_EXT, PatternflyFileExt } from "@kie-tools/form-code-generator-patternfly-theme/dist/theme"; +import unescape from "lodash/unescape"; +import JSONSchemaBridge from "uniforms-bridge-json-schema"; +import { getUniformsSchema } from "./getUniformsSchema"; +import { inputSanitizationUtil } from "./inputSanitizationUtil"; +import { JbpmFormAssetBase } from "./types"; + +export interface PatternflyFormAsset extends FormAsset, JbpmFormAssetBase {} + +export const jbpmPatternflyFormCodeGeneratorTheme: FormCodeGeneratorTheme = { + generate: (formSchema) => { + const uniformsSchema = getUniformsSchema(formSchema.schema); + const form = renderForm({ + id: formSchema.name, + sanitizedId: inputSanitizationUtil(formSchema.name), + schema: new JSONSchemaBridge(uniformsSchema, () => true), + disabled: false, + placeholder: true, + }); + return { + id: formSchema.name, + sanitizedId: inputSanitizationUtil(formSchema.name), + assetName: `${formSchema.name}.${PATTERNFLY_FILE_EXT}`, + sanitizedAssetName: `${inputSanitizationUtil(formSchema.name)}.${PATTERNFLY_FILE_EXT}`, + type: PATTERNFLY_FILE_EXT, + content: unescape(form), + config: { + schema: JSON.stringify(formSchema.schema), + resources: { + styles: {}, + scripts: {}, + }, + }, + }; + }, +}; diff --git a/packages/form-generation-tool/src/generation/index.ts b/packages/jbpm-form-code-generator-themes/src/types.ts similarity index 89% rename from packages/form-generation-tool/src/generation/index.ts rename to packages/jbpm-form-code-generator-themes/src/types.ts index 8ff98501e40..8560d8fb3bf 100644 --- a/packages/form-generation-tool/src/generation/index.ts +++ b/packages/jbpm-form-code-generator-themes/src/types.ts @@ -17,4 +17,7 @@ * under the License. */ -export * from "./formGenerationCommand"; +export interface JbpmFormAssetBase { + sanitizedId: string; + sanitizedAssetName: string; +} diff --git a/packages/form-generation-tool/tests/generation/tools/uniforms/bootstrap4/mock.ts b/packages/jbpm-form-code-generator-themes/tests/__mocks__/bootstrap.ts similarity index 100% rename from packages/form-generation-tool/tests/generation/tools/uniforms/bootstrap4/mock.ts rename to packages/jbpm-form-code-generator-themes/tests/__mocks__/bootstrap.ts diff --git a/packages/form-generation-tool/tests/generation/tools/uniforms/patternfly/mock.ts b/packages/jbpm-form-code-generator-themes/tests/__mocks__/partternfly.ts similarity index 100% rename from packages/form-generation-tool/tests/generation/tools/uniforms/patternfly/mock.ts rename to packages/jbpm-form-code-generator-themes/tests/__mocks__/partternfly.ts diff --git a/packages/jbpm-form-code-generator-themes/tests/getUniformsSchema.test.ts b/packages/jbpm-form-code-generator-themes/tests/getUniformsSchema.test.ts new file mode 100644 index 00000000000..dc7b1e3c270 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/tests/getUniformsSchema.test.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +import { getUniformsSchema } from "../dist/getUniformsSchema"; + +describe("getUniformsSchema tests", () => { + it("get empty uniforms schema", () => { + expect(getUniformsSchema({})).toEqual({}); + }); + + it("get uniforms schema with empty properties", () => { + expect(getUniformsSchema({ properties: {} })).toEqual({ properties: {} }); + }); + + it("get uniforms schema with properties that are empty", () => { + expect(getUniformsSchema({ properties: { a: {} } })).toEqual({ properties: { a: {} } }); + }); + + it("get uniforms schema with input property", () => { + expect(getUniformsSchema({ properties: { a: { input: true } } })).toEqual({ + properties: { a: { uniforms: { disabled: true } } }, + }); + }); + + it("get uniforms schema with output property", () => { + expect(getUniformsSchema({ properties: { a: { output: true } } })).toEqual({ properties: { a: {} } }); + }); + + it("get uniforms schema with input and output property", () => { + expect(getUniformsSchema({ properties: { a: { input: true, output: true } } })).toEqual({ properties: { a: {} } }); + }); +}); diff --git a/packages/jbpm-form-code-generator-themes/tests/jbpmBootstrap4FormGeneratorTheme.test.ts b/packages/jbpm-form-code-generator-themes/tests/jbpmBootstrap4FormGeneratorTheme.test.ts new file mode 100644 index 00000000000..f5b556f6d2f --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/tests/jbpmBootstrap4FormGeneratorTheme.test.ts @@ -0,0 +1,117 @@ +/* + * 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. + */ + +import { generateFormCode } from "@kie-tools/form-code-generator/dist/generateFormCode"; +import { + BOOTSTRAP4_CSS_URL, + BOOTSTRAP4_JS_URL, + JQUERY_URL, +} from "@kie-tools/form-code-generator-bootstrap4-theme/dist/theme"; +import { jbpmBootstrap4FormCodeGeneratorTheme } from "../dist/jbpmBootstrap4FormCodeGeneratorTheme"; +import { ApplyForVisaSchema, ConfirmTravelSchema } from "./__mocks__/bootstrap"; + +describe("jbpmBootstrap4FormCodeGeneratorTheme tests", () => { + it("Generate", () => { + const formAsset = jbpmBootstrap4FormCodeGeneratorTheme.generate({ + name: "ApplyFor#Visa", + schema: ApplyForVisaSchema, + }); + + expect(formAsset).not.toBeUndefined(); + expect(formAsset.id).toStrictEqual("ApplyFor#Visa"); + expect(formAsset.sanitizedId).toStrictEqual("ApplyFor_Visa"); + expect(formAsset.assetName).toStrictEqual("ApplyFor#Visa.html"); + expect(formAsset.sanitizedAssetName).toStrictEqual("ApplyFor_Visa.html"); + expect(formAsset.content).not.toBeUndefined(); + expect(formAsset.config).not.toBeUndefined(); + expect(formAsset.config).toMatchObject({ + schema: JSON.stringify(ApplyForVisaSchema), + resources: { + styles: { + "bootstrap.min.css": BOOTSTRAP4_CSS_URL, + }, + scripts: { + "jquery.js": JQUERY_URL, + "bootstrap.bundle.min.js": BOOTSTRAP4_JS_URL, + }, + }, + }); + }); + + it("generateFormCode - form assets", () => { + const formAssets = generateFormCode({ + formSchemas: [ + { name: "Apply#For#Visa", schema: ApplyForVisaSchema }, + { name: "ConfirmTravel", schema: ConfirmTravelSchema }, + ], + formCodeGeneratorTheme: jbpmBootstrap4FormCodeGeneratorTheme, + }); + + expect(formAssets).toHaveLength(2); + expect(formAssets[0]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "Apply#For#Visa", + sanitizedId: "Apply_For_Visa", + assetName: "Apply#For#Visa.html", + sanitizedAssetName: "Apply_For_Visa.html", + config: { + resources: { + styles: { + "bootstrap.min.css": BOOTSTRAP4_CSS_URL, + }, + scripts: { + "jquery.js": JQUERY_URL, + "bootstrap.bundle.min.js": BOOTSTRAP4_JS_URL, + }, + }, + schema: JSON.stringify(ApplyForVisaSchema), + }, + type: "html", + }), + formError: undefined, + }) + ); + + expect(formAssets[1]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "ConfirmTravel", + sanitizedId: "ConfirmTravel", + assetName: "ConfirmTravel.html", + sanitizedAssetName: "ConfirmTravel.html", + config: { + resources: { + styles: { + "bootstrap.min.css": BOOTSTRAP4_CSS_URL, + }, + scripts: { + "jquery.js": JQUERY_URL, + "bootstrap.bundle.min.js": BOOTSTRAP4_JS_URL, + }, + }, + schema: JSON.stringify(ConfirmTravelSchema), + }, + type: "html", + }), + formError: undefined, + }) + ); + }); +}); diff --git a/packages/jbpm-form-code-generator-themes/tests/jbpmPatternflyFormGeneratorTheme.test.ts b/packages/jbpm-form-code-generator-themes/tests/jbpmPatternflyFormGeneratorTheme.test.ts new file mode 100644 index 00000000000..371e8827e06 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/tests/jbpmPatternflyFormGeneratorTheme.test.ts @@ -0,0 +1,87 @@ +/* + * 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. + */ + +import { generateFormCode } from "@kie-tools/form-code-generator/dist/generateFormCode"; +import { jbpmPatternflyFormCodeGeneratorTheme } from "../dist/jbpmPatternflyFormCodeGeneratorTheme"; +import { ApplyForVisaSchema, ConfirmTravelSchema } from "./__mocks__/partternfly"; + +describe("jbpmPatternflyFormCodeGeneratorTheme tests", () => { + it("Generate", () => { + const formAsset = jbpmPatternflyFormCodeGeneratorTheme.generate({ + name: "ApplyFor#Visa", + schema: ApplyForVisaSchema, + }); + + expect(formAsset).not.toBeUndefined(); + expect(formAsset.id).toStrictEqual("ApplyFor#Visa"); + expect(formAsset.sanitizedId).toStrictEqual("ApplyFor_Visa"); + expect(formAsset.assetName).toStrictEqual("ApplyFor#Visa.tsx"); + expect(formAsset.sanitizedAssetName).toStrictEqual("ApplyFor_Visa.tsx"); + expect(formAsset.content).not.toBeUndefined(); + expect(formAsset.content).toContain("const Form__ApplyFor_Visa"); + expect(formAsset.content).toContain("export default Form__ApplyFor_Visa;"); + expect(formAsset.config).not.toBeUndefined(); + expect(formAsset.config).toMatchObject({ + schema: JSON.stringify(ApplyForVisaSchema), + resources: { + styles: {}, + scripts: {}, + }, + }); + }); + + it("generateFormCode - form assets", () => { + const formAssets = generateFormCode({ + formSchemas: [ + { name: "Apply#For#Visa", schema: ApplyForVisaSchema }, + { name: "ConfirmTravel", schema: ConfirmTravelSchema }, + ], + formCodeGeneratorTheme: jbpmPatternflyFormCodeGeneratorTheme, + }); + + expect(formAssets).toHaveLength(2); + expect(formAssets[0]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "Apply#For#Visa", + sanitizedId: "Apply_For_Visa", + assetName: "Apply#For#Visa.tsx", + sanitizedAssetName: "Apply_For_Visa.tsx", + config: { resources: { scripts: {}, styles: {} }, schema: JSON.stringify(ApplyForVisaSchema) }, + type: "tsx", + }), + formError: undefined, + }) + ); + + expect(formAssets[1]).toEqual( + expect.objectContaining({ + formAsset: expect.objectContaining({ + id: "ConfirmTravel", + sanitizedId: "ConfirmTravel", + assetName: "ConfirmTravel.tsx", + sanitizedAssetName: "ConfirmTravel.tsx", + config: { resources: { scripts: {}, styles: {} }, schema: JSON.stringify(ConfirmTravelSchema) }, + type: "tsx", + }), + formError: undefined, + }) + ); + }); +}); diff --git a/packages/form-generation-tool/src/cli/index.ts b/packages/jbpm-form-code-generator-themes/tests/jest.setup.ts similarity index 95% rename from packages/form-generation-tool/src/cli/index.ts rename to packages/jbpm-form-code-generator-themes/tests/jest.setup.ts index 900d4290b24..1c413b1660e 100644 --- a/packages/form-generation-tool/src/cli/index.ts +++ b/packages/jbpm-form-code-generator-themes/tests/jest.setup.ts @@ -17,4 +17,4 @@ * under the License. */ -export { run } from "./cli"; +import "@testing-library/jest-dom"; diff --git a/packages/jbpm-form-code-generator-themes/tsconfig.json b/packages/jbpm-form-code-generator-themes/tsconfig.json new file mode 100644 index 00000000000..565feb5d585 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@kie-tools/tsconfig/tsconfig.cjs.json", + "compilerOptions": { + "esModuleInterop": true, + "jsx": "react-jsx" + } +} diff --git a/packages/jbpm-form-code-generator-themes/tsconfig.tests.json b/packages/jbpm-form-code-generator-themes/tsconfig.tests.json new file mode 100644 index 00000000000..1b2aedc6d23 --- /dev/null +++ b/packages/jbpm-form-code-generator-themes/tsconfig.tests.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "types": ["@testing-library/jest-dom"] + } +} diff --git a/packages/jbpm-quarkus-devui/dev/pom.xml b/packages/jbpm-quarkus-devui/dev/pom.xml index 66c31c82286..90dfb810f19 100644 --- a/packages/jbpm-quarkus-devui/dev/pom.xml +++ b/packages/jbpm-quarkus-devui/dev/pom.xml @@ -35,44 +35,12 @@ ${revision} - 3.13.0 true - 17 - 17 - UTF-8 - UTF-8 - 3.5.0 - 3.12.1 - 3.2.0 - 3.4.1 - 4.13.2 true - 1.26.1 - 0.5 - 0.2.2 - - io.quarkus - quarkus-bom - ${quarkus.platform.version} - pom - import - - - org.kie.kogito - kogito-kie-bom - ${version.org.kie.kogito} - pom - import - - - org.jbpm - jbpm-with-drools-quarkus - ${version.org.kie.kogito} - org.jbpm jbpm-quarkus-devui @@ -102,7 +70,6 @@ org.apache.commons commons-compress - ${version.org.apache.commons.commons-compress} io.quarkus @@ -182,7 +149,6 @@ io.quarkiverse.embedded.postgresql quarkus-embedded-postgresql - ${version.io.quarkiverse.embedded.postgresql} @@ -198,7 +164,6 @@ junit junit - ${version.junit} test @@ -209,78 +174,10 @@ src/main/resources - - - - org.apache.maven.plugins - maven-site-plugin - ${maven.site.plugin.version} - - - org.apache.commons - commons-compress - ${version.org.apache.commons.commons-compress} - - - org.iq80.snappy - snappy - ${version.org.iq80.snappy} - - - - - org.apache.maven.plugins - maven-remote-resources-plugin - ${maven.remote.resources.plugin.version} - - - org.apache.commons - commons-compress - ${version.org.apache.commons.commons-compress} - - - org.iq80.snappy - snappy - ${version.org.iq80.snappy} - - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven.jar.plugin.version} - - - org.iq80.snappy - snappy - ${version.org.iq80.snappy} - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-plugin.version} - - - org.iq80.snappy - snappy - ${version.org.iq80.snappy} - - - org.apache.commons - commons-compress - ${version.org.apache.commons.commons-compress} - - - - - io.quarkus quarkus-maven-plugin - ${quarkus.platform.version} true @@ -292,14 +189,12 @@ maven-compiler-plugin - ${compiler-plugin.version} ${maven.compiler.parameters} maven-surefire-plugin - ${surefire-plugin.version} org.jboss.logmanager.LogManager @@ -310,7 +205,6 @@ org.codehaus.mojo flatten-maven-plugin - 1.6.0 true resolveCiFriendliesOnly diff --git a/packages/jbpm-quarkus-devui/install.js b/packages/jbpm-quarkus-devui/install.js index fbc73cb1c4c..69cd5a3dcd4 100644 --- a/packages/jbpm-quarkus-devui/install.js +++ b/packages/jbpm-quarkus-devui/install.js @@ -17,9 +17,10 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.jbpmQuarkusDevuiExtension.version} +setupMavenConfigFile(` + -Drevision=${env.jbpmQuarkusDevuiExtension.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-deployment/pom.xml b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-deployment/pom.xml index f5616c1a44f..6cb40ffd6b9 100644 --- a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-deployment/pom.xml +++ b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-deployment/pom.xml @@ -36,7 +36,6 @@ org.jbpm.quarkus.dev.ui.deployment ../node_modules/@kie-tools/runtime-tools-process-dev-ui-webapp - 0.8.11 @@ -63,7 +62,7 @@ io.quarkus - quarkus-rest-client-deployment + quarkus-resteasy-client-deployment io.quarkus @@ -73,18 +72,20 @@ org.kie.kogito kogito-quarkus-extension-spi - + org.apache.james apache-mime4j-core - ${version.apache.mime4j} - - + io.quarkus quarkus-undertow-deployment @@ -121,7 +122,7 @@ io.quarkus quarkus-extension-processor - ${quarkus.platform.version} + ${version.quarkus} diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-parent.iml b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-parent.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-parent.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/pom.xml b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/pom.xml index b07f83ca31c..d56dbb280f9 100644 --- a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/pom.xml +++ b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/pom.xml @@ -55,7 +55,7 @@ io.quarkus - quarkus-rest-client + quarkus-resteasy-client @@ -125,12 +125,13 @@ test + io.quarkus quarkus-extension-maven-plugin - ${quarkus.platform.version} + ${version.quarkus} compile @@ -153,7 +154,7 @@ io.quarkus quarkus-extension-processor - ${quarkus.platform.version} + ${version.quarkus} diff --git a/packages/jbpm-quarkus-devui/package.json b/packages/jbpm-quarkus-devui/package.json index d832c918046..ab4c41c31e1 100644 --- a/packages/jbpm-quarkus-devui/package.json +++ b/packages/jbpm-quarkus-devui/package.json @@ -15,23 +15,22 @@ "scripts": { "build:dev": "run-script-os", "build:dev:darwin:linux": "mvn clean install -DskipTests", - "build:dev:win32": "pnpm powershell \"mvn clean install -DskipTests \"", + "build:dev:win32": "pnpm powershell \"mvn clean install `-DskipTests\"", "build:prod": "pnpm lint && run-script-os", - "build:prod:darwin:linux": "mvn clean deploy -DdeployAtEnd -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -Dreproducible", - "build:prod:win32": "pnpm powershell \"mvn clean deploy `-DdeployAtEnd `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dmaven.deploy.skip=$(build-env maven.deploy.skip) `-Dreproducible\"", + "build:prod:darwin:linux": "mvn clean deploy -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -Dreproducible", + "build:prod:win32": "pnpm powershell \"mvn clean deploy `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dmaven.deploy.skip=$(build-env maven.deploy.skip) `-Dreproducible\"", "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command", "quarkus:dev": "run-script-os", "quarkus:dev:darwin:linux": "mvn clean package quarkus:dev -DskipTests", - "quarkus:dev:win32": "mvn clean package quarkus:dev -DskipTests", + "quarkus:dev:win32": "mvn clean package quarkus:dev `-DskipTests", "start": "pnpm build:dev && mvn -f ./dev/pom.xml quarkus:dev" }, "dependencies": { "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/runtime-tools-process-dev-ui-webapp": "workspace:*", "run-script-os": "^1.1.6" diff --git a/packages/jobs-service-webapp/webpack.config.js b/packages/jobs-service-webapp/webpack.config.js index 8bfef9544ce..86e0614b66a 100644 --- a/packages/jobs-service-webapp/webpack.config.js +++ b/packages/jobs-service-webapp/webpack.config.js @@ -21,10 +21,9 @@ const CopyPlugin = require("copy-webpack-plugin"); const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { env } = require("./env"); -const buildEnv = env; -module.exports = async (env) => - merge(common(env), { +module.exports = async (webpackEnv) => + merge(common(webpackEnv), { entry: {}, plugins: [ new CopyPlugin({ @@ -40,6 +39,6 @@ module.exports = async (env) => static: { directory: "./dist", }, - port: buildEnv.jobsServiceWebapp.dev.port, + port: env.jobsServiceWebapp.dev.port, }, }); diff --git a/packages/kie-editors-dev-vscode-extension/package.json b/packages/kie-editors-dev-vscode-extension/package.json index d69caf24e54..e6f92302c56 100644 --- a/packages/kie-editors-dev-vscode-extension/package.json +++ b/packages/kie-editors-dev-vscode-extension/package.json @@ -75,7 +75,7 @@ "rimraf": "^3.0.2", "sanitize-filename-ts": "^1.0.2", "typescript": "^5.5.3", - "vscode-extension-tester": "^8.3.1", + "vscode-extension-tester": "^8.8.0", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", diff --git a/packages/kie-editors-dev-vscode-extension/webpack.config.js b/packages/kie-editors-dev-vscode-extension/webpack.config.js index bc410bfe13d..9406ab23019 100644 --- a/packages/kie-editors-dev-vscode-extension/webpack.config.js +++ b/packages/kie-editors-dev-vscode-extension/webpack.config.js @@ -25,8 +25,8 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const stunnerEditors = require("@kie-tools/stunner-editors"); const vscodeJavaCodeCompletionExtensionPlugin = require("@kie-tools/vscode-java-code-completion-extension-plugin"); -module.exports = async (env) => [ - merge(common(env), { +module.exports = async (webpackEnv) => [ + merge(common(webpackEnv), { output: { library: "AppFormer.VsCodePack", libraryTarget: "umd", @@ -41,7 +41,7 @@ module.exports = async (env) => [ "extension/extension": "./src/extension/extension.ts", }, }), - merge(common(env), { + merge(common(webpackEnv), { output: { library: "AppFormer.VsCodePack", libraryTarget: "umd", @@ -62,7 +62,7 @@ module.exports = async (env) => [ }), ], }), - merge(common(env), { + merge(common(webpackEnv), { output: { library: "AppFormer.VsCodePackWebview", libraryTarget: "umd", @@ -112,7 +112,7 @@ module.exports = async (env) => [ }), ], }), - merge(common(env), { + merge(common(webpackEnv), { output: { library: "AppFormer.VsCodePackWebview", libraryTarget: "umd", diff --git a/packages/kie-editors-standalone/e2e-tests/webpack.config.js b/packages/kie-editors-standalone/e2e-tests/webpack.config.js index 7c9a7967fe5..bee9949535c 100644 --- a/packages/kie-editors-standalone/e2e-tests/webpack.config.js +++ b/packages/kie-editors-standalone/e2e-tests/webpack.config.js @@ -22,10 +22,9 @@ const HtmlWebPackPlugin = require("html-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { merge } = require("webpack-merge"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { app: path.resolve(__dirname, "src", "index.tsx"), @@ -48,6 +47,6 @@ module.exports = (env) => overlay: true, }, open: false, - port: buildEnv.standaloneEditors.dev.port, + port: env.standaloneEditors.dev.port, }, }); diff --git a/packages/kie-editors-standalone/webpack.build-resources.config.js b/packages/kie-editors-standalone/webpack.build-resources.config.js index aa885e4ddd4..355624ae595 100644 --- a/packages/kie-editors-standalone/webpack.build-resources.config.js +++ b/packages/kie-editors-standalone/webpack.build-resources.config.js @@ -23,8 +23,8 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const CopyPlugin = require("copy-webpack-plugin"); const patternflyBase = require("@kie-tools-core/patternfly-base"); -module.exports = (env) => [ - merge(common(env), { +module.exports = (webpackEnv) => [ + merge(common(webpackEnv), { entry: { "preprocessor/preprocessor": "./src/preprocessor/preprocessor.ts", }, @@ -35,7 +35,7 @@ module.exports = (env) => [ __filename: true, //Uses current working dir }, }), - merge(common(env), { + merge(common(webpackEnv), { output: { publicPath: "", }, diff --git a/packages/kie-editors-standalone/webpack.package-resources.config.js b/packages/kie-editors-standalone/webpack.package-resources.config.js index 550deafb3b9..ec50e6a77ec 100644 --- a/packages/kie-editors-standalone/webpack.package-resources.config.js +++ b/packages/kie-editors-standalone/webpack.package-resources.config.js @@ -21,10 +21,9 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const path = require("path"); const { env } = require("./env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { output: { path: path.join(__dirname, "dist"), filename: "[name]/index.js", @@ -51,6 +50,6 @@ module.exports = (env) => historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }], compress: true, - port: buildEnv.standaloneEditors.dev.port, + port: env.standaloneEditors.dev.port, }, }); diff --git a/packages/kn-plugin-workflow/e2e-tests/gen_manifest_test.go b/packages/kn-plugin-workflow/e2e-tests/gen_manifest_test.go index 448d2be0730..8460519d5ac 100644 --- a/packages/kn-plugin-workflow/e2e-tests/gen_manifest_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/gen_manifest_test.go @@ -94,6 +94,7 @@ func TestGenManifestProjectSuccess(t *testing.T) { projectDir := filepath.Join(TempTestsPath, projectName) err := os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) for _, run := range tests { _, err = ExecuteKnWorkflow(run.args...) diff --git a/packages/kn-plugin-workflow/e2e-tests/helper_test.go b/packages/kn-plugin-workflow/e2e-tests/helper_test.go index 8d45777b8c6..392e959ee92 100644 --- a/packages/kn-plugin-workflow/e2e-tests/helper_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/helper_test.go @@ -173,6 +173,36 @@ func CleanUpAndChdirTemp(t *testing.T) { } } +func WriteMavenConfigFileWithTailDirs(projectDir string) { + dirPath := filepath.Join(projectDir, ".mvn") + if _, err := os.Stat(dirPath); os.IsNotExist(err) { + err := os.Mkdir(dirPath, 0755) // Permissions: owner=rwx, group=rx, others=rx + if err != nil { + fmt.Printf("Error creating .mvn directory. %v", err) + os.Exit(1) + } + } + + sonataflowQuarkusDevUiM2, err := filepath.Abs("../../../node_modules/@kie-tools/sonataflow-quarkus-devui/dist/1st-party-m2/repository") + if err != nil { + fmt.Printf("Failed to resolve absolute path for `@kie-tools/sonataflow-quarkus-devui` package. %v", err) + os.Exit(1) + } + mavenBaseM2, err := filepath.Abs("../../../node_modules/@kie-tools/maven-base/dist/1st-party-m2/repository") + if err != nil { + fmt.Printf("Failed to resolve absolute path for `@kie-tools/maven-base` package. %v", err) + os.Exit(1) + } + + tail := mavenBaseM2 + "," + sonataflowQuarkusDevUiM2 + "\n" + + err = os.WriteFile(filepath.Join(projectDir, ".mvn", "maven.config"), []byte("-Dmaven.repo.local.tail="+tail), 0644) + if err != nil { + fmt.Printf("Failed to create .mvn/maven.config file: %v", err) + os.Exit(1) + } +} + func AddSnapshotRepositoryDeclarationToPom(t *testing.T, projectDir string) { VerifyFilesExist(t, projectDir, []string{"pom.xml"}) pomFilePath := filepath.Join(projectDir, "pom.xml") diff --git a/packages/kn-plugin-workflow/e2e-tests/quarkus_build_test.go b/packages/kn-plugin-workflow/e2e-tests/quarkus_build_test.go index 753677c86e3..2b8e9af4122 100644 --- a/packages/kn-plugin-workflow/e2e-tests/quarkus_build_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/quarkus_build_test.go @@ -121,6 +121,7 @@ func RunQuarkusBuildTest(t *testing.T, cfgTestInputQuarkusCreate CfgTestInputQua err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) // Run `quarkus build` command args := transformQuarkusBuildCmdCfgToArgs(test.input) diff --git a/packages/kn-plugin-workflow/e2e-tests/quarkus_convert_test.go b/packages/kn-plugin-workflow/e2e-tests/quarkus_convert_test.go index d2b79047757..a6a94174f2d 100644 --- a/packages/kn-plugin-workflow/e2e-tests/quarkus_convert_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/quarkus_convert_test.go @@ -106,6 +106,7 @@ func RunQuarkusConvertTest(t *testing.T, cfgTestInputCreateConvert CfgTestInputC err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) // Run `quarkus convert` command _, err = ExecuteKnWorkflowQuarkus(transformQuarkusConvertCmdCfgToArgs(t, test.input)...) @@ -158,6 +159,7 @@ func TestQuarkusConvertProjectFailed(t *testing.T) { err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) // Run `quarkus convert` command _, err = ExecuteKnWorkflowQuarkus(transformQuarkusConvertCmdCfgToArgs(t, test.input)...) @@ -182,6 +184,7 @@ func TestQuarkusConvertProjectFailedAlreadyQuarkus(t *testing.T) { err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) // Run `quarkus convert` command _, err = ExecuteKnWorkflowQuarkus(transformQuarkusConvertCmdCfgToArgs(t, test.input)...) diff --git a/packages/kn-plugin-workflow/e2e-tests/quarkus_create_test.go b/packages/kn-plugin-workflow/e2e-tests/quarkus_create_test.go index b0b809a0e6b..23aabd99c8f 100644 --- a/packages/kn-plugin-workflow/e2e-tests/quarkus_create_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/quarkus_create_test.go @@ -23,6 +23,7 @@ package e2e_tests import ( "fmt" + "os" "path/filepath" "testing" @@ -108,7 +109,10 @@ func RunQuarkusCreateTest(t *testing.T, test CfgTestInputQuarkusCreate) string { // Run `quarkus create` command _, err = ExecuteKnWorkflowQuarkus(transformQuarkusCreateCmdCfgToArgs(test.input)...) + + err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got: %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) // Check if the project directory was created require.DirExistsf(t, projectDir, "Expected project directory '%s' to be created", projectDir) diff --git a/packages/kn-plugin-workflow/e2e-tests/quarkus_run_test.go b/packages/kn-plugin-workflow/e2e-tests/quarkus_run_test.go index 8645ec844a6..f127d98575e 100644 --- a/packages/kn-plugin-workflow/e2e-tests/quarkus_run_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/quarkus_run_test.go @@ -91,8 +91,10 @@ func RunQuarkusRunTest(t *testing.T, cfgTestInputPrepareQuarkusCreateRun CfgTest // Create and build the quarkus project projectName := RunQuarkusCreateTest(t, cfgTestInputPrepareQuarkusCreateRun) projectDir := filepath.Join(TempTestsPath, projectName) + err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) cmd := exec.Command(KnExecutable) diff --git a/packages/kn-plugin-workflow/e2e-tests/run_test.go b/packages/kn-plugin-workflow/e2e-tests/run_test.go index 13a542b1e53..f3f371b4b21 100644 --- a/packages/kn-plugin-workflow/e2e-tests/run_test.go +++ b/packages/kn-plugin-workflow/e2e-tests/run_test.go @@ -86,8 +86,10 @@ func RunRunTest(t *testing.T, cfgTestInputPrepareCreate CfgTestInputCreate, test projectName := GetCreateProjectName(t, cfgTestInputPrepareCreateRun) projectDir := filepath.Join(TempTestsPath, projectName) + err = os.Chdir(projectDir) require.NoErrorf(t, err, "Expected nil error, got %v", err) + WriteMavenConfigFileWithTailDirs(projectDir) cmd := exec.Command(KnExecutable) diff --git a/packages/kn-plugin-workflow/package.json b/packages/kn-plugin-workflow/package.json index 34155f71362..b860ec7803c 100644 --- a/packages/kn-plugin-workflow/package.json +++ b/packages/kn-plugin-workflow/package.json @@ -39,8 +39,8 @@ "go:test-e2e:report": "go run github.com/jstemmer/go-junit-report/v2 -set-exit-code -in ./dist-tests-e2e/go-test-output-e2e.txt -out ./dist-tests-e2e/junit-report-it.xml", "install": "go mod tidy", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command", - "setup:env": "cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env quarkusPlatform.version) PLUGIN_VERSION=$(build-env knPluginWorkflow.version) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env kogitoRuntime.version)", - "setup:env:win32": "pnpm powershell \"cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env quarkusPlatform.version) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env kogitoRuntime.version) PLUGIN_VERSION=$(build-env knPluginWorkflow.version)\"", + "setup:env": "cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env versions.quarkus) PLUGIN_VERSION=$(build-env knPluginWorkflow.version) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env versions.kogito)", + "setup:env:win32": "pnpm powershell \"cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env versions.quarkus) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env versions.kogito) PLUGIN_VERSION=$(build-env knPluginWorkflow.version)\"", "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"pnpm go:test\" \"pnpm go:test:report\"", "test-e2e": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e\" \"pnpm go:test-e2e:report\"", "test-e2e:logs": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:logs\" \"pnpm go:test-e2e:report\"", @@ -49,6 +49,10 @@ "test-e2e:quarkus": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:quarkus\" \"pnpm go:test-e2e:report\"", "test-e2e:quarkus:logs": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:quarkus:logs\" \"pnpm go:test-e2e:report\"" }, + "dependencies": { + "@kie-tools/maven-base": "workspace:*", + "@kie-tools/sonataflow-quarkus-devui": "workspace:*" + }, "devDependencies": { "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-devmode-image": "workspace:*", diff --git a/packages/kogito-base-builder-image/install.js b/packages/kogito-base-builder-image/install.js index fa67779a3bb..0e3b3188d06 100644 --- a/packages/kogito-base-builder-image/install.js +++ b/packages/kogito-base-builder-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoBaseBuilderImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoBaseBuilderImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,14 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoBaseBuilderImage.registry}/${buildEnv.env.kogitoBaseBuilderImage.account}/${buildEnv.env.kogitoBaseBuilderImage.name}`; +const imageUrl = `${env.kogitoBaseBuilderImage.registry}/${env.kogitoBaseBuilderImage.account}/${env.kogitoBaseBuilderImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-base-builder.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync(originalYamlPath, path.join(resourcesPath, `${buildEnv.env.kogitoBaseBuilderImage.name}-image.yaml`)); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoBaseBuilderImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-base-builder-image/package.json b/packages/kogito-base-builder-image/package.json index a6542722da4..806db506377 100644 --- a/packages/kogito-base-builder-image/package.json +++ b/packages/kogito-base-builder-image/package.json @@ -21,11 +21,11 @@ "image:build": "run-script-os", "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoBaseBuilderImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoBaseBuilderImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoBaseBuilderImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoBaseBuilderImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoBaseBuilderImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoBaseBuilderImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoBaseBuilderImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoBaseBuilderImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { "@kie-tools/python-venv": "workspace:*", diff --git a/packages/kogito-data-index-ephemeral-image/install.js b/packages/kogito-data-index-ephemeral-image/install.js index c650f3bac2a..5e3e2c01d85 100644 --- a/packages/kogito-data-index-ephemeral-image/install.js +++ b/packages/kogito-data-index-ephemeral-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoDataIndexEphemeralImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoDataIndexEphemeralImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,17 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoDataIndexEphemeralImage.registry}/${buildEnv.env.kogitoDataIndexEphemeralImage.account}/${buildEnv.env.kogitoDataIndexEphemeralImage.name}`; +const imageUrl = `${env.kogitoDataIndexEphemeralImage.registry}/${env.kogitoDataIndexEphemeralImage.account}/${env.kogitoDataIndexEphemeralImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-data-index-ephemeral.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync( - originalYamlPath, - path.join(resourcesPath, `${buildEnv.env.kogitoDataIndexEphemeralImage.name}-image.yaml`) -); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoDataIndexEphemeralImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-data-index-ephemeral-image/package.json b/packages/kogito-data-index-ephemeral-image/package.json index 7905134b22f..6cc2887dec4 100644 --- a/packages/kogito-data-index-ephemeral-image/package.json +++ b/packages/kogito-data-index-ephemeral-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm copy-assets\" \"pnpm image:build\"", + "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm mvn-build-app\" \"pnpm copy-assets\" \"pnpm image:build\"", "build:prod": "pnpm build:dev && pnpm image:test", "copy-assets": "run-script-os", "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build", @@ -21,15 +21,19 @@ "copy-test-assets:linux:darwin": "cp -R test-resources/. build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:darwin:linux": "pnpm setup:env make -C ./build build-kogito-app build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDataIndexEphemeralImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDataIndexEphemeralImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDataIndexEphemeralImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDataIndexEphemeralImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "mvn-build-app": "run-script-os", + "mvn-build-app:linux:darwin": "mvn -am package -Dquarkus.package.type=fast-jar -Dquarkus.container-image.build=false -B -f ./resources/app/pom.xml", + "mvn-build-app:win32": "echo \"Build skipped on Windows\"", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDataIndexEphemeralImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDataIndexEphemeralImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDataIndexEphemeralImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDataIndexEphemeralImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", diff --git a/packages/kogito-data-index-ephemeral-image/resources/app/pom.xml b/packages/kogito-data-index-ephemeral-image/resources/app/pom.xml new file mode 100644 index 00000000000..ae7bd8c8f94 --- /dev/null +++ b/packages/kogito-data-index-ephemeral-image/resources/app/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.kie + kie-tools-maven-base + ${revision} + ../../node_modules/@kie-tools/maven-base/pom.xml + + + kogito-data-index-ephemeral-image-app + ${revision} + + KIE Tools :: Kogito Data Index Ephemeral Image :: App + Kogito Data Index Ephemeral Image Quarkus App + + + + org.kie.kogito + data-index-service-inmemory + ${version.org.kie.kogito} + + + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + + diff --git a/packages/kogito-data-index-ephemeral-image/resources/incubator-kie-kogito-data-index-ephemeral-image.yaml b/packages/kogito-data-index-ephemeral-image/resources/incubator-kie-kogito-data-index-ephemeral-image.yaml index 5c414019813..d4be0f424bc 100644 --- a/packages/kogito-data-index-ephemeral-image/resources/incubator-kie-kogito-data-index-ephemeral-image.yaml +++ b/packages/kogito-data-index-ephemeral-image/resources/incubator-kie-kogito-data-index-ephemeral-image.yaml @@ -16,25 +16,23 @@ # specific language governing permissions and limitations # under the License. # -schema_version: 1 - name: "docker.io/apache/incubator-kie-kogito-data-index-ephemeral" version: "main" -from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19" +from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20" description: "Runtime image for Kogito Data Index Service for ephemeral PostgreSQL persistence provider" labels: - - name: "org.kie.kogito.version" + - name: org.kie.kogito.version value: "### SET ME DURING BUILD PROCESS ###" - - name: "maintainer" + - name: maintainer value: "Apache KIE " - - name: "io.k8s.description" + - name: io.k8s.description value: "Runtime image for Kogito Data Index Service for ephemeral PostgreSQL persistence provider" - - name: "io.k8s.display-name" + - name: io.k8s.display-name value: "Kogito Data Index Service - ephemeral PostgreSQL" - - name: "io.openshift.tags" + - name: io.openshift.tags value: "kogito,data-index,data-index-ephemeral" - - name: "io.openshift.expose-services" + - name: io.openshift.expose-services value: "8080:http" envs: diff --git a/packages/kogito-data-index-ephemeral-image/resources/modules/kogito-data-index-ephemeral/module.yaml b/packages/kogito-data-index-ephemeral-image/resources/modules/kogito-data-index-ephemeral/module.yaml index 94e22660e5b..88fc47af32b 100644 --- a/packages/kogito-data-index-ephemeral-image/resources/modules/kogito-data-index-ephemeral/module.yaml +++ b/packages/kogito-data-index-ephemeral-image/resources/modules/kogito-data-index-ephemeral/module.yaml @@ -20,12 +20,10 @@ schema_version: 1 name: org.kie.kogito.dataindex.ephemeral version: "main" -# see build-kogito-apps-components.sh script, responsible for build it. -# called by the Makefile before builds +# Relative to build/target/image/modules/, that's why the four `../` artifacts: - - path: /tmp/build/data-index-service-inmemory - dest: /home/kogito/bin - name: quarkus-app + - path: ../../../../app/target/quarkus-app + dest: /home/kogito/bin/quarkus-app execute: - script: configure diff --git a/packages/kogito-data-index-postgresql-image/install.js b/packages/kogito-data-index-postgresql-image/install.js index 319a9b8ebd4..9b61611cc10 100644 --- a/packages/kogito-data-index-postgresql-image/install.js +++ b/packages/kogito-data-index-postgresql-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoDataIndexPostgresqlImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoDataIndexPostgresqlImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,17 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoDataIndexPostgresqlImage.registry}/${buildEnv.env.kogitoDataIndexPostgresqlImage.account}/${buildEnv.env.kogitoDataIndexPostgresqlImage.name}`; +const imageUrl = `${env.kogitoDataIndexPostgresqlImage.registry}/${env.kogitoDataIndexPostgresqlImage.account}/${env.kogitoDataIndexPostgresqlImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-data-index-postgresql.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync( - originalYamlPath, - path.join(resourcesPath, `${buildEnv.env.kogitoDataIndexPostgresqlImage.name}-image.yaml`) -); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoDataIndexPostgresqlImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-data-index-postgresql-image/package.json b/packages/kogito-data-index-postgresql-image/package.json index f672f148df0..92fbd5c800e 100644 --- a/packages/kogito-data-index-postgresql-image/package.json +++ b/packages/kogito-data-index-postgresql-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm copy-assets\" \"pnpm image:build\"", + "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm mvn-build-app\" \"pnpm copy-assets\" \"pnpm image:build\"", "build:prod": "pnpm build:dev && pnpm image:test", "copy-assets": "run-script-os", "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build", @@ -21,15 +21,19 @@ "copy-test-assets:linux:darwin": "cp -R test-resources/. build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:darwin:linux": "pnpm setup:env make -C ./build build-kogito-app build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDataIndexPostgresqlImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDataIndexPostgresqlImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDataIndexPostgresqlImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDataIndexPostgresqlImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "mvn-build-app": "run-script-os", + "mvn-build-app:linux:darwin": "mvn -am package -Dquarkus.package.type=fast-jar -Dquarkus.container-image.build=false -B -f ./resources/app/pom.xml", + "mvn-build-app:win32": "echo \"Build skipped on Windows\"", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDataIndexPostgresqlImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDataIndexPostgresqlImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDataIndexPostgresqlImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDataIndexPostgresqlImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", diff --git a/packages/kogito-data-index-postgresql-image/resources/app/pom.xml b/packages/kogito-data-index-postgresql-image/resources/app/pom.xml new file mode 100644 index 00000000000..c055b84a81e --- /dev/null +++ b/packages/kogito-data-index-postgresql-image/resources/app/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.kie + kie-tools-maven-base + ${revision} + ../../node_modules/@kie-tools/maven-base/pom.xml + + + kogito-data-index-postgresql-image-app + ${revision} + + KIE Tools :: Kogito Data Index PostgreSQL Image :: App + Kogito Data Index PostgreSQL Image Quarkus App + + + + org.kie.kogito + data-index-service-postgresql + ${version.org.kie.kogito} + + + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + + diff --git a/packages/kogito-data-index-postgresql-image/resources/incubator-kie-kogito-data-index-postgresql-image.yaml b/packages/kogito-data-index-postgresql-image/resources/incubator-kie-kogito-data-index-postgresql-image.yaml index 6baa79e3a5b..ee05a988133 100644 --- a/packages/kogito-data-index-postgresql-image/resources/incubator-kie-kogito-data-index-postgresql-image.yaml +++ b/packages/kogito-data-index-postgresql-image/resources/incubator-kie-kogito-data-index-postgresql-image.yaml @@ -20,7 +20,7 @@ schema_version: 1 name: "docker.io/apache/incubator-kie-kogito-data-index-ephemeral" version: "main" -from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19" +from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20" description: "Runtime image for Kogito Data Index Service for PostgreSQL persistence provider" labels: diff --git a/packages/kogito-data-index-postgresql-image/resources/modules/kogito-data-index-postgresql/module.yaml b/packages/kogito-data-index-postgresql-image/resources/modules/kogito-data-index-postgresql/module.yaml index 43c9fe6d9e9..ec56b961158 100644 --- a/packages/kogito-data-index-postgresql-image/resources/modules/kogito-data-index-postgresql/module.yaml +++ b/packages/kogito-data-index-postgresql-image/resources/modules/kogito-data-index-postgresql/module.yaml @@ -20,12 +20,10 @@ schema_version: 1 name: org.kie.kogito.dataindex.postgresql version: "main" -# see build-kogito-apps-components.sh script, responsible for build it. -# called by the Makefile before builds +# Relative to build/target/image/modules/, that's why the four `../` artifacts: - - path: /tmp/build/data-index-service-postgresql - dest: /home/kogito/bin - name: quarkus-app + - path: ../../../../app/target/quarkus-app + dest: /home/kogito/bin/quarkus-app execute: - script: configure diff --git a/packages/kogito-jit-runner-image/install.js b/packages/kogito-jit-runner-image/install.js index 2d2789e493b..9be7a1027ef 100644 --- a/packages/kogito-jit-runner-image/install.js +++ b/packages/kogito-jit-runner-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoJitRunnerImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoJitRunnerImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,14 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoJitRunnerImage.registry}/${buildEnv.env.kogitoJitRunnerImage.account}/${buildEnv.env.kogitoJitRunnerImage.name}`; +const imageUrl = `${env.kogitoJitRunnerImage.registry}/${env.kogitoJitRunnerImage.account}/${env.kogitoJitRunnerImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-jit-runner.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync(originalYamlPath, path.join(resourcesPath, `${buildEnv.env.kogitoJitRunnerImage.name}-image.yaml`)); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoJitRunnerImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-jit-runner-image/package.json b/packages/kogito-jit-runner-image/package.json index 5762e0ea2eb..dc1def35950 100644 --- a/packages/kogito-jit-runner-image/package.json +++ b/packages/kogito-jit-runner-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm copy-assets\" \"pnpm image:build\"", + "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm mvn-build-app\" \"pnpm copy-assets\" \"pnpm image:build\"", "build:prod": "pnpm build:dev && pnpm image:test", "copy-assets": "run-script-os", "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build", @@ -21,15 +21,19 @@ "copy-test-assets:linux:darwin": "cp -R test-resources/. build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:darwin:linux": "pnpm setup:env make -C ./build build-kogito-app build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJitRunnerImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJitRunnerImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJitRunnerImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJitRunnerImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "mvn-build-app": "run-script-os", + "mvn-build-app:linux:darwin": "mvn -am package -Dquarkus.package.type=fast-jar -Dquarkus.container-image.build=false -B -f ./resources/app/pom.xml", + "mvn-build-app:win32": "echo \"Build skipped on Windows\"", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJitRunnerImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJitRunnerImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJitRunnerImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJitRunnerImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", diff --git a/packages/kogito-jit-runner-image/resources/app/pom.xml b/packages/kogito-jit-runner-image/resources/app/pom.xml new file mode 100644 index 00000000000..8c2fe83217c --- /dev/null +++ b/packages/kogito-jit-runner-image/resources/app/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.kie + kie-tools-maven-base + ${revision} + ../../node_modules/@kie-tools/maven-base/pom.xml + + + kogito-jit-runner-image-app + ${revision} + + KIE Tools :: Kogito JIT Runner Image :: App + Kogito JIT Runner Image Quarkus App + + + + org.kie.kogito + jitexecutor-runner + ${version.org.kie.kogito} + + + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + + diff --git a/packages/kogito-jit-runner-image/resources/incubator-kie-kogito-jit-runner-image.yaml b/packages/kogito-jit-runner-image/resources/incubator-kie-kogito-jit-runner-image.yaml index e6b453f6112..323a6cc1d50 100644 --- a/packages/kogito-jit-runner-image/resources/incubator-kie-kogito-jit-runner-image.yaml +++ b/packages/kogito-jit-runner-image/resources/incubator-kie-kogito-jit-runner-image.yaml @@ -20,7 +20,7 @@ schema_version: 1 name: "docker.io/apache/incubator-kie-kogito-jit-runner" version: "main" -from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19" +from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20" description: "Runtime image for Kogito JIT Runner" labels: diff --git a/packages/kogito-jit-runner-image/resources/modules/kogito-jit-runner/module.yaml b/packages/kogito-jit-runner-image/resources/modules/kogito-jit-runner/module.yaml index db1d8ec4666..58355012470 100644 --- a/packages/kogito-jit-runner-image/resources/modules/kogito-jit-runner/module.yaml +++ b/packages/kogito-jit-runner-image/resources/modules/kogito-jit-runner/module.yaml @@ -20,12 +20,10 @@ schema_version: 1 name: org.kie.kogito.jit-runner version: "main" -# see build-kogito-apps-components.sh script, responsible for build it. -# called by the Makefile before builds +# Relative to build/target/image/modules/, that's why the four `../` artifacts: - - path: /tmp/build/jitexecutor-runner - dest: /home/kogito/bin - name: quarkus-app + - path: ../../../../app/target/quarkus-app + dest: /home/kogito/bin/quarkus-app execute: - script: configure diff --git a/packages/kogito-jobs-service-allinone-image/install.js b/packages/kogito-jobs-service-allinone-image/install.js index 8ea16c03076..968e4e4e162 100644 --- a/packages/kogito-jobs-service-allinone-image/install.js +++ b/packages/kogito-jobs-service-allinone-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoJobsServiceAllInOneImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoJobsServiceAllInOneImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,17 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoJobsServiceAllInOneImage.registry}/${buildEnv.env.kogitoJobsServiceAllInOneImage.account}/${buildEnv.env.kogitoJobsServiceAllInOneImage.name}`; +const imageUrl = `${env.kogitoJobsServiceAllInOneImage.registry}/${env.kogitoJobsServiceAllInOneImage.account}/${env.kogitoJobsServiceAllInOneImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-jobs-service-allinone.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync( - originalYamlPath, - path.join(resourcesPath, `${buildEnv.env.kogitoJobsServiceAllInOneImage.name}-image.yaml`) -); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoJobsServiceAllInOneImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-jobs-service-allinone-image/package.json b/packages/kogito-jobs-service-allinone-image/package.json index 465aa51336a..132b3b59afd 100644 --- a/packages/kogito-jobs-service-allinone-image/package.json +++ b/packages/kogito-jobs-service-allinone-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm copy-assets\" \"pnpm image:build\"", + "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm mvn-build-app\" \"pnpm copy-assets\" \"pnpm image:build\"", "build:prod": "pnpm build:dev && pnpm image:test", "copy-assets": "run-script-os", "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build", @@ -21,15 +21,19 @@ "copy-test-assets:linux:darwin": "cp -R test-resources/. build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:darwin:linux": "pnpm setup:env make -C ./build build-kogito-app build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJobsServiceAllInOneImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJobsServiceAllInOneImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJobsServiceAllInOneImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJobsServiceAllInOneImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "mvn-build-app": "run-script-os", + "mvn-build-app:linux:darwin": "mvn -am package -Dquarkus.package.type=fast-jar -Dquarkus.container-image.build=false -B -f ./resources/app/pom.xml", + "mvn-build-app:win32": "echo \"Build skipped on Windows\"", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJobsServiceAllInOneImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJobsServiceAllInOneImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJobsServiceAllInOneImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJobsServiceAllInOneImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", diff --git a/packages/dev-deployment-kogito-quarkus-blank-app-image/pom.xml b/packages/kogito-jobs-service-allinone-image/resources/app/ephemeral/pom.xml similarity index 51% rename from packages/dev-deployment-kogito-quarkus-blank-app-image/pom.xml rename to packages/kogito-jobs-service-allinone-image/resources/app/ephemeral/pom.xml index 5a9e0af1ed2..d0699004862 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app-image/pom.xml +++ b/packages/kogito-jobs-service-allinone-image/resources/app/ephemeral/pom.xml @@ -7,48 +7,56 @@ ~ 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. + ~ under the License. --> 4.0.0 - org.kie.kogito - dev-deployment-kogito-quarkus-blank-app-image + + org.kie + kogito-jobs-service-image-parent + ${revision} + + + kogito-jobs-service-inmemory-image-app ${revision} + KIE Tools :: Kogito Jobs Service Inmemory Image :: App + Kogito Jobs Service Inmemory Image Quarkus App + - - - org.kie - kie-tools-maven-base - ${project.version} - pom + org.kie.kogito + jobs-service-inmemory + ${version.org.kie.kogito} + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + diff --git a/.idea/jsLinters/eslint.xml b/packages/kogito-jobs-service-allinone-image/resources/app/pom.xml similarity index 50% rename from .idea/jsLinters/eslint.xml rename to packages/kogito-jobs-service-allinone-image/resources/app/pom.xml index bc2bd7823c2..d9ef6a0be43 100644 --- a/.idea/jsLinters/eslint.xml +++ b/packages/kogito-jobs-service-allinone-image/resources/app/pom.xml @@ -1,4 +1,4 @@ - + - - - - + + 4.0.0 + + org.kie + kie-tools-maven-base + ${revision} + ../../node_modules/@kie-tools/maven-base/pom.xml + + + kogito-jobs-service-image-parent + ${revision} + pom + + KIE Tools :: Kogito Jobs Service Image :: Parent + Kogito Kogito Jobs Service Image Parent + + + ephemeral + postgresql + diff --git a/packages/kogito-jobs-service-allinone-image/resources/app/postgresql/pom.xml b/packages/kogito-jobs-service-allinone-image/resources/app/postgresql/pom.xml new file mode 100644 index 00000000000..3b329361104 --- /dev/null +++ b/packages/kogito-jobs-service-allinone-image/resources/app/postgresql/pom.xml @@ -0,0 +1,62 @@ + + + + 4.0.0 + + org.kie + kogito-jobs-service-image-parent + ${revision} + + + kogito-jobs-service-postgresql-image-app + ${revision} + + KIE Tools :: Kogito Jobs Service Postgresql Image :: App + Kogito Kogito Jobs Service Postgresql Image Quarkus App + + + + org.kie.kogito + jobs-service-postgresql + ${version.org.kie.kogito} + + + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + + diff --git a/packages/kogito-jobs-service-allinone-image/resources/incubator-kie-kogito-jobs-service-allinone-image.yaml b/packages/kogito-jobs-service-allinone-image/resources/incubator-kie-kogito-jobs-service-allinone-image.yaml index eb63de643ee..2872d6a0132 100644 --- a/packages/kogito-jobs-service-allinone-image/resources/incubator-kie-kogito-jobs-service-allinone-image.yaml +++ b/packages/kogito-jobs-service-allinone-image/resources/incubator-kie-kogito-jobs-service-allinone-image.yaml @@ -20,7 +20,7 @@ schema_version: 1 name: "docker.io/apache/incubator-kie-kogito-jobs-service-ephemeral" version: "main" -from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19" +from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20" description: "Runtime image for Kogito Jobs Service with all available jdbc providers" labels: diff --git a/packages/kogito-jobs-service-allinone-image/resources/modules/kogito-jobs-service-all-in-one/module.yaml b/packages/kogito-jobs-service-allinone-image/resources/modules/kogito-jobs-service-all-in-one/module.yaml index 1963808b63d..244300c4d04 100644 --- a/packages/kogito-jobs-service-allinone-image/resources/modules/kogito-jobs-service-all-in-one/module.yaml +++ b/packages/kogito-jobs-service-allinone-image/resources/modules/kogito-jobs-service-all-in-one/module.yaml @@ -21,12 +21,12 @@ name: org.kie.kogito.jobs.service.allinone version: "main" artifacts: - - path: /tmp/build/jobs-service-inmemory-all-in-one + - path: ../../../../app/ephemeral/target/quarkus-app + dest: /home/kogito/bin/ephemeral/quarkus-app name: jobs-service-inmemory-all-in-one - dest: /home/kogito/bin/ephemeral - - path: /tmp/build/jobs-service-postgresql-all-in-one + - path: ../../../../app/postgresql/target/quarkus-app + dest: /home/kogito/bin/postgresql/quarkus-app name: jobs-service-postgresql-all-in-one - dest: /home/kogito/bin/postgresql execute: - script: configure diff --git a/packages/kogito-jobs-service-ephemeral-image/install.js b/packages/kogito-jobs-service-ephemeral-image/install.js index ac33c6ae754..68c5fc634a6 100644 --- a/packages/kogito-jobs-service-ephemeral-image/install.js +++ b/packages/kogito-jobs-service-ephemeral-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoJobsServiceEphemeralImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoJobsServiceEphemeralImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,17 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoJobsServiceEphemeralImage.registry}/${buildEnv.env.kogitoJobsServiceEphemeralImage.account}/${buildEnv.env.kogitoJobsServiceEphemeralImage.name}`; +const imageUrl = `${env.kogitoJobsServiceEphemeralImage.registry}/${env.kogitoJobsServiceEphemeralImage.account}/${env.kogitoJobsServiceEphemeralImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-jobs-service-ephemeral.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync( - originalYamlPath, - path.join(resourcesPath, `${buildEnv.env.kogitoJobsServiceEphemeralImage.name}-image.yaml`) -); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoJobsServiceEphemeralImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-jobs-service-ephemeral-image/package.json b/packages/kogito-jobs-service-ephemeral-image/package.json index 32d001b99e6..bf9c76b7c8a 100644 --- a/packages/kogito-jobs-service-ephemeral-image/package.json +++ b/packages/kogito-jobs-service-ephemeral-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm copy-assets\" \"pnpm image:build\"", + "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm mvn-build-app\" \"pnpm copy-assets\" \"pnpm image:build\"", "build:prod": "pnpm build:dev && pnpm image:test", "copy-assets": "run-script-os", "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build", @@ -21,15 +21,19 @@ "copy-test-assets:linux:darwin": "cp -R test-resources/. build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:darwin:linux": "pnpm setup:env make -C ./build build-kogito-app build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJobsServiceEphemeralImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJobsServiceEphemeralImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJobsServiceEphemeralImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJobsServiceEphemeralImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "mvn-build-app": "run-script-os", + "mvn-build-app:linux:darwin": "mvn -am package -Dquarkus.package.type=fast-jar -Dquarkus.container-image.build=false -B -f ./resources/app/pom.xml", + "mvn-build-app:win32": "echo \"Build skipped on Windows\"", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJobsServiceEphemeralImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJobsServiceEphemeralImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJobsServiceEphemeralImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJobsServiceEphemeralImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", diff --git a/packages/kogito-jobs-service-ephemeral-image/resources/app/pom.xml b/packages/kogito-jobs-service-ephemeral-image/resources/app/pom.xml new file mode 100644 index 00000000000..ab1afd2aba6 --- /dev/null +++ b/packages/kogito-jobs-service-ephemeral-image/resources/app/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.kie + kie-tools-maven-base + ${revision} + ../../node_modules/@kie-tools/maven-base/pom.xml + + + kogito-jobs-service-inmemory-image-app + ${revision} + + KIE Tools :: Kogito Jobs Service Inmemory Image :: App + Kogito Jobs Service Inmemory Image Quarkus App + + + + org.kie.kogito + jobs-service-inmemory + ${version.org.kie.kogito} + + + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + + diff --git a/packages/kogito-jobs-service-ephemeral-image/resources/incubator-kie-kogito-jobs-service-ephemeral-image.yaml b/packages/kogito-jobs-service-ephemeral-image/resources/incubator-kie-kogito-jobs-service-ephemeral-image.yaml index 92536ef40f5..f622fec9eed 100644 --- a/packages/kogito-jobs-service-ephemeral-image/resources/incubator-kie-kogito-jobs-service-ephemeral-image.yaml +++ b/packages/kogito-jobs-service-ephemeral-image/resources/incubator-kie-kogito-jobs-service-ephemeral-image.yaml @@ -20,7 +20,7 @@ schema_version: 1 name: "docker.io/apache/incubator-kie-kogito-jobs-service-ephemeral" version: "main" -from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19" +from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20" description: "Runtime image for Kogito in memory Jobs Service" labels: diff --git a/packages/kogito-jobs-service-ephemeral-image/resources/modules/added/kogito-app-launch.sh b/packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/added/kogito-app-launch.sh similarity index 96% rename from packages/kogito-jobs-service-ephemeral-image/resources/modules/added/kogito-app-launch.sh rename to packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/added/kogito-app-launch.sh index 66b2da357fe..0f470cac6d3 100644 --- a/packages/kogito-jobs-service-ephemeral-image/resources/modules/added/kogito-app-launch.sh +++ b/packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/added/kogito-app-launch.sh @@ -45,4 +45,4 @@ DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-option exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \ -Dquarkus.http.host=0.0.0.0 \ -Dquarkus.http.port=8080 \ - -jar "${KOGITO_HOME}"/bin/ephemeral/quarkus-app/quarkus-run.jar + -jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar diff --git a/packages/kogito-jobs-service-ephemeral-image/resources/modules/configure b/packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/configure similarity index 100% rename from packages/kogito-jobs-service-ephemeral-image/resources/modules/configure rename to packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/configure diff --git a/packages/kogito-jobs-service-ephemeral-image/resources/modules/module.yaml b/packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/module.yaml similarity index 81% rename from packages/kogito-jobs-service-ephemeral-image/resources/modules/module.yaml rename to packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/module.yaml index b320c789219..dc0020ddada 100644 --- a/packages/kogito-jobs-service-ephemeral-image/resources/modules/module.yaml +++ b/packages/kogito-jobs-service-ephemeral-image/resources/modules/kogito-jobs-service-ephemeral/module.yaml @@ -20,12 +20,10 @@ schema_version: 1 name: org.kie.kogito.jobs.service.ephemeral version: "main" -# see build-kogito-apps-components.sh script, responsible for build it. -# called by the Makefile before builds +# Relative to build/target/image/modules/, that's why the four `../` artifacts: - - path: /tmp/build/jobs-service-inmemory - dest: /home/kogito/bin/ephemeral - name: quarkus-app + - path: ../../../../app/target/quarkus-app + dest: /home/kogito/bin/quarkus-app execute: - script: configure diff --git a/packages/kogito-jobs-service-ephemeral-image/test-resources/tests/features/kogito-jobs-service-ephemeral.feature b/packages/kogito-jobs-service-ephemeral-image/test-resources/tests/features/kogito-jobs-service-ephemeral.feature index bb0102bc084..f9458b09d65 100644 --- a/packages/kogito-jobs-service-ephemeral-image/test-resources/tests/features/kogito-jobs-service-ephemeral.feature +++ b/packages/kogito-jobs-service-ephemeral-image/test-resources/tests/features/kogito-jobs-service-ephemeral.feature @@ -30,13 +30,13 @@ Feature: Kogito-jobs-service-ephemeral feature. Scenario: Verify if the application jar exists When container is started with command bash - Then run sh -c 'ls /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar' in container and immediately check its output for /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar + Then run sh -c 'ls /home/kogito/bin/quarkus-app/quarkus-run.jar' in container and immediately check its output for /home/kogito/bin/quarkus-app/quarkus-run.jar Scenario: Verify if the debug is correctly enabled with the ephemeral jar When container is started with env | variable | value | | SCRIPT_DEBUG | true | - Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/ephemeral/quarkus-app/quarkus-run.jar + Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/quarkus-app/quarkus-run.jar And container log should contain started in And container log should not contain Application failed to start diff --git a/packages/kogito-jobs-service-postgresql-image/install.js b/packages/kogito-jobs-service-postgresql-image/install.js index e975ea5c3d7..10ca5359643 100644 --- a/packages/kogito-jobs-service-postgresql-image/install.js +++ b/packages/kogito-jobs-service-postgresql-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.kogitoJobsServicePostgresqlImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoJobsServicePostgresqlImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,17 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.kogitoJobsServicePostgresqlImage.registry}/${buildEnv.env.kogitoJobsServicePostgresqlImage.account}/${buildEnv.env.kogitoJobsServicePostgresqlImage.name}`; +const imageUrl = `${env.kogitoJobsServicePostgresqlImage.registry}/${env.kogitoJobsServicePostgresqlImage.account}/${env.kogitoJobsServicePostgresqlImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*kogito-jobs-service-postgresql.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync( - originalYamlPath, - path.join(resourcesPath, `${buildEnv.env.kogitoJobsServicePostgresqlImage.name}-image.yaml`) -); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.kogitoJobsServicePostgresqlImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/kogito-jobs-service-postgresql-image/package.json b/packages/kogito-jobs-service-postgresql-image/package.json index ef5fc8a6346..cb22dbfa6f1 100644 --- a/packages/kogito-jobs-service-postgresql-image/package.json +++ b/packages/kogito-jobs-service-postgresql-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm copy-assets\" \"pnpm image:build\"", + "build:dev": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm mvn-build-app\" \"pnpm copy-assets\" \"pnpm image:build\"", "build:prod": "pnpm build:dev && pnpm image:test", "copy-assets": "run-script-os", "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build", @@ -21,15 +21,19 @@ "copy-test-assets:linux:darwin": "cp -R test-resources/. build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:darwin:linux": "pnpm setup:env make -C ./build build-kogito-app build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", - "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results && cp -R build/target/test/results dist-tests-e2e/\"", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"mkdir -p build/target/test/results\" \"cp -R build/target/test/results dist-tests-e2e/\"", "image:test:darwin:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJobsServicePostgresqlImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJobsServicePostgresqlImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJobsServicePostgresqlImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJobsServicePostgresqlImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)" + "mvn-build-app": "run-script-os", + "mvn-build-app:linux:darwin": "mvn -am package -Dquarkus.package.type=fast-jar -Dquarkus.container-image.build=false -B -f ./resources/app/pom.xml", + "mvn-build-app:win32": "echo \"Build skipped on Windows\"", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoJobsServicePostgresqlImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoJobsServicePostgresqlImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoJobsServicePostgresqlImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoJobsServicePostgresqlImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)" }, "devDependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", diff --git a/packages/kogito-jobs-service-postgresql-image/resources/app/pom.xml b/packages/kogito-jobs-service-postgresql-image/resources/app/pom.xml new file mode 100644 index 00000000000..61e48009f51 --- /dev/null +++ b/packages/kogito-jobs-service-postgresql-image/resources/app/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + org.kie + kie-tools-maven-base + ${revision} + ../../node_modules/@kie-tools/maven-base/pom.xml + + + kogito-jobs-service-postgresql-image-app + ${revision} + + KIE Tools :: Kogito Jobs Service Postgresql Image :: App + Kogito Kogito Jobs Service Postgresql Image Quarkus App + + + + org.kie.kogito + jobs-service-postgresql + ${version.org.kie.kogito} + + + + + ${project.artifactId} + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + + diff --git a/packages/kogito-jobs-service-postgresql-image/resources/incubator-kie-kogito-jobs-service-postgresql-image.yaml b/packages/kogito-jobs-service-postgresql-image/resources/incubator-kie-kogito-jobs-service-postgresql-image.yaml index 8458b48a849..f2ccc8bc2c5 100644 --- a/packages/kogito-jobs-service-postgresql-image/resources/incubator-kie-kogito-jobs-service-postgresql-image.yaml +++ b/packages/kogito-jobs-service-postgresql-image/resources/incubator-kie-kogito-jobs-service-postgresql-image.yaml @@ -20,7 +20,7 @@ schema_version: 1 name: "docker.io/apache/incubator-kie-kogito-jobs-service-postgresql" version: "main" -from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19" +from: "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20" description: "Runtime image for Kogito Jobs Service based on Postgresql" labels: diff --git a/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/added/kogito-app-launch.sh b/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/added/kogito-app-launch.sh index 4ee5b43d62b..0f470cac6d3 100644 --- a/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/added/kogito-app-launch.sh +++ b/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/added/kogito-app-launch.sh @@ -45,4 +45,4 @@ DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-option exec java ${SHOW_JVM_SETTINGS} ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_JOBS_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \ -Dquarkus.http.host=0.0.0.0 \ -Dquarkus.http.port=8080 \ - -jar "${KOGITO_HOME}"/bin/postgresql/quarkus-app/quarkus-run.jar + -jar "${KOGITO_HOME}"/bin/quarkus-app/quarkus-run.jar diff --git a/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/module.yaml b/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/module.yaml index 6bdc6b692cc..c5fcb2a5bc3 100644 --- a/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/module.yaml +++ b/packages/kogito-jobs-service-postgresql-image/resources/modules/kogito-jobs-service-postgresql/module.yaml @@ -20,12 +20,10 @@ schema_version: 1 name: org.kie.kogito.jobs.service.postgresql version: "main" -# see build-kogito-apps-components.sh script, responsible for build it. -# called by the Makefile before builds +# Relative to build/target/image/modules/, that's why the four `../` artifacts: - - path: /tmp/build/jobs-service-postgresql - dest: /home/kogito/bin/postgresql - name: quarkus-app + - path: ../../../../app/target/quarkus-app + dest: /home/kogito/bin/quarkus-app execute: - script: configure diff --git a/packages/kogito-jobs-service-postgresql-image/test-resources/tests/features/kogito-jobs-service-postgresql.feature b/packages/kogito-jobs-service-postgresql-image/test-resources/tests/features/kogito-jobs-service-postgresql.feature index 4c601a9d361..c8aa91d8fb8 100644 --- a/packages/kogito-jobs-service-postgresql-image/test-resources/tests/features/kogito-jobs-service-postgresql.feature +++ b/packages/kogito-jobs-service-postgresql-image/test-resources/tests/features/kogito-jobs-service-postgresql.feature @@ -30,7 +30,7 @@ Feature: Kogito-jobs-service-postgresql feature. Scenario: Verify if the application jar exists When container is started with command bash - Then run sh -c 'ls /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar' in container and immediately check its output for /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar + Then run sh -c 'ls /home/kogito/bin/quarkus-app/quarkus-run.jar' in container and immediately check its output for /home/kogito/bin/quarkus-app/quarkus-run.jar Scenario: verify if container starts as expected When container is started with env @@ -41,7 +41,7 @@ Feature: Kogito-jobs-service-postgresql feature. | QUARKUS_DATASOURCE_USERNAME | test | | QUARKUS_DATASOURCE_PASSWORD | 123456 | | QUARKUS_DATASOURCE_JDBC_URL | jdbc:postgresql://10.11.12.13:5432/hibernate_orm_test | - Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/postgresql/quarkus-app/quarkus-run.jar + Then container log should contain -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -jar /home/kogito/bin/quarkus-app/quarkus-run.jar And container log should contain QUARKUS_DATASOURCE_DB_KIND=postgresql And container log should contain QUARKUS_DATASOURCE_USERNAME=test And container log should contain QUARKUS_DATASOURCE_PASSWORD=123456 diff --git a/packages/maven-base/README.md b/packages/maven-base/README.md index 81d44a5ab28..1ab5a2ce9a0 100644 --- a/packages/maven-base/README.md +++ b/packages/maven-base/README.md @@ -17,6 +17,14 @@ ## @kie-tools/maven-base +Foundational files for Maven-based packages. + +- `pom.xml`: Centralized, common Maven configurations. Should be used as parent of Maven-based pacakges. +- `settings.xml`: Moslty repositories configuration. +- `index.js`: Essential scripts for configuring properties such as `-Drevision` and `-Dmaven.repo.local.tail`. + +For more information, refer to the [KIE Tools :: Manual](../../repo/docs/MANUAL.md#specifics--maven) + --- Apache KIE (incubating) is an effort undergoing incubation at The Apache Software diff --git a/.idea/vcs.xml b/packages/maven-base/empty-pom.xml similarity index 64% rename from .idea/vcs.xml rename to packages/maven-base/empty-pom.xml index 565e3e5413b..b11bb7a085d 100644 --- a/.idea/vcs.xml +++ b/packages/maven-base/empty-pom.xml @@ -7,18 +7,25 @@ ~ 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. ---> - - - - + ~ under the License. + --> + + 4.0.0 + + + org.apache.kie + kie-tools-maven-base-empty-pom + 0.0.0-SNAPSHOT diff --git a/packages/maven-base/env/index.js b/packages/maven-base/env/index.js index 96c5d8d4e6f..71670217a09 100644 --- a/packages/maven-base/env/index.js +++ b/packages/maven-base/env/index.js @@ -31,6 +31,9 @@ module.exports = composeEnv([require("@kie-tools/root-env/env")], { mavenBase: { version: require("../package.json").version, }, + mvnw: { + version: "3.3.0", + }, maven: { deploy: { skip: getOrDefault(this.vars.KIE_TOOLS_BUILD__mavenDeploySkip), diff --git a/packages/maven-base/index.js b/packages/maven-base/index.js new file mode 100755 index 00000000000..5860a133b9e --- /dev/null +++ b/packages/maven-base/index.js @@ -0,0 +1,207 @@ +/* + * 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 cp = require("child_process"); +const fs = require("fs"); +const path = require("path"); +const { env } = require("./env"); + +// Constants relative to consumer packages. +const MVN_CONFIG_ORIGINAL_FILE_PATH = path.join(".mvn", "maven.config.original"); +const MVN_CONFIG_FILE_PATH = path.join(".mvn", "maven.config"); + +// This package's constants. +const EMPTY_POM_XML_PATH = path.join(__dirname, "empty-pom.xml"); +const SETTINGS_XML_PATH = path.join(__dirname, "settings.xml"); + +const DEFAULT_MAVEN_CONFIG = ` +-Dstyle.color=always +--batch-mode +--settings=${SETTINGS_XML_PATH} +`.trim(); + +const DEFAULT_LOCAL_REPO = String( + cp.execSync(`mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout -f ${EMPTY_POM_XML_PATH}`, { + stdio: "pipe", + encoding: "utf-8", + }) +).trim(); + +const BOOTSTRAP_CLI_ARGS = `-P-include-1st-party-dependencies --settings=${SETTINGS_XML_PATH}`; + +module.exports = { + /** + * Evaluation of ${settings.localRepository}. + */ + DEFAULT_LOCAL_REPO, + + /** + * Maven CLI arguments to be passed for `mvn` commands running during `bootstrap` phase. + */ + BOOTSTRAP_CLI_ARGS, + + /** + * An absolute path for an empty POM, in case someone needs to run `mvn` scripts without having a pom.xml file. + */ + EMPTY_POM_XML_PATH, + + /** + * Installs `mvnw` on the same directory of invocation. + * */ + installMvnw: () => { + console.info(`[maven-base] Installing mvnw...`); + console.time(`[maven-base] Installing mvnw...`); + + const cmd = `mvn -e org.apache.maven.plugins:maven-wrapper-plugin:${env.mvnw.version}:wrapper ${BOOTSTRAP_CLI_ARGS}`; + + if (process.platform === "win32") { + cp.execSync(cmd.replaceAll(" -", " `-"), { stdio: "inherit", shell: "powershell.exe" }); + } else { + cp.execSync(cmd, { stdio: "inherit" }); + } + + console.timeEnd(`[maven-base] Installing mvnw...`); + }, + + /** + * Helps setting up an array of absolute paths that will be used to configure `-Dmaven.repo.local.tail`. + * + * @param dirname Where to locate the first package.json. + * + * @returns A comma-separated string containing a flat list of absolute paths of local Maven repositories. + */ + buildTailFromPackageJsonDependencies: (dirname) => { + return deepResolveMavenLocalRepoTail(path.resolve(dirname ?? ".")).join(","); + }, + + /** + * Builds a single Maven repository directory out of multiple local Maven repositories using hard links. + * + * @param tmpM2Dir Relative path of this new Maven repository directory. It will be deleted and recreated for each invocation. + * @param dirname A list of paths representing additional Maven repository directories, to be concatenated the default one (I.e, `maven.repo.local`) + * */ + prepareHardLinkedM2ForPackage: (tmpM2Dir, relativePackagePath) => { + const resolvedTmpM2Dir = path.resolve(tmpM2Dir); + if (fs.existsSync(resolvedTmpM2Dir)) { + fs.rmSync(resolvedTmpM2Dir, { recursive: true, force: true }); + } + fs.mkdirSync(resolvedTmpM2Dir, { recursive: true }); + + // head + cp.execSync(`cp -nal ${DEFAULT_LOCAL_REPO}/* ${resolvedTmpM2Dir}`, { stdio: "inherit" }); + + const cwd = path.resolve(".", relativePackagePath); + const packageName = require(path.resolve(cwd, "package.json")).name; + const tail = deepResolveMavenLocalRepoTail(cwd, packageName); + + // tail + for (const t of tail) { + if (fs.existsSync(path.resolve(t))) { + cp.execSync(`cp -al ${path.resolve(t)}/* ${resolvedTmpM2Dir}`, { stdio: "inherit" }); + } + } + }, + + /** + * Sets a property on a POM. + * + * @param entry An object with `key` and `value` properties + */ + setPomProperty: ({ key, value }) => { + if (!key || value === undefined) { + console.error("[maven-base] Can't set a POM property without proper `key` and `value`."); + process.exit(1); + } + + console.info(`[maven-base] Setting property '${key}' with value '${value}'...`); + console.time(`[maven-base] Setting property '${key}' with value '${value}'...`); + + const cmd = `mvn versions:set-property -Dproperty=${key} -DnewVersion=${value} -DgenerateBackupPoms=false ${BOOTSTRAP_CLI_ARGS}`; + + if (process.platform === "win32") { + cp.execSync(cmd.replaceAll(" -", " `-"), { stdio: "inherit", shell: "powershell.exe" }); + } else { + cp.execSync(cmd, { stdio: "inherit" }); + } + + console.timeEnd(`[maven-base] Setting property '${key}' with value '${value}'...`); + }, + + /** + * Writes to `.mvn/maven.config` idempotently, preserving what was there before this function was called. + * + * @param pkgSpecificMvnConfigString New-line-separated string containing arguments to the `mvn` command. + * @param args An object with a `ignoreDefault: boolean` property. + */ + setupMavenConfigFile: (pkgSpecificMvnConfigString, args) => { + console.info(`[maven-base] Configuring Maven through .mvn/maven.config...`); + console.time(`[maven-base] Configuring Maven through .mvn/maven.config...`); + + let originalMvnConfigString; + if (fs.existsSync(MVN_CONFIG_ORIGINAL_FILE_PATH)) { + console.info(`[maven-base] Found '${MVN_CONFIG_ORIGINAL_FILE_PATH}'.`); + originalMvnConfigString = fs.readFileSync(MVN_CONFIG_ORIGINAL_FILE_PATH, "utf-8"); + } else if (fs.existsSync(MVN_CONFIG_FILE_PATH)) { + console.info(`[maven-base] Found '${MVN_CONFIG_FILE_PATH}'.`); + originalMvnConfigString = fs.readFileSync(MVN_CONFIG_FILE_PATH, "utf-8"); + } else { + console.info(`[maven-base] No previous config found.`); + originalMvnConfigString = ""; + } + + fs.mkdirSync(".mvn", { recursive: true }); + + console.info(`[maven-base] Writing '${MVN_CONFIG_ORIGINAL_FILE_PATH}'...`); + console.info(`${originalMvnConfigString}` || ""); + fs.writeFileSync(MVN_CONFIG_ORIGINAL_FILE_PATH, originalMvnConfigString); + + const sanitizedPkgSpecificMvnConfigString = pkgSpecificMvnConfigString + .trim() + .split("\n") + .map((line) => line.trim()) + .join("\n"); + + const newMvnConfigString = + (args?.ignoreDefault ? "" : `${DEFAULT_MAVEN_CONFIG}\n`) + + (sanitizedPkgSpecificMvnConfigString ? `${sanitizedPkgSpecificMvnConfigString}\n` : "") + + (originalMvnConfigString ? `${originalMvnConfigString}\n` : ""); + + console.info(`[maven-base] Writing '${MVN_CONFIG_FILE_PATH}'...`); + console.info(newMvnConfigString); + + fs.writeFileSync(MVN_CONFIG_FILE_PATH, newMvnConfigString); + console.timeEnd(`[maven-base] Configuring Maven through .mvn/maven.config...`); + }, +}; + +// private functions + +function deepResolveMavenLocalRepoTail(cwd) { + const packageJsonDependencies = require(path.resolve(cwd, "package.json")).dependencies ?? {}; + return [ + ...new Set([ + path.resolve(fs.realpathSync(cwd), "dist/1st-party-m2/repository"), + ...Object.entries(packageJsonDependencies).flatMap(([depName, depVersion]) => + depVersion === "workspace:*" // It's an internal package. + ? deepResolveMavenLocalRepoTail(cwd + "/node_modules/" + depName) + : [] + ), + ]), + ]; +} diff --git a/packages/maven-base/install.js b/packages/maven-base/install.js index 84abd5b5001..43b2170a102 100644 --- a/packages/maven-base/install.js +++ b/packages/maven-base/install.js @@ -17,11 +17,24 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, setPomProperty, buildTailFromPackageJsonDependencies } = require("."); -setup(` - -Drevision=${buildEnv.env.mavenBase.version} - -Dquarkus.platform.version=${buildEnv.env.quarkusPlatform.version} - -Dversion.org.kie.kogito=${buildEnv.env.kogitoRuntime.version} -`); +setupMavenConfigFile( + ` + -Drevision=${env.mavenBase.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} + -Dquarkus.platform.version=${env.quarkusPlatform.version} + -Dversion.org.kie.kogito=${env.kogitoRuntime.version} +` +); + +setPomProperty({ + key: "version.org.kie.kogito", + value: env.versions.kogito, +}); + +setPomProperty({ + key: "version.quarkus", + value: env.versions.quarkus, +}); diff --git a/packages/maven-base/kie-tools-maven-base.iml b/packages/maven-base/kie-tools-maven-base.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/maven-base/kie-tools-maven-base.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/maven-base/package.json b/packages/maven-base/package.json index 5f51a357ca8..2d50f866f76 100644 --- a/packages/maven-base/package.json +++ b/packages/maven-base/package.json @@ -15,16 +15,15 @@ "scripts": { "build:dev": "run-script-os", "build:dev:darwin:linux": "mvn clean install -DskipTests", - "build:dev:win32": "pnpm powershell \"mvn clean install -DskipTests \"", + "build:dev:win32": "pnpm powershell \"mvn clean install `-DskipTests\"", "build:prod": "pnpm lint && run-script-os", - "build:prod:darwin:linux": "mvn clean deploy -DdeployAtEnd -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -Dreproducible", - "build:prod:win32": "pnpm powershell \"mvn clean deploy `-DdeployAtEnd `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dmaven.deploy.skip=$(build-env maven.deploy.skip) `-Dreproducible\"", + "build:prod:darwin:linux": "mvn clean deploy -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -Dreproducible", + "build:prod:win32": "pnpm powershell \"mvn clean deploy `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dmaven.deploy.skip=$(build-env maven.deploy.skip) `-Dreproducible\"", "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/packages/maven-base/pom.xml b/packages/maven-base/pom.xml index 9d097bfa4f8..953a5764ec4 100644 --- a/packages/maven-base/pom.xml +++ b/packages/maven-base/pom.xml @@ -97,34 +97,56 @@ - 2024-01-12T00:00:00Z - 3.4.1 17 17 - true UTF-8 UTF-8 - 3.13.0 - 3.2.0 - 1.6.0 + + + 2024-01-12T00:00:00Z + true + + + 3.4.1 + 3.13.0 + 3.2.0 + 3.0.0-M7 + 3.5.0 + 3.1.3 + 3.2.0 + 3.1.2 + 3.12.1 + 3.3.1 + 3.6.1 + 3.4.1 + 3.2.0 + 3.4.0 + 1.6.0 + + + 999-20241016-SNAPSHOT + + + 3.8.6 + + 4.13.2 - 3.5.0 - 3.8.6 - 999-20240912-SNAPSHOT - ${quarkus.platform.version} - io.quarkus - 3.0.0-M7 + 1.26.1 + 0.5 + 0.2.2 + 0.8.11 + 2.3.32 + 3.25.3 + 5.10.2 + 4.11.0 + 0.4 + 0.23.0 - - io.quarkus - quarkus-bom - ${quarkus.platform.version} - pom - import - + + org.kie.kogito kogito-bom @@ -158,6 +180,90 @@ kogito-quarkus-test-utils ${version.org.kie.kogito} + + org.kie + kie-dmn-test-resources + ${version.org.kie.kogito} + tests + + + org.kie.j2cl.tools.yaml.mapper + common + ${version.org.kie.j2cl.tools.yaml.mapper} + + + org.kie.j2cl.tools.yaml.mapper + processor + ${version.org.kie.j2cl.tools.yaml.mapper} + provided + + + + + + io.quarkus + quarkus-bom + ${version.quarkus} + pom + import + + + + + + junit + junit + ${version.junit} + test + + + org.apache.commons + commons-compress + ${version.org.apache.commons.commons-compress} + + + io.quarkiverse.embedded.postgresql + quarkus-embedded-postgresql + ${version.io.quarkiverse.embedded.postgresql} + + + org.iq80.snappy + snappy + ${version.org.iq80.snappy} + + + + org.apache.james + apache-mime4j-core + ${version.org.apache.mime4j} + + + org.freemarker + freemarker + ${version.org.freemarker} + + + org.junit.jupiter + junit-jupiter-engine + ${version.org.junit.jupiter} + test + + + org.assertj + assertj-core + ${version.org.assertj} + test + + + org.mockito + mockito-inline + ${version.org.mockito} + test + @@ -171,20 +277,97 @@ ${project.build.outputTimestamp} ${session.executionRootDirectory}/node_modules/@kie-tools/maven-base/not-reproducible-plugins.properties + + org.apache.maven.plugins + maven-install-plugin + ${version.maven.install.plugin} + + + org.apache.maven.plugins + maven-deploy-plugin + ${version.maven.deploy.plugin} + + + org.apache.maven.plugins + maven-helper-plugin + ${version.maven.helper.plugin} + + + org.apache.maven.plugins + maven-dependency-plugin + ${version.maven.dependency.plugin} + + + org.apache.maven.plugins + maven-compiler-plugin + ${version.maven.compiler.plugin} + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.maven.failsafe.plugin} + + + org.apache.maven.plugins + maven-clean-plugin + ${version.maven.clean.plugin} + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.maven.surefire.plugin} + + + org.apache.maven.plugins + maven-jar-plugin + ${version.maven.jar.plugin} + + + org.apache.maven.plugins + maven-source-plugin + ${version.maven.source.plugin} + + + org.apache.maven.plugins + maven-remote-resources-plugin + ${version.maven.remote.resources.plugin} + + + org.codehaus.mojo + flatten-maven-plugin + ${version.codehaus.flatten.plugin} + + + + + io.quarkus + quarkus-maven-plugin + ${version.quarkus} + + + + + org.kie.j2cl.tools + j2cl-maven-plugin + ${version.j2cl.maven.plugin} + + + + + org.codehaus.mojo flatten-maven-plugin - ${version.flatten.plugin} true resolveCiFriendliesOnly @@ -207,7 +390,9 @@ - org.apache.maven.plugins + + + maven-source-plugin @@ -228,6 +413,106 @@ + + + + + + + + + + + use-maven-repo-local-tail + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-install-plugin + ${version.maven.install.plugin} + + true + + + + + + + + + + maven-clean-plugin + + + + ${basedir}/dist/1st-party-m2 + + **/* + + false + + + + + + + + + + maven-dependency-plugin + + + clean-local-repo + clean + + purge-local-repository + + + **/* + false + ${project.groupId}:${project.artifactId}:${project.version} + true + + + + + + + + + maven-deploy-plugin + + + deploy-to-local-dist-1st-party-m2 + install + + deploy + + + false + kie-tools--local-dist-1st-party-m2::file://${maven.multiModuleProjectDirectory}/dist/1st-party-m2/repository + + + + + + + reproducible-build @@ -239,7 +524,6 @@ - org.apache.maven.plugins maven-artifact-plugin @@ -248,8 +532,11 @@ check-buildplan - + validate @@ -257,8 +544,11 @@ compare - + install diff --git a/packages/maven-base/settings.xml b/packages/maven-base/settings.xml new file mode 100644 index 00000000000..7b260596554 --- /dev/null +++ b/packages/maven-base/settings.xml @@ -0,0 +1,101 @@ + + + + apache-public-repository-group-mirror-to-central + apache-public-repository-group + https://repo.maven.apache.org/maven2 + + + jboss-public-repository-group-mirror-to-central + jboss-public-repository-group + https://repo.maven.apache.org/maven2 + + + jboss-enterprise-maven-repository-mirror-to-central + jboss-enterprise-maven-repository + https://repo.maven.apache.org/maven2 + + + + + + kie-tools--default-repos + + + ignore--kie-tools--default-repos + !true + + + + + apache.snapshots + Apache Snapshot Repository + https://repository.apache.org/snapshots + + false + + + true + never + + + + central + Central Repository + https://repo.maven.apache.org/maven2 + + false + + + + apache-public-repository-group + Apache Public Repository Group + https://repo.maven.apache.org/maven2 + default + + false + never + + + false + never + + + + jboss-public-repository-group + JBOSS Public Repository Group + https://repo.maven.apache.org/maven2 + default + + false + never + + + false + never + + + + + + apache-public-repository-group + Apache Public Repository Group + https://repository.apache.org/content/groups/public/ + default + + false + never + + + false + never + + + + + + diff --git a/packages/maven-config-setup-helper/index.js b/packages/maven-config-setup-helper/index.js deleted file mode 100755 index 8612c0ce73e..00000000000 --- a/packages/maven-config-setup-helper/index.js +++ /dev/null @@ -1,77 +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 { execSync } = require("child_process"); -const fs = require("fs"); -const path = require("path"); - -const MVN_CONFIG_ORIGINAL_FILE_PATH = path.join(".mvn", "maven.config.original"); -const MVN_CONFIG_FILE_PATH = path.join(".mvn", "maven.config"); - -module.exports = { - setPomProperty: ({ key, value }) => { - if (!key || !value) { - console.error("[maven-config-setup-helper] Wrong values provided"); - process.exit(1); - } - - if (process.platform === "win32") { - execSync(`mvn versions:set-property \`-Dproperty=${key} \`-DnewVersion=${value} \`-DgenerateBackupPoms=false`, { - stdio: "inherit", - shell: "powershell.exe", - }); - } else { - execSync(`mvn versions:set-property -Dproperty=${key} -DnewVersion=${value} -DgenerateBackupPoms=false`, { - stdio: "inherit", - }); - } - }, - setup: (mavenConfigString) => { - let originalMvnConfigString; - if (fs.existsSync(MVN_CONFIG_ORIGINAL_FILE_PATH)) { - console.info(`[maven-config-setup-helper] Found '${MVN_CONFIG_ORIGINAL_FILE_PATH}'.`); - originalMvnConfigString = fs.readFileSync(MVN_CONFIG_ORIGINAL_FILE_PATH, "utf-8"); - } else if (fs.existsSync(MVN_CONFIG_FILE_PATH)) { - console.info(`[maven-config-setup-helper] Found '${MVN_CONFIG_FILE_PATH}'.`); - originalMvnConfigString = fs.readFileSync(MVN_CONFIG_FILE_PATH, "utf-8"); - } else { - console.info(`[maven-config-setup-helper] No previous config found.`); - originalMvnConfigString = ""; - } - - fs.mkdirSync(".mvn", { recursive: true }); - - console.info(`[maven-config-setup-helper] Writing '${MVN_CONFIG_ORIGINAL_FILE_PATH}'...`); - console.info(`${originalMvnConfigString}` || ""); - fs.writeFileSync(MVN_CONFIG_ORIGINAL_FILE_PATH, originalMvnConfigString); - - const trimmedMavenConfigString = mavenConfigString - .trim() - .split("\n") - .map((l) => l.trim()) - .join("\n"); - - const newMavenConfigString = `${originalMvnConfigString.trim()}\n${trimmedMavenConfigString.trim()}`.trim(); - console.info(`[maven-config-setup-helper] Writing '${MVN_CONFIG_FILE_PATH}'...`); - console.info(newMavenConfigString); - fs.writeFileSync(MVN_CONFIG_FILE_PATH, newMavenConfigString); - - console.info(`[maven-config-setup-helper] Done.`); - }, -}; diff --git a/packages/maven-config-setup-helper/package.json b/packages/maven-config-setup-helper/package.json deleted file mode 100644 index 626e6ddf24d..00000000000 --- a/packages/maven-config-setup-helper/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@kie-tools/maven-config-setup-helper", - "version": "0.0.0", - "description": "", - "license": "Apache-2.0", - "keywords": [], - "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" - }, - "files": [ - "index.js" - ], - "scripts": {}, - "devDependencies": {} -} diff --git a/packages/maven-m2-repo-via-http-image/settings.xml.envsubst b/packages/maven-m2-repo-via-http-image/settings.xml.envsubst index 8cc22d223db..8fecb67bac4 100644 --- a/packages/maven-m2-repo-via-http-image/settings.xml.envsubst +++ b/packages/maven-m2-repo-via-http-image/settings.xml.envsubst @@ -25,10 +25,12 @@ true never + ignore true never + ignore @@ -42,10 +44,12 @@ true never + ignore true never + ignore diff --git a/packages/online-editor/build/defaultEnvJson.ts b/packages/online-editor/build/defaultEnvJson.ts index 5c06712afec..55d0a27e9d4 100644 --- a/packages/online-editor/build/defaultEnvJson.ts +++ b/packages/online-editor/build/defaultEnvJson.ts @@ -19,13 +19,13 @@ import { EnvJson } from "../src/env/EnvJson"; import { routes } from "../src/navigation/Routes"; +import { AuthProviderGroup, AuthProviderType } from "../src/authProviders/AuthProvidersApi"; +import { FileTypes } from "@kie-tools-core/workspaces-git-fs/dist/constants/ExtensionHelper"; +import { GLOB_PATTERN } from "../src/envelopeLocator/EditorEnvelopeLocatorFactory"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { env } from "../env"; -import { AuthProviderGroup, AuthProviderType } from "../src/authProviders/AuthProvidersApi"; -import { FileTypes } from "@kie-tools-core/workspaces-git-fs/dist/constants/ExtensionHelper"; -import { GLOB_PATTERN } from "../src/envelopeLocator/EditorEnvelopeLocatorFactory"; const buildEnv: any = env; // build-env is not typed function getDevDeploymentImageUrl(imageEnvVars: any) { diff --git a/packages/online-editor/playwright.config.ts b/packages/online-editor/playwright.config.ts index 911125dffa2..3c1ac8f65ee 100644 --- a/packages/online-editor/playwright.config.ts +++ b/packages/online-editor/playwright.config.ts @@ -20,9 +20,9 @@ import { defineConfig } from "@playwright/test"; import playwirghtBaseConfig from "@kie-tools/playwright-base/playwright.config"; import merge from "lodash/merge"; -import { env } from "./env"; -const buildEnv: any = env; +import { env } from "./env"; +const buildEnv: any = env; // build-env is not typed const customConfig = defineConfig({ expect: { diff --git a/packages/online-editor/webpack.config.ts b/packages/online-editor/webpack.config.ts index 30d4a58ea8f..9c670edd7f1 100644 --- a/packages/online-editor/webpack.config.ts +++ b/packages/online-editor/webpack.config.ts @@ -37,7 +37,7 @@ import HtmlReplaceWebpackPlugin from "html-replace-webpack-plugin"; import { env } from "./env"; const buildEnv: any = env; // build-env is not typed -export default async (env: any, argv: any) => { +export default async (webpackEnv: any, webpackArgv: any) => { const buildInfo = getBuildInfo(); const [ extendedServices_linuxDownloadUrl, @@ -56,7 +56,7 @@ export default async (env: any, argv: any) => { } return [ - merge(common(env), { + merge(common(webpackEnv), { entry: { "workspace/worker/sharedWorker": "./src/workspace/worker/sharedWorker.ts", }, @@ -77,7 +77,7 @@ export default async (env: any, argv: any) => { ], }), { - ...merge(common(env), { + ...merge(common(webpackEnv), { entry: { index: "./src/index.tsx", "bpmn-envelope": "./src/envelope/BpmnEditorEnvelopeApp.ts", @@ -104,8 +104,8 @@ export default async (env: any, argv: any) => { WEBPACK_REPLACE__extendedServicesMacOsDownloadUrl: extendedServices_macOsDownloadUrl, WEBPACK_REPLACE__extendedServicesWindowsDownloadUrl: extendedServices_windowsDownloadUrl, WEBPACK_REPLACE__extendedServicesCompatibleVersion: extendedServices_compatibleVersion, - WEBPACK_REPLACE__quarkusPlatformVersion: buildEnv.quarkusPlatform.version, - WEBPACK_REPLACE__kogitoRuntimeVersion: buildEnv.kogitoRuntime.version, + WEBPACK_REPLACE__quarkusPlatformVersion: buildEnv.versions.quarkus, + WEBPACK_REPLACE__kogitoRuntimeVersion: buildEnv.versions.kogito, }), new CopyPlugin({ patterns: [ diff --git a/packages/playwright-base/playwright.config.ts b/packages/playwright-base/playwright.config.ts index a5134a73aa8..b298eaf7100 100644 --- a/packages/playwright-base/playwright.config.ts +++ b/packages/playwright-base/playwright.config.ts @@ -57,7 +57,7 @@ export default defineConfig({ toHaveScreenshot: { // An acceptable ratio of pixels that are different to the // total amount of pixels, between 0 and 1. - maxDiffPixelRatio: 0.01, + maxDiffPixelRatio: 0.1, }, }, /* Configure projects for major browsers */ diff --git a/packages/pmml-editor/dev-webapp/webpack.config.js b/packages/pmml-editor/dev-webapp/webpack.config.js index c7e17860336..dadf2bdd805 100644 --- a/packages/pmml-editor/dev-webapp/webpack.config.js +++ b/packages/pmml-editor/dev-webapp/webpack.config.js @@ -23,10 +23,9 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), @@ -67,7 +66,7 @@ module.exports = (env) => }, historyApiFallback: true, compress: true, - port: buildEnv.pmmlEditor.dev.port, + port: env.pmmlEditor.dev.port, open: false, hot: true, }, diff --git a/packages/pmml-vscode-extension/webpack.config.js b/packages/pmml-vscode-extension/webpack.config.js index 3c0d90d0e31..b7408cc7d8a 100644 --- a/packages/pmml-vscode-extension/webpack.config.js +++ b/packages/pmml-vscode-extension/webpack.config.js @@ -22,8 +22,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { ProvidePlugin } = require("webpack"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "PmmlEditor", libraryTarget: "umd", @@ -35,14 +35,14 @@ const commonConfig = (env) => }, }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension": "./src/extension/extension.ts", }, }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "webworker", entry: { "extension/extensionWeb": "./src/extension/extension.ts", @@ -54,7 +54,7 @@ module.exports = async (env) => [ }), ], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "webview/PmmlEditorEnvelopeApp": "./src/webview/PmmlEditorEnvelopeApp.ts", diff --git a/packages/root-env/README.md b/packages/root-env/README.md index b1ef148b999..64841857f2d 100644 --- a/packages/root-env/README.md +++ b/packages/root-env/README.md @@ -17,6 +17,8 @@ ## @kie-tools/root-env +Foundational environment variables used by most packages of `kie-tools`. + --- Apache KIE (incubating) is an effort undergoing incubation at The Apache Software diff --git a/packages/root-env/env/index.js b/packages/root-env/env/index.js index 8f2a58db774..510050b39a3 100644 --- a/packages/root-env/env/index.js +++ b/packages/root-env/env/index.js @@ -34,6 +34,14 @@ module.exports = composeEnv([], { default: `${false}`, description: "Ignores failures on tests and continues with the build until the end.", }, + KIE_TOOLS_BUILD__runScriptsTests: { + default: `${false}`, + description: "Enables/disables running scripts/ tests during bootstrap.", + }, + KIE_TOOLS_BUILD__ignoreScriptTestFailures: { + default: `${false}`, + description: "Ignores failures on scripts/ tests and continues with bootstrap until the end.", + }, KIE_TOOLS_BUILD__runEndToEndTests: { default: `${false}`, description: "Enables/disables running end-to-end tests during the build.", @@ -62,7 +70,7 @@ module.exports = composeEnv([], { }, /* (begin) This part of the file is referenced in `scripts/update-kogito-version` */ KOGITO_RUNTIME_version: { - default: "999-20240912-SNAPSHOT", + default: "999-20241016-SNAPSHOT", description: "Kogito version to be used on dependency declaration.", }, /* (end) */ @@ -77,6 +85,10 @@ module.exports = composeEnv([], { run: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__runTests)), ignoreFailures: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__ignoreTestFailures)), }, + scriptTests: { + run: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__runScriptsTests)), + ignoreFailures: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__ignoreScriptTestFailures)), + }, endToEndTests: { run: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__runEndToEndTests)), ignoreFailures: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__ignoreEndToEndTestFailures)), @@ -90,11 +102,9 @@ module.exports = composeEnv([], { examples: { build: str2bool(getOrDefault(this.vars.KIE_TOOLS_BUILD__buildExamples)), }, - kogitoRuntime: { - version: getOrDefault(this.vars.KOGITO_RUNTIME_version), - }, - quarkusPlatform: { - version: getOrDefault(this.vars.QUARKUS_PLATFORM_version), + versions: { + kogito: getOrDefault(this.vars.KOGITO_RUNTIME_version), + quarkus: getOrDefault(this.vars.QUARKUS_PLATFORM_version), }, }; }, diff --git a/packages/root-env/root-env.iml b/packages/root-env/root-env.iml new file mode 100644 index 00000000000..7deb42cadf6 --- /dev/null +++ b/packages/root-env/root-env.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/packages/runtime-tools-components/src/common/components/EndpointLink/EndpointLink.tsx b/packages/runtime-tools-components/src/common/components/EndpointLink/EndpointLink.tsx index 61eb379306a..8fae6351782 100644 --- a/packages/runtime-tools-components/src/common/components/EndpointLink/EndpointLink.tsx +++ b/packages/runtime-tools-components/src/common/components/EndpointLink/EndpointLink.tsx @@ -21,6 +21,7 @@ import React from "react"; import { Button } from "@patternfly/react-core/dist/js/components/Button"; import { ExternalLinkAltIcon } from "@patternfly/react-icons/dist/js/icons/external-link-alt-icon"; import { componentOuiaProps, OUIAProps } from "../../ouiaTools"; +import { Truncate } from "@patternfly/react-core/dist/js/components/Truncate"; interface IOwnProps { serviceUrl?: string; @@ -45,7 +46,10 @@ export const EndpointLink: React.FC = ({ isInline={true} {...componentOuiaProps(ouiaId, "endpoint-link", ouiaSafe)} > - {isLinkShown ? serviceUrl : linkLabel || "Endpoint"} + {} ); diff --git a/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx b/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx index 3d6449c9899..468f7fbceb0 100644 --- a/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx +++ b/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { useState } from "react"; +import React, { useState, useMemo } from "react"; import { Alert, AlertActionCloseButton, AlertActionLink } from "@patternfly/react-core/dist/js/components/Alert"; import { componentOuiaProps, OUIAProps } from "../../ouiaTools"; @@ -42,6 +42,10 @@ export const FormNotification: React.FC = ({ notification const variant = notification.type === "error" ? "danger" : "success"; const [showDetails, setShowDetails] = useState(false); + const content = useMemo( + () => showDetails && notification.details &&

{notification.details}

, + [showDetails, notification.details] + ); return ( = ({ notification actionClose={} {...componentOuiaProps(ouiaId, "form-notification-alert", ouiaSafe)} > - {showDetails && notification.details &&

{notification.details}

} + {content}
); }; diff --git a/packages/runtime-tools-management-console-webapp/build/defaultEnvJson.js b/packages/runtime-tools-management-console-webapp/build/defaultEnvJson.js index 3f723e0772a..ad06a77878c 100644 --- a/packages/runtime-tools-management-console-webapp/build/defaultEnvJson.js +++ b/packages/runtime-tools-management-console-webapp/build/defaultEnvJson.js @@ -17,17 +17,16 @@ * under the License. */ -const { env: buildEnv } = require("../env"); +const { env } = require("../env"); const version = require("../package.json").version; module.exports = { defaultEnvJson: { - RUNTIME_TOOLS_MANAGEMENT_CONSOLE_KOGITO_ENV_MODE: buildEnv.runtimeToolsManagementConsoleWebapp.kogitoEnvMode, + RUNTIME_TOOLS_MANAGEMENT_CONSOLE_KOGITO_ENV_MODE: env.runtimeToolsManagementConsoleWebapp.kogitoEnvMode, RUNTIME_TOOLS_MANAGEMENT_CONSOLE_KOGITO_APP_NAME: "Management Console", RUNTIME_TOOLS_MANAGEMENT_CONSOLE_KOGITO_APP_VERSION: version, - RUNTIME_TOOLS_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT: - buildEnv.runtimeToolsManagementConsoleWebapp.kogitoDataIndexUrl, + RUNTIME_TOOLS_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT: env.runtimeToolsManagementConsoleWebapp.kogitoDataIndexUrl, KOGITO_CONSOLES_KEYCLOAK_DISABLE_HEALTH_CHECK: false, KOGITO_CONSOLES_KEYCLOAK_UPDATE_TOKEN_VALIDITY: 30, KOGITO_CONSOLES_KEYCLOAK_HEALTH_CHECK_URL: diff --git a/packages/runtime-tools-management-console-webapp/webpack.config.js b/packages/runtime-tools-management-console-webapp/webpack.config.js index 6083334a7bd..51d6ed79352 100644 --- a/packages/runtime-tools-management-console-webapp/webpack.config.js +++ b/packages/runtime-tools-management-console-webapp/webpack.config.js @@ -22,13 +22,13 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); -const { env: buildEnv } = require("./env"); +const { env } = require("./env"); const { defaultEnvJson } = require("./build/defaultEnvJson"); const BG_IMAGES_DIRNAME = "bgimages"; -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: path.resolve(__dirname, "src", "index.tsx"), }, @@ -36,8 +36,8 @@ module.exports = async (env) => { static: { directory: "./dist", }, - host: buildEnv.runtimeToolsManagementConsoleWebapp.host, - port: buildEnv.runtimeToolsManagementConsoleWebapp.port, + host: env.runtimeToolsManagementConsoleWebapp.host, + port: env.runtimeToolsManagementConsoleWebapp.port, compress: true, historyApiFallback: true, hot: true, diff --git a/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/ProcessFormContainer/ProcessFormContainer.tsx b/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/ProcessFormContainer/ProcessFormContainer.tsx index 5895d63c40d..6baa0e7be99 100755 --- a/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/ProcessFormContainer/ProcessFormContainer.tsx +++ b/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/ProcessFormContainer/ProcessFormContainer.tsx @@ -57,7 +57,7 @@ const ProcessFormContainer: React.FC = ({ onSubmitSuccess(id); }) .catch((error) => { - const message = error.response ? error.response.data : error.message; + const message = error.response ? `${error.response.statusText} : ${error.message}` : error.message; onSubmitError(message); }); }, diff --git a/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/ProcessFormPage/ProcessFormPage.tsx b/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/ProcessFormPage/ProcessFormPage.tsx index 1de2b62da2e..ab68c515a7f 100644 --- a/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/ProcessFormPage/ProcessFormPage.tsx +++ b/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/ProcessFormPage/ProcessFormPage.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useEffect, useState } from "react"; +import React, { useEffect, useState, useCallback } from "react"; import { Card, CardBody } from "@patternfly/react-core/dist/js/components/Card"; import { PageSection } from "@patternfly/react-core/dist/js/components/Page"; import ProcessFormContainer from "../../containers/ProcessFormContainer/ProcessFormContainer"; @@ -51,10 +51,6 @@ const ProcessFormPage: React.FC = ({ ouiaId, ouiaSafe }) => { history.push("/Processes"); }; - const goToProcessDetails = () => { - history.push(`/Process/${processId}`); - }; - const showNotification = ( notificationType: Notification["type"], submitMessage: string, @@ -72,18 +68,21 @@ const ProcessFormPage: React.FC = ({ ouiaId, ouiaSafe }) => { goToProcessDefinition(); }, }, - { - label: "Go to Process details", - onClick: () => { - setNotification(null); - goToProcessDetails(); - }, - }, ], close: () => { setNotification(null); }, }); + return ( + <> + {processId && ( +
+ + +
+ )} + + ); }; const onSubmitSuccess = (id: string): void => { @@ -97,6 +96,14 @@ const ProcessFormPage: React.FC = ({ ouiaId, ouiaSafe }) => { showNotification("error", message, details); }; + const handleClick = useCallback(() => { + const goToProcessDetails = () => { + history.push(`/Process/${processId}`); + }; + setNotification(null); + goToProcessDetails(); + }, [setNotification, history, processId]); + return ( { - const dataIndexURL = buildEnv.runtimeToolsProcessDevUIWebapp.kogitoDataIndexUrl; - return merge(common(env), { +module.exports = async (webpackEnv) => { + const dataIndexURL = env.runtimeToolsProcessDevUIWebapp.kogitoDataIndexUrl; + return merge(common(webpackEnv), { entry: { standalone: path.resolve(__dirname, "src", "standalone", "standalone.ts"), envelope: path.resolve(__dirname, "src", "standalone", "EnvelopeApp.ts"), @@ -43,7 +42,7 @@ module.exports = async (env) => { static: { directory: "./dist", }, - port: buildEnv.runtimeToolsProcessDevUIWebapp.port, + port: env.runtimeToolsProcessDevUIWebapp.port, compress: true, historyApiFallback: true, hot: true, @@ -69,7 +68,7 @@ module.exports = async (env) => { KOGITO_APP_VERSION: "DEV", KOGITO_APP_NAME: "Runtime tools dev-ui", KOGITO_DATAINDEX_HTTP_URL: dataIndexURL, - KOGITO_REMOTE_KOGITO_APP_URL: buildEnv.runtimeToolsProcessDevUIWebapp.kogitoAppUrl, + KOGITO_REMOTE_KOGITO_APP_URL: env.runtimeToolsProcessDevUIWebapp.kogitoAppUrl, }), new CopyPlugin({ patterns: [ @@ -99,11 +98,11 @@ module.exports = async (env) => { new HtmlReplaceWebpackPlugin([ { pattern: /\${WEBPACK_REPLACEMENT_WEBAPP_HOST}/g, - replacement: () => buildEnv.runtimeToolsProcessDevUIWebapp.host ?? "", + replacement: () => env.runtimeToolsProcessDevUIWebapp.host ?? "", }, { pattern: /\${WEBPACK_REPLACEMENT_WEBAPP_PORT}/g, - replacement: () => buildEnv.runtimeToolsProcessDevUIWebapp.port ?? "", + replacement: () => env.runtimeToolsProcessDevUIWebapp.port ?? "", }, ]), ], diff --git a/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/WorkflowDetails/WorkflowDetails.tsx b/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/WorkflowDetails/WorkflowDetails.tsx index 1a0364f9e12..5f2ea170b45 100644 --- a/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/WorkflowDetails/WorkflowDetails.tsx +++ b/packages/runtime-tools-swf-enveloped-components/src/workflowDetails/envelope/components/WorkflowDetails/WorkflowDetails.tsx @@ -50,6 +50,8 @@ import WorkflowDetailsTimelinePanel from "../WorkflowDetailsTimelinePanel/Workfl import SwfCombinedEditor from "../SwfCombinedEditor/SwfCombinedEditor"; import { Job, WorkflowInstance, WorkflowInstanceState } from "@kie-tools/runtime-tools-swf-gateway-api/dist/types"; +const SWFCOMBINEDEDITOR_WIDTH = 1000; + interface WorkflowDetailsProps { isEnvelopeConnectedToChannel: boolean; driver: WorkflowDetailsDriver; @@ -218,7 +220,7 @@ const WorkflowDetails: React.FC = ({ isEnvelopeConnectedTo return ( - + ); @@ -250,7 +252,7 @@ const WorkflowDetails: React.FC = ({ isEnvelopeConnectedTo const renderWorkflowVariables = (): JSX.Element => { return ( - {Object.keys(updateJson).length > 0 && ( + {updateJson && Object.keys(updateJson).length > 0 && ( = ({ isEnvelopeConnectedTo return ( {renderSwfDiagram()} - + {renderWorkflowDetails()} {renderWorkflowVariables()} diff --git a/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDefinitionList.test.tsx b/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDefinitionList.test.tsx index 6226790263e..f72efab13a2 100644 --- a/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDefinitionList.test.tsx +++ b/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDefinitionList.test.tsx @@ -18,7 +18,7 @@ */ import * as React from "react"; -import { render, waitFor, screen, fireEvent, act } from "@testing-library/react"; +import { render, waitFor, fireEvent } from "@testing-library/react"; import "@testing-library/jest-dom"; import WorkflowDefinitionList from "@kie-tools/runtime-tools-swf-enveloped-components/dist/workflowDefinitions/envelope/components/WorkflowDefinitionList/WorkflowDefinitionList"; diff --git a/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDetails.test.tsx b/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDetails.test.tsx new file mode 100644 index 00000000000..f54261b947a --- /dev/null +++ b/packages/runtime-tools-swf-enveloped-components/tests/components/WorkflowDetails.test.tsx @@ -0,0 +1,89 @@ +/* + * 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. + */ + +import * as React from "react"; +import { render } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import WorkflowDetails from "@kie-tools/runtime-tools-swf-enveloped-components/dist/workflowDetails/envelope/components/WorkflowDetails/WorkflowDetails"; +import { WorkflowInstance, WorkflowInstanceState } from "@kie-tools/runtime-tools-swf-gateway-api/dist/types"; + +const mockDriver = { + jobsQuery: jest.fn(), +}; + +const sampleWorkflowDetails: WorkflowInstance = { + id: "6d114aaf-b599-49da-b434-f18133b40072", + processId: "timeout", + processName: "timeout", + variables: { + workflowdata: { + varName: "value", + }, + }, + state: WorkflowInstanceState.Active, + start: new Date("2024-10-18T12:25:00.192Z"), + lastUpdate: new Date("2024-10-18T12:25:00.192Z"), + endpoint: "http://localhost:4000/timeout", + nodes: [], +}; + +describe("WorkflowDetails component", () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test("should render the workflow details correctly", () => { + const component = render( + + ); + + expect(component.queryByText("6d114")).toBeInTheDocument(); + }); + + test.each([ + [undefined, false], + [null, false], + [{}, false], + [{ workflowdata: {} }, true], + [sampleWorkflowDetails.variables, true], + ])( + "should render the workflow Variables card correctly when variables is `%j`", + (variablesMock, variablesCardVisible) => { + const workflowDetailsMock = { ...sampleWorkflowDetails, variables: variablesMock }; + const component = render( + + ); + + if (variablesCardVisible) { + expect(component.queryByText("Variables")).toBeInTheDocument(); + expect(component.queryByText("workflowdata")).toBeInTheDocument(); + } else { + expect(component.queryByText("Variables")).not.toBeInTheDocument(); + } + } + ); +}); diff --git a/packages/runtime-tools-swf-gateway-api/src/gatewayApi/apis.tsx b/packages/runtime-tools-swf-gateway-api/src/gatewayApi/apis.tsx index 619ebe387c0..3d391590079 100644 --- a/packages/runtime-tools-swf-gateway-api/src/gatewayApi/apis.tsx +++ b/packages/runtime-tools-swf-gateway-api/src/gatewayApi/apis.tsx @@ -729,3 +729,22 @@ export const saveFormContent = (formName: string, content: FormContent): Promise .catch((error) => reject(error)); }); }; + +export async function verifyDataIndex(dataIndexUrl?: string): Promise { + if (!dataIndexUrl) { + return false; + } + + try { + const response = await fetch(dataIndexUrl, { + headers: { + "Content-Type": "application/json", + }, + method: "POST", + body: '{"query":""}', + }); + return response.status === 200; + } catch (e) { + return false; + } +} diff --git a/packages/runtime-tools-task-console-webapp/build/defaultEnvJson.js b/packages/runtime-tools-task-console-webapp/build/defaultEnvJson.js index 399e6b5c929..1dfbfde3c21 100644 --- a/packages/runtime-tools-task-console-webapp/build/defaultEnvJson.js +++ b/packages/runtime-tools-task-console-webapp/build/defaultEnvJson.js @@ -17,18 +17,18 @@ * under the License. */ -const { env: buildEnv } = require("../env"); +const { env } = require("../env"); const version = require("../package.json").version; module.exports = { defaultEnvJson: { - RUNTIME_TOOLS_TASK_CONSOLE_KOGITO_ENV_MODE: buildEnv.runtimeToolsTaskConsoleWebapp.kogitoEnvMode, + RUNTIME_TOOLS_TASK_CONSOLE_KOGITO_ENV_MODE: env.runtimeToolsTaskConsoleWebapp.kogitoEnvMode, RUNTIME_TOOLS_TASK_CONSOLE_KOGITO_APP_NAME: "Task Console", RUNTIME_TOOLS_TASK_CONSOLE_KOGITO_APP_VERSION: version, RUNTIME_TOOLS_TASK_CONSOLE_KOGITO_TASK_STATES_LIST: "Ready,Reserved,Completed,Aborted,Skipped", RUNTIME_TOOLS_TASK_CONSOLE_KOGITO_TASK_ACTIVE_STATES_LIST: "Ready,Reserved", - RUNTIME_TOOLS_TASK_CONSOLE_DATA_INDEX_ENDPOINT: buildEnv.runtimeToolsTaskConsoleWebapp.kogitoDataIndexUrl, + RUNTIME_TOOLS_TASK_CONSOLE_DATA_INDEX_ENDPOINT: env.runtimeToolsTaskConsoleWebapp.kogitoDataIndexUrl, KOGITO_CONSOLES_KEYCLOAK_DISABLE_HEALTH_CHECK: false, KOGITO_CONSOLES_KEYCLOAK_UPDATE_TOKEN_VALIDITY: 30, KOGITO_CONSOLES_KEYCLOAK_HEALTH_CHECK_URL: diff --git a/packages/runtime-tools-task-console-webapp/webpack.config.js b/packages/runtime-tools-task-console-webapp/webpack.config.js index 3191882517d..4dda3c7e5ee 100644 --- a/packages/runtime-tools-task-console-webapp/webpack.config.js +++ b/packages/runtime-tools-task-console-webapp/webpack.config.js @@ -22,13 +22,13 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin"); -const { env: buildEnv } = require("./env"); +const { env } = require("./env"); const { defaultEnvJson } = require("./build/defaultEnvJson"); const BG_IMAGES_DIRNAME = "bgimages"; -module.exports = async (env) => { - return merge(common(env), { +module.exports = async (webpackEnv) => { + return merge(common(webpackEnv), { entry: { index: path.resolve(__dirname, "src", "index.tsx"), "resources/form-displayer": "./src/resources/form-displayer.ts", @@ -37,8 +37,8 @@ module.exports = async (env) => { static: { directory: "./dist", }, - host: buildEnv.runtimeToolsTaskConsoleWebapp.host, - port: buildEnv.runtimeToolsTaskConsoleWebapp.port, + host: env.runtimeToolsTaskConsoleWebapp.host, + port: env.runtimeToolsTaskConsoleWebapp.port, compress: true, historyApiFallback: true, hot: true, diff --git a/packages/uniforms-patternfly-codegen/README.md b/packages/scesim-editor-envelope/README.md similarity index 92% rename from packages/uniforms-patternfly-codegen/README.md rename to packages/scesim-editor-envelope/README.md index 81da116376f..64a8f8018c0 100644 --- a/packages/uniforms-patternfly-codegen/README.md +++ b/packages/scesim-editor-envelope/README.md @@ -15,9 +15,9 @@ under the License. --> -## Uniforms Patternfly Codegen +## Test Scenario Editor Envelope -This module contains the [Uniforms](https://uniforms.tools) theme contain to generate Patternfly forms for the `@kie-tools/form-generation-tool`. +Package responsible for creating the necessary pumbling for `scesim-editor` to be used inside an Envelope. --- diff --git a/packages/scesim-editor/src/common/TestScenarioCommonConstants.ts b/packages/scesim-editor-envelope/env/index.js similarity index 79% rename from packages/scesim-editor/src/common/TestScenarioCommonConstants.ts rename to packages/scesim-editor-envelope/env/index.js index 55edecff712..61bc742bd66 100644 --- a/packages/scesim-editor/src/common/TestScenarioCommonConstants.ts +++ b/packages/scesim-editor-envelope/env/index.js @@ -17,9 +17,11 @@ * under the License. */ -export const EMPTY_TYPE = "java.lang.Void"; +const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env"); -export enum TEST_SCENARIO_EXPRESSION_TYPE { - EXPRESSION, - NOT_EXPRESSION, -} +module.exports = composeEnv([require("@kie-tools/root-env/env")], { + vars: varsWithName({}), + get env() { + return {}; + }, +}); diff --git a/packages/scesim-editor-envelope/package.json b/packages/scesim-editor-envelope/package.json new file mode 100644 index 00000000000..17edf9fec90 --- /dev/null +++ b/packages/scesim-editor-envelope/package.json @@ -0,0 +1,55 @@ +{ + "name": "@kie-tools/scesim-editor-envelope", + "version": "0.0.0", + "description": "", + "license": "Apache-2.0", + "keywords": [], + "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" + }, + "files": [ + "dist", + "src" + ], + "scripts": { + "build:dev": "rimraf dist && tsc -p tsconfig.json", + "build:prod": "rimraf dist && pnpm lint && tsc -p tsconfig.json", + "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"" + }, + "dependencies": { + "@kie-tools-core/editor": "workspace:*", + "@kie-tools-core/envelope": "workspace:*", + "@kie-tools-core/envelope-bus": "workspace:*", + "@kie-tools-core/keyboard-shortcuts": "workspace:*", + "@kie-tools-core/notifications": "workspace:*", + "@kie-tools-core/react-hooks": "workspace:*", + "@kie-tools-core/workspace": "workspace:*", + "@kie-tools/boxed-expression-component": "workspace:*", + "@kie-tools/dmn-marshaller": "workspace:*", + "@kie-tools/scesim-editor": "workspace:*", + "@kie-tools/scesim-marshaller": "workspace:*", + "@kie-tools/xml-parser-ts": "workspace:*", + "@patternfly/react-core": "^4.276.6" + }, + "devDependencies": { + "@babel/core": "^7.16.0", + "@babel/preset-env": "^7.16.0", + "@babel/preset-react": "^7.16.0", + "@kie-tools/eslint": "workspace:*", + "@kie-tools/root-env": "workspace:*", + "@kie-tools/tsconfig": "workspace:*", + "@types/react": "^17.0.6", + "@types/react-dom": "^17.0.5", + "rimraf": "^3.0.2", + "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" + } +} diff --git a/packages/scesim-editor-envelope/src/TestScenarioEditorEnvelopeApiFactory.ts b/packages/scesim-editor-envelope/src/TestScenarioEditorEnvelopeApiFactory.ts new file mode 100644 index 00000000000..394581f8575 --- /dev/null +++ b/packages/scesim-editor-envelope/src/TestScenarioEditorEnvelopeApiFactory.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import { EnvelopeApiFactoryArgs } from "@kie-tools-core/envelope"; +import { EditorEnvelopeViewApi, KogitoEditorEnvelopeApiImpl } from "@kie-tools-core/editor/dist/envelope"; +import { + Editor, + KogitoEditorChannelApi, + KogitoEditorEnvelopeApi, + KogitoEditorEnvelopeContextType, +} from "@kie-tools-core/editor/dist/api"; +import { TestScenarioEditorFactory } from "./TestScenarioEditorFactory"; + +export type TestScenarioEnvelopeApiFactoryArgs = EnvelopeApiFactoryArgs< + KogitoEditorEnvelopeApi, + KogitoEditorChannelApi, + EditorEnvelopeViewApi, + KogitoEditorEnvelopeContextType +>; + +export class TestScenarioEditorEnvelopeApiImpl + extends KogitoEditorEnvelopeApiImpl + implements KogitoEditorEnvelopeApi +{ + constructor(readonly scesimArgs: TestScenarioEnvelopeApiFactoryArgs) { + super(scesimArgs, new TestScenarioEditorFactory()); + } +} diff --git a/packages/scesim-editor-envelope/src/TestScenarioEditorFactory.tsx b/packages/scesim-editor-envelope/src/TestScenarioEditorFactory.tsx new file mode 100644 index 00000000000..8957ffaf43f --- /dev/null +++ b/packages/scesim-editor-envelope/src/TestScenarioEditorFactory.tsx @@ -0,0 +1,160 @@ +/* + * 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. + */ + +import * as React from "react"; +import { useCallback } from "react"; +import { + Editor, + EditorFactory, + EditorInitArgs, + KogitoEditorEnvelopeContextType, + KogitoEditorChannelApi, + EditorTheme, + DEFAULT_WORKSPACE_ROOT_ABSOLUTE_POSIX_PATH, +} from "@kie-tools-core/editor/dist/api"; +import { Notification } from "@kie-tools-core/notifications/dist/api"; +import { ResourceContent, ResourcesList, WorkspaceEdit } from "@kie-tools-core/workspace/dist/api"; +import { TestScenarioEditorRoot } from "./TestScenarioEditorRoot"; + +export class TestScenarioEditorFactory implements EditorFactory { + public createEditor( + envelopeContext: KogitoEditorEnvelopeContextType, + initArgs: EditorInitArgs + ): Promise { + return Promise.resolve(new TestScenarioEditorInterface(envelopeContext, initArgs)); + } +} + +export class TestScenarioEditorInterface implements Editor { + private self: TestScenarioEditorRoot; + public af_isReact = true; + public af_componentId: "scesim-editor"; + public af_componentTitle: "Test Scenario Editor"; + + constructor( + private readonly envelopeContext: KogitoEditorEnvelopeContextType, + private readonly initArgs: EditorInitArgs + ) {} + + // Not in-editor + + public getPreview(): Promise { + return this.self.getDiagramSvg(); + } + + public async validate(): Promise { + return Promise.resolve([]); + } + + // Forwarding to the editor + + public async setTheme(theme: EditorTheme): Promise { + return Promise.resolve(); // No-op for now. The Test Scenario Editor only has the LIGHT theme. + } + + public async undo(): Promise { + return this.self.undo(); + } + + public async redo(): Promise { + return this.self.redo(); + } + + public getContent(): Promise { + return this.self.getContent(); + } + + public setContent(normalizedPosixPathRelativeToTheWorkspaceRoot: string, content: string): Promise { + return this.self.setContent(normalizedPosixPathRelativeToTheWorkspaceRoot, content); + } + + // This is the argument to ReactDOM.render. These props can be understood like "static globals". + public af_componentRoot() { + return ( + (this.self = testScenarioEditorRoot)} + envelopeContext={this.envelopeContext} + workspaceRootAbsolutePosixPath={ + this.initArgs.workspaceRootAbsolutePosixPath ?? DEFAULT_WORKSPACE_ROOT_ABSOLUTE_POSIX_PATH + } + isReadOnly={this.initArgs.isReadOnly} + /> + ); + } +} + +// This component is a wrapper. It memoizes the TestScenarioEditorRoot props beforing rendering it. +function TestScenarioEditorRootWrapper({ + envelopeContext, + exposing, + workspaceRootAbsolutePosixPath, + isReadOnly, +}: { + envelopeContext?: KogitoEditorEnvelopeContextType; + exposing: (s: TestScenarioEditorRoot) => void; + workspaceRootAbsolutePosixPath: string; + isReadOnly: boolean; +}) { + const onNewEdit = useCallback( + (workspaceEdit: WorkspaceEdit) => { + envelopeContext?.channelApi.notifications.kogitoWorkspace_newEdit.send(workspaceEdit); + }, + [envelopeContext] + ); + + const onRequestWorkspaceFilesList = useCallback( + async (resource: ResourcesList) => { + return ( + envelopeContext?.channelApi.requests.kogitoWorkspace_resourceListRequest(resource) ?? new ResourcesList("", []) + ); + }, + [envelopeContext] + ); + + const onRequestWorkspaceFileContent = useCallback( + async (resource: ResourceContent) => { + return envelopeContext?.channelApi.requests.kogitoWorkspace_resourceContentRequest(resource); + }, + [envelopeContext] + ); + + const onOpenFileFromNormalizedPosixPathRelativeToTheWorkspaceRoot = useCallback( + (normalizedPosixPathRelativeToTheWorkspaceRoot: string) => { + envelopeContext?.channelApi.notifications.kogitoWorkspace_openFile.send( + normalizedPosixPathRelativeToTheWorkspaceRoot + ); + }, + [envelopeContext] + ); + + return ( + + ); +} diff --git a/packages/scesim-editor-envelope/src/TestScenarioEditorRoot.tsx b/packages/scesim-editor-envelope/src/TestScenarioEditorRoot.tsx new file mode 100644 index 00000000000..d38148a2239 --- /dev/null +++ b/packages/scesim-editor-envelope/src/TestScenarioEditorRoot.tsx @@ -0,0 +1,517 @@ +/* + * 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. + */ + +import * as React from "react"; +import { useEffect, useMemo, useState } from "react"; +import * as __path from "path"; +import { + imperativePromiseHandle, + PromiseImperativeHandle, +} from "@kie-tools-core/react-hooks/dist/useImperativePromiseHandler"; +import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api"; +import { ResourceContent, SearchType, WorkspaceChannelApi, WorkspaceEdit } from "@kie-tools-core/workspace/dist/api"; +import { KeyboardShortcutsService } from "@kie-tools-core/keyboard-shortcuts/dist/envelope/KeyboardShortcutsService"; +import { Flex } from "@patternfly/react-core/dist/js/layouts/Flex"; +import { EmptyState, EmptyStateBody, EmptyStateIcon } from "@patternfly/react-core/dist/js/components/EmptyState"; +import { Title } from "@patternfly/react-core/dist/js/components/Title"; +import { domParser } from "@kie-tools/xml-parser-ts"; +import { normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; +import { getMarshaller as getDmnMarshaller } from "@kie-tools/dmn-marshaller"; +import * as TestScenarioEditor from "@kie-tools/scesim-editor/dist/TestScenarioEditor"; +import { getMarshaller, SceSimMarshaller, SceSimModel } from "@kie-tools/scesim-marshaller"; +import { EMPTY_ONE_EIGHT } from "@kie-tools/scesim-editor/dist/resources/EmptyScesimFile"; + +export const DMN_MODELS_SEARCH_GLOB_PATTERN = "**/*.{dmn}"; + +export type TestScenarioEditorRootProps = { + exposing: (s: TestScenarioEditorRoot) => void; + isReadOnly: boolean; + keyboardShortcutsService: KeyboardShortcutsService | undefined; + onNewEdit: (edit: WorkspaceEdit) => void; + onRequestWorkspaceFilesList: WorkspaceChannelApi["kogitoWorkspace_resourceListRequest"]; + onRequestWorkspaceFileContent: WorkspaceChannelApi["kogitoWorkspace_resourceContentRequest"]; + onOpenFileFromNormalizedPosixPathRelativeToTheWorkspaceRoot: WorkspaceChannelApi["kogitoWorkspace_openFile"]; + workspaceRootAbsolutePosixPath: string; +}; + +export type TestScenarioEditorRootState = { + error: Error | undefined; + externalModelsByNamespace: TestScenarioEditor.ExternalDmnsIndex; + externalModelsManagerDoneBootstraping: boolean; + isReadOnly: boolean; + keyboardShortcutsRegistred: boolean; + keyboardShortcutsRegisterIds: number[]; + marshaller: SceSimMarshaller | undefined; + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot: string | undefined; + pointer: number; + stack: SceSimModel[]; +}; + +export class TestScenarioEditorRoot extends React.Component { + private readonly externalModelsManagerDoneBootstraping = imperativePromiseHandle(); + + private readonly testScenarioEditorRef: React.RefObject; + + constructor(props: TestScenarioEditorRootProps) { + super(props); + props.exposing(this); + this.testScenarioEditorRef = React.createRef(); + this.state = { + error: undefined, + externalModelsByNamespace: {}, + externalModelsManagerDoneBootstraping: false, + isReadOnly: props.isReadOnly, + keyboardShortcutsRegisterIds: [], + keyboardShortcutsRegistred: false, + marshaller: undefined, + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot: undefined, + pointer: -1, + stack: [], + }; + } + + // Exposed API + + public async undo(): Promise { + this.setState((prev) => ({ ...prev, pointer: Math.max(0, prev.pointer - 1) })); + } + + public async redo(): Promise { + this.setState((prev) => ({ ...prev, pointer: Math.min(prev.stack.length - 1, prev.pointer + 1) })); + } + + public async getDiagramSvg(): Promise { + return this.testScenarioEditorRef.current?.getDiagramSvg(); + } + + public async getContent(): Promise { + if (!this.state.marshaller || !this.model) { + throw new Error( + `Test Scenario EDITOR ROOT: Content has not been set yet. Throwing an error to prevent returning a "default" content.` + ); + } + + return this.state.marshaller.builder.build(this.model); + } + + public async setContent( + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot: string, + content: string + ): Promise { + const marshaller = this.getMarshaller(content || EMPTY_ONE_EIGHT); + + // Save stack + let savedStackPointer: SceSimModel[] = []; + + // Set the model and path for external models manager. + this.setState((prev) => { + savedStackPointer = [...prev.stack]; + return { + stack: [marshaller.parser.parse()], + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot, + pointer: 0, + }; + }); + + // Wait the external manager models to load. + await this.externalModelsManagerDoneBootstraping.promise; + + // Set the valeus to render the Test Scenario Editor. + this.setState((prev) => { + // External change to the same file. + if ( + prev.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot === + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot + ) { + const newStack = savedStackPointer.slice(0, prev.pointer + 1); + return { + externalModelsManagerDoneBootstraping: true, + isReadOnly: prev.isReadOnly, + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot, + marshaller, + pointer: newStack.length, + stack: [...newStack, marshaller.parser.parse()], + }; + } + + // Different file opened. Need to reset everything. + else { + return { + externalModelsManagerDoneBootstraping: true, + isReadOnly: prev.isReadOnly, + marshaller, + openFilenormalizedPosixPathRelativeToTheWorkspaceRoot, + pointer: 0, + stack: [marshaller.parser.parse()], + }; + } + }); + } + + public get model(): SceSimModel | undefined { + return this.state.stack[this.state.pointer]; + } + + // Internal methods + + private getMarshaller(content: string) { + try { + return getMarshaller(content || EMPTY_ONE_EIGHT); + } catch (e) { + this.setState((s) => ({ + ...s, + error: e, + })); + throw e; + } + } + + private setExternalModelsByNamespace = (externalModelsByNamespace: TestScenarioEditor.ExternalDmnsIndex) => { + this.setState((prev) => ({ ...prev, externalModelsByNamespace })); + }; + + private onModelChange: TestScenarioEditor.OnSceSimModelChange = (model) => { + this.setState( + (prev) => { + const newStack = prev.stack.slice(0, prev.pointer + 1); + return { + ...prev, + stack: [...newStack, model], + pointer: newStack.length, + }; + }, + () => + this.props.onNewEdit({ + id: `${this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot}__${generateUuid()}`, + }) + ); + }; + + private onRequestExternalModelsAvailableToInclude: TestScenarioEditor.OnRequestExternalModelsAvailableToInclude = + async () => { + if (!this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot) { + return []; + } + + const list = await this.props.onRequestWorkspaceFilesList({ + pattern: DMN_MODELS_SEARCH_GLOB_PATTERN, + opts: { type: SearchType.TRAVERSAL }, + }); + + return list.normalizedPosixPathsRelativeToTheWorkspaceRoot.flatMap((p) => + __path.relative(__path.dirname(this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot!), p) + ); + }; + + private onRequestToResolvePathRelativeToTheOpenFile: TestScenarioEditor.OnRequestToResolvePath = ( + normalizedPosixPathRelativeToTheOpenFile + ) => { + const normalizedPosixPathRelativeToTheWorkspaceRoot = __path + .resolve( + __path.dirname(this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot!), + normalizedPosixPathRelativeToTheOpenFile + ) + .substring(1); // Remove leading slash. + + return normalizedPosixPathRelativeToTheWorkspaceRoot; + + // Example: + // this.state.openFileAbsolutePath = /Users/ljmotta/packages/dmns/Dmn.dmn + // normalizedPosixPathRelativeToTheOpenFile = ../../tmp/Tmp.dmn + // workspaceRootAbsolutePosixPath = /Users/ljmotta + // resolvedAbsolutePath = /Users/ljmotta/tmp/Tmp.dmn + // return (which is the normalizedPosixPathRelativeToTheWorkspaceRoot) = tmp/Tmp.dmn + }; + + private onRequestExternalModelByPathsRelativeToTheOpenFile: TestScenarioEditor.OnRequestExternalModelByPath = async ( + normalizedPosixPathRelativeToTheOpenFile + ) => { + const normalizedPosixPathRelativeToTheWorkspaceRoot = this.onRequestToResolvePathRelativeToTheOpenFile( + normalizedPosixPathRelativeToTheOpenFile + ); + const resource = await this.props.onRequestWorkspaceFileContent({ + normalizedPosixPathRelativeToTheWorkspaceRoot, + opts: { type: "text" }, + }); + + const ext = __path.extname(normalizedPosixPathRelativeToTheOpenFile); + if (ext === ".dmn") { + return { + normalizedPosixPathRelativeToTheOpenFile, + type: "dmn", + model: normalize(getDmnMarshaller(resource?.content ?? "", { upgradeTo: "latest" }).parser.parse()), + svg: "", + }; + } else { + throw new Error(`Unknown extension '${ext}'.`); + } + }; + + private onOpenFileFromPathRelativeToTheOpenFile = (normalizedPosixPathRelativeToTheOpenFile: string) => { + if (!this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot) { + return; + } + + this.props.onOpenFileFromNormalizedPosixPathRelativeToTheWorkspaceRoot( + this.onRequestToResolvePathRelativeToTheOpenFile(normalizedPosixPathRelativeToTheOpenFile) + ); + }; + + public componentDidUpdate( + prevProps: Readonly, + prevState: Readonly, + snapshot?: any + ): void { + if (this.props.keyboardShortcutsService === undefined || this.state.keyboardShortcutsRegistred === true) { + return; + } + + const commands = this.testScenarioEditorRef.current?.getCommands(); + if (commands === undefined) { + return; + } + const togglePropertiesPanel = this.props.keyboardShortcutsService?.registerKeyPress( + "I", + "Misc | Open/Close dock panel", + async () => commands.toggleTestScenarioDock() + ); + + this.setState((prev) => ({ + ...prev, + keyboardShortcutsRegistred: true, + keyboardShortcutsRegisterIds: [togglePropertiesPanel], + })); + } + + public componentWillUnmount() { + const keyboardShortcuts = this.testScenarioEditorRef.current?.getCommands(); + if (keyboardShortcuts === undefined) { + return; + } + + this.state.keyboardShortcutsRegisterIds.forEach((id) => { + this.props.keyboardShortcutsService?.deregister(id); + }); + } + + public render() { + return ( + <> + {this.state.error && } + {this.model && ( + <> + + { + + } + + )} + + ); + } +} + +function ExternalModelsManager({ + workspaceRootAbsolutePosixPath, + thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot, + model, + onChange, + onRequestWorkspaceFileContent, + onRequestWorkspaceFilesList, + externalModelsManagerDoneBootstraping, +}: { + workspaceRootAbsolutePosixPath: string; + thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot: string | undefined; + model: SceSimModel; + onChange: (externalModelsByNamespace: TestScenarioEditor.ExternalDmnsIndex) => void; + onRequestWorkspaceFileContent: WorkspaceChannelApi["kogitoWorkspace_resourceContentRequest"]; + onRequestWorkspaceFilesList: WorkspaceChannelApi["kogitoWorkspace_resourceListRequest"]; + externalModelsManagerDoneBootstraping: PromiseImperativeHandle; +}) { + const targetNamespace = useMemo(() => { + if (model.ScenarioSimulationModel.settings.type?.__$$text !== "DMN") { + return null; + } + if (model.ScenarioSimulationModel.settings.dmnNamespace?.__$$text) { + return model.ScenarioSimulationModel.settings.dmnNamespace?.__$$text.toUpperCase(); + } + return null; + }, [model.ScenarioSimulationModel.settings]); + + const [externalUpdatesCount, setExternalUpdatesCount] = useState(0); + + // This is a hack. Every time a file is updates in KIE Sandbox, the Shared Worker emits an event to this BroadcastChannel. + // By listening to it, we can reload the `externalModelsByNamespace` object. This makes the DMN Editor react to external changes, + // Which is very important for multi-file editing. + // + // Now, this mechanism is not ideal. We would ideally only be notified on changes to relevant files, but this sub-system does not exist yet. + // The consequence of this "hack" is some extra reloads. + useEffect(() => { + const bc = new BroadcastChannel("workspaces_files"); + bc.onmessage = ({ data }) => { + // Changes to `thisDmn` shouldn't update its references to external models. + // Here, `data?.relativePath` is relative to the workspace root. + if (data?.relativePath === thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot) { + return; + } + // We want to track changes on DMN files only. + if ( + !thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot && + __path.extname(thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot!).toUpperCase() !== "dmn" + ) { + return; + } + + setExternalUpdatesCount((prev) => prev + 1); + }; + return () => { + bc.close(); + }; + }, [thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot]); + + // This effect actually populates `externalModelsByNamespace` through the `onChange` call. + useEffect(() => { + let canceled = false; + + if (!thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot || !targetNamespace) { + return; + } + + onRequestWorkspaceFilesList({ pattern: DMN_MODELS_SEARCH_GLOB_PATTERN, opts: { type: SearchType.TRAVERSAL } }) + .then((list) => { + const resources: Array> = []; + for (let i = 0; i < list.normalizedPosixPathsRelativeToTheWorkspaceRoot.length; i++) { + const normalizedPosixPathRelativeToTheWorkspaceRoot = list.normalizedPosixPathsRelativeToTheWorkspaceRoot[i]; + + if ( + normalizedPosixPathRelativeToTheWorkspaceRoot === thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot + ) { + continue; + } + + resources.push( + onRequestWorkspaceFileContent({ + normalizedPosixPathRelativeToTheWorkspaceRoot, + opts: { type: "text" }, + }) + ); + } + return Promise.all(resources); + }) + .then((resources) => { + const externalModelsIndex: TestScenarioEditor.ExternalDmnsIndex = {}; + + for (let i = 0; i < resources.length; i++) { + const resource = resources[i]; + if (!resource) { + continue; + } + + const content = resource.content ?? ""; + + const normalizedPosixPathRelativeToTheOpenFile = __path.relative( + __path.dirname(thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot), + resource.normalizedPosixPathRelativeToTheWorkspaceRoot + ); + + const ext = __path.extname(resource.normalizedPosixPathRelativeToTheWorkspaceRoot); + if (ext === ".dmn") { + const namespace = domParser.getDomDocument(content).documentElement.getAttribute("namespace"); + if (namespace === targetNamespace) { + // Check for multiplicity of namespaces on DMN models + if (externalModelsIndex[namespace]) { + console.warn( + `TEST SCENARIO EDITOR ROOT: Multiple DMN models encountered with the same namespace '${namespace}': '${ + resource.normalizedPosixPathRelativeToTheWorkspaceRoot + }' and '${ + externalModelsIndex[namespace]!.normalizedPosixPathRelativeToTheOpenFile + }'. The latter will be considered.` + ); + } + + externalModelsIndex[namespace] = { + normalizedPosixPathRelativeToTheOpenFile, + model: normalize(getDmnMarshaller(content, { upgradeTo: "latest" }).parser.parse()), + svg: "", + }; + } + } else { + throw new Error(`Unknown extension '${ext}'.`); + } + } + + if (!canceled) { + onChange(externalModelsIndex); + } + externalModelsManagerDoneBootstraping.resolve(); + }); + + return () => { + canceled = true; + }; + }, [ + targetNamespace, + onChange, + onRequestWorkspaceFileContent, + onRequestWorkspaceFilesList, + thisScesimNormalizedPosixPathRelativeToTheWorkspaceRoot, + externalUpdatesCount, + workspaceRootAbsolutePosixPath, + externalModelsManagerDoneBootstraping, + ]); + + return <>; +} + +function TestScenarioMarshallerFallbackError({ error }: { error: Error }) { + return ( + + +
😕
} /> + + Unable to open file. + +
+ Error details: {error.message} +
+
+ ); +} diff --git a/packages/scesim-editor-envelope/tsconfig.json b/packages/scesim-editor-envelope/tsconfig.json new file mode 100644 index 00000000000..9154a249aa5 --- /dev/null +++ b/packages/scesim-editor-envelope/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@kie-tools/tsconfig/tsconfig.esm.json", + "compilerOptions": { + "jsx": "react-jsx" + } +} diff --git a/packages/scesim-editor/.storybook/preview.tsx b/packages/scesim-editor/.storybook/preview.tsx index 4e7e10ae856..f0300e08ed8 100644 --- a/packages/scesim-editor/.storybook/preview.tsx +++ b/packages/scesim-editor/.storybook/preview.tsx @@ -44,13 +44,7 @@ const preview: Preview = { }, // It should be Story() to be possible to use "preview-api" inside stories; (https://github.com/storybookjs/storybook/issues/22132) - decorators: [ - (Story) => ( -
- {Story()} -
- ), - ], + decorators: [(Story) =>
{Story()}
], }; export default preview; diff --git a/packages/scesim-editor/README.md b/packages/scesim-editor/README.md index fd2b0454047..eedff691504 100644 --- a/packages/scesim-editor/README.md +++ b/packages/scesim-editor/README.md @@ -44,16 +44,16 @@ To build the `scesim-editor` module ONLY, you can use ONE of the below commands: - `pnpm -F @kie-tools/scesim-editor build:dev` This is fast, but not as strict. It skips tests, linters, and some type checks. Recommended for dev purposes. - `pnpm -F @kie-tools/scesim-editor build:prod` The default command to build production-ready packages. This is the recommended build for production purposes -## How to launch the Test Scenario Dev WebApp +## How to launch the Test Scenario Storybook Dev WebApp -After building the project, you can benefit of the Dev Webapp for development or testing scope. +After building the project, you can benefit of the Storybook Dev Webapp for development or testing scope. To launch it, simply type in your terminal the following command: `pnpm -F @kie-tools/scesim-editor start` A web server with a Dev Webapp of Test Scenario editor will be launched, reachable at the following address: -http://localhost:9004/ or http://192.168.1.128:9004/ +http://localhost:9902/ or http://172.20.10.3:9902/ --- diff --git a/packages/scesim-editor/package.json b/packages/scesim-editor/package.json index 4f6bae028e6..5814b86fe1f 100644 --- a/packages/scesim-editor/package.json +++ b/packages/scesim-editor/package.json @@ -7,7 +7,7 @@ "scripts": { "build:dev": "rimraf dist && tsc -p tsconfig.json", "build:prod": "rimraf dist && pnpm lint && tsc -p tsconfig.json && pnpm test-e2e", - "build:storybook": "storybook build -o dist-storybook", + "build:storybook": "rimraf dist-storybook && NODE_ENV=development storybook build -o dist-storybook", "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command", "start": "run-script-os", @@ -21,16 +21,19 @@ "@kie-tools-core/i18n": "workspace:*", "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools/boxed-expression-component": "workspace:*", + "@kie-tools/dmn-marshaller": "workspace:*", "@kie-tools/i18n-common-dictionary": "workspace:*", "@kie-tools/scesim-marshaller": "workspace:*", "@patternfly/react-core": "^4.276.6", "@patternfly/react-icons": "^4.93.6", "@patternfly/react-styles": "^4.92.6", + "immer": "^10.0.3", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2", "react-table": "^7.6.2", - "uuid": "^8.3.2" + "uuid": "^8.3.2", + "zustand": "^4.4.2" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -57,7 +60,9 @@ "@types/uuid": "^8.3.0", "copy-webpack-plugin": "^11.0.0", "cross-env": "^7.0.3", + "deep-object-diff": "^1.1.9", "file-loader": "^6.2.0", + "react-error-boundary": "^4.0.13", "rimraf": "^3.0.2", "run-script-os": "^1.1.6", "storybook": "^7.3.2", diff --git a/packages/scesim-editor/playwright.config.ts b/packages/scesim-editor/playwright.config.ts index b837bceb451..3b46d138ea6 100644 --- a/packages/scesim-editor/playwright.config.ts +++ b/packages/scesim-editor/playwright.config.ts @@ -20,9 +20,9 @@ import { defineConfig } from "@playwright/test"; import playwrightBaseConfig from "@kie-tools/playwright-base/playwright.config"; import merge from "lodash/merge"; -import { env } from "./env"; -const buildEnv: any = env; +import { env } from "./env"; +const buildEnv: any = env; // build-env is not typed const customConfig = defineConfig({ use: { @@ -42,7 +42,7 @@ const customConfig = defineConfig({ toHaveScreenshot: { // An acceptable ratio of pixels that are different to the // total amount of pixels, between 0 and 1. - maxDiffPixelRatio: 0.001, + maxDiffPixelRatio: 0.1, }, }, }); diff --git a/packages/scesim-editor/src/TestScenarioEditor.tsx b/packages/scesim-editor/src/TestScenarioEditor.tsx index 62f15be68f3..b352179c2ff 100644 --- a/packages/scesim-editor/src/TestScenarioEditor.tsx +++ b/packages/scesim-editor/src/TestScenarioEditor.tsx @@ -20,17 +20,17 @@ import "@patternfly/react-core/dist/styles/base.css"; import * as React from "react"; -import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react"; +import { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from "react"; import { I18nDictionariesProvider } from "@kie-tools-core/i18n/dist/react-components"; import { testScenarioEditorDictionaries, TestScenarioEditorI18nContext, testScenarioEditorI18nDefaults } from "./i18n"; -import { getMarshaller, SceSimModel } from "@kie-tools/scesim-marshaller"; -import { - SceSim__FactMappingType, - SceSim__ScenarioSimulationModelType, -} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; +import { DmnLatestModel } from "@kie-tools/dmn-marshaller"; +import { Normalized } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; + +import { SceSimModel } from "@kie-tools/scesim-marshaller"; +import { SceSim__FactMappingType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; import { Alert } from "@patternfly/react-core/dist/js/components/Alert"; import { Bullseye } from "@patternfly/react-core/dist/js/layouts/Bullseye"; @@ -46,16 +46,29 @@ import ErrorIcon from "@patternfly/react-icons/dist/esm/icons/error-circle-o-ico import TableIcon from "@patternfly/react-icons/dist/esm/icons/table-icon"; import HelpIcon from "@patternfly/react-icons/dist/esm/icons/help-icon"; -import ErrorBoundary from "./reactExt/ErrorBoundary"; +import { ErrorBoundary, ErrorBoundaryPropsWithFallback } from "react-error-boundary"; + +import { Commands, CommandsContextProvider, useCommands } from "./commands/CommandsContextProvider"; +import TestScenarioCreationPanel from "./creation/TestScenarioCreationPanel"; import TestScenarioDrawerPanel from "./drawer/TestScenarioDrawerPanel"; import TestScenarioSideBarMenu from "./sidebar/TestScenarioSideBarMenu"; import TestScenarioTable from "./table/TestScenarioTable"; import { useTestScenarioEditorI18n } from "./i18n"; -import { EMPTY_ONE_EIGHT } from "./resources/EmptyScesimFile"; - import "./TestScenarioEditor.css"; -import TestScenarioCreationPanel from "./creation/TestScenarioCreationPanel"; +import { ComputedStateCache } from "./store/ComputedStateCache"; +import { Computed, createTestScenarioEditorStore, TestScenarioEditorTab } from "./store/TestScenarioEditorStore"; +import { + StoreApiType, + TestScenarioEditorStoreApiContext, + useTestScenarioEditorStore, + useTestScenarioEditorStoreApi, +} from "./store/TestScenarioStoreContext"; +import { TestScenarioEditorErrorFallback } from "./TestScenarioEditorErrorFallback"; +import { TestScenarioEditorContextProvider, useTestScenarioEditor } from "./TestScenarioEditorContext"; +import { TestScenarioEditorExternalModelsContextProvider } from "./externalModels/TestScenarioEditorDependenciesContext"; +import { useEffectAfterFirstRender } from "./hook/useEffectAfterFirstRender"; +import { INITIAL_COMPUTED_CACHE } from "./store/computed/initial"; /* Constants */ @@ -63,17 +76,6 @@ const CURRENT_SUPPORTED_VERSION = "1.8"; /* Enums */ -export enum TestScenarioEditorDock { - CHEATSHEET, - DATA_OBJECT, - SETTINGS, -} - -enum TestScenarioEditorTab { - EDITOR, - BACKGROUND, -} - enum TestScenarioFileStatus { EMPTY, ERROR, @@ -82,43 +84,75 @@ enum TestScenarioFileStatus { VALID, } -export enum TestScenarioType { - DMN, - RULE, -} - /* Types */ -export type TestScenarioAlert = { - enabled: boolean; - message?: string; - variant: "success" | "danger" | "warning" | "info" | "default"; +export type OnRequestExternalModelsAvailableToInclude = () => Promise; +export type OnRequestToJumpToPath = (normalizedPosixPathRelativeToTheOpenFile: string) => void; +export type OnRequestToResolvePath = (normalizedPosixPathRelativeToTheOpenFile: string) => string; +export type OnSceSimModelChange = (model: SceSimModel) => void; + +export type OnRequestExternalModelByPath = ( + normalizedPosixPathRelativeToTheOpenFile: string +) => Promise; +export type ExternalDmnsIndex = Record; + +export type ExternalDmn = { + model: Normalized; + normalizedPosixPathRelativeToTheOpenFile: string; + svg: string; }; -export type TestScenarioDataObject = { - id: string; - children?: TestScenarioDataObject[]; - customBadgeContent?: string; - isSimpleTypeFact?: boolean; - name: string; +export type TestScenarioEditorProps = { + /** + * When the SceSim represented by `model` ("This SceSim") is DMN-type Test Scenario this prop needs to map their contents by namespace. + * The SceSim model won't be correctly rendered if an included model is not found on this object. + */ + externalModelsByNamespace?: ExternalDmnsIndex; + /** + * A link that will take users to an issue tracker so they can report problems they find on the Test Scenario Editor. + * This is shown on the ErrorBoundary fallback component, when an uncaught error happens. + */ + issueTrackerHref?: string; + /** + * The Test Scenario itself. + */ + model: SceSimModel; + /** + * Called when a change occurs on `model`, so the controlled flow of the component can be done. + */ + onModelChange?: OnSceSimModelChange; + /** + * Notifies the caller when the Test Scenario Editor performs a new edit after the debounce time. + */ + onModelDebounceStateChanged?: (changed: boolean) => void; + /** + * Called when the contents of a specific available DMN model is necessary. + */ + onRequestExternalModelByPath?: OnRequestExternalModelByPath; + /** + * Called when the list of paths of available DMN models + */ + onRequestExternalModelsAvailableToInclude?: OnRequestExternalModelsAvailableToInclude; + /** + * When users want to jump to another file, this method is called, allowing the controller of this component decide what to do. + * Links are only rendered if this is provided. Otherwise, paths will be rendered as text. + */ + onRequestToJumpToPath?: OnRequestToJumpToPath; + /** + * All paths inside the Test Scenario Editor are relative. To be able to resolve them and display them as absolute paths, this function is called. + * If undefined, the relative paths will be displayed. + */ + onRequestToResolvePath?: OnRequestToResolvePath; + /** + * The file path of the current opened Test Scenario scesim file + */ + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: string | undefined; }; export type TestScenarioEditorRef = { - /* TODO Convert these to Promises */ - getContent(): string; + reset: (mode: SceSimModel) => void; + getCommands: () => Commands; getDiagramSvg: () => Promise; - setContent(pathRelativeToTheWorkspaceRoot: string, content: string): void; -}; - -export type TestScenarioSettings = { - assetType: string; - dmnFilePath?: string; - dmnName?: string; - dmnNamespace?: string; - isStatelessSessionRule?: boolean; - isTestSkipped: boolean; - kieSessionRule?: string; - ruleFlowGroup?: string; }; export type TestScenarioSelectedColumnMetaData = { @@ -127,174 +161,71 @@ export type TestScenarioSelectedColumnMetaData = { isBackground: boolean; }; -function TestScenarioMainPanel({ - fileName, - scesimModel, - updateSettingField, - updateTestScenarioModel, -}: { - fileName: string; - scesimModel: { ScenarioSimulationModel: SceSim__ScenarioSimulationModelType }; - updateSettingField: (field: string, value: string) => void; - updateTestScenarioModel: React.Dispatch>; -}) { +function TestScenarioMainPanel() { const { i18n } = useTestScenarioEditorI18n(); - - const [alert, setAlert] = useState({ enabled: false, variant: "info" }); - const [dataObjects, setDataObjects] = useState([]); - const [dockPanel, setDockPanel] = useState({ isOpen: true, selected: TestScenarioEditorDock.DATA_OBJECT }); - const [selectedColumnMetadata, setSelectedColumnMetaData] = useState(null); - const [tab, setTab] = useState(TestScenarioEditorTab.EDITOR); + const { commandsRef } = useCommands(); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); + const navigation = useTestScenarioEditorStore((s) => s.navigation); + const scesimModel = useTestScenarioEditorStore((s) => s.scesim.model); + const isAlertEnabled = true; // Will be managed in kie-issue#970 + const testScenarioType = scesimModel.ScenarioSimulationModel.settings.type?.__$$text.toUpperCase(); const scenarioTableScrollableElementRef = useRef(null); const backgroundTableScrollableElementRef = useRef(null); - const onTabChanged = useCallback((_event, tab) => { - setSelectedColumnMetaData(null); - setTab(tab); - }, []); - - const closeDockPanel = useCallback(() => { - setDockPanel((prev) => { - return { ...prev, isOpen: false }; - }); - }, []); - - const openDockPanel = useCallback((selected: TestScenarioEditorDock) => { - setDockPanel({ isOpen: true, selected: selected }); - }, []); - - useEffect(() => { - setDockPanel({ isOpen: true, selected: TestScenarioEditorDock.DATA_OBJECT }); - setSelectedColumnMetaData(null); - setTab(TestScenarioEditorTab.EDITOR); - }, [fileName]); - - /** This is TEMPORARY */ - useEffect(() => { - /* To create the Data Object arrays we need an external source, in details: */ - /* DMN Data: Retrieving DMN type from linked DMN file */ - /* Java classes: Retrieving Java classes info from the user projects */ - /* At this time, none of the above are supported */ - /* Therefore, it tries to retrieve these info from the SCESIM file, if are present */ - - /* Retriving Data Object from the scesim file. - That makes sense for previously created scesim files */ - - const factsMappings: SceSim__FactMappingType[] = - scesimModel.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping ?? []; - - const dataObjects: TestScenarioDataObject[] = []; - - /* The first two FactMapping are related to the "Number" and "Description" columns. - If those columns only are present, no Data Objects can be detected in the scesim file */ - for (let i = 2; i < factsMappings.length; i++) { - if (factsMappings[i].className!.__$$text === "java.lang.Void") { - continue; - } - const factID = factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text; - const dataObject = dataObjects.find((value) => value.id === factID); - const isSimpleTypeFact = factsMappings[i].expressionElements!.ExpressionElement!.length == 1; - const propertyID = isSimpleTypeFact //POTENTIAL BUG - ? factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text.concat(".") - : factsMappings[i] - .expressionElements!.ExpressionElement!.map((expressionElement) => expressionElement.step.__$$text) - .join("."); - const propertyName = isSimpleTypeFact - ? "value" - : factsMappings[i].expressionElements!.ExpressionElement!.slice(-1)[0].step.__$$text; - if (dataObject) { - if (!dataObject.children?.some((value) => value.id === propertyID)) { - dataObject.children!.push({ - id: propertyID, - customBadgeContent: factsMappings[i].className.__$$text, - isSimpleTypeFact: isSimpleTypeFact, - name: propertyName, - }); - } - } else { - dataObjects.push({ - id: factID, - name: factsMappings[i].factAlias!.__$$text, - customBadgeContent: factsMappings[i].factIdentifier!.className!.__$$text, - children: [ - { - id: propertyID, - name: propertyName, - customBadgeContent: factsMappings[i].className.__$$text, - }, - ], - }); - } - } + const onTabChanged = useCallback( + (_event, tab) => { + testScenarioEditorStoreApi.setState((state) => { + state.navigation.tab = tab; + }); + }, + [testScenarioEditorStoreApi] + ); - setDataObjects(dataObjects); - }, [scesimModel.ScenarioSimulationModel.settings.type]); + const showDockPanel = useCallback( + (show: boolean) => { + testScenarioEditorStoreApi.setState((state) => { + state.navigation.dock.isOpen = show; + }); + }, + [testScenarioEditorStoreApi] + ); - /** It determines the Alert State */ + // Show Properties panel useEffect(() => { - const assetType = scesimModel.ScenarioSimulationModel.settings.type!.__$$text; - - let alertEnabled = false; - let alertMessage = ""; - let alertVariant: "default" | "danger" | "warning" | "info" | "success" = "danger"; - - if (dataObjects.length > 0) { - alertMessage = - assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.alerts.dmnDataRetrievedFromScesim - : i18n.alerts.ruleDataRetrievedFromScesim; - alertEnabled = true; - } else { - alertMessage = - assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.alerts.dmnDataNotAvailable - : i18n.alerts.ruleDataNotAvailable; - alertVariant = assetType === TestScenarioType[TestScenarioType.DMN] ? "warning" : "danger"; - alertEnabled = true; + if (!commandsRef.current) { + return; } - - setAlert({ enabled: alertEnabled, message: alertMessage, variant: alertVariant }); - }, [dataObjects, i18n, scesimModel.ScenarioSimulationModel.settings.type]); + commandsRef.current.toggleTestScenarioDock = async () => { + console.trace("Test Scenario Editor: COMMANDS: Toggle dock panel..."); + testScenarioEditorStoreApi.setState((state) => { + state.navigation.dock.isOpen = !state.navigation.dock.isOpen; + }); + }; + }, [testScenarioEditorStoreApi, commandsRef]); return ( <>
- - - } - > + + showDockPanel(false)} />}> - {alert.enabled && ( + {isAlertEnabled && (
- +
)}
- + @@ -314,11 +245,8 @@ function TestScenarioMainPanel({ ref={scenarioTableScrollableElementRef} >
@@ -343,11 +271,8 @@ function TestScenarioMainPanel({ ref={backgroundTableScrollableElementRef} >
@@ -357,7 +282,7 @@ function TestScenarioMainPanel({
- + ); } @@ -380,29 +305,84 @@ function TestScenarioParserErrorPanel({ ); } -const TestScenarioEditorInternal = ({ forwardRef }: { forwardRef?: React.Ref }) => { - /** Test Scenario File, Model and Marshaller Management */ +export const TestScenarioEditorInternal = ({ + forwardRef, + model, + onModelChange, + onModelDebounceStateChanged, +}: TestScenarioEditorProps & { forwardRef?: React.Ref }) => { + console.trace("[TestScenarioEditorInternal] Component creation ..."); - const [scesimFile, setScesimFile] = useState({ content: "", path: "" }); + const scesim = useTestScenarioEditorStore((s) => s.scesim); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); + const { testScenarioEditorModelBeforeEditingRef, testScenarioEditorRootElementRef } = useTestScenarioEditor(); + const { commandsRef } = useCommands(); - const marshaller = useMemo(() => getMarshaller(scesimFile.content.trim()), [scesimFile]); + /** Implementing Editor APIs */ - const scesimLoaded: { ScenarioSimulationModel: SceSim__ScenarioSimulationModelType } = useMemo( - () => marshaller.parser.parse(), - [marshaller.parser] + // Allow imperativelly controlling the Editor. + useImperativeHandle( + forwardRef, + () => ({ + reset: () => { + console.trace("[TestScenarioEditorInternal: Reset called!"); + const state = testScenarioEditorStoreApi.getState(); + state.dispatch(state).scesim.reset(); + }, + getCommands: () => commandsRef.current, + getDiagramSvg: async () => undefined, + }), + [commandsRef, testScenarioEditorStoreApi] ); - const [scesimModel, setScesimModel] = useState(scesimLoaded); + // Make sure the Test Scenario Editor reacts to props changing. + useEffectAfterFirstRender(() => { + testScenarioEditorStoreApi.setState((state) => { + // Avoid unecessary state updates + if (model === state.scesim.model) { + console.trace("[TestScenarioEditorInternal]: useEffectAfterFirstRender called, but the models are the same!"); + return; + } + + console.trace("[TestScenarioEditorInternal]: Model updated!"); + + state.scesim.model = model; + testScenarioEditorModelBeforeEditingRef.current = model; + //state.dispatch(state).scesim.reset(); + }); + }, [testScenarioEditorStoreApi, model]); + + // Only notify changes when dragging/resizing operations are not happening. + useEffectAfterFirstRender(() => { + onModelDebounceStateChanged?.(false); + + const timeout = setTimeout(() => { + // Ignore changes made outside... If the controller of the component + // changed its props, it knows it already, we don't need to call "onModelChange" again. + if (model === scesim.model) { + return; + } + + onModelDebounceStateChanged?.(true); + console.trace("[TestScenarioEditorInternal: Debounce State changed!"); + console.trace(scesim.model); + onModelChange?.(scesim.model); + }, 500); + + return () => { + clearTimeout(timeout); + }; + }, [onModelChange, scesim.model]); const scesimFileStatus = useMemo(() => { - if (scesimModel.ScenarioSimulationModel) { - const parserErrorField = "parsererror" as keyof typeof scesimModel.ScenarioSimulationModel; - if (scesimModel.ScenarioSimulationModel[parserErrorField]) { + if (scesim.model.ScenarioSimulationModel) { + const parserErrorField = "parsererror" as keyof typeof scesim.model.ScenarioSimulationModel; + if (scesim.model.ScenarioSimulationModel[parserErrorField]) { return TestScenarioFileStatus.ERROR; } - if (scesimModel.ScenarioSimulationModel["@_version"] != CURRENT_SUPPORTED_VERSION) { + if (scesim.model.ScenarioSimulationModel["@_version"] != CURRENT_SUPPORTED_VERSION) { return TestScenarioFileStatus.UNSUPPORTED; - } else if (scesimModel.ScenarioSimulationModel["settings"]?.["type"]) { + } else if (scesim.model.ScenarioSimulationModel.settings?.type) { return TestScenarioFileStatus.VALID; } else { return TestScenarioFileStatus.NEW; @@ -410,84 +390,12 @@ const TestScenarioEditorInternal = ({ forwardRef }: { forwardRef?: React.Ref { - console.debug("SCESIM Model updated"); - console.debug(scesimLoaded); - setScesimModel(scesimLoaded); - }, [scesimLoaded]); - - /** Implementing Editor APIs */ + }, [scesim]); - useImperativeHandle( - forwardRef, - () => ({ - getContent: () => marshaller.builder.build(scesimModel), - getDiagramSvg: async () => undefined, - setContent: (normalizedPosixPathRelativeToTheWorkspaceRoot, content) => { - console.debug("SCESIM setContent called"); - console.debug("=== FILE CONTENT ==="); - console.debug(content ? content : "EMPTY FILE"); - console.debug("=== END FILE CONTENT ==="); - - setScesimFile({ content: content || EMPTY_ONE_EIGHT, path: normalizedPosixPathRelativeToTheWorkspaceRoot }); - }, - }), - [marshaller.builder, scesimModel] - ); - - /** scesim model update functions */ - - const setInitialSettings = useCallback( - ( - assetType: string, - isStatelessSessionRule: boolean, - isTestSkipped: boolean, - kieSessionRule: string, - ruleFlowGroup: string - ) => - setScesimModel((prevState) => ({ - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - settings: { - ...prevState.ScenarioSimulationModel.settings, - dmnFilePath: - assetType === TestScenarioType[TestScenarioType.DMN] ? { __$$text: "./MockedDMNName.dmn" } : undefined, - dmoSession: - assetType === TestScenarioType[TestScenarioType.RULE] && kieSessionRule - ? { __$$text: kieSessionRule } - : undefined, - ruleFlowGroup: - assetType === TestScenarioType[TestScenarioType.RULE] && ruleFlowGroup - ? { __$$text: ruleFlowGroup } - : undefined, - skipFromBuild: { __$$text: isTestSkipped }, - stateless: - assetType === TestScenarioType[TestScenarioType.RULE] ? { __$$text: isStatelessSessionRule } : undefined, - type: { __$$text: assetType }, - }, - }, - })), - [setScesimModel] - ); - - const updateSettingsField = useCallback( - (fieldName: string, value: string) => - setScesimModel((prevState) => ({ - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - ["settings"]: { - ...prevState.ScenarioSimulationModel["settings"], - [fieldName]: { __$$text: value }, - }, - }, - })), - [setScesimModel] - ); + console.trace("[TestScenarioEditorInternal] File Status: " + TestScenarioFileStatus[scesimFileStatus]); return ( - <> +
{(() => { switch (scesimFileStatus) { case TestScenarioFileStatus.EMPTY: @@ -507,13 +415,13 @@ const TestScenarioEditorInternal = ({ forwardRef }: { forwardRef?: React.Ref ); case TestScenarioFileStatus.NEW: - return ; + return ; case TestScenarioFileStatus.UNSUPPORTED: return ( ); case TestScenarioFileStatus.VALID: - return ( - - ); + return ; } })()} - +
); }; -export const TestScenarioEditor = React.forwardRef((props: {}, ref: React.Ref) => { - const [scesimFileParsingError, setScesimFileParsingError] = useState(null); - - return ( - - - } - setError={setScesimFileParsingError} +export const TestScenarioEditor = React.forwardRef( + (props: TestScenarioEditorProps, ref: React.Ref) => { + console.trace("[TestScenarioEditor] Component creation ... "); + console.trace(props.model); + + const store = useMemo( + () => createTestScenarioEditorStore(props.model, new ComputedStateCache(INITIAL_COMPUTED_CACHE)), + // Purposefully empty. This memoizes the initial value of the store + // eslint-disable-next-line react-hooks/exhaustive-deps + [] + ); + const storeRef = React.useRef(store); + + const resetState: ErrorBoundaryPropsWithFallback["onReset"] = useCallback(({ args }) => { + storeRef.current?.setState((state) => { + state.scesim.model = args[0]; + }); + }, []); + + return ( + - - - - ); -}); + + + + + + + + + + + + + ); + } +); diff --git a/packages/scesim-editor/src/TestScenarioEditorContext.tsx b/packages/scesim-editor/src/TestScenarioEditorContext.tsx new file mode 100644 index 00000000000..3702076ce6c --- /dev/null +++ b/packages/scesim-editor/src/TestScenarioEditorContext.tsx @@ -0,0 +1,77 @@ +/* + * 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. + */ + +import * as React from "react"; +import { useContext, useMemo, useRef } from "react"; +import { SceSimModel } from "@kie-tools/scesim-marshaller"; +import { TestScenarioEditorProps } from "./TestScenarioEditor"; + +export type SceSimModelBeforeEditing = SceSimModel; + +export type TestScenarioEditorContextProviderProps = Pick< + TestScenarioEditorProps, + | "issueTrackerHref" + | "model" + | "onRequestToJumpToPath" + | "onRequestToResolvePath" + | "openFileNormalizedPosixPathRelativeToTheWorkspaceRoot" +>; + +export type TestScenarioEditorContextType = Pick< + TestScenarioEditorContextProviderProps, + | "issueTrackerHref" + | "onRequestToJumpToPath" + | "onRequestToResolvePath" + | "openFileNormalizedPosixPathRelativeToTheWorkspaceRoot" +> & { + testScenarioEditorModelBeforeEditingRef: React.MutableRefObject; + testScenarioEditorRootElementRef: React.RefObject; +}; + +const TestScenarioEditorContext = React.createContext({} as any); + +export function useTestScenarioEditor() { + return useContext(TestScenarioEditorContext); +} + +export function TestScenarioEditorContextProvider( + props: React.PropsWithChildren +) { + const testScenarioEditorModelBeforeEditingRef = useRef(props.model); + const testScenarioEditorRootElementRef = useRef(null); + + const value = useMemo( + () => ({ + issueTrackerHref: props.issueTrackerHref, + testScenarioEditorModelBeforeEditingRef, + testScenarioEditorRootElementRef, + onRequestToJumpToPath: props.onRequestToJumpToPath, + onRequestToResolvePath: props.onRequestToResolvePath, + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: + props.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot, + }), + [ + props.issueTrackerHref, + props.onRequestToJumpToPath, + props.onRequestToResolvePath, + props.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot, + ] + ); + return {props.children}; +} diff --git a/packages/scesim-editor/src/TestScenarioEditorErrorFallback.tsx b/packages/scesim-editor/src/TestScenarioEditorErrorFallback.tsx new file mode 100644 index 00000000000..5d532330d10 --- /dev/null +++ b/packages/scesim-editor/src/TestScenarioEditorErrorFallback.tsx @@ -0,0 +1,93 @@ +/* + * 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. + */ + +import * as React from "react"; +import { useCallback, useEffect } from "react"; +import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button"; +import { + EmptyState, + EmptyStateBody, + EmptyStateIcon, + EmptyStatePrimary, +} from "@patternfly/react-core/dist/js/components/EmptyState"; +import { ExternalLinkAltIcon } from "@patternfly/react-icons/dist/js/icons/external-link-alt-icon"; +import { ClipboardCopy, ClipboardCopyVariant } from "@patternfly/react-core/dist/js/components/ClipboardCopy"; +import { Flex } from "@patternfly/react-core/dist/js/layouts/Flex"; +import { Title } from "@patternfly/react-core/dist/js/components/Title"; +import { FallbackProps } from "react-error-boundary"; +import { useTestScenarioEditorI18n } from "./i18n"; +import { useTestScenarioEditor } from "./TestScenarioEditorContext"; + +export function TestScenarioEditorErrorFallback({ error, resetErrorBoundary }: FallbackProps) { + const { i18n } = useTestScenarioEditorI18n(); + const { testScenarioEditorModelBeforeEditingRef, issueTrackerHref } = useTestScenarioEditor(); + + const resetToLastWorkingState = useCallback(() => { + resetErrorBoundary(testScenarioEditorModelBeforeEditingRef.current); + }, [testScenarioEditorModelBeforeEditingRef, resetErrorBoundary]); + + useEffect(() => { + console.error(error); + }, [error]); + + return ( + + +
😕
} /> + + {i18n.errorFallBack.title} + + {i18n.errorFallBack.body} +
+ + {JSON.stringify( + { + name: error.name, + message: error.message, + cause: error.cause, + stack: error.stack, + }, + null, + 2 + ).replaceAll("\\n", "\n")} + +
+ + + {issueTrackerHref && ( + + + + )} + +
+
+ ); +} diff --git a/packages/scesim-editor/src/commands/CommandsContextProvider.tsx b/packages/scesim-editor/src/commands/CommandsContextProvider.tsx new file mode 100644 index 00000000000..aa6b09ac182 --- /dev/null +++ b/packages/scesim-editor/src/commands/CommandsContextProvider.tsx @@ -0,0 +1,43 @@ +/* + * 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. + */ + +import * as React from "react"; +import { useContext, useRef } from "react"; + +export interface Commands { + toggleTestScenarioDock: () => void; +} + +const CommandsContext = React.createContext<{ + commandsRef: React.MutableRefObject; +}>({} as any); + +export function useCommands() { + return useContext(CommandsContext); +} + +export function CommandsContextProvider(props: React.PropsWithChildren<{}>) { + const commandsRef = useRef({ + toggleTestScenarioDock: () => { + throw new Error("Test Scenario EDITOR: toggleTestScenarioDock command not implemented."); + }, + }); + + return {props.children}; +} diff --git a/packages/scesim-editor/src/common/TestScenarioCommonFunctions.tsx b/packages/scesim-editor/src/common/TestScenarioCommonFunctions.tsx deleted file mode 100644 index cd9b95ca376..00000000000 --- a/packages/scesim-editor/src/common/TestScenarioCommonFunctions.tsx +++ /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. - */ - -import { - SceSim__FactMappingValueType, - SceSim__ScenarioSimulationModelType, - SceSim__expressionIdentifierType, - SceSim__factIdentifierType, -} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; -import * as React from "react"; - -/** - Given a List of FactMappingValues (Row of Cells), it founds the index of the list's element that matches with the - identifiers (factIdentifier and expressionIdentifier) fields. -*/ -export const retrieveFactMappingValueIndexByIdentifiers = ( - factMappingValues: SceSim__FactMappingValueType[], - factIdentifier: SceSim__factIdentifierType, - expressionIdentifier: SceSim__expressionIdentifierType -) => { - return factMappingValues.findIndex( - (factMappingValue) => - factMappingValue.factIdentifier.name?.__$$text == factIdentifier.name?.__$$text && - factMappingValue.factIdentifier.className?.__$$text == factIdentifier.className?.__$$text && - factMappingValue.expressionIdentifier.name?.__$$text == expressionIdentifier.name?.__$$text && - factMappingValue.expressionIdentifier.type?.__$$text == expressionIdentifier.type?.__$$text - ); -}; - -export const retrieveModelDescriptor = (scesimModel: SceSim__ScenarioSimulationModelType, isBackground: boolean) => { - if (isBackground) { - return scesimModel.background.scesimModelDescriptor; - } else { - return scesimModel.simulation.scesimModelDescriptor; - } -}; - -export const retrieveRowsDataFromModel = (scesimModel: SceSim__ScenarioSimulationModelType, isBackground: boolean) => { - if (isBackground) { - return scesimModel.background.scesimData.BackgroundData; - } else { - return scesimModel.simulation.scesimData.Scenario; - } -}; diff --git a/packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx b/packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx index 9dfd3812fca..679b924171b 100644 --- a/packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx +++ b/packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx @@ -18,6 +18,7 @@ */ import * as React from "react"; +import { useCallback } from "react"; import { Button } from "@patternfly/react-core/dist/js/components/Button"; import { Checkbox } from "@patternfly/react-core/dist/js/components/Checkbox"; @@ -33,36 +34,49 @@ import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip"; import AddIcon from "@patternfly/react-icons/dist/esm/icons/add-circle-o-icon"; import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon"; -import { TestScenarioType } from "../TestScenarioEditor"; +import { useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext"; import { useTestScenarioEditorI18n } from "../i18n"; import "./TestScenarioCreationPanel.css"; -function TestScenarioCreationPanel({ - onCreateScesimButtonClicked, -}: { - onCreateScesimButtonClicked: ( - assetType: string, - isStatelessSessionRule: boolean, - isTestSkipped: boolean, - kieSessionRule: string, - ruleFlowGroup: string - ) => void; -}) { +function TestScenarioCreationPanel() { const { i18n } = useTestScenarioEditorI18n(); const assetsOption = [ { value: "", label: i18n.creationPanel.assetsOption.noChoice, disabled: true }, - { value: TestScenarioType[TestScenarioType.DMN], label: i18n.creationPanel.assetsOption.dmn, disabled: false }, - { value: TestScenarioType[TestScenarioType.RULE], label: i18n.creationPanel.assetsOption.rule, disabled: false }, + { value: "DMN", label: i18n.creationPanel.assetsOption.dmn, disabled: false }, + { value: "RULE", label: i18n.creationPanel.assetsOption.rule, disabled: false }, ]; - const [assetType, setAssetType] = React.useState(""); + const [assetType, setAssetType] = React.useState<"" | "DMN" | "RULE">(""); const [isAutoFillTableEnabled, setAutoFillTableEnabled] = React.useState(true); const [isStatelessSessionRule, setStatelessSessionRule] = React.useState(false); const [isTestSkipped, setTestSkipped] = React.useState(false); const [kieSessionRule, setKieSessionRule] = React.useState(""); const [ruleFlowGroup, setRuleFlowGroup] = React.useState(""); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); + + const createTestScenario = useCallback( + ( + assetType: string, + isStatelessSessionRule: boolean, + isTestSkipped: boolean, + kieSessionRule: string, + ruleFlowGroup: string + ) => + testScenarioEditorStoreApi.setState((state) => { + const settings = state.scesim.model.ScenarioSimulationModel.settings; + settings.dmnFilePath = assetType === "DMN" ? { __$$text: "./MockedDMNName.dmn" } : undefined; + settings.dmnName = assetType === "DMN" ? { __$$text: "MockedDMNName.dmn" } : undefined; + settings.dmnNamespace = assetType === "DMN" ? { __$$text: "https:\\kiegroup" } : undefined; + settings.dmoSession = assetType === "RULE" && kieSessionRule ? { __$$text: kieSessionRule } : undefined; + settings.ruleFlowGroup = assetType === "RULE" && ruleFlowGroup ? { __$$text: ruleFlowGroup } : undefined; + settings.skipFromBuild = { __$$text: isTestSkipped }; + settings.stateless = assetType === "RULE" ? { __$$text: isStatelessSessionRule } : undefined; + settings.type = { __$$text: assetType }; + }), + [testScenarioEditorStoreApi] + ); return ( @@ -75,7 +89,7 @@ function TestScenarioCreationPanel({ setAssetType(value)} + onChange={(value: "" | "DMN" | "RULE") => setAssetType(value)} value={assetType} > {assetsOption.map((option, index) => ( @@ -83,7 +97,7 @@ function TestScenarioCreationPanel({ ))} - {assetType === TestScenarioType[TestScenarioType.DMN] && ( + {assetType === "DMN" && ( <> @@ -111,7 +125,7 @@ function TestScenarioCreationPanel({ )} - {assetType === TestScenarioType[TestScenarioType.RULE] && ( + {assetType === "RULE" && ( <> } isDisabled={assetType == ""} onClick={() => - onCreateScesimButtonClicked(assetType, isStatelessSessionRule, isTestSkipped, kieSessionRule, ruleFlowGroup) + createTestScenario(assetType, isStatelessSessionRule, isTestSkipped, kieSessionRule, ruleFlowGroup) } variant="primary" > diff --git a/packages/scesim-editor/src/drawer/TestScenarioDrawerCheatSheetPanel.tsx b/packages/scesim-editor/src/drawer/TestScenarioDrawerCheatSheetPanel.tsx index c3b14567fdb..982456cf6c4 100644 --- a/packages/scesim-editor/src/drawer/TestScenarioDrawerCheatSheetPanel.tsx +++ b/packages/scesim-editor/src/drawer/TestScenarioDrawerCheatSheetPanel.tsx @@ -21,79 +21,58 @@ import * as React from "react"; import { Text, TextContent, TextList, TextListItem } from "@patternfly/react-core/dist/js/components/Text"; -import { TestScenarioType } from "../TestScenarioEditor"; import { useTestScenarioEditorI18n } from "../i18n"; +import { useTestScenarioEditorStore } from "../store/TestScenarioStoreContext"; -function TestScenarioDrawerCheatSheetPanel({ assetType }: { assetType: string }) { +function TestScenarioDrawerCheatSheetPanel() { const { i18n } = useTestScenarioEditorI18n(); + const settingsModel = useTestScenarioEditorStore((state) => state.scesim.model.ScenarioSimulationModel.settings); + const testScenarioType = settingsModel.type?.__$$text.toUpperCase(); return ( {i18n.drawer.cheatSheet.paragraph1} {i18n.drawer.cheatSheet.paragraph2( - assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.dataSelector.titleDMN - : i18n.drawer.dataSelector.titleRule + testScenarioType === "DMN" ? i18n.drawer.dataSelector.titleDMN : i18n.drawer.dataSelector.titleRule )} {i18n.drawer.cheatSheet.paragraph3(i18n.tab.backgroundTabTitle, i18n.tab.scenarioTabTitle)} {i18n.drawer.cheatSheet.paragraph4} - {assetType === TestScenarioType[TestScenarioType.DMN] && {i18n.drawer.cheatSheet.paragraph5DMN}} + {testScenarioType === "DMN" && {i18n.drawer.cheatSheet.paragraph5DMN}} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.paragraph6DMN - : i18n.drawer.cheatSheet.paragraph6Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.paragraph6DMN : i18n.drawer.cheatSheet.paragraph6Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression1DMN - : i18n.drawer.cheatSheet.expression1Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression1DMN : i18n.drawer.cheatSheet.expression1Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression2DMN - : i18n.drawer.cheatSheet.expression2Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression2DMN : i18n.drawer.cheatSheet.expression2Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression3DMN - : i18n.drawer.cheatSheet.expression3Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression3DMN : i18n.drawer.cheatSheet.expression3Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression4DMN - : i18n.drawer.cheatSheet.expression4Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression4DMN : i18n.drawer.cheatSheet.expression4Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression5DMN - : i18n.drawer.cheatSheet.expression5Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression5DMN : i18n.drawer.cheatSheet.expression5Rule} + T - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression6DMN - : i18n.drawer.cheatSheet.expression6Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression6DMN : i18n.drawer.cheatSheet.expression6Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression7DMN - : i18n.drawer.cheatSheet.expression7Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression7DMN : i18n.drawer.cheatSheet.expression7Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression8DMN - : i18n.drawer.cheatSheet.expression8Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression8DMN : i18n.drawer.cheatSheet.expression8Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] - ? i18n.drawer.cheatSheet.expression9DMN - : i18n.drawer.cheatSheet.expression9Rule} + {testScenarioType === "DMN" ? i18n.drawer.cheatSheet.expression9DMN : i18n.drawer.cheatSheet.expression9Rule} - {assetType === TestScenarioType[TestScenarioType.DMN] && ( - {i18n.drawer.cheatSheet.expression10DMN} - )} + {testScenarioType === "DMN" && {i18n.drawer.cheatSheet.expression10DMN}} ); diff --git a/packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx b/packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx index d1a1d554ea7..f6aebaa087b 100644 --- a/packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx +++ b/packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx @@ -34,24 +34,14 @@ import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip/"; import { TreeView, TreeViewDataItem, TreeViewSearch } from "@patternfly/react-core/dist/js/components/TreeView/"; import { WarningTriangleIcon } from "@patternfly/react-icons/dist/esm/icons/warning-triangle-icon"; -import { SceSimModel } from "@kie-tools/scesim-marshaller"; -import { - SceSim__FactMappingType, - SceSim__FactMappingValuesTypes, - SceSim__expressionElementsType, -} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; - -import { TestScenarioDataObject, TestScenarioSelectedColumnMetaData, TestScenarioType } from "../TestScenarioEditor"; -import { useTestScenarioEditorI18n } from "../i18n"; +import { SceSim__expressionElementsType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; -import { EMPTY_TYPE, TEST_SCENARIO_EXPRESSION_TYPE } from "../common/TestScenarioCommonConstants"; -import { - retrieveFactMappingValueIndexByIdentifiers, - retrieveModelDescriptor, - retrieveRowsDataFromModel, -} from "../common/TestScenarioCommonFunctions"; +import { useTestScenarioEditorI18n } from "../i18n"; import "./TestScenarioDrawerDataSelectorPanel.css"; +import { useTestScenarioEditorStore, useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext"; +import { TestScenarioDataObject, TestScenarioEditorTab } from "../store/TestScenarioEditorStore"; +import { updateColumn } from "../mutations/updateColumn"; const enum TestScenarioDataSelectorState { DISABLED, // All subcomponents are DISABLED @@ -59,22 +49,19 @@ const enum TestScenarioDataSelectorState { TREEVIEW_ENABLED_ONLY, // TreeView component is enabled only, in a read only mode (when a column is selected) } -function TestScenarioDataSelectorPanel({ - assetType, - dataObjects, - scesimModel, - selectedColumnMetadata, - updateSelectedColumnMetaData, - updateTestScenarioModel, -}: { - assetType: string; - dataObjects: TestScenarioDataObject[]; - scesimModel: SceSimModel; - selectedColumnMetadata: TestScenarioSelectedColumnMetaData | null; - updateSelectedColumnMetaData: React.Dispatch>; - updateTestScenarioModel: React.Dispatch>; -}) { +function TestScenarioDataSelectorPanel() { const { i18n } = useTestScenarioEditorI18n(); + const dataObjects = useTestScenarioEditorStore((state) => state.computed(state).getTestScenarioDataObjects()); + const scesimModel = useTestScenarioEditorStore((state) => state.scesim.model); + const tableStatus = useTestScenarioEditorStore((state) => state.table); + const tabStatus = useTestScenarioEditorStore((state) => state.navigation.tab); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); + const testScenarioType = scesimModel.ScenarioSimulationModel.settings.type?.__$$text.toUpperCase(); + + const selectedColumnMetadata = + tabStatus === TestScenarioEditorTab.SIMULATION + ? tableStatus.simulation.selectedColumn + : tableStatus.background.selectedColumn; const [allExpanded, setAllExpanded] = useState(false); const [dataSelectorStatus, setDataSelectorStatus] = useState(TestScenarioDataSelectorState.DISABLED); @@ -171,8 +158,9 @@ function TestScenarioDataSelectorPanel({ /** It filters out all the Data Objects and their Children already assigned in the table */ const filterOutAlreadyAssignedDataObjectsAndChildren = useCallback( (expressionElement: SceSim__expressionElementsType, isBackground: boolean) => { - const testScenarioDescriptor = retrieveModelDescriptor(scesimModel.ScenarioSimulationModel, isBackground); - + const testScenarioDescriptor = isBackground + ? scesimModel.ScenarioSimulationModel.background.scesimModelDescriptor + : scesimModel.ScenarioSimulationModel.simulation.scesimModelDescriptor; const assignedExpressionElements = testScenarioDescriptor.factMappings.FactMapping!.map( (factMapping) => factMapping.expressionElements! ); @@ -233,9 +221,9 @@ function TestScenarioDataSelectorPanel({ * - All the NOT-assigned fields of the selected column instance * - All the NOT-assigned fields of the NOT-ASSIGNED instances, if the selected column doesn't have an instance (1th level header) assigned */ - if (selectedColumnMetadata.factMapping.className.__$$text === EMPTY_TYPE) { + if (selectedColumnMetadata.factMapping.className.__$$text === "java.lang.Void") { const isFactIdentifierAssigned = - selectedColumnMetadata.factMapping.factIdentifier.className!.__$$text !== EMPTY_TYPE; + selectedColumnMetadata.factMapping.factIdentifier.className!.__$$text !== "java.lang.Void"; let filteredDataObjects: TestScenarioDataObject[] = []; if (isFactIdentifierAssigned) { @@ -245,10 +233,9 @@ function TestScenarioDataSelectorPanel({ selectedColumnMetadata.isBackground ); } else { - const testScenarioDescriptor = retrieveModelDescriptor( - scesimModel.ScenarioSimulationModel, - selectedColumnMetadata.isBackground - ); + const testScenarioDescriptor = selectedColumnMetadata.isBackground + ? scesimModel.ScenarioSimulationModel.background.scesimModelDescriptor + : scesimModel.ScenarioSimulationModel.simulation.scesimModelDescriptor; const assignedExpressionElements = testScenarioDescriptor.factMappings.FactMapping!.map( (factMapping) => factMapping.expressionElements! ); @@ -286,12 +273,10 @@ function TestScenarioDataSelectorPanel({ */ const factIdentifier = selectedColumnMetadata.factMapping.expressionElements!.ExpressionElement![0].step.__$$text; const filteredDataObjects = dataObjects.filter((dataObject) => filterTypesItems(dataObject, factIdentifier)); - const isExpressionType = - selectedColumnMetadata.factMapping.factMappingValueType!.__$$text === - TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.EXPRESSION]; + const isExpressionType = selectedColumnMetadata.factMapping.factMappingValueType!.__$$text === "EXPRESSION"; const isSimpleTypeFact = selectedColumnMetadata.factMapping.expressionElements!.ExpressionElement!.length === 1 && - selectedColumnMetadata.factMapping.className.__$$text !== EMPTY_TYPE; + selectedColumnMetadata.factMapping.className.__$$text !== "java.lang.Void"; let fieldID: string; if (isExpressionType) { fieldID = selectedColumnMetadata.factMapping.expressionElements!.ExpressionElement![0].step.__$$text; @@ -303,7 +288,7 @@ function TestScenarioDataSelectorPanel({ .join("."); } - //TODO 1 This not work with multiple level and expressions fields. + //TODO 1 This not work with multiple level and expressions fields. see kie-issues#1514 const treeViewItemToActivate = filteredDataObjects .reduce((acc: TestScenarioDataObject[], item) => { return item.children ? acc.concat(item.children) : acc; @@ -332,25 +317,25 @@ function TestScenarioDataSelectorPanel({ const treeViewEmptyIcon = filteredItems.length === 0 ? WarningTriangleIcon : WarningTriangleIcon; const title = dataObjects.length === 0 - ? assetType === TestScenarioType[TestScenarioType.DMN] + ? testScenarioType === "DMN" ? i18n.drawer.dataSelector.emptyDataObjectsTitleDMN : i18n.drawer.dataSelector.emptyDataObjectsTitleRule : "No more properties"; //TODO CHANGE const description = dataObjects.length === 0 - ? assetType === TestScenarioType[TestScenarioType.DMN] + ? testScenarioType === "DMN" ? i18n.drawer.dataSelector.emptyDataObjectsDescriptionDMN : i18n.drawer.dataSelector.emptyDataObjectsDescriptionRule : "All the properties have been already assigned"; //TODO CHANGE { - assetType === TestScenarioType[TestScenarioType.DMN] + testScenarioType === "DMN" ? i18n.drawer.dataSelector.emptyDataObjectsTitleDMN : i18n.drawer.dataSelector.emptyDataObjectsTitleRule; } return { description: description, enabled: isTreeViewNotEmpty, icon: treeViewEmptyIcon, title: title }; - }, [assetType, dataObjects.length, filteredItems.length, i18n]); + }, [testScenarioType, dataObjects.length, filteredItems.length, i18n]); const insertDataObjectButtonStatus = useMemo(() => { if (!selectedColumnMetadata) { @@ -391,106 +376,49 @@ function TestScenarioDataSelectorPanel({ // CHECK const onInsertDataObjectClick = useCallback( - /** TODO 2 : NEED A POPUP ASKING IF WE WANT TO REPLACE VALUES OR NOT */ - + /** TODO 2 : NEED A POPUP ASKING IF WE WANT TO REPLACE VALUES OR NOT see kie-issues#1514 */ () => { - updateTestScenarioModel((prevState) => { - const isBackground = selectedColumnMetadata!.isBackground; - const factMappings = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings - .FactMapping!; - const deepClonedFactMappings = JSON.parse(JSON.stringify(factMappings)); - const isRootType = isDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString()); - const rootDataObject = findDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString()); - - const className = treeViewStatus.activeItems[0].customBadgeContent!.toString(); - const expressionAlias = isRootType ? "Expression " : treeViewStatus.activeItems[0].name!.toString(); - const expressionElementsSteps = treeViewStatus.activeItems[0].id!.split(".").filter((step) => !!step.trim()); //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS - const factName = treeViewStatus.activeItems[0].id!.split(".")[0]; //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS - const factClassName = isRootType - ? treeViewStatus.activeItems[0].customBadgeContent!.toString() - : rootDataObject.customBadgeContent!.toString(); - const factMappingValueType = isRootType - ? TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.EXPRESSION] - : TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.NOT_EXPRESSION]; - - const factMappingToUpdate: SceSim__FactMappingType = deepClonedFactMappings[selectedColumnMetadata!.index]; - factMappingToUpdate.className = { __$$text: className }; - factMappingToUpdate.factAlias = { __$$text: factName }; - factMappingToUpdate.factIdentifier.className = { __$$text: factClassName }; - factMappingToUpdate.factIdentifier.name = { __$$text: factName }; - factMappingToUpdate.factMappingValueType = { __$$text: factMappingValueType }; - factMappingToUpdate.expressionAlias = { __$$text: expressionAlias }; - factMappingToUpdate.expressionElements = { - ExpressionElement: expressionElementsSteps.map((ee) => { - return { step: { __$$text: ee } }; - }), - }; - - const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse( - JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground)) - ); - - deepClonedRowsData.forEach((fmv, index) => { - const factMappingValues = fmv.factMappingValues.FactMappingValue!; - const newFactMappingValues = [...factMappingValues]; - - const factMappingValueToUpdateIndex = retrieveFactMappingValueIndexByIdentifiers( - newFactMappingValues, - selectedColumnMetadata!.factMapping.factIdentifier, - selectedColumnMetadata!.factMapping.expressionIdentifier - ); - const factMappingValueToUpdate = factMappingValues[factMappingValueToUpdateIndex]; - newFactMappingValues[factMappingValueToUpdateIndex] = { - ...factMappingValueToUpdate, - factIdentifier: { className: { __$$text: factClassName }, name: { __$$text: factName } }, - // rawValue: { - // __$$text: update.value, //TODO 2 related - // }, - }; - - deepClonedRowsData[index].factMappingValues.FactMappingValue = newFactMappingValues; + const isBackground = selectedColumnMetadata!.isBackground; + const isRootType = isDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString()); + const rootDataObject = findDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString()); + const className = treeViewStatus.activeItems[0].customBadgeContent!.toString(); + const expressionAlias = isRootType ? "Expression " : treeViewStatus.activeItems[0].name!.toString(); + const expressionElementsSteps = treeViewStatus.activeItems[0].id!.split(".").filter((step) => !!step.trim()); //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS see kie-issues#1514 + const factName = treeViewStatus.activeItems[0].id!.split(".")[0]; //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS see kie-issues#1514 + const factClassName = isRootType + ? treeViewStatus.activeItems[0].customBadgeContent!.toString() + : rootDataObject.customBadgeContent!.toString(); + const factMappingValueType = isRootType ? "EXPRESSION" : "NOT_EXPRESSION"; + + testScenarioEditorStoreApi.setState((state) => { + const factMappings = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!; + const factMappingValuesTypes = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimData.BackgroundData! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; + + const { updatedFactMapping } = updateColumn({ + className: className, + expressionAlias: expressionAlias, + expressionElementsSteps: expressionElementsSteps, + expressionIdentifierName: selectedColumnMetadata!.factMapping.expressionIdentifier.name?.__$$text, + expressionIdentifierType: selectedColumnMetadata!.factMapping.expressionIdentifier.type?.__$$text, + factMappings: factMappings, + factClassName: factClassName, + factIdentifierClassName: selectedColumnMetadata!.factMapping.factIdentifier.className?.__$$text, + factIdentifierName: selectedColumnMetadata!.factMapping.factIdentifier.name?.__$$text, + factMappingValuesTypes: factMappingValuesTypes, + factMappingValueType: factMappingValueType, + factName: factName, + selectedColumnIndex: selectedColumnMetadata!.index, }); - /** Updating the selectedColumn */ - updateSelectedColumnMetaData({ - factMapping: JSON.parse(JSON.stringify(factMappingToUpdate)), + state.dispatch(state).table.updateSelectedColumn({ + factMapping: updatedFactMapping, index: selectedColumnMetadata!.index, isBackground: isBackground, }); - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping - : deepClonedFactMappings, - }, - }, - scesimData: { - Scenario: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimData.Scenario - : deepClonedRowsData, - }, - }, - background: { - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? deepClonedFactMappings - : prevState.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping, - }, - }, - scesimData: { - BackgroundData: isBackground - ? deepClonedRowsData - : prevState.ScenarioSimulationModel.background.scesimData.BackgroundData, - }, - }, - }, - }; }); }, [ @@ -498,9 +426,8 @@ function TestScenarioDataSelectorPanel({ findDataObjectRootParent, isDataObjectRootParent, selectedColumnMetadata, + testScenarioEditorStoreApi, treeViewStatus.activeItems, - updateSelectedColumnMetaData, - updateTestScenarioModel, ] ); @@ -552,12 +479,12 @@ function TestScenarioDataSelectorPanel({ return ( <> - {assetType === TestScenarioType[TestScenarioType.DMN] + {testScenarioType === "DMN" ? i18n.drawer.dataSelector.descriptionDMN : i18n.drawer.dataSelector.descriptionRule} void; - onUpdateSettingField: (field: string, value: boolean | string) => void; - scesimModel: SceSimModel; - selectedColumnMetaData: TestScenarioSelectedColumnMetaData | null; - selectedDock: TestScenarioEditorDock; - testScenarioSettings: TestScenarioSettings; - updateSelectedColumnMetaData: React.Dispatch>; - updateTestScenarioModel: React.Dispatch>; -}) { +function TestScenarioDrawerPanel({ onDrawerClose }: { onDrawerClose: () => void }) { const { i18n } = useTestScenarioEditorI18n(); + const navigation = useTestScenarioEditorStore((state) => state.navigation); + const settingsModel = useTestScenarioEditorStore((state) => state.scesim.model.ScenarioSimulationModel.settings); + const testScenarioType = settingsModel.type?.__$$text.toUpperCase(); return ( @@ -77,17 +51,17 @@ function TestScenarioDrawerPanel({ {(() => { - switch (selectedDock) { + switch (navigation.dock.selected) { case TestScenarioEditorDock.CHEATSHEET: return i18n.drawer.cheatSheet.title; case TestScenarioEditorDock.DATA_OBJECT: - return testScenarioSettings.assetType === TestScenarioType[TestScenarioType.DMN] + return testScenarioType === "DMN" ? i18n.drawer.dataSelector.titleDMN : i18n.drawer.dataSelector.titleRule; case TestScenarioEditorDock.SETTINGS: return i18n.drawer.settings.title; default: - throw new Error("Wrong state, an invalid dock has been selected " + selectedDock); + throw new Error("Wrong state, an invalid dock has been selected " + navigation.dock.selected); } })()} @@ -96,30 +70,15 @@ function TestScenarioDrawerPanel({ {(() => { - switch (selectedDock) { + switch (navigation.dock.selected) { case TestScenarioEditorDock.CHEATSHEET: - return ; + return ; case TestScenarioEditorDock.DATA_OBJECT: - return ( - - ); + return ; case TestScenarioEditorDock.SETTINGS: - return ( - - ); + return ; default: - throw new Error("Wrong state, an invalid dock has been selected " + selectedDock); + throw new Error("Wrong state, an invalid dock has been selected " + navigation.dock.selected); } })()} diff --git a/packages/scesim-editor/src/drawer/TestScenarioDrawerSettingsPanel.tsx b/packages/scesim-editor/src/drawer/TestScenarioDrawerSettingsPanel.tsx index 6e6f421e9a4..d8dc56ea324 100644 --- a/packages/scesim-editor/src/drawer/TestScenarioDrawerSettingsPanel.tsx +++ b/packages/scesim-editor/src/drawer/TestScenarioDrawerSettingsPanel.tsx @@ -17,58 +17,74 @@ * under the License. */ import * as React from "react"; +import { useCallback } from "react"; import { Checkbox } from "@patternfly/react-core/dist/esm/components/Checkbox"; import { FormSelect, FormSelectOption } from "@patternfly/react-core/dist/esm/components/FormSelect"; +import { HelpIcon } from "@patternfly/react-icons/dist/esm/icons/help-icon"; +import { Icon } from "@patternfly/react-core/dist/esm/components/Icon/Icon"; import { TextInput } from "@patternfly/react-core/dist/js/components/TextInput"; import { Title } from "@patternfly/react-core/dist/js/components/Title"; +import { Tooltip } from "@patternfly/react-core/dist/esm/components/Tooltip"; -import { TestScenarioSettings, TestScenarioType } from "../TestScenarioEditor"; -import { useTestScenarioEditorI18n } from "../i18n"; +import { SceSim__settingsType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; -import { HelpIcon } from "@patternfly/react-icons/dist/esm/icons/help-icon"; -import { Icon } from "@patternfly/react-core/dist/esm/components/Icon/Icon"; -import { Tooltip } from "@patternfly/react-core/dist/esm/components/Tooltip"; +import { useTestScenarioEditorI18n } from "../i18n"; +import { useTestScenarioEditorStore, useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext"; import "./TestScenarioDrawerSettingsPanel.css"; +import { useTestScenarioEditor } from "../TestScenarioEditorContext"; -function TestScenarioDrawerSettingsPanel({ - fileName, - onUpdateSettingField, - testScenarioSettings, -}: { - fileName: string; - onUpdateSettingField: (field: string, value: boolean | string) => void; - testScenarioSettings: TestScenarioSettings; -}) { +function TestScenarioDrawerSettingsPanel() { const { i18n } = useTestScenarioEditorI18n(); + const { openFileNormalizedPosixPathRelativeToTheWorkspaceRoot } = useTestScenarioEditor(); + const settingsModel = useTestScenarioEditorStore((state) => state.scesim.model.ScenarioSimulationModel.settings); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); + const testScenarioType = settingsModel.type?.__$$text.toUpperCase(); + + const updateSettingsField = useCallback( + (fieldName: keyof SceSim__settingsType, value: string | boolean) => + testScenarioEditorStoreApi.setState((state) => { + (state.scesim.model.ScenarioSimulationModel.settings[fieldName] as { __$$text: string | boolean }) = { + __$$text: value, + }; + }), + [testScenarioEditorStoreApi] + ); return ( <> {i18n.drawer.settings.fileName} - + {i18n.drawer.settings.assetType} - {testScenarioSettings.assetType === TestScenarioType[TestScenarioType.DMN] ? ( + {testScenarioType === "DMN" ? ( <> {i18n.drawer.settings.dmnModel} {/* Temporary Mocked */} @@ -77,19 +93,21 @@ function TestScenarioDrawerSettingsPanel({ {i18n.drawer.settings.dmnName} {i18n.drawer.settings.dmnNameSpace} ) : ( @@ -103,11 +121,12 @@ function TestScenarioDrawerSettingsPanel({ onUpdateSettingField("dmoSession", value)} + onChange={(value) => updateSettingsField("dmoSession", value)} placeholder={i18n.drawer.settings.kieSessionRulePlaceholder} type="text" - value={testScenarioSettings.kieSessionRule} + value={settingsModel.dmoSession?.__$$text} /> {i18n.drawer.settings.ruleFlowGroup} @@ -118,19 +137,20 @@ function TestScenarioDrawerSettingsPanel({ </Tooltip> onUpdateSettingField("ruleFlowGroup", value)} + onChange={(value) => updateSettingsField("ruleFlowGroup", value)} placeholder={i18n.drawer.settings.ruleFlowGroupPlaceholder} type="text" - value={testScenarioSettings.ruleFlowGroup} + value={settingsModel.ruleFlowGroup?.__$$text} />
onUpdateSettingField("stateless", value)} + onChange={(value) => updateSettingsField("stateless", value)} />
@@ -145,9 +165,9 @@ function TestScenarioDrawerSettingsPanel({
onUpdateSettingField("skipFromBuild", value)} + onChange={(value) => updateSettingsField("skipFromBuild", value)} />
diff --git a/packages/scesim-editor/src/externalModels/TestScenarioEditorDependenciesContext.tsx b/packages/scesim-editor/src/externalModels/TestScenarioEditorDependenciesContext.tsx new file mode 100644 index 00000000000..b74b9447f3d --- /dev/null +++ b/packages/scesim-editor/src/externalModels/TestScenarioEditorDependenciesContext.tsx @@ -0,0 +1,64 @@ +/* + * 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. + */ + +import * as React from "react"; +import { useContext, useMemo } from "react"; +import { + OnRequestExternalModelsAvailableToInclude, + OnRequestExternalModelByPath, + ExternalDmnsIndex, +} from "../TestScenarioEditor"; + +export interface TestScenarioEditorExternalModelsContextType { + onRequestExternalModelByPath?: OnRequestExternalModelByPath; + onRequestExternalModelsAvailableToInclude?: OnRequestExternalModelsAvailableToInclude; + externalModelsByNamespace?: ExternalDmnsIndex; +} + +const TestScenarioEditorExternalModelsContext = React.createContext( + {} as any +); + +export function useExternalModels() { + return useContext(TestScenarioEditorExternalModelsContext); +} + +export function TestScenarioEditorExternalModelsContextProvider( + _props: React.PropsWithChildren +) { + const { children, ...props } = _props; + + const value = useMemo(() => { + return { + externalModelsByNamespace: props.externalModelsByNamespace, + onRequestExternalModelByPath: props.onRequestExternalModelByPath, + onRequestExternalModelsAvailableToInclude: props.onRequestExternalModelsAvailableToInclude, + }; + }, [ + props.externalModelsByNamespace, + props.onRequestExternalModelByPath, + props.onRequestExternalModelsAvailableToInclude, + ]); + + return ( + + {children} + + ); +} diff --git a/packages/scesim-editor/src/hook/useEffectAfterFirstRender.ts b/packages/scesim-editor/src/hook/useEffectAfterFirstRender.ts new file mode 100644 index 00000000000..df84f4b1ae9 --- /dev/null +++ b/packages/scesim-editor/src/hook/useEffectAfterFirstRender.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +import { useEffect, useRef } from "react"; + +export function useEffectAfterFirstRender(effect: Parameters[0], b: React.DependencyList) { + const didMountRef = useRef(false); + + useEffect(() => { + if (didMountRef.current) { + return effect(); + } + didMountRef.current = true; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, b); +} diff --git a/packages/scesim-editor/src/i18n/TestScenarioEditorI18n.ts b/packages/scesim-editor/src/i18n/TestScenarioEditorI18n.ts index be68682f4d4..1eaebb8771b 100644 --- a/packages/scesim-editor/src/i18n/TestScenarioEditorI18n.ts +++ b/packages/scesim-editor/src/i18n/TestScenarioEditorI18n.ts @@ -115,6 +115,12 @@ interface TestScenarioEditorDictionary extends ReferenceDictionary { title: string; }; }; + errorFallBack: { + title: string; + body: string; + lastActionButton: string; + fileIssueHref: string; + }; sidebar: { cheatSheetTooltip: string; dataSelectorTooltip: string; diff --git a/packages/scesim-editor/src/i18n/locales/en.ts b/packages/scesim-editor/src/i18n/locales/en.ts index 72de8ce02cc..888f1e2b871 100644 --- a/packages/scesim-editor/src/i18n/locales/en.ts +++ b/packages/scesim-editor/src/i18n/locales/en.ts @@ -137,6 +137,12 @@ export const en: TestScenarioEditorI18n = { title: "Settings", }, }, + errorFallBack: { + title: "An unexpected error happened", + body: "This is a bug. Please consider reporting it so the DMN Editor can continue improving. See the details below.", + lastActionButton: "Try undoing last action", + fileIssueHref: "File an issue", + }, sidebar: { cheatSheetTooltip: "CheatSheet: Useful information for Test Scenario Usage", dataSelectorTooltip: "Selector: It provides a tool to edit your Scenarios", diff --git a/packages/scesim-editor/src/mutations/addColumn.ts b/packages/scesim-editor/src/mutations/addColumn.ts new file mode 100644 index 00000000000..ab5a22bf7a3 --- /dev/null +++ b/packages/scesim-editor/src/mutations/addColumn.ts @@ -0,0 +1,183 @@ +/* + * 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. + */ + +import _ from "lodash"; +import { v4 as uuid } from "uuid"; + +import { + SceSim__FactMappingType, + SceSim__FactMappingValuesTypes, +} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; +import { InsertRowColumnsDirection } from "@kie-tools/boxed-expression-component/dist/api/BeeTable"; + +export function addColumn({ + beforeIndex, + factMappings, + factMappingValues, + insertDirection, + isInstance, + selectedColumnFactMappingIndex, +}: { + beforeIndex: number; + factMappings: SceSim__FactMappingType[]; + factMappingValues: SceSim__FactMappingValuesTypes[]; + insertDirection: InsertRowColumnsDirection; + isInstance: boolean; + selectedColumnFactMappingIndex: number; +}) { + const selectedColumnFactMapping = factMappings[selectedColumnFactMappingIndex]; + const targetColumnIndex = determineNewColumnTargetIndex( + factMappings, + insertDirection, + isInstance, + selectedColumnFactMappingIndex, + selectedColumnFactMapping + ); + + const instanceDefaultNames = factMappings + .filter((factMapping) => factMapping.factAlias!.__$$text.startsWith("INSTANCE-")) + .map((factMapping) => factMapping.factAlias!.__$$text); + + const isNewInstance = isInstance || selectedColumnFactMapping.factIdentifier.className?.__$$text === "java.lang.Void"; + + const newFactMapping = { + className: { __$$text: "java.lang.Void" }, + columnWidth: { __$$text: 150 }, + expressionAlias: { __$$text: "PROPERTY" }, + expressionElements: isNewInstance + ? undefined + : { + ExpressionElement: [ + { + step: { + __$$text: selectedColumnFactMapping.expressionElements!.ExpressionElement![0].step.__$$text, + }, + }, + ], + }, + expressionIdentifier: { + name: { __$$text: `_${uuid()}`.toLocaleUpperCase() }, + type: { __$$text: selectedColumnFactMapping.expressionIdentifier.type!.__$$text }, + }, + factAlias: { + __$$text: isNewInstance + ? getNextAvailablePrefixedName(instanceDefaultNames, "INSTANCE") + : selectedColumnFactMapping.factAlias.__$$text, + }, + factIdentifier: { + name: { + __$$text: isNewInstance + ? getNextAvailablePrefixedName(instanceDefaultNames, "INSTANCE") + : selectedColumnFactMapping.factIdentifier.name!.__$$text, + }, + className: { + __$$text: isNewInstance ? "java.lang.Void" : selectedColumnFactMapping.factIdentifier.className!.__$$text, + }, + }, + factMappingValueType: { __$$text: "NOT_EXPRESSION" }, + }; + + factMappings.splice(targetColumnIndex, 0, newFactMapping); + + factMappingValues.forEach((scenario) => { + scenario.factMappingValues.FactMappingValue!.splice(beforeIndex + 1, 0, { + expressionIdentifier: { + name: { __$$text: newFactMapping.expressionIdentifier.name.__$$text }, + type: { __$$text: newFactMapping.expressionIdentifier.type.__$$text }, + }, + factIdentifier: { + name: { __$$text: newFactMapping.factIdentifier.name.__$$text }, + className: { __$$text: newFactMapping.factIdentifier.className.__$$text }, + }, + rawValue: { __$$text: "", "@_class": "string" }, + }); + }); +} + +/* It determines in which index position a column should be added. In case of a field, the new column index is simply + in the right or in the left of the selected column. In case of a new instance, it's required to find the first column + index outside the selected Instance group. */ +const determineNewColumnTargetIndex = ( + factMappings: SceSim__FactMappingType[], + insertDirection: InsertRowColumnsDirection, + isInstance: boolean, + selectedColumnIndex: number, + selectedFactMapping: SceSim__FactMappingType +) => { + const groupType = selectedFactMapping.expressionIdentifier.type!.__$$text; + const instanceName = selectedFactMapping.factIdentifier.name!.__$$text; + const instanceType = selectedFactMapping.factIdentifier.className!.__$$text; + + if (!isInstance) { + if (insertDirection === InsertRowColumnsDirection.AboveOrRight) { + return selectedColumnIndex + 1; + } else { + return selectedColumnIndex; + } + } + + let newColumnTargetColumn = -1; + + if (insertDirection === InsertRowColumnsDirection.AboveOrRight) { + for (let i = selectedColumnIndex; i < factMappings.length; i++) { + const currentFM = factMappings[i]; + if ( + currentFM.expressionIdentifier.type!.__$$text === groupType && + currentFM.factIdentifier.name?.__$$text === instanceName && + currentFM.factIdentifier.className?.__$$text === instanceType + ) { + if (i == factMappings.length - 1) { + newColumnTargetColumn = i + 1; + } + } else { + newColumnTargetColumn = i; + break; + } + } + } else { + for (let i = selectedColumnIndex; i >= 0; i--) { + const currentFM = factMappings[i]; + + if ( + currentFM.expressionIdentifier.type!.__$$text === groupType && + currentFM.factIdentifier.name?.__$$text === instanceName && + currentFM.factIdentifier.className?.__$$text === instanceType + ) { + if (i == 0) { + newColumnTargetColumn = 0; + } + } else { + newColumnTargetColumn = i + 1; + break; + } + } + } + + return newColumnTargetColumn; +}; + +const getNextAvailablePrefixedName = ( + names: string[], + namePrefix: string, + lastIndex: number = names.length +): string => { + const candidate = `${namePrefix}-${lastIndex + 1}`; + const elemWithCandidateName = names.indexOf(candidate); + return elemWithCandidateName >= 0 ? getNextAvailablePrefixedName(names, namePrefix, lastIndex + 1) : candidate; +}; diff --git a/packages/scesim-editor/src/mutations/addRow.ts b/packages/scesim-editor/src/mutations/addRow.ts new file mode 100644 index 00000000000..65887921b4e --- /dev/null +++ b/packages/scesim-editor/src/mutations/addRow.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +import { + SceSim__FactMappingType, + SceSim__FactMappingValuesTypes, +} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; + +export function addRow({ + beforeIndex, + factMappings, + factMappingValues, +}: { + beforeIndex: number; + factMappings: SceSim__FactMappingType[]; + factMappingValues: SceSim__FactMappingValuesTypes[]; +}) { + /* Creating a new Scenario (Row) composed by a list of FactMappingValues. The list order is not relevant. */ + const factMappingValuesItems = factMappings.map((factMapping) => { + return { + expressionIdentifier: { + name: { __$$text: factMapping.expressionIdentifier.name!.__$$text }, + type: { __$$text: factMapping.expressionIdentifier.type!.__$$text }, + }, + factIdentifier: { + name: { __$$text: factMapping.factIdentifier.name!.__$$text }, + className: { __$$text: factMapping.factIdentifier.className!.__$$text }, + }, + rawValue: { __$$text: "", "@_class": "string" }, + }; + }); + + const newScenario = { + factMappingValues: { + FactMappingValue: factMappingValuesItems, + }, + }; + + factMappingValues.splice(beforeIndex, 0, newScenario); +} diff --git a/packages/scesim-editor/src/mutations/deleteColumn.ts b/packages/scesim-editor/src/mutations/deleteColumn.ts new file mode 100644 index 00000000000..07137ff667d --- /dev/null +++ b/packages/scesim-editor/src/mutations/deleteColumn.ts @@ -0,0 +1,87 @@ +/* + * 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. + */ + +import _, { isNumber } from "lodash"; +import { + SceSim__FactMappingType, + SceSim__FactMappingValuesTypes, +} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; + +export function deleteColumn({ + factMappingIndexToRemove, + factMappings, + factMappingValues, + isBackground, + isInstance, + selectedColumnIndex, +}: { + factMappingIndexToRemove: number; + factMappings: SceSim__FactMappingType[]; + factMappingValues: SceSim__FactMappingValuesTypes[]; + isBackground: boolean; + isInstance: boolean; + selectedColumnIndex: number; +}): { + deletedFactMappingIndexs: number[]; +} { + /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact + FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings + that belongs to the the instance group */ + const factMappingToRemove = factMappings[factMappingIndexToRemove]; + const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text; + const instanceName = factMappingToRemove.factIdentifier.name!.__$$text; + const instanceType = factMappingToRemove.factIdentifier.className!.__$$text; + + const allFactMappingWithIndexesToRemove = isInstance + ? factMappings + .map((factMapping, index) => { + if ( + factMapping.expressionIdentifier.type!.__$$text === groupType && + factMapping.factIdentifier.name?.__$$text === instanceName && + factMapping.factIdentifier.className?.__$$text === instanceType + ) { + return { factMappingIndex: index, factMapping: factMapping }; + } else { + return {}; + } + }) + .filter((item) => isNumber(item.factMappingIndex)) + : [{ factMappingIndex: selectedColumnIndex + (isBackground ? 0 : 1), factMapping: factMappingToRemove }]; + + factMappings.splice(allFactMappingWithIndexesToRemove[0].factMappingIndex!, allFactMappingWithIndexesToRemove.length); + + factMappingValues.forEach((rowData) => { + allFactMappingWithIndexesToRemove.forEach((itemToRemove) => { + const factMappingValueColumnIndexToRemove = rowData.factMappingValues.FactMappingValue!.findIndex( + (factMappingValue) => + factMappingValue.factIdentifier.name?.__$$text === itemToRemove.factMapping!.factIdentifier.name?.__$$text && + factMappingValue.factIdentifier.className?.__$$text === + itemToRemove.factMapping!.factIdentifier.className?.__$$text && + factMappingValue.expressionIdentifier.name?.__$$text === + itemToRemove.factMapping!.expressionIdentifier.name?.__$$text && + factMappingValue.expressionIdentifier.type?.__$$text === + itemToRemove.factMapping!.expressionIdentifier.type?.__$$text + ); + + rowData.factMappingValues.FactMappingValue!.splice(factMappingValueColumnIndexToRemove, 1); + }); + }); + + return { deletedFactMappingIndexs: allFactMappingWithIndexesToRemove.flatMap((item) => item.factMappingIndex!) }; +} diff --git a/packages/scesim-editor/src/mutations/deleteRow.ts b/packages/scesim-editor/src/mutations/deleteRow.ts new file mode 100644 index 00000000000..26f14903a7d --- /dev/null +++ b/packages/scesim-editor/src/mutations/deleteRow.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +import { SceSim__FactMappingValuesTypes } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; + +export function deleteRow({ + rowIndex, + factMappingValues, +}: { + rowIndex: number; + factMappingValues: SceSim__FactMappingValuesTypes[]; +}) { + factMappingValues.splice(rowIndex, 1); +} diff --git a/packages/form-generation-tool/tests/generation/fs/loadProjectSchemas.test.ts b/packages/scesim-editor/src/mutations/duplicateRow.ts similarity index 55% rename from packages/form-generation-tool/tests/generation/fs/loadProjectSchemas.test.ts rename to packages/scesim-editor/src/mutations/duplicateRow.ts index 4d9933b5fab..268da3f826f 100644 --- a/packages/form-generation-tool/tests/generation/fs/loadProjectSchemas.test.ts +++ b/packages/scesim-editor/src/mutations/duplicateRow.ts @@ -17,20 +17,25 @@ * under the License. */ -import { loadProjectSchemas } from "../../../src/generation/fs"; -import { FormSchema } from "../../../src/generation/types"; +import { SceSim__FactMappingValuesTypes } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; -describe("loadProjectSchemas tests", () => { - it("Load project without schemas", () => { - expect(loadProjectSchemas(`${__dirname}/resources/empty`)).toHaveLength(0); - }); +export function dupliacteRow({ + rowIndex, + factMappingValues, +}: { + rowIndex: number; + factMappingValues: SceSim__FactMappingValuesTypes[]; +}) { + /* It simply clones a Scenario (Row) and adds it in a current-cloned Scenario list */ + const factMappingValuesItems = JSON.parse( + JSON.stringify(factMappingValues[rowIndex].factMappingValues.FactMappingValue) + ); - it("Load project with schemas", () => { - const schemas: FormSchema[] = loadProjectSchemas(`${__dirname}/resources/full`, "schemas"); + const newScenario = { + factMappingValues: { + FactMappingValue: factMappingValuesItems, + }, + }; - expect(schemas).toHaveLength(2); - - expect(schemas[0].name).toBe("travels_ApplyForVisa"); - expect(schemas[1].name).toBe("travels_ConfirmTravel"); - }); -}); + factMappingValues.splice(rowIndex, 0, newScenario); +} diff --git a/packages/scesim-editor/src/mutations/updateCell.ts b/packages/scesim-editor/src/mutations/updateCell.ts new file mode 100644 index 00000000000..3a984fb32c7 --- /dev/null +++ b/packages/scesim-editor/src/mutations/updateCell.ts @@ -0,0 +1,52 @@ +/* + * 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. + */ + +import { + SceSim__FactMappingType, + SceSim__FactMappingValuesTypes, +} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; + +export function updateCell({ + columnIndex, + factMappings, + factMappingValuesTypes, + rowIndex, + value, +}: { + columnIndex: number; + factMappings: SceSim__FactMappingType[]; + factMappingValuesTypes: SceSim__FactMappingValuesTypes[]; + rowIndex: number; + value: any; +}) { + /* To update the related FactMappingValue, it compares every FactMappingValue associated with the Scenario (Row) + that contains the cell with the FactMapping (Column) fields factIdentifier and expressionIdentifier */ + const factMapping = factMappings[columnIndex]; + const factMappingValues = factMappingValuesTypes[rowIndex].factMappingValues.FactMappingValue!; + + const factMappingValueToUpdateIndex = factMappingValues.findIndex( + (factMappingValue) => + factMappingValue.factIdentifier.name?.__$$text === factMapping!.factIdentifier.name?.__$$text && + factMappingValue.factIdentifier.className?.__$$text === factMapping!.factIdentifier.className?.__$$text && + factMappingValue.expressionIdentifier.name?.__$$text === factMapping!.expressionIdentifier.name?.__$$text && + factMappingValue.expressionIdentifier.type?.__$$text === factMapping!.expressionIdentifier.type?.__$$text + ); + const factMappingValueToUpdate = factMappingValues[factMappingValueToUpdateIndex]; + factMappingValueToUpdate.rawValue = { __$$text: value }; +} diff --git a/packages/scesim-editor/src/mutations/updateColumn.ts b/packages/scesim-editor/src/mutations/updateColumn.ts new file mode 100644 index 00000000000..081e78de4c4 --- /dev/null +++ b/packages/scesim-editor/src/mutations/updateColumn.ts @@ -0,0 +1,84 @@ +/* + * 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. + */ + +import _ from "lodash"; +import { + SceSim__FactMappingType, + SceSim__FactMappingValuesTypes, +} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; + +export function updateColumn({ + className, + expressionAlias, + expressionElementsSteps, + expressionIdentifierName, + expressionIdentifierType, + factMappings, + factMappingValuesTypes, + factMappingValueType, + factClassName, + factIdentifierClassName, + factIdentifierName, + factName, + selectedColumnIndex, +}: { + className: string; + expressionAlias: string; + expressionElementsSteps: string[]; + expressionIdentifierName: string | undefined; + expressionIdentifierType: string | undefined; + factMappings: SceSim__FactMappingType[]; + factMappingValuesTypes: SceSim__FactMappingValuesTypes[]; + factMappingValueType: "EXPRESSION" | "NOT_EXPRESSION"; + factClassName: string; + factIdentifierClassName: string | undefined; + factIdentifierName: string | undefined; + factName: string; + selectedColumnIndex: number; +}): { updatedFactMapping: SceSim__FactMappingType } { + const factMappingToUpdate = factMappings[selectedColumnIndex]; + factMappingToUpdate.className = { __$$text: className }; + factMappingToUpdate.factAlias = { __$$text: factName }; + factMappingToUpdate.factIdentifier.className = { __$$text: factClassName }; + factMappingToUpdate.factIdentifier.name = { __$$text: factName }; + factMappingToUpdate.factMappingValueType = { __$$text: factMappingValueType }; + factMappingToUpdate.expressionAlias = { __$$text: expressionAlias }; + factMappingToUpdate.expressionElements = { + ExpressionElement: expressionElementsSteps.map((ee) => { + return { step: { __$$text: ee } }; + }), + }; + + factMappingValuesTypes.forEach((fmv) => { + const factMappingValues = fmv.factMappingValues.FactMappingValue!; + const factMappingValueToUpdateIndex = factMappingValues.findIndex( + (factMappingValue) => + factMappingValue.factIdentifier.name?.__$$text === factIdentifierName && + factMappingValue.factIdentifier.className?.__$$text === factIdentifierClassName && + factMappingValue.expressionIdentifier.name?.__$$text === expressionIdentifierName && + factMappingValue.expressionIdentifier.type?.__$$text === expressionIdentifierType + ); + const factMappingValueToUpdate = factMappingValues[factMappingValueToUpdateIndex]; + factMappingValueToUpdate.factIdentifier.className = { __$$text: factClassName }; + factMappingValueToUpdate.factIdentifier.name = { __$$text: factName }; + //factMappingValueToUpdate.rawValue = { __$$text: update.value }, //TODO 2 related see kie-issues#1514 + }); + + return { updatedFactMapping: JSON.parse(JSON.stringify(factMappingToUpdate)) }; +} diff --git a/packages/form-generation-tool/webpack.config.js b/packages/scesim-editor/src/mutations/updateColumnWidth.ts similarity index 63% rename from packages/form-generation-tool/webpack.config.js rename to packages/scesim-editor/src/mutations/updateColumnWidth.ts index 6063e28adf9..8a59346ad03 100644 --- a/packages/form-generation-tool/webpack.config.js +++ b/packages/scesim-editor/src/mutations/updateColumnWidth.ts @@ -17,19 +17,22 @@ * under the License. */ -const nodeExternals = require("webpack-node-externals"); -const { merge } = require("webpack-merge"); -const common = require("@kie-tools-core/webpack-base/webpack.common.config"); +import { SceSim__FactMappingType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; -module.exports = (env, argv) => [ - merge(common(env, argv), { - entry: { - index: "./src/index.ts", - }, - target: "node", - output: { - libraryTarget: "commonjs2", - }, - externals: [nodeExternals({ modulesDir: "../../node_modules" })], - }), -]; +export function updateColumnWidth({ + factMappings, + columnIndex, + newWidth, + oldWidth, +}: { + factMappings: SceSim__FactMappingType[]; + columnIndex: number; + newWidth: number | undefined; + oldWidth: number | undefined; +}) { + if (newWidth && oldWidth !== newWidth) { + factMappings[columnIndex].columnWidth = { + __$$text: newWidth, + }; + } +} diff --git a/packages/scesim-editor/src/reactExt/ErrorBoundary.tsx b/packages/scesim-editor/src/reactExt/ErrorBoundary.tsx deleted file mode 100644 index e61f50af242..00000000000 --- a/packages/scesim-editor/src/reactExt/ErrorBoundary.tsx +++ /dev/null @@ -1,62 +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. - */ - -import * as React from "react"; -import { ErrorInfo } from "react"; - -interface State { - hasError: boolean; -} - -interface Props { - children: React.ReactNode; - error: React.ReactNode; - setError?: React.Dispatch; -} - -export class ErrorBoundary extends React.Component { - constructor(props: any) { - super(props); - this.state = { hasError: false }; - } - - public reset() { - this.props.setError?.(null); - this.setState({ hasError: false }); - } - - public componentDidCatch(error: Error, errorInfo: ErrorInfo) { - this.props.setError?.(error); - console.error(error); - } - - public render() { - if (this.state.hasError) { - return this.props.error; - } - - return this.props.children; - } - - public static getDerivedStateFromError(error: Error) { - return { hasError: true }; - } -} - -export default ErrorBoundary; diff --git a/packages/scesim-editor/src/sidebar/TestScenarioSideBarMenu.tsx b/packages/scesim-editor/src/sidebar/TestScenarioSideBarMenu.tsx index df9671c6bb9..de41743c500 100644 --- a/packages/scesim-editor/src/sidebar/TestScenarioSideBarMenu.tsx +++ b/packages/scesim-editor/src/sidebar/TestScenarioSideBarMenu.tsx @@ -27,25 +27,32 @@ import CogIcon from "@patternfly/react-icons/dist/esm/icons/cog-icon"; import EditIcon from "@patternfly/react-icons/dist/esm/icons/edit-alt-icon"; import InfoIcon from "@patternfly/react-icons/dist/esm/icons/info-icon"; -import { TestScenarioEditorDock } from "../TestScenarioEditor"; import { useTestScenarioEditorI18n } from "../i18n"; +import { TestScenarioEditorDock } from "../store/TestScenarioEditorStore"; +import { useTestScenarioEditorStore, useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext"; import "./TestScenarioSideBarMenu.css"; -function TestScenarioSideBarMenu({ - onSideBarButtonClicked, - selectedSideBarMenuItem, -}: { - onSideBarButtonClicked: (selected: TestScenarioEditorDock) => void; - selectedSideBarMenuItem: { isOpen: boolean; selected: TestScenarioEditorDock }; -}) { +function TestScenarioSideBarMenu() { const { i18n } = useTestScenarioEditorI18n(); + const navigation = useTestScenarioEditorStore((state) => state.navigation); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); const isSelectedMenuItem = useCallback( (item: TestScenarioEditorDock) => { - return selectedSideBarMenuItem.isOpen && selectedSideBarMenuItem.selected === item; + return navigation.dock.isOpen && navigation.dock.selected === item; }, - [selectedSideBarMenuItem] + [navigation.dock] + ); + + const updateSelectedDock = useCallback( + (selected: TestScenarioEditorDock) => { + testScenarioEditorStoreApi.setState((state) => { + state.navigation.dock.isOpen = true; + state.navigation.dock.selected = selected; + }); + }, + [testScenarioEditorStoreApi] ); return ( @@ -58,7 +65,7 @@ function TestScenarioSideBarMenu({ : "kie-scesim-editor-side-bar-menu--button" } variant="plain" - onClick={() => onSideBarButtonClicked(TestScenarioEditorDock.DATA_OBJECT)} + onClick={() => updateSelectedDock(TestScenarioEditorDock.DATA_OBJECT)} icon={} /> @@ -70,7 +77,7 @@ function TestScenarioSideBarMenu({ : "kie-scesim-editor-side-bar-menu--button" } icon={} - onClick={() => onSideBarButtonClicked(TestScenarioEditorDock.CHEATSHEET)} + onClick={() => updateSelectedDock(TestScenarioEditorDock.CHEATSHEET)} variant="plain" />
@@ -82,7 +89,7 @@ function TestScenarioSideBarMenu({ : "kie-scesim-editor-side-bar-menu--button" } icon={} - onClick={() => onSideBarButtonClicked(TestScenarioEditorDock.SETTINGS)} + onClick={() => updateSelectedDock(TestScenarioEditorDock.SETTINGS)} variant="plain" /> diff --git a/packages/scesim-editor/src/store/ComputedStateCache.ts b/packages/scesim-editor/src/store/ComputedStateCache.ts new file mode 100644 index 00000000000..400595c931b --- /dev/null +++ b/packages/scesim-editor/src/store/ComputedStateCache.ts @@ -0,0 +1,96 @@ +/* + * 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. + */ + +export type TypeOrReturnType = T extends (...args: any[]) => any ? ReturnType : T; + +export type CacheEntry = { + value: TypeOrReturnType | undefined; + dependencies: readonly any[]; +}; + +export type Cache = { + [K in keyof T]: CacheEntry; +}; + +let r: number = 0; + +export class ComputedStateCache> { + private readonly cache: Cache; + + constructor(initialValues: Cache) { + this.cache = { ...initialValues }; + } + + public cached( + key: K, + delegate: (...dependencies: D) => TypeOrReturnType, + dependencies: D + ): TypeOrReturnType { + r++; + + const cachedDeps = this.cache[key]?.dependencies ?? []; + + let depsAreEqual = cachedDeps.length === dependencies.length; + if (depsAreEqual) { + for (let i = 0; i < cachedDeps.length; i++) { + if (!Object.is(cachedDeps[i], dependencies[i])) { + depsAreEqual = false; + } + } + } + + if (depsAreEqual) { + return this.cache[key].value!; + } + + const v = delegate(...dependencies); + this.cache[key].dependencies = dependencies; + this.cache[key].value = v; + return v; + } + + public cachedData( + key: K, + delegate: (...data: Y) => TypeOrReturnType, + data: Y, + dependencies: D + ): TypeOrReturnType { + r++; + + const cachedDeps = this.cache[key]?.dependencies ?? []; + + let depsAreEqual = cachedDeps.length === dependencies.length; + if (depsAreEqual) { + for (let i = 0; i < cachedDeps.length; i++) { + if (!Object.is(cachedDeps[i], dependencies[i])) { + depsAreEqual = false; + } + } + } + + if (depsAreEqual) { + return this.cache[key].value!; + } + + const v = delegate(...data); + this.cache[key].dependencies = dependencies; + this.cache[key].value = v; + return v; + } +} diff --git a/packages/scesim-editor/src/store/TestScenarioEditorStore.ts b/packages/scesim-editor/src/store/TestScenarioEditorStore.ts new file mode 100644 index 00000000000..7be9d3f10ec --- /dev/null +++ b/packages/scesim-editor/src/store/TestScenarioEditorStore.ts @@ -0,0 +1,164 @@ +/* + * 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. + */ + +import { SceSimModel } from "@kie-tools/scesim-marshaller"; +import { enableMapSet } from "immer"; +import { create } from "zustand"; +import { immer } from "zustand/middleware/immer"; + +import { SceSim__FactMappingType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; + +import { ComputedStateCache } from "./ComputedStateCache"; +import { computeTestScenarioDataObjects } from "./computed/computeTestScenarioDataObjects"; + +enableMapSet(); // Necessary because `Computed` has a lot of Maps and Sets. + +export enum TestScenarioEditorDock { + CHEATSHEET, + DATA_OBJECT, + SETTINGS, +} + +export enum TestScenarioEditorTab { + BACKGROUND, + SIMULATION, +} + +export type TestScenarioAlert = { + enabled: boolean; + message?: string; + variant: "success" | "danger" | "warning" | "info" | "default"; +}; + +export type TestScenarioDataObject = { + id: string; + children?: TestScenarioDataObject[]; + customBadgeContent?: string; + isSimpleTypeFact?: boolean; + name: string; +}; + +export type TestScenarioSelectedColumnMetaData = { + factMapping: SceSim__FactMappingType; + index: number; + isBackground: boolean; +}; + +export interface State { + computed: (s: State) => Computed; + dispatch: (s: State) => Dispatch; + navigation: { + dock: { + isOpen: boolean; + selected: TestScenarioEditorDock; + }; + tab: TestScenarioEditorTab; + }; + scesim: { model: SceSimModel }; + table: { + background: { + selectedColumn: TestScenarioSelectedColumnMetaData | null; + }; + simulation: { + selectedColumn: TestScenarioSelectedColumnMetaData | null; + }; + }; +} + +// Read this to understand why we need computed as part of the store. +// https://github.com/pmndrs/zustand/issues/132#issuecomment-1120467721 +export type Computed = { + getTestScenarioDataObjects(): TestScenarioDataObject[]; +}; + +export type Dispatch = { + scesim: { + reset: () => void; + }; + table: { + updateSelectedColumn: (columnMetadata: TestScenarioSelectedColumnMetaData | null) => void; + }; +}; + +export const defaultStaticState = (): Omit => ({ + navigation: { + dock: { + isOpen: true, + selected: TestScenarioEditorDock.DATA_OBJECT, + }, + tab: TestScenarioEditorTab.SIMULATION, + }, + table: { + background: { + selectedColumn: null, + }, + simulation: { + selectedColumn: null, + }, + }, +}); + +export function createTestScenarioEditorStore(model: SceSimModel, computedCache: ComputedStateCache) { + console.trace("[TestScenarioEditorStore] Creating store with above model and empty cache "); + console.trace(model); + + const { ...defaultState } = defaultStaticState(); + return create( + immer(() => ({ + ...defaultState, + scesim: { + model: model, + }, + dispatch(state: State) { + return { + scesim: { + reset: () => { + state.navigation.tab = TestScenarioEditorTab.SIMULATION; + state.navigation.dock.isOpen = true; + state.navigation.dock.selected = TestScenarioEditorDock.DATA_OBJECT; + state.table.background.selectedColumn = null; + state.table.simulation.selectedColumn = null; + }, + }, + table: { + updateSelectedColumn: (columnMetadata: TestScenarioSelectedColumnMetaData) => { + if (state.navigation.tab === TestScenarioEditorTab.BACKGROUND) { + state.table.background.selectedColumn = columnMetadata; + } else { + state.table.simulation.selectedColumn = columnMetadata; + } + }, + }, + }; + }, + computed(state: State) { + return { + getTestScenarioDataObjects: () => { + return computedCache.cachedData( + "getTestScenarioDataObjects", + computeTestScenarioDataObjects, + [state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping], + [state.scesim.model.ScenarioSimulationModel.settings.type] + ); + }, + }; + }, + })) + ); +} diff --git a/packages/scesim-editor/src/store/TestScenarioStoreContext.ts b/packages/scesim-editor/src/store/TestScenarioStoreContext.ts new file mode 100644 index 00000000000..f910fc424dc --- /dev/null +++ b/packages/scesim-editor/src/store/TestScenarioStoreContext.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +import { createContext, useContext } from "react"; +import { StoreApi, UseBoundStore } from "zustand"; +import { WithImmer } from "zustand/middleware/immer"; +import { useStoreWithEqualityFn } from "zustand/traditional"; +import { State } from "./TestScenarioEditorStore"; + +type ExtractState = StoreApi extends { getState: () => infer T } ? T : never; + +export type StoreApiType = UseBoundStore>>; + +export const TestScenarioEditorStoreApiContext = createContext({} as any); + +export function useTestScenarioEditorStore( + selector: (state: State) => StateSlice, + equalityFn?: (a: StateSlice, b: StateSlice) => boolean +) { + const store = useContext(TestScenarioEditorStoreApiContext); + + if (store === null) { + throw new Error("Can't use Test Scenario Editor Store outside of the TestScenarioEditor component."); + } + + return useStoreWithEqualityFn(store, selector, equalityFn); +} + +export function useTestScenarioEditorStoreApi() { + return useContext(TestScenarioEditorStoreApiContext); +} diff --git a/packages/scesim-editor/src/store/computed/computeTestScenarioDataObjects.ts b/packages/scesim-editor/src/store/computed/computeTestScenarioDataObjects.ts new file mode 100644 index 00000000000..228f4b1fbe8 --- /dev/null +++ b/packages/scesim-editor/src/store/computed/computeTestScenarioDataObjects.ts @@ -0,0 +1,80 @@ +/* + * 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. + */ + +import { Computed, State, TestScenarioDataObject } from "../TestScenarioEditorStore"; + +export function computeTestScenarioDataObjects( + factMappings: State["scesim"]["model"]["ScenarioSimulationModel"]["simulation"]["scesimModelDescriptor"]["factMappings"]["FactMapping"] +) { + /* To create the Data Object arrays we need an external source, in details: */ + /* DMN Data: Retrieving DMN type from linked DMN file */ + /* Java classes: Retrieving Java classes info from the user projects */ + /* At this time, none of the above are supported */ + /* Therefore, it tries to retrieve these info from the SCESIM file, if are present */ + + /* Retriving Data Object from the scesim file. + That makes sense for previously created scesim files */ + + const factsMappings = factMappings ?? []; + const dataObjects: TestScenarioDataObject[] = []; + + /* The first two FactMapping are related to the "Number" and "Description" columns. + If those columns only are present, no Data Objects can be detected in the scesim file */ + for (let i = 2; i < factsMappings.length; i++) { + if (factsMappings[i].className!.__$$text === "java.lang.Void") { + continue; + } + const factID = factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text; + const dataObject = dataObjects.find((value) => value.id === factID); + const isSimpleTypeFact = factsMappings[i].expressionElements!.ExpressionElement!.length === 1; + const propertyID = isSimpleTypeFact //POTENTIAL BUG + ? factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text.concat(".") + : factsMappings[i] + .expressionElements!.ExpressionElement!.map((expressionElement) => expressionElement.step.__$$text) + .join("."); + const propertyName = isSimpleTypeFact + ? "value" + : factsMappings[i].expressionElements!.ExpressionElement!.slice(-1)[0].step.__$$text; + if (dataObject) { + if (!dataObject.children?.some((value) => value.id === propertyID)) { + dataObject.children!.push({ + id: propertyID, + customBadgeContent: factsMappings[i].className.__$$text, + isSimpleTypeFact: isSimpleTypeFact, + name: propertyName, + }); + } + } else { + dataObjects.push({ + id: factID, + name: factsMappings[i].factAlias!.__$$text, + customBadgeContent: factsMappings[i].factIdentifier!.className!.__$$text, + children: [ + { + id: propertyID, + name: propertyName, + customBadgeContent: factsMappings[i].className.__$$text, + }, + ], + }); + } + } + + return dataObjects; +} diff --git a/packages/scesim-editor/src/store/computed/initial.ts b/packages/scesim-editor/src/store/computed/initial.ts new file mode 100644 index 00000000000..ce228895c2a --- /dev/null +++ b/packages/scesim-editor/src/store/computed/initial.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +import { Cache } from "../ComputedStateCache"; +import { Computed } from "../TestScenarioEditorStore"; + +export const INITIAL_COMPUTED_CACHE: Cache = { + getTestScenarioDataObjects: { + value: undefined, + dependencies: [], + }, +}; diff --git a/packages/scesim-editor/src/table/TestScenarioTable.tsx b/packages/scesim-editor/src/table/TestScenarioTable.tsx index 32ec8ae704d..14a83ff5289 100644 --- a/packages/scesim-editor/src/table/TestScenarioTable.tsx +++ b/packages/scesim-editor/src/table/TestScenarioTable.tsx @@ -21,17 +21,7 @@ import * as React from "react"; import { useCallback, useMemo } from "react"; import * as ReactTable from "react-table"; -import _, { isNumber } from "lodash"; -import { v4 as uuid } from "uuid"; - -import { - SceSim__backgroundDatasType, - SceSim__backgroundType, - SceSim__FactMappingType, - SceSim__FactMappingValuesTypes, - SceSim__scenariosType, - SceSim__simulationType, -} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; +import _ from "lodash"; import { BeeTableContextMenuAllowedOperationsConditions, @@ -47,30 +37,32 @@ import { getColumnsAtLastLevel, } from "@kie-tools/boxed-expression-component/dist/table/BeeTable"; -import { SceSimModel } from "@kie-tools/scesim-marshaller"; +import { + SceSim__backgroundDatasType, + SceSim__backgroundType, + SceSim__FactMappingType, + SceSim__scenariosType, + SceSim__simulationType, +} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types"; import { useTestScenarioEditorI18n } from "../i18n"; -import { TestScenarioSelectedColumnMetaData, TestScenarioType } from "../TestScenarioEditor"; +import { useTestScenarioEditorStore, useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext"; +import { addColumn } from "../mutations/addColumn"; +import { deleteColumn } from "../mutations/deleteColumn"; import "./TestScenarioTable.css"; -import { - retrieveFactMappingValueIndexByIdentifiers, - retrieveModelDescriptor, - retrieveRowsDataFromModel, -} from "../common/TestScenarioCommonFunctions"; +import { addRow } from "../mutations/addRow"; +import { deleteRow } from "../mutations/deleteRow"; +import { dupliacteRow } from "../mutations/duplicateRow"; +import { updateCell } from "../mutations/updateCell"; +import { updateColumnWidth } from "../mutations/updateColumnWidth"; function TestScenarioTable({ - assetType, tableData, scrollableParentRef, - updateSelectedColumnMetaData, - updateTestScenarioModel, }: { - assetType: string; tableData: SceSim__simulationType | SceSim__backgroundType; scrollableParentRef: React.RefObject; - updateSelectedColumnMetaData: React.Dispatch>; - updateTestScenarioModel: React.Dispatch>; }) { enum TestScenarioTableColumnHeaderGroup { EXPECT = "expect-header", @@ -89,6 +81,9 @@ function TestScenarioTable({ type ROWTYPE = any; // FIXME: https://github.com/apache/incubator-kie-issues/issues/169 const { i18n } = useTestScenarioEditorI18n(); + const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi(); + const settingsModel = useTestScenarioEditorStore((state) => state.scesim.model.ScenarioSimulationModel.settings); + const testScenarioType = settingsModel.type?.__$$text.toUpperCase(); /** BACKGROUND TABLE MANAGMENT */ @@ -119,71 +114,33 @@ function TestScenarioTable({ const determineDataTypeLabel = useCallback( (dataType: string) => { let dataTypeLabel = dataType; - if (assetType === TestScenarioType[TestScenarioType.RULE]) { + if (testScenarioType === "RULE") { dataTypeLabel = dataTypeLabel.split(".").pop() ?? dataTypeLabel; } return dataTypeLabel.endsWith("Void") ? "" : dataTypeLabel; }, - [assetType] + [testScenarioType] ); /* It updates any column width change in the Model */ const setColumnWidth = useCallback( (inputIndex: number) => (newWidthAction: React.SetStateAction) => { - updateTestScenarioModel((prevState) => { - const oldWidth = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings - .FactMapping![inputIndex].columnWidth?.__$$text; + testScenarioEditorStoreApi.setState((state) => { + const factMappings = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!; + const oldWidth = factMappings[inputIndex].columnWidth?.__$$text; const newWidth = typeof newWidthAction === "function" ? newWidthAction(oldWidth) : newWidthAction; - let model = prevState; - if (newWidth && oldWidth !== newWidth) { - /* Cloning the FactMapping list and updating the new width */ - const deepClonedFactMappings: SceSim__FactMappingType[] = JSON.parse( - JSON.stringify( - retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings.FactMapping - ) - ); - const factMappingToUpdate = deepClonedFactMappings[inputIndex]; - - if (factMappingToUpdate.columnWidth?.__$$text) { - factMappingToUpdate.columnWidth.__$$text = newWidth; - } else { - factMappingToUpdate.columnWidth = { - __$$text: newWidth, - }; - } - - model = { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - ...prevState.ScenarioSimulationModel.simulation, - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping - : deepClonedFactMappings, - }, - }, - }, - background: { - ...prevState.ScenarioSimulationModel.background, - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? deepClonedFactMappings - : prevState.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping, - }, - }, - }, - }, - }; - } - - return model; + updateColumnWidth({ + factMappings: factMappings, + columnIndex: inputIndex, + newWidth: newWidth, + oldWidth: oldWidth, + }); }); }, - [isBackground, updateTestScenarioModel] + [isBackground, testScenarioEditorStoreApi] ); /* It determines the column data based on the given FactMapping (Scesim column representation). @@ -244,7 +201,7 @@ function TestScenarioTable({ | | +--------------------------------+-----+----------------------------------+-----+ | # | | givenInstance (given-instance) | ... | expectGroup (expect-instance) | ... | | | +----------------+---------------+-----+----------------------------------+-----+ - | | | field (given) | field (given)| ... | field (expect) | field (expect)| ... | + | | | field (given) | field (given) | ... | field (expect) | field (expect)| ... | +---+---------------+----------------+---------------+-----+-----------------+----------------+-----+ Every section has its related groupType in the rounded brackets, that are crucial to determine the correct context menu behavior (adding/removing an instance requires a different logic than @@ -507,140 +464,25 @@ function TestScenarioTable({ const onCellUpdates = useCallback( (cellUpdates: BeeTableCellUpdate[]) => { cellUpdates.forEach((update) => { - updateTestScenarioModel((prevState) => { - /* To update the related FactMappingValue, it compares every FactMappingValue associated with the Scenario (Row) - that contains the cell with the FactMapping (Column) fields factIdentifier and expressionIdentifier */ - const factMapping = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings - .FactMapping![update.columnIndex + columnIndexStart]; - - const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse( - JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground)) - ); - const factMappingValues = deepClonedRowsData[update.rowIndex].factMappingValues.FactMappingValue!; - const newFactMappingValues = [...factMappingValues]; - - const factMappingValueToUpdateIndex = retrieveFactMappingValueIndexByIdentifiers( - newFactMappingValues, - factMapping.factIdentifier, - factMapping.expressionIdentifier - ); - const factMappingValueToUpdate = factMappingValues[factMappingValueToUpdateIndex]; - - if (factMappingValueToUpdate.rawValue) { - factMappingValueToUpdate.rawValue!.__$$text = update.value; - } else { - newFactMappingValues[factMappingValueToUpdateIndex] = { - ...factMappingValueToUpdate, - rawValue: { - __$$text: update.value, - }, - }; - } - - deepClonedRowsData[update.rowIndex].factMappingValues.FactMappingValue = newFactMappingValues; - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - ...prevState.ScenarioSimulationModel.simulation, - scesimData: { - Scenario: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimData.Scenario - : deepClonedRowsData, - }, - }, - background: { - ...prevState.ScenarioSimulationModel.background, - scesimData: { - BackgroundData: isBackground - ? deepClonedRowsData - : prevState.ScenarioSimulationModel.background.scesimData.BackgroundData, - }, - }, - }, - }; + testScenarioEditorStoreApi.setState((state) => { + const factMappings = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!; + const factMappingValuesTypes = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimData.BackgroundData! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; + + updateCell({ + columnIndex: update.columnIndex + columnIndexStart, + factMappings: factMappings, + factMappingValuesTypes: factMappingValuesTypes, + rowIndex: update.rowIndex, + value: update.value, + }); }); }); }, - [columnIndexStart, isBackground, updateTestScenarioModel] - ); - - const getNextAvailablePrefixedName = useCallback( - (names: string[], namePrefix: string, lastIndex: number = names.length): string => { - const candidate = `${namePrefix}-${lastIndex + 1}`; - const elemWithCandidateName = names.indexOf(candidate); - return elemWithCandidateName >= 0 ? getNextAvailablePrefixedName(names, namePrefix, lastIndex + 1) : candidate; - }, - [] - ); - - /* It determines in which index position a column should be added. In case of a field, the new column index - is simply in the right or in the left of the selected column. In case of a new instance, it's required to - find the first column index outside the selected Instance group. */ - const determineNewColumnTargetIndex = useCallback( - ( - factMappings: SceSim__FactMappingType[], - insertDirection: InsertRowColumnsDirection, - selectedColumnIndex: number, - selectedColumnGroupType: string, - selectedFactMapping: SceSim__FactMappingType - ) => { - const groupType = selectedFactMapping.expressionIdentifier.type!.__$$text; - const instanceName = selectedFactMapping.factIdentifier.name!.__$$text; - const instanceType = selectedFactMapping.factIdentifier.className!.__$$text; - - if ( - selectedColumnGroupType === TestScenarioTableColumnFieldGroup.EXPECT || - selectedColumnGroupType === TestScenarioTableColumnFieldGroup.GIVEN - ) { - if (insertDirection === InsertRowColumnsDirection.AboveOrRight) { - return selectedColumnIndex + 1; - } else { - return selectedColumnIndex; - } - } - - let newColumnTargetColumn = -1; - - if (insertDirection === InsertRowColumnsDirection.AboveOrRight) { - for (let i = selectedColumnIndex; i < factMappings.length; i++) { - const currentFM = factMappings[i]; - if ( - currentFM.expressionIdentifier.type!.__$$text === groupType && - currentFM.factIdentifier.name?.__$$text === instanceName && - currentFM.factIdentifier.className?.__$$text === instanceType - ) { - if (i == factMappings.length - 1) { - newColumnTargetColumn = i + 1; - } - } else { - newColumnTargetColumn = i; - break; - } - } - } else { - for (let i = selectedColumnIndex; i >= 0; i--) { - const currentFM = factMappings[i]; - - if ( - currentFM.expressionIdentifier.type!.__$$text === groupType && - currentFM.factIdentifier.name?.__$$text === instanceName && - currentFM.factIdentifier.className?.__$$text === instanceType - ) { - if (i == 0) { - newColumnTargetColumn = 0; - } - } else { - newColumnTargetColumn = i + 1; - break; - } - } - } - - return newColumnTargetColumn; - }, - [TestScenarioTableColumnFieldGroup] + [columnIndexStart, isBackground, testScenarioEditorStoreApi] ); /** @@ -687,143 +529,48 @@ function TestScenarioTable({ columnsCount: number; insertDirection: InsertRowColumnsDirection; }) => { - /* GIVEN and EXPECTED column types can be added only */ - if (TestScenarioTableColumnFieldGroup.OTHER === args.groupType) { + /* GIVEN and EXPECTED of FIELD and INSTANCE column types can be added only */ + if ( + TestScenarioTableColumnFieldGroup.OTHER === args.groupType || + TestScenarioTableColumnHeaderGroup.EXPECT === args.groupType || + TestScenarioTableColumnHeaderGroup.GIVEN === args.groupType + ) { + console.error("Can't add a " + args.groupType + " type column."); return; } const isInstance = args.groupType === TestScenarioTableColumnInstanceGroup.EXPECT || args.groupType === TestScenarioTableColumnInstanceGroup.GIVEN; - updateTestScenarioModel((prevState) => { - const factMappingList = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings - .FactMapping!; - const selectedColumnIndex = determineSelectedColumnIndex(factMappingList, args.currentIndex, isInstance); - - /* Creating the new FactMapping based on the original selected column's FactMapping */ - const selectedColumnFactMapping = factMappingList[selectedColumnIndex]; - const targetColumnIndex = determineNewColumnTargetIndex( - factMappingList, - args.insertDirection, - selectedColumnIndex, - args.groupType, - selectedColumnFactMapping - ); - - const instanceDefaultNames = factMappingList - .filter((factMapping) => factMapping.factAlias!.__$$text.startsWith("INSTANCE-")) - .map((factMapping) => factMapping.factAlias!.__$$text); - - const isNewInstance = - isInstance || selectedColumnFactMapping.factIdentifier.className?.__$$text === "java.lang.Void"; - - const newFactMapping = { - className: { __$$text: "java.lang.Void" }, - columnWidth: { __$$text: 150 }, - expressionAlias: { __$$text: "PROPERTY" }, - expressionElements: isNewInstance - ? undefined - : { - ExpressionElement: [ - { - step: { - __$$text: selectedColumnFactMapping.expressionElements!.ExpressionElement![0].step.__$$text, - }, - }, - ], - }, - expressionIdentifier: { - name: { __$$text: `_${uuid()}`.toLocaleUpperCase() }, - type: { __$$text: selectedColumnFactMapping.expressionIdentifier.type!.__$$text }, - }, - factAlias: { - __$$text: isNewInstance - ? getNextAvailablePrefixedName(instanceDefaultNames, "INSTANCE") - : selectedColumnFactMapping.factAlias.__$$text, - }, - factIdentifier: { - name: { - __$$text: isNewInstance - ? getNextAvailablePrefixedName(instanceDefaultNames, "INSTANCE") - : selectedColumnFactMapping.factIdentifier.name!.__$$text, - }, - className: { - __$$text: isNewInstance ? "java.lang.Void" : selectedColumnFactMapping.factIdentifier.className!.__$$text, - }, - }, - factMappingValueType: { __$$text: "NOT_EXPRESSION" }, - }; - - /* Cloning the FactMapping list and putting the new one in the user defined index */ - const deepClonedFactMappings = JSON.parse( - JSON.stringify( - retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings.FactMapping - ) + testScenarioEditorStoreApi.setState((state) => { + const factMappings = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!; + const factMappingValues = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimData.BackgroundData! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; + const selectedColumnFactMappingIndex = determineSelectedColumnIndex( + factMappings, + args.currentIndex, + isInstance ); - deepClonedFactMappings.splice(targetColumnIndex, 0, newFactMapping); - /* Creating and adding a new FactMappingValue (cell) in every row, as a consequence of the new FactMapping (column) - we're going to introduce. The FactMappingValue will be linked with its related FactMapping via expressionIdentifier - and factIdentier data. That means, the column index of new FactMappingValue could be different in other Scenario (rows) */ - const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse( - JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground)) - ); - deepClonedRowsData.forEach((scenario) => { - scenario.factMappingValues.FactMappingValue!.splice(args.beforeIndex + 1, 0, { - expressionIdentifier: { - name: { __$$text: newFactMapping.expressionIdentifier.name.__$$text }, - type: { __$$text: newFactMapping.expressionIdentifier.type.__$$text }, - }, - factIdentifier: { - name: { __$$text: newFactMapping.factIdentifier.name.__$$text }, - className: { __$$text: newFactMapping.factIdentifier.className.__$$text }, - }, - rawValue: { __$$text: "", "@_class": "string" }, - }); + addColumn({ + beforeIndex: args.beforeIndex, + factMappings: factMappings, + factMappingValues: factMappingValues, + isInstance: isInstance, + insertDirection: args.insertDirection, + selectedColumnFactMappingIndex: selectedColumnFactMappingIndex, }); - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping - : deepClonedFactMappings, - }, - }, - scesimData: { - Scenario: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimData.Scenario - : deepClonedRowsData, - }, - }, - background: { - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? deepClonedFactMappings - : prevState.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping, - }, - }, - scesimData: { - BackgroundData: isBackground - ? deepClonedRowsData - : prevState.ScenarioSimulationModel.background.scesimData.BackgroundData, - }, - }, - }, - }; }); }, [ - determineNewColumnTargetIndex, determineSelectedColumnIndex, - getNextAvailablePrefixedName, isBackground, - updateTestScenarioModel, + testScenarioEditorStoreApi, TestScenarioTableColumnFieldGroup, + TestScenarioTableColumnHeaderGroup, TestScenarioTableColumnInstanceGroup, ] ); @@ -833,127 +580,54 @@ function TestScenarioTable({ */ const onColumnDeleted = useCallback( (args: { columnIndex: number; groupType: string }) => { - updateTestScenarioModel((prevState) => { - const isInstance = - args.groupType === TestScenarioTableColumnInstanceGroup.EXPECT || - args.groupType === TestScenarioTableColumnInstanceGroup.GIVEN; - - const factMappings = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings - .FactMapping!; - const columnIndexToRemove = determineSelectedColumnIndex(factMappings, args.columnIndex + 1, isInstance); - - /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact - FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings - that belongs to the the instance group */ - const factMappingToRemove = factMappings[columnIndexToRemove]; - const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text; - const instanceName = factMappingToRemove.factIdentifier.name!.__$$text; - const instanceType = factMappingToRemove.factIdentifier.className!.__$$text; - - const allFactMappingWithIndexesToRemove = isInstance - ? factMappings - .map((factMapping, index) => { - if ( - factMapping.expressionIdentifier.type!.__$$text === groupType && - factMapping.factIdentifier.name?.__$$text === instanceName && - factMapping.factIdentifier.className?.__$$text === instanceType - ) { - return { factMappingIndex: index, factMapping: factMapping }; - } else { - return {}; - } - }) - .filter((item) => isNumber(item.factMappingIndex)) - : [{ factMappingIndex: args.columnIndex + columnIndexStart, factMapping: factMappingToRemove }]; - - /* Cloning the FactMappings list (Columns) and and removing the FactMapping (Column) at given index */ - const deepClonedFactMappings = JSON.parse( - JSON.stringify( - retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings.FactMapping - ) - ); - deepClonedFactMappings.splice( - allFactMappingWithIndexesToRemove[0].factMappingIndex, - allFactMappingWithIndexesToRemove.length - ); - - /* Cloning the Scenario List (Rows) and finding the Cell(s) to remove accordingly to the factMapping data of - the removed columns */ - const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse( - JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground) ?? []) - ); - deepClonedRowsData.forEach((rowData) => { - allFactMappingWithIndexesToRemove.forEach((itemToRemove) => { - const factMappingValueColumnIndexToRemove = retrieveFactMappingValueIndexByIdentifiers( - rowData.factMappingValues.FactMappingValue!, - itemToRemove.factMapping!.factIdentifier, - itemToRemove.factMapping!.expressionIdentifier - )!; - - return { - factMappingValues: { - FactMappingValue: rowData.factMappingValues.FactMappingValue!.splice( - factMappingValueColumnIndexToRemove, - 1 - ), - }, - }; - }); + /* GIVEN and EXPECTED of FIELD and INSTANCE column types can be deleted only */ + if ( + TestScenarioTableColumnFieldGroup.OTHER === args.groupType || + TestScenarioTableColumnHeaderGroup.EXPECT === args.groupType || + TestScenarioTableColumnHeaderGroup.GIVEN === args.groupType + ) { + console.error("Can't delete a " + args.groupType + " type column."); + return; + } + const isInstance = + args.groupType === TestScenarioTableColumnInstanceGroup.EXPECT || + args.groupType === TestScenarioTableColumnInstanceGroup.GIVEN; + testScenarioEditorStoreApi.setState((state) => { + const factMappings = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!; + const factMappingValues = isBackground + ? state.scesim.model.ScenarioSimulationModel.background.scesimData.BackgroundData! + : state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; + const factMappingIndexToRemove = determineSelectedColumnIndex(factMappings, args.columnIndex + 1, isInstance); + + const { deletedFactMappingIndexs } = deleteColumn({ + factMappingIndexToRemove: factMappingIndexToRemove, + factMappings: factMappings, + factMappingValues: factMappingValues, + isBackground: isBackground, + isInstance: isInstance, + selectedColumnIndex: args.columnIndex, }); /** Updating the selectedColumn. When deleting, BEETable automatically shifts the selected cell in the left */ - const firstIndexOnTheLeft = Math.min( - ...allFactMappingWithIndexesToRemove.map((item) => item.factMappingIndex!) - ); + const firstIndexOnTheLeft = Math.min(...deletedFactMappingIndexs); const selectedColumnIndex = firstIndexOnTheLeft > 0 ? firstIndexOnTheLeft - 1 : 0; - updateSelectedColumnMetaData({ - factMapping: JSON.parse(JSON.stringify(deepClonedFactMappings[selectedColumnIndex])), + + state.dispatch(state).table.updateSelectedColumn({ + factMapping: JSON.parse(JSON.stringify(factMappings[selectedColumnIndex])), index: firstIndexOnTheLeft, - isBackground, + isBackground: isBackground, }); - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping - : deepClonedFactMappings, - }, - }, - scesimData: { - Scenario: isBackground - ? prevState.ScenarioSimulationModel.simulation.scesimData.Scenario - : deepClonedRowsData, - }, - }, - background: { - scesimModelDescriptor: { - factMappings: { - FactMapping: isBackground - ? deepClonedFactMappings - : prevState.ScenarioSimulationModel.background.scesimModelDescriptor.factMappings.FactMapping, - }, - }, - scesimData: { - BackgroundData: isBackground - ? deepClonedRowsData - : prevState.ScenarioSimulationModel.background.scesimData.BackgroundData, - }, - }, - }, - }; }); }, [ - updateTestScenarioModel, - TestScenarioTableColumnInstanceGroup, - isBackground, determineSelectedColumnIndex, - columnIndexStart, - updateSelectedColumnMetaData, + isBackground, + testScenarioEditorStoreApi, + TestScenarioTableColumnFieldGroup, + TestScenarioTableColumnHeaderGroup, + TestScenarioTableColumnInstanceGroup, ] ); @@ -965,50 +639,15 @@ function TestScenarioTable({ if (isBackground) { throw new Error("Impossible state. Background table can have a single row only"); } - updateTestScenarioModel((prevState) => { - /* Creating a new Scenario (Row) composed by a list of FactMappingValues. The list order is not relevant. */ + testScenarioEditorStoreApi.setState((state) => { const factMappings = - prevState.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping ?? []; - const factMappingValuesItems = factMappings.map((factMapping) => { - return { - expressionIdentifier: { - name: { __$$text: factMapping.expressionIdentifier.name!.__$$text }, - type: { __$$text: factMapping.expressionIdentifier.type!.__$$text }, - }, - factIdentifier: { - name: { __$$text: factMapping.factIdentifier.name!.__$$text }, - className: { __$$text: factMapping.factIdentifier.className!.__$$text }, - }, - rawValue: { __$$text: "", "@_class": "string" }, - }; - }); + state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!; + const factMappingValues = state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; - const newScenario = { - factMappingValues: { - FactMappingValue: factMappingValuesItems, - }, - }; - - /* Cloning che current Scenario List and adding thew new Scenario previously created */ - const deepClonedScenarios = JSON.parse( - JSON.stringify(prevState.ScenarioSimulationModel.simulation.scesimData.Scenario) - ); - deepClonedScenarios.splice(args.beforeIndex, 0, newScenario); - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - ...prevState.ScenarioSimulationModel.simulation, - scesimData: { - Scenario: deepClonedScenarios, - }, - }, - }, - }; + addRow({ beforeIndex: args.beforeIndex, factMappings: factMappings, factMappingValues: factMappingValues }); }); }, - [isBackground, updateTestScenarioModel] + [isBackground, testScenarioEditorStoreApi] ); /** @@ -1019,28 +658,13 @@ function TestScenarioTable({ if (isBackground) { throw new Error("Impossible state. Background table can have a single row only"); } - updateTestScenarioModel((prevState) => { - /* Just updating the Scenario List (Rows) cloning the current List and removing the row at the given rowIndex */ - const deepClonedScenarios = JSON.parse( - JSON.stringify(prevState.ScenarioSimulationModel.simulation.scesimData.Scenario ?? []) - ); - deepClonedScenarios.splice(args.rowIndex, 1); - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - ...prevState.ScenarioSimulationModel.simulation, - scesimData: { - ...prevState.ScenarioSimulationModel.simulation.scesimData, - Scenario: deepClonedScenarios, - }, - }, - }, - }; + testScenarioEditorStoreApi.setState((state) => { + const factMappingValues = state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; + + deleteRow({ rowIndex: args.rowIndex, factMappingValues: factMappingValues }); }); }, - [isBackground, updateTestScenarioModel] + [isBackground, testScenarioEditorStoreApi] ); /** @@ -1051,41 +675,13 @@ function TestScenarioTable({ if (isBackground) { throw new Error("Impossible state. Background table can have a single row only"); } - updateTestScenarioModel((prevState) => { - /* It simply clones a Scenario (Row) and adds it in a current-cloned Scenario list */ - const clonedFactMappingValues = JSON.parse( - JSON.stringify( - prevState.ScenarioSimulationModel.simulation.scesimData.Scenario![args.rowIndex].factMappingValues - .FactMappingValue - ) - ); + testScenarioEditorStoreApi.setState((state) => { + const factMappingValues = state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!; - const factMappingValues = { - factMappingValues: { - FactMappingValue: clonedFactMappingValues, - }, - }; - - const deepClonedScenarios = JSON.parse( - JSON.stringify(prevState.ScenarioSimulationModel.simulation.scesimData.Scenario ?? []) - ); - deepClonedScenarios.splice(args.rowIndex, 0, factMappingValues); - - return { - ScenarioSimulationModel: { - ...prevState.ScenarioSimulationModel, - simulation: { - ...prevState.ScenarioSimulationModel.simulation, - scesimData: { - ...prevState.ScenarioSimulationModel.simulation.scesimData, - Scenario: deepClonedScenarios, - }, - }, - }, - }; + dupliacteRow({ rowIndex: args.rowIndex, factMappingValues: factMappingValues }); }); }, - [isBackground, updateTestScenarioModel] + [isBackground, testScenarioEditorStoreApi] ); /** @@ -1093,9 +689,11 @@ function TestScenarioTable({ */ const onDataCellClick = useCallback( (_columnID: string) => { - updateSelectedColumnMetaData(null); + testScenarioEditorStoreApi.setState((state) => { + state.dispatch(state).table.updateSelectedColumn(null); + }); }, - [updateSelectedColumnMetaData] + [testScenarioEditorStoreApi] ); const onHeaderClick = useCallback( @@ -1105,7 +703,9 @@ function TestScenarioTable({ columnKey == TestScenarioTableColumnHeaderGroup.EXPECT || columnKey == TestScenarioTableColumnHeaderGroup.GIVEN ) { - updateSelectedColumnMetaData(null); + testScenarioEditorStoreApi.setState((state) => { + state.dispatch(state).table.updateSelectedColumn(null); + }); return; } @@ -1123,25 +723,23 @@ function TestScenarioTable({ selectedInstanceGroup?.columns[0].dataType === "" ) { const propertyID = selectedInstanceGroup?.columns[0].id; - let selectedFactMapping; - let selectedFactIndex; - if (propertyID) { - selectedFactMapping = modelDescriptor.factMappings.FactMapping!.find( - (factMapping) => factMapping.expressionIdentifier.name?.__$$text === propertyID - ); - selectedFactIndex = selectedFactMapping - ? modelDescriptor.factMappings.FactMapping!.indexOf(selectedFactMapping!) - : -1; - } - const selectedColumnMetaData = { - factMapping: JSON.parse(JSON.stringify(selectedFactMapping)), - index: selectedFactIndex ?? -1, - isBackground: isBackground, - }; - - updateSelectedColumnMetaData(selectedColumnMetaData); + const selectedFactMapping = modelDescriptor.factMappings.FactMapping!.find( + (factMapping) => factMapping.expressionIdentifier.name?.__$$text === propertyID + ); + const selectedFactIndex = selectedFactMapping + ? modelDescriptor.factMappings.FactMapping!.indexOf(selectedFactMapping!) + : -1; + testScenarioEditorStoreApi.setState((state) => { + state.dispatch(state).table.updateSelectedColumn({ + factMapping: JSON.parse(JSON.stringify(selectedFactMapping)), + index: selectedFactIndex ?? -1, + isBackground: isBackground, + }); + }); } else { - updateSelectedColumnMetaData(null); + testScenarioEditorStoreApi.setState((state) => { + state.dispatch(state).table.updateSelectedColumn(null); + }); } return; } @@ -1153,13 +751,13 @@ function TestScenarioTable({ ? modelDescriptor.factMappings.FactMapping!.indexOf(selectedFactMapping!) : -1; - const selectedColumnMetaData = { - factMapping: JSON.parse(JSON.stringify(selectedFactMapping)), - index: selectedFactIndex ?? -1, - isBackground: isBackground, - }; - - updateSelectedColumnMetaData(selectedColumnMetaData ?? null); + testScenarioEditorStoreApi.setState((state) => { + state.dispatch(state).table.updateSelectedColumn({ + factMapping: JSON.parse(JSON.stringify(selectedFactMapping)), + index: selectedFactIndex ?? -1, + isBackground: isBackground, + }); + }); }, [ TestScenarioTableColumnFieldGroup, @@ -1167,7 +765,7 @@ function TestScenarioTable({ isBackground, tableColumns.instancesGroup, tableData, - updateSelectedColumnMetaData, + testScenarioEditorStoreApi, ] ); diff --git a/packages/scesim-editor/stories/dev/DevWebApp.stories.tsx b/packages/scesim-editor/stories/dev/DevWebApp.stories.tsx index 9d17767d2bf..580fe83116e 100644 --- a/packages/scesim-editor/stories/dev/DevWebApp.stories.tsx +++ b/packages/scesim-editor/stories/dev/DevWebApp.stories.tsx @@ -17,112 +17,149 @@ * under the License. */ -import React, { useCallback, useRef, useState, useEffect } from "react"; +import React, { useCallback, useMemo, useRef, useState } from "react"; import type { Meta, StoryObj } from "@storybook/react"; -import { SceSimEditorWrapper, SceSimEditorWrapperProps } from "../scesimEditorStoriesWrapper"; -import { Button, Flex, FlexItem, Page, PageSection } from "@patternfly/react-core/dist/js"; -import { TestScenarioEditorRef } from "../../src/TestScenarioEditor"; -import { SceSimMarshaller } from "../../../scesim-marshaller/src/index"; -import { SceSimModel, getMarshaller } from "@kie-tools/scesim-marshaller"; -import { emptySceSim } from "../misc/empty/Empty.stories"; -import { isOldEnoughDrl } from "../useCases/IsOldEnoughRule.stories"; -import { trafficViolationDmn } from "../useCases/TrafficViolationDmn.stories"; -import { useArgs } from "@storybook/preview-api"; - +import "@patternfly/react-core/dist/styles/base.css"; +import { Button } from "@patternfly/react-core/dist/js/components/Button"; +import { Flex, FlexItem } from "@patternfly/react-core/dist/js/layouts/Flex"; +import { Page, PageSection } from "@patternfly/react-core/dist/js/components/Page"; +import { Stack, StackItem } from "@patternfly/react-core/dist/js"; +import { SceSimMarshaller, SceSimModel, getMarshaller } from "@kie-tools/scesim-marshaller"; +import { + ExternalDmnsIndex, + OnRequestExternalModelByPath, + OnRequestExternalModelsAvailableToInclude, + OnRequestToJumpToPath, + OnSceSimModelChange, + TestScenarioEditorProps, +} from "../../src/TestScenarioEditor"; +import { SceSimEditorWrapper } from "../scesimEditorStoriesWrapper"; +import { emptyFileName, emptySceSim } from "../misc/empty/Empty.stories"; +import { isOldEnoughDrl, isOldEnoughDrlFileName } from "../useCases/IsOldEnoughRule.stories"; +import { trafficViolationDmn, trafficViolationDmnFileName } from "../useCases/TrafficViolationDmn.stories"; +import { availableModelsByPath } from "../examples/AvailableDMNModels"; import "./DevWebApp.css"; -type DevWebAppProps = SceSimEditorWrapperProps; - -function DevWebApp(props: DevWebAppProps) { - const ref = useRef(null); - const [args, updateArgs] = useArgs(); - - const [state, setState] = useState<{ marshaller: SceSimMarshaller; stack: SceSimModel[]; pointer: number }>(() => { +function DevWebApp(props: TestScenarioEditorProps) { + const [fileName, setFileName] = useState("Untitled.scesim"); + const [state, setState] = useState<{ + marshaller: SceSimMarshaller; + pointer: number; + stack: SceSimModel[]; + }>(() => { const emptySceSimMarshaller = getMarshaller(emptySceSim); return { marshaller: emptySceSimMarshaller, - stack: [emptySceSimMarshaller.parser.parse()], pointer: 0, + stack: [emptySceSimMarshaller.parser.parse()], }; }); - const onSelectModel = useCallback((newModel) => { - const model = getMarshaller(newModel).parser.parse(); - setState((prev) => { - const newStack = prev.stack.slice(0, prev.pointer + 1); - return { - ...prev, - stack: [...newStack, model], - pointer: newStack.length, - }; - }); + const currentModel = state.stack[state.pointer]; + const downloadRef = useRef(null); + const isUndoEnabled = state.pointer > 0; + const isRedoEnabled = state.pointer !== state.stack.length - 1; + + const copyAsXml = useCallback(() => { + navigator.clipboard.writeText(state.marshaller.builder.build(currentModel)); + }, [currentModel, state.marshaller.builder]); + + const downloadAsXml = useCallback(() => { + if (downloadRef.current) { + const fileBlob = new Blob([state.marshaller.builder.build(currentModel)], { type: "text/xml" }); + downloadRef.current.download = fileName ?? `scesim-test-${makeid(10)}.scesim`; + downloadRef.current.href = URL.createObjectURL(fileBlob); + downloadRef.current.click(); + } + }, [currentModel, fileName, state.marshaller.builder]); + + // TODO Unmarshall here the DMN + const externalModelsByNamespace = useMemo(() => { + return currentModel.ScenarioSimulationModel.settings.dmnNamespace?.__$$text, {} as ExternalDmnsIndex; + }, [currentModel.ScenarioSimulationModel.settings.dmnNamespace]); + + const onDragOver = useCallback((e: React.DragEvent) => { + e.preventDefault(); // Necessary to disable the browser's default 'onDrop' handling. }, []); const onDrop = useCallback((e: React.DragEvent) => { + console.log("Test Scenario Editor :: Dev webapp :: File(s) dropped! Opening it."); + e.preventDefault(); // Necessary to disable the browser's default 'onDrop' handling. if (e.dataTransfer.items) { // Use DataTransferItemList interface to access the file(s) [...e.dataTransfer.items].forEach((item, i) => { if (item.kind === "file") { - const fileName = item.getAsFile()?.name; const reader = new FileReader(); - reader.addEventListener("load", ({ target }) => - ref.current?.setContent(fileName ?? "", target?.result as string) - ); + setFileName(item.getAsFile()?.name); + reader.addEventListener("load", ({ target }) => { + const marshaller = getMarshaller(target?.result as string); + setState({ + marshaller, + pointer: 0, + stack: [marshaller.parser.parse()], + }); + }); reader.readAsText(item.getAsFile() as any); } }); } }, []); - const onDragOver = useCallback((e: React.DragEvent) => { - e.preventDefault(); // Necessary to disable the browser's default 'onDrop' handling. + const onModelChange = useCallback((model) => { + setState((prev) => { + const newStack = prev.stack.slice(0, prev.pointer + 1); + return { + ...prev, + stack: [...newStack, model], + pointer: newStack.length, + }; + }); + }, []); + + const onRequestToJumpToPath = useCallback((path) => { + alert("A request to open this file: " + path); + }, []); + + const onSelectModel = useCallback( + (newModel, fileName) => { + onModelChange(getMarshaller(newModel).parser.parse()); + setFileName(fileName); + }, + [onModelChange] + ); + + const redo = useCallback(() => { + setState((prev) => ({ ...prev, pointer: Math.min(prev.stack.length - 1, prev.pointer + 1) })); }, []); const reset = useCallback(() => { const marshaller = getMarshaller(emptySceSim); setState({ marshaller, - stack: [marshaller.parser.parse()], pointer: 0, + stack: [marshaller.parser.parse()], }); }, []); - const currentModel = state.stack[state.pointer]; - - const downloadRef = useRef(null); - const downloadAsXml = useCallback(() => { - if (downloadRef.current) { - const fileBlob = new Blob([state.marshaller.builder.build(currentModel)], { type: "text/xml" }); - downloadRef.current.download = `scesim-${makeid(10)}.scesim`; - downloadRef.current.href = URL.createObjectURL(fileBlob); - downloadRef.current.click(); - } - }, [currentModel, state.marshaller.builder]); - - const copyAsXml = useCallback(() => { - navigator.clipboard.writeText(state.marshaller.builder.build(currentModel)); - }, [currentModel, state.marshaller.builder]); + const undo = useCallback(() => { + setState((prev) => ({ ...prev, pointer: Math.max(0, prev.pointer - 1) })); + }, []); - useEffect(() => { - updateArgs({ content: state.marshaller.builder.build(state.stack[state.stack.length - 1]) }); - }, [state.marshaller.builder, state.stack, updateArgs]); + const onRequestExternalModelByPath = useCallback(async (path) => { + return availableModelsByPath[path] ?? null; + }, []); - useEffect(() => { - onSelectModel(args.content); - }, [args.content, onSelectModel]); + const onRequestExternalModelsAvailableToInclude = useCallback(async () => { + return Object.keys(availableModelsByPath); + }, []); return ( - <> -
- - + + + +

Test Scenario Editor :: Dev WebApp

@@ -130,38 +167,76 @@ function DevWebApp(props: DevWebAppProps) {
(Drag & drop a file anywhere to open it)
+
+
+ + - +     - + +     + +     |     +     - +     |     - +     - +     - + - -
-
- - {SceSimEditorWrapper({ - pathRelativeToTheWorkspaceRoot: "dev.scesim", - content: state.marshaller.builder.build(state.stack[state.stack.length - 1]), - })} - -
-
- + + + + +
+ + {SceSimEditorWrapper({ + issueTrackerHref: props.issueTrackerHref, + externalModelsByNamespace: externalModelsByNamespace, + model: currentModel, + onModelChange: onModelChange, + onRequestExternalModelsAvailableToInclude: onRequestExternalModelsAvailableToInclude, + onRequestExternalModelByPath: onRequestExternalModelByPath, + onRequestToJumpToPath: onRequestToJumpToPath, + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: fileName, + })} + + ); } @@ -177,18 +252,19 @@ function makeid(length: number) { return result; } -const meta: Meta = { +const meta: Meta = { title: "Dev/Web App", component: DevWebApp, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const WebApp: Story = { render: (args) => DevWebApp(args), args: { - pathRelativeToTheWorkspaceRoot: "dev.scesim", - content: emptySceSim, + issueTrackerHref: "https://github.com/apache/incubator-kie-issues/issues/new", + model: getMarshaller(emptySceSim).parser.parse(), + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: "Untitled.scesim", }, }; diff --git a/packages/scesim-editor/stories/examples/AvailableDMNModels.ts b/packages/scesim-editor/stories/examples/AvailableDMNModels.ts index 315e2451ebc..70d8fbb5f44 100644 --- a/packages/scesim-editor/stories/examples/AvailableDMNModels.ts +++ b/packages/scesim-editor/stories/examples/AvailableDMNModels.ts @@ -17,17 +17,19 @@ * under the License. */ -import { DmnLatestModel, getMarshaller } from "@kie-tools/dmn-marshaller"; +import * as TestScenarioEditor from "../../src/TestScenarioEditor"; +import { getMarshaller } from "@kie-tools/dmn-marshaller"; +import { normalize } from "@kie-tools/dmn-marshaller/dist/normalization/normalize"; import { LOAN_PRE_QUALIFICATION, TRAFFIC_VIOLATION } from "./ExternalDmnModels"; -export const loanPreQualification = getMarshaller(LOAN_PRE_QUALIFICATION, { upgradeTo: "latest" }).parser.parse(); -export const trafficViolationModel = getMarshaller(TRAFFIC_VIOLATION, { upgradeTo: "latest" }).parser.parse(); +export const loanPreQualification = normalize( + getMarshaller(LOAN_PRE_QUALIFICATION, { upgradeTo: "latest" }).parser.parse() +); +export const trafficViolationModel = normalize( + getMarshaller(TRAFFIC_VIOLATION, { upgradeTo: "latest" }).parser.parse() +); -export const avaiableModels: { - model: DmnLatestModel; - normalizedPosixPathRelativeToTheOpenFile: string; - svg: string; -}[] = [ +export const avaiableModels: TestScenarioEditor.ExternalDmn[] = [ { model: loanPreQualification, svg: "", @@ -40,19 +42,12 @@ export const avaiableModels: { }, ]; -// export const availableModelsByPath: Record = Object.values(avaiableModels).reduce( -// (acc, v) => { -// acc[v.normalizedPosixPathRelativeToTheOpenFile] = v; -// return acc; -// }, -// {} as Record -// ); - -// export const modelsByNamespace = Object.values(avaiableModels).reduce((acc, v) => { -// if (v.type === "dmn") { -// acc[v.model.definitions["@_namespace"]] = v; -// } else if (v.type === "pmml") { -// acc[getPmmlNamespace({ normalizedPosixPathRelativeToTheOpenFile: v.normalizedPosixPathRelativeToTheOpenFile })] = v; -// } -// return acc; -// }, {} as DmnEditor.ExternalModelsIndex); +export const availableModelsByPath: Record = Object.values( + avaiableModels +).reduce( + (acc, v) => { + acc[v.normalizedPosixPathRelativeToTheOpenFile] = v; + return acc; + }, + {} as Record +); diff --git a/packages/scesim-editor/stories/misc/empty/Empty.stories.tsx b/packages/scesim-editor/stories/misc/empty/Empty.stories.tsx index af7a17fc235..7aa0696d501 100644 --- a/packages/scesim-editor/stories/misc/empty/Empty.stories.tsx +++ b/packages/scesim-editor/stories/misc/empty/Empty.stories.tsx @@ -18,11 +18,13 @@ */ import type { Meta, StoryObj } from "@storybook/react"; -import { SceSimEditorWrapper, SceSimEditorWrapperProps } from "../../scesimEditorStoriesWrapper"; +import { getMarshaller } from "@kie-tools/scesim-marshaller"; import { TestScenarioEditor } from "../../../src/TestScenarioEditor"; +import { SceSimEditorWrapper, StorybookTestScenarioEditorProps } from "../../scesimEditorStoriesWrapper"; +export const emptyFileName = "Untitled.scesim"; export const emptySceSim = ` - + @@ -180,12 +182,16 @@ const meta: Meta<{}> = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj; + +const marshaller = getMarshaller(emptySceSim); +const model = marshaller.parser.parse(); export const Empty: Story = { render: (args) => SceSimEditorWrapper(args), args: { - pathRelativeToTheWorkspaceRoot: "empty.scesim", - content: emptySceSim, + model: marshaller.parser.parse(), + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: emptyFileName, + xml: marshaller.builder.build(model), }, }; diff --git a/packages/scesim-editor/stories/scesimEditor/SceSimEditor.mdx b/packages/scesim-editor/stories/scesimEditor/SceSimEditor.mdx index 33f1a2e32a8..c253f319b3f 100644 --- a/packages/scesim-editor/stories/scesimEditor/SceSimEditor.mdx +++ b/packages/scesim-editor/stories/scesimEditor/SceSimEditor.mdx @@ -17,9 +17,9 @@ import { Meta } from "@storybook/blocks"; - + -# SceSim Editor +# Test Scenario Editor Before deploying them into a production environment, test scenarios enable you to validate the functionality of - Business rules and business rule data (for rules-based test scenarios) diff --git a/packages/scesim-editor/stories/scesimEditorStoriesWrapper.tsx b/packages/scesim-editor/stories/scesimEditorStoriesWrapper.tsx index 656adba6208..802302e52ca 100644 --- a/packages/scesim-editor/stories/scesimEditorStoriesWrapper.tsx +++ b/packages/scesim-editor/stories/scesimEditorStoriesWrapper.tsx @@ -18,25 +18,68 @@ */ import * as React from "react"; -import { useEffect, useRef } from "react"; -import { TestScenarioEditor, TestScenarioEditorRef } from "../src/TestScenarioEditor"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useArgs } from "@storybook/preview-api"; +import { diff } from "deep-object-diff"; +import { SceSimModel, getMarshaller } from "@kie-tools/scesim-marshaller"; +import { TestScenarioEditor, TestScenarioEditorProps, TestScenarioEditorRef } from "../src/TestScenarioEditor"; +import { EMPTY_ONE_EIGHT } from "../src/resources/EmptyScesimFile"; -export interface SceSimEditorWrapperProps { - pathRelativeToTheWorkspaceRoot: string; - content: string; -} +export type StorybookTestScenarioEditorProps = TestScenarioEditorProps & { xml: string }; -export function SceSimEditorWrapper(props: SceSimEditorWrapperProps) { +export function SceSimEditorWrapper(props: Partial) { + const [args, updateArgs] = useArgs(); + const argsCopy = useRef(args); const ref = useRef(null); + const [modelArgs, setModelArgs] = useState(args.model); + const model = useMemo(() => props?.model ?? modelArgs, [modelArgs, props?.model]); + + const onModelChange = useMemo( + () => (props?.onModelChange ? props.onModelChange : setModelArgs), + [props?.onModelChange] + ); useEffect(() => { - /* Simulating a call from "Foundation" code */ - ref.current?.setContent(props.pathRelativeToTheWorkspaceRoot, props.content); - }, [ref, props.content, props.pathRelativeToTheWorkspaceRoot]); + if (Object.keys(diff(argsCopy.current.model, model)).length !== 0) { + updateArgs({ + ...argsCopy.current, + model: model, + xml: getMarshaller(EMPTY_ONE_EIGHT).builder.build(model), + }); + } + }, [updateArgs, model]); + + useEffect(() => { + if (Object.keys(diff(argsCopy.current, args)).length === 0) { + return; + } + argsCopy.current = args; + if (Object.keys(diff(args.model, model)).length === 0) { + return; + } + onModelChange(args.model); + }, [args, model, onModelChange]); + + const onModelDebounceStateChanged = useCallback(() => { + console.debug("[scesimEditorStoriesWrapper] Model Debounce state"); + }, []); return ( -
- -
+ ); } diff --git a/packages/scesim-editor/stories/useCases/IsOldEnoughRule.stories.tsx b/packages/scesim-editor/stories/useCases/IsOldEnoughRule.stories.tsx index 86592e1a75d..0aa060b7715 100644 --- a/packages/scesim-editor/stories/useCases/IsOldEnoughRule.stories.tsx +++ b/packages/scesim-editor/stories/useCases/IsOldEnoughRule.stories.tsx @@ -19,9 +19,11 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; +import { getMarshaller } from "@kie-tools/scesim-marshaller"; import { TestScenarioEditor } from "../../src/TestScenarioEditor"; -import { SceSimEditorWrapper, SceSimEditorWrapperProps } from "../scesimEditorStoriesWrapper"; +import { SceSimEditorWrapper, StorybookTestScenarioEditorProps } from "../scesimEditorStoriesWrapper"; +export const isOldEnoughDrlFileName = "IsOldEnough.scesim"; export const isOldEnoughDrl = ` @@ -394,12 +396,16 @@ const meta: Meta<{}> = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj; + +const marshaller = getMarshaller(isOldEnoughDrl); +const model = marshaller.parser.parse(); export const IsOldEnough: Story = { - render: (args) => SceSimEditorWrapper(args), args: { - pathRelativeToTheWorkspaceRoot: "isOldEnough.scesim", - content: isOldEnoughDrl, + model: marshaller.parser.parse(), + xml: marshaller.builder.build(model), + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: isOldEnoughDrlFileName, }, + render: (args) => SceSimEditorWrapper(args), }; diff --git a/packages/scesim-editor/stories/useCases/TrafficViolationDmn.stories.tsx b/packages/scesim-editor/stories/useCases/TrafficViolationDmn.stories.tsx index 031704f4650..58856b5432a 100644 --- a/packages/scesim-editor/stories/useCases/TrafficViolationDmn.stories.tsx +++ b/packages/scesim-editor/stories/useCases/TrafficViolationDmn.stories.tsx @@ -19,9 +19,11 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; +import { getMarshaller } from "@kie-tools/scesim-marshaller"; import { TestScenarioEditor } from "../../src/TestScenarioEditor"; -import { SceSimEditorWrapper, SceSimEditorWrapperProps } from "../scesimEditorStoriesWrapper"; +import { SceSimEditorWrapper, StorybookTestScenarioEditorProps } from "../scesimEditorStoriesWrapper"; +export const trafficViolationDmnFileName = "TrafficViolation.scesim"; export const trafficViolationDmn = ` @@ -796,12 +798,16 @@ const meta: Meta<{}> = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj; + +const marshaller = getMarshaller(trafficViolationDmn); +const model = marshaller.parser.parse(); export const TrafficViolation: Story = { render: (args) => SceSimEditorWrapper(args), args: { - pathRelativeToTheWorkspaceRoot: "trafficViolation.scesim", - content: trafficViolationDmn, + model: marshaller.parser.parse(), + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: trafficViolationDmnFileName, + xml: marshaller.builder.build(model), }, }; diff --git a/packages/scesim-editor/tests-e2e/__screenshots__/Google-Chrome/misc/emptyExpression/create-a-new-test-scenario.png b/packages/scesim-editor/tests-e2e/__screenshots__/Google-Chrome/misc/emptyExpression/create-a-new-test-scenario.png index 97f6e8b3d07..4334ab5e3a3 100644 Binary files a/packages/scesim-editor/tests-e2e/__screenshots__/Google-Chrome/misc/emptyExpression/create-a-new-test-scenario.png and b/packages/scesim-editor/tests-e2e/__screenshots__/Google-Chrome/misc/emptyExpression/create-a-new-test-scenario.png differ diff --git a/packages/scesim-editor/tests-e2e/__screenshots__/chromium/misc/emptyExpression/create-a-new-test-scenario.png b/packages/scesim-editor/tests-e2e/__screenshots__/chromium/misc/emptyExpression/create-a-new-test-scenario.png index e85c3f76dec..7cd45f75364 100644 Binary files a/packages/scesim-editor/tests-e2e/__screenshots__/chromium/misc/emptyExpression/create-a-new-test-scenario.png and b/packages/scesim-editor/tests-e2e/__screenshots__/chromium/misc/emptyExpression/create-a-new-test-scenario.png differ diff --git a/packages/scesim-editor/tests-e2e/__screenshots__/webkit/misc/emptyExpression/create-a-new-test-scenario.png b/packages/scesim-editor/tests-e2e/__screenshots__/webkit/misc/emptyExpression/create-a-new-test-scenario.png index 30c67fbe4bf..caa7de3b78b 100644 Binary files a/packages/scesim-editor/tests-e2e/__screenshots__/webkit/misc/emptyExpression/create-a-new-test-scenario.png and b/packages/scesim-editor/tests-e2e/__screenshots__/webkit/misc/emptyExpression/create-a-new-test-scenario.png differ diff --git a/packages/scesim-marshaller/src/schemas/scesim-1_8/SceSim.xsd b/packages/scesim-marshaller/src/schemas/scesim-1_8/SceSim.xsd index 6f5ebe95ae7..efa8b3b494e 100644 --- a/packages/scesim-marshaller/src/schemas/scesim-1_8/SceSim.xsd +++ b/packages/scesim-marshaller/src/schemas/scesim-1_8/SceSim.xsd @@ -1,3 +1,20 @@ + + > src/main/resources/application.properties \ - && mvn clean package -B -ntp \ + && mvn clean package -B \ && rm -rf target/ diff --git a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/install.js b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/install.js index b562eaace2c..009bd4bbdd9 100644 --- a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/install.js +++ b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/install.js @@ -17,11 +17,17 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.swfDeploymentQuarkusApp.version} - -Dquarkus.platform.version=${buildEnv.env.quarkusPlatform.version} - -Dversion.org.kie.kogito=${buildEnv.env.kogitoRuntime.version} -`); +setupMavenConfigFile( + ` + --batch-mode + -Dstyle.color=always + -Drevision=${env.swfDeploymentQuarkusApp.version} + -Dversion.quarkus=${env.versions.quarkus} + -Dversion.org.kie.kogito=${env.versions.kogito} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} +`, + { ignoreDefault: true } // Can't have special configuration that only works inside this repo. +); diff --git a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/package.json b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/package.json index 94f344bb90b..9ee447e43ae 100644 --- a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/package.json +++ b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/package.json @@ -27,10 +27,10 @@ "quarkus:dev:win32": "mvn clean package quarkus:dev `-DskipTests" }, "dependencies": { + "@kie-tools/maven-base": "workspace:*", "@kie-tools/sonataflow-quarkus-devui": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/pom.xml b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/pom.xml index 40a5864091d..a02511ff4b5 100644 --- a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/pom.xml +++ b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/pom.xml @@ -36,16 +36,14 @@ serverless-logic-web-tools-swf-deployment-quarkus-app ${revision} + KIE Tools :: Serverless Logic Web Tools :: Deployment Quarkus app + 3.13.0 false 17 UTF-8 UTF-8 - quarkus-bom - io.quarkus - org.kie.kogito - kogito-bom 2.1.20 1.26.0 1.14.2 @@ -55,15 +53,15 @@ - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + io.quarkus + quarkus-bom + ${version.quarkus} pom import - ${kogito.bom.group-id} - ${kogito.bom.artifact-id} + org.kie.kogito + kogito-bom ${version.org.kie.kogito} pom import @@ -108,11 +106,6 @@ org.kie kie-addons-quarkus-knative-eventing - - org.apache.kie.sonataflow - sonataflow-quarkus-devui - ${project.version} - org.kie kogito-addons-quarkus-data-index-inmemory @@ -147,12 +140,65 @@ + + + include-1st-party-dependencies + + + kieTools.do-not-use-this-property.ignore1stPartyDependencies + !true + + + + + + org.apache.kie.sonataflow + sonataflow-quarkus-devui-bom + ${project.version} + pom + import + + + + + + org.apache.kie.sonataflow + sonataflow-quarkus-devui + + + + + + + + use-maven-repo-local-tail + + + kieTools.do-not-use-this-property.ignoreMavenRepoLocalTail + !true + + + + + + + maven-install-plugin + + true + + + + + + + + - ${quarkus.platform.group-id} + io.quarkus quarkus-maven-plugin - ${quarkus.platform.version} + ${version.quarkus} true diff --git a/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/serverless-logic-web-tools-swf-deployment-quarkus-app.iml b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/serverless-logic-web-tools-swf-deployment-quarkus-app.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/serverless-logic-web-tools-swf-deployment-quarkus-app/serverless-logic-web-tools-swf-deployment-quarkus-app.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/serverless-logic-web-tools-swf-dev-mode-image/Containerfile b/packages/serverless-logic-web-tools-swf-dev-mode-image/Containerfile index 1038ffd3cc4..461cab7af48 100644 --- a/packages/serverless-logic-web-tools-swf-dev-mode-image/Containerfile +++ b/packages/serverless-logic-web-tools-swf-dev-mode-image/Containerfile @@ -34,7 +34,6 @@ RUN chown kogito /home/kogito/.m2 && \ mvn clean package \ quarkus:go-offline \ -B \ - -ntp \ -s /home/kogito/.m2/settings.xml \ -Dmaven.test.skip \ -Dmaven.repo.local=/home/kogito/.m2/repository \ diff --git a/packages/serverless-logic-web-tools-swf-dev-mode-image/entrypoint.sh b/packages/serverless-logic-web-tools-swf-dev-mode-image/entrypoint.sh index 97c40b91eca..6695bbf1449 100644 --- a/packages/serverless-logic-web-tools-swf-dev-mode-image/entrypoint.sh +++ b/packages/serverless-logic-web-tools-swf-dev-mode-image/entrypoint.sh @@ -26,6 +26,7 @@ cd /tmp/app/serverless-logic-web-tools-swf-deployment-quarkus-app mvn quarkus:dev \ -nsu \ + -B \ -o \ -s /home/kogito/.m2/settings.xml \ -Ddebug=false \ diff --git a/packages/serverless-logic-web-tools-swf-dev-mode-image/env/index.js b/packages/serverless-logic-web-tools-swf-dev-mode-image/env/index.js index 1c29373cc23..7e8dab30e31 100644 --- a/packages/serverless-logic-web-tools-swf-dev-mode-image/env/index.js +++ b/packages/serverless-logic-web-tools-swf-dev-mode-image/env/index.js @@ -35,10 +35,6 @@ module.exports = composeEnv([rootEnv, require("@kie-tools/serverless-logic-web-t default: `${kogitoBaseBuilderImageEnv.registry}/${kogitoBaseBuilderImageEnv.account}/${kogitoBaseBuilderImageEnv.name}:${kogitoBaseBuilderImageEnv.buildTag}`, description: "Base image complete tag.", }, - SERVERLESS_LOGIC_WEB_TOOLS_DEVMODE_IMAGE__mavenM2RepoViaHttpImage: { - default: `${mavenM2RepoViaHttpImageEnv.registry}/${mavenM2RepoViaHttpImageEnv.account}/${mavenM2RepoViaHttpImageEnv.name}:${mavenM2RepoViaHttpImageEnv.buildTag}`, - description: "The image tag for the Maven M2 Repo via HTTP. Used during the build only.", - }, }), get env() { return { @@ -46,9 +42,7 @@ module.exports = composeEnv([rootEnv, require("@kie-tools/serverless-logic-web-t baseImageTag: getOrDefault(this.vars.SERVERLESS_LOGIC_WEB_TOOLS_DEVMODE_IMAGE__baseImageTag), version: require("../package.json").version, dev: { - mavenM2RepoViaHttpImage: getOrDefault( - this.vars.SERVERLESS_LOGIC_WEB_TOOLS_DEVMODE_IMAGE__mavenM2RepoViaHttpImage - ), + mavenM2RepoViaHttpImage: `${mavenM2RepoViaHttpImageEnv.registry}/${mavenM2RepoViaHttpImageEnv.account}/${mavenM2RepoViaHttpImageEnv.name}:${mavenM2RepoViaHttpImageEnv.buildTag}`, }, }, }; diff --git a/packages/serverless-logic-web-tools-swf-dev-mode-image/install.js b/packages/serverless-logic-web-tools-swf-dev-mode-image/install.js index 6a812f4a2e6..d73cc3c46df 100644 --- a/packages/serverless-logic-web-tools-swf-dev-mode-image/install.js +++ b/packages/serverless-logic-web-tools-swf-dev-mode-image/install.js @@ -17,9 +17,9 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.slwtDevModeImage.version} +setupMavenConfigFile(` + -Drevision=${env.slwtDevModeImage.version} `); diff --git a/packages/serverless-logic-web-tools-swf-dev-mode-image/package.json b/packages/serverless-logic-web-tools-swf-dev-mode-image/package.json index f395d8d6393..c5759d0320e 100644 --- a/packages/serverless-logic-web-tools-swf-dev-mode-image/package.json +++ b/packages/serverless-logic-web-tools-swf-dev-mode-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy:assets\" \"pnpm image:docker:build\" \"pnpm image:docker:squash\" --finally \"pnpm m2-repo-via-http:container:kill\"", + "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy:assets\" \"pnpm image:docker:build\" \"pnpm image:docker:squash\" --finally \"pnpm m2-repo-via-http:container:kill\" \"rimraf ./dist/tmp-m2\"", "build:dev": "pnpm build", "build:prod": "pnpm build", "copy:assets": "rimraf dist-dev && mkdir -p ./dist-dev && pnpm copy:quarkus-app && pnpm copy:sonataflow-deployment-webapp && pnpm copy:maven-m2-repo-via-http-image--settings-xml", @@ -30,12 +30,13 @@ "image:docker:squash": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && DOCKER_HOST=$(docker context inspect | jq '.[].Endpoints.docker.Host' | tr -d '\"') docker-squash -t $(build-env slwtDevModeImageEnv.registry)/$(build-env slwtDevModeImageEnv.account)/$(build-env slwtDevModeImageEnv.name):$(build-env slwtDevModeImageEnv.buildTag) $(build-env slwtDevModeImageEnv.registry)/$(build-env slwtDevModeImageEnv.account)/$(build-env slwtDevModeImageEnv.name):$(build-env slwtDevModeImageEnv.buildTag)", "install": "node install.js", "m2-repo-via-http:container:kill": "(docker container kill m2-repo-via-http || true) && (docker container rm m2-repo-via-http || true)", - "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && docker run --name m2-repo-via-http -v \"$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout):/var/www/html\" -dit $(build-env slwtDevModeImage.dev.mavenM2RepoViaHttpImage)", + "m2-repo-via-http:container:prepare-m2-repo-volume": "node -e 'require(`@kie-tools/maven-base`).prepareHardLinkedM2ForPackage(`./dist/tmp-m2/repository`, `./node_modules/@kie-tools/serverless-logic-web-tools-swf-deployment-quarkus-app`)'", + "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && pnpm m2-repo-via-http:container:prepare-m2-repo-volume && docker run --name m2-repo-via-http -v \"./dist/tmp-m2/repository:/var/www/html\" -dit $(build-env slwtDevModeImage.dev.mavenM2RepoViaHttpImage)", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "devDependencies": { "@kie-tools/image-builder": "workspace:*", - "@kie-tools/maven-config-setup-helper": "workspace:*", + "@kie-tools/maven-base": "workspace:*", "@kie-tools/maven-m2-repo-via-http-image": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", diff --git a/packages/serverless-logic-web-tools/build/defaultEnvJson.ts b/packages/serverless-logic-web-tools/build/defaultEnvJson.ts index 95c73bfb6db..3b37893e395 100644 --- a/packages/serverless-logic-web-tools/build/defaultEnvJson.ts +++ b/packages/serverless-logic-web-tools/build/defaultEnvJson.ts @@ -22,7 +22,6 @@ import { EnvJson } from "../src/env/EnvJson"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { env } from "../env"; - const buildEnv: any = env; // build-env is not typed export const defaultEnvJson: EnvJson = { diff --git a/packages/serverless-logic-web-tools/src/i18n/AppI18n.ts b/packages/serverless-logic-web-tools/src/i18n/AppI18n.ts index 9824c624c08..3b1178924cc 100644 --- a/packages/serverless-logic-web-tools/src/i18n/AppI18n.ts +++ b/packages/serverless-logic-web-tools/src/i18n/AppI18n.ts @@ -105,6 +105,12 @@ interface AppDictionary extends ReferenceDictionary { dependencyWarningTooltip: string; }; }; + RuntimeToolsSettings: { + configModal: { + validDataIndexURLError: string; + dataIndexConnectionError: string; + }; + }; } export interface AppI18n extends AppDictionary, CommonI18n {} diff --git a/packages/serverless-logic-web-tools/src/i18n/locales/de.ts b/packages/serverless-logic-web-tools/src/i18n/locales/de.ts index f795fce6748..2c102f9781b 100644 --- a/packages/serverless-logic-web-tools/src/i18n/locales/de.ts +++ b/packages/serverless-logic-web-tools/src/i18n/locales/de.ts @@ -112,4 +112,10 @@ export const de: AppI18n = { "Modelle in diesem Arbeitsbereich können von Bereitstellungen aus anderen Arbeitsbereichen abhängen.", }, }, + RuntimeToolsSettings: { + configModal: { + validDataIndexURLError: "Bitte geben Sie eine gültige Datenindex-URL ein.", + dataIndexConnectionError: "Verbindung abgelehnt. Bitte überprüfen Sie die bereitgestellten Informationen.", + }, + }, }; diff --git a/packages/serverless-logic-web-tools/src/i18n/locales/en.ts b/packages/serverless-logic-web-tools/src/i18n/locales/en.ts index 800745e2565..cb2359064e1 100644 --- a/packages/serverless-logic-web-tools/src/i18n/locales/en.ts +++ b/packages/serverless-logic-web-tools/src/i18n/locales/en.ts @@ -108,4 +108,10 @@ export const en: AppI18n = { dependencyWarningTooltip: "Models in this workspace may depend on deployments from other workspaces.", }, }, + RuntimeToolsSettings: { + configModal: { + validDataIndexURLError: "Please enter a valid Data Index URL.", + dataIndexConnectionError: "Connection refused. Please check the information provided.", + }, + }, }; diff --git a/packages/serverless-logic-web-tools/src/settings/runtimeTools/RuntimeToolsSettings.tsx b/packages/serverless-logic-web-tools/src/settings/runtimeTools/RuntimeToolsSettings.tsx index ccbdd84723c..79b253567e4 100644 --- a/packages/serverless-logic-web-tools/src/settings/runtimeTools/RuntimeToolsSettings.tsx +++ b/packages/serverless-logic-web-tools/src/settings/runtimeTools/RuntimeToolsSettings.tsx @@ -17,10 +17,10 @@ * under the License. */ -import React from "react"; +import React, { useEffect } from "react"; import { Button, ButtonVariant } from "@patternfly/react-core/dist/js/components/Button"; import { EmptyState, EmptyStateBody, EmptyStateIcon } from "@patternfly/react-core/dist/js/components/EmptyState"; -import { ActionGroup, Form, FormGroup } from "@patternfly/react-core/dist/js/components/Form"; +import { ActionGroup, Form, FormAlert, FormGroup } from "@patternfly/react-core/dist/js/components/Form"; import { InputGroup, InputGroupText } from "@patternfly/react-core/dist/js/components/InputGroup"; import { Modal, ModalVariant } from "@patternfly/react-core/dist/js/components/Modal"; import { PageSection } from "@patternfly/react-core/dist/js/components/Page"; @@ -43,14 +43,31 @@ import { saveConfigCookie, } from "./RuntimeToolsConfig"; import { removeTrailingSlashFromUrl } from "../../url"; +import { isDataIndexUrlValid } from "../../url"; +import { Alert } from "@patternfly/react-core/dist/js"; +import { useAppI18n } from "../../i18n"; +import { verifyDataIndex } from "@kie-tools/runtime-tools-swf-gateway-api/src/gatewayApi/apis"; const PAGE_TITLE = "Runtime Tools"; +enum FormValiationOptions { + INITIAL = "INITIAL", + INVALID = "INVALID", + CONNECTION_ERROR = "CONNECTION_ERROR", +} + export function RuntimeToolsSettings(props: SettingsPageProps) { + const { i18n } = useAppI18n(); const settings = useSettings(); const settingsDispatch = useSettingsDispatch(); const [config, setConfig] = useState(settings.runtimeTools.config); const [isModalOpen, setIsModalOpen] = useState(false); + const [isConfigValidated, setConfigValidated] = useState(FormValiationOptions.INITIAL); + const [dataIndexUrlAvailable, setDataIndexUrlAvailable] = useState(false); + + useEffect(() => { + setConfigValidated(FormValiationOptions.INITIAL); + }, [config]); const handleModalToggle = useCallback(() => { setIsModalOpen((prevIsModalOpen) => !prevIsModalOpen); @@ -76,10 +93,23 @@ export function RuntimeToolsSettings(props: SettingsPageProps) { resetConfigCookie(); }, [settingsDispatch.runtimeTools]); - const onApply = useCallback(() => { + const onApply = useCallback(async () => { const newConfig: RuntimeToolsSettingsConfig = { dataIndexUrl: removeTrailingSlashFromUrl(config.dataIndexUrl), }; + const isDataIndexUrlVerified = await verifyDataIndex(config.dataIndexUrl); + if (!isDataIndexUrlValid(config.dataIndexUrl)) { + setConfigValidated(FormValiationOptions.INVALID); + return; + } else { + if (isDataIndexUrlVerified == true) { + setDataIndexUrlAvailable(true); + } else { + setConfigValidated(FormValiationOptions.CONNECTION_ERROR); + return; + } + } + setConfig(newConfig); settingsDispatch.runtimeTools.setConfig(newConfig); saveConfigCookie(newConfig); @@ -144,6 +174,28 @@ export function RuntimeToolsSettings(props: SettingsPageProps) { appendTo={props.pageContainerRef.current || document.body} >
+ {isConfigValidated === FormValiationOptions.INVALID && ( + + + + )} + {isConfigValidated === FormValiationOptions.CONNECTION_ERROR && ( + + + + )} { + it.each([ + ["http://example.com", true], + ["http://example.com/", true], + ["https://example.com/", true], + ["ftps://example.com/", false], + ])("the data index URL %s validation should be %s", (inputUrl, isValidUrl) => { + expect(isDataIndexUrlValid(inputUrl)).toBe(isValidUrl); + }); +}); diff --git a/packages/serverless-logic-web-tools/webpack.config.ts b/packages/serverless-logic-web-tools/webpack.config.ts index 961ee98cb09..5ab93ac0360 100644 --- a/packages/serverless-logic-web-tools/webpack.config.ts +++ b/packages/serverless-logic-web-tools/webpack.config.ts @@ -36,10 +36,9 @@ import HtmlReplaceWebpackPlugin from "html-replace-webpack-plugin"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { env } from "./env"; - const buildEnv: any = env; // build-env is not typed -export default async (env: any, argv: any) => { +export default async (webpackEnv: any, webpackArgv: any) => { const buildInfo = getBuildInfo(); const gtmResource = getGtmResource(); const [swfBuilderImageRegistry, swfBuilderImageAccount, swfBuilderImageName, swfBuilderImageTag] = @@ -56,7 +55,7 @@ export default async (env: any, argv: any) => { ] = getDashbuilderViewerImageArgs(); return [ - merge(common(env), { + merge(common(webpackEnv), { entry: { "workspace/worker/sharedWorker": "./src/workspace/worker/sharedWorker.ts", }, @@ -80,7 +79,7 @@ export default async (env: any, argv: any) => { ], }), { - ...merge(common(env), { + ...merge(common(webpackEnv), { entry: { index: "./src/index.tsx", "yard-editor-envelope": "./src/envelope/YardEditorEnvelopeApp.ts", diff --git a/packages/serverless-workflow-combined-editor/dev-webapp/webpack.config.js b/packages/serverless-workflow-combined-editor/dev-webapp/webpack.config.js index 82d442e7915..867e11d98ad 100644 --- a/packages/serverless-workflow-combined-editor/dev-webapp/webpack.config.js +++ b/packages/serverless-workflow-combined-editor/dev-webapp/webpack.config.js @@ -25,10 +25,9 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const swEditorAssets = require("@kie-tools/serverless-workflow-diagram-editor-assets"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), @@ -100,6 +99,6 @@ module.exports = (env) => historyApiFallback: true, static: [{ directory: path.join(__dirname) }], compress: true, - port: buildEnv.serverlessWorkflowCombinedEditor.dev.port, + port: env.serverlessWorkflowCombinedEditor.dev.port, }, }); diff --git a/packages/serverless-workflow-dev-ui-webapp/webpack.config.js b/packages/serverless-workflow-dev-ui-webapp/webpack.config.js index 8f66faab9e4..a7732717cff 100644 --- a/packages/serverless-workflow-dev-ui-webapp/webpack.config.js +++ b/packages/serverless-workflow-dev-ui-webapp/webpack.config.js @@ -29,10 +29,9 @@ const swEditor = require("@kie-tools/serverless-workflow-diagram-editor-assets") const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const { env } = require("./env"); -const buildEnv = env; -module.exports = async (env) => - merge(common(env), { +module.exports = async (webpackEnv) => + merge(common(webpackEnv), { entry: { standalone: path.resolve(__dirname, "src", "standalone", "standalone.ts"), envelope: path.resolve(__dirname, "src", "standalone", "EnvelopeApp.ts"), @@ -45,7 +44,7 @@ module.exports = async (env) => static: { directory: "./dist", }, - port: buildEnv.runtimeToolsDevUiWebapp.dev.port, + port: env.runtimeToolsDevUiWebapp.dev.port, compress: true, historyApiFallback: true, hot: true, diff --git a/packages/serverless-workflow-diagram-editor/install.js b/packages/serverless-workflow-diagram-editor/install.js index 9d355452e5e..7ad945caca7 100644 --- a/packages/serverless-workflow-diagram-editor/install.js +++ b/packages/serverless-workflow-diagram-editor/install.js @@ -17,14 +17,25 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { + setupMavenConfigFile, + buildTailFromPackageJsonDependencies, + DEFAULT_LOCAL_REPO, +} = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.swfDiagramEditor.version} - -Duberfire.version=${buildEnv.env.swfDiagramEditor.UBERFIRE__version} - -Dfont_awesome.version=${buildEnv.env.swfDiagramEditor.FONT_AWESOME__version} - -Dgwtbootstrap3.version=${buildEnv.env.swfDiagramEditor.GWTBOOTSTRAP3__version} - -Dbootstrap.version=${buildEnv.env.swfDiagramEditor.BOOTSTRAP__version} - -Danimate_css.version=${buildEnv.env.swfDiagramEditor.ANIMATE_CSS__version} -`); +setupMavenConfigFile( + ` + --batch-mode + -Dstyle.color=always + -Drevision=${env.swfDiagramEditor.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()},${DEFAULT_LOCAL_REPO} + -Drevision=${env.swfDiagramEditor.version} + -Duberfire.version=${env.swfDiagramEditor.UBERFIRE__version} + -Dfont_awesome.version=${env.swfDiagramEditor.FONT_AWESOME__version} + -Dgwtbootstrap3.version=${env.swfDiagramEditor.GWTBOOTSTRAP3__version} + -Dbootstrap.version=${env.swfDiagramEditor.BOOTSTRAP__version} + -Danimate_css.version=${env.swfDiagramEditor.ANIMATE_CSS__version} + `, // For some reason, j2cl-maven-plugin needs the DEFAULT_LOCAL_REPO here as the last tail too. + { ignoreDefault: true } // Default configuration doesn't work for this module. Since this module is not going to last long, we rely on this workaround for a while. +); diff --git a/packages/serverless-workflow-diagram-editor/package.json b/packages/serverless-workflow-diagram-editor/package.json index afdb0988436..d7cf50e2424 100644 --- a/packages/serverless-workflow-diagram-editor/package.json +++ b/packages/serverless-workflow-diagram-editor/package.json @@ -28,7 +28,7 @@ "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", + "@kie-tools/maven-base": "workspace:*", "@kie-tools/root-env": "workspace:*", "cpr": "^3.0.1", "rimraf": "^3.0.2", diff --git a/packages/serverless-workflow-diagram-editor/pom.xml b/packages/serverless-workflow-diagram-editor/pom.xml index 91080e2cd77..68d998606e9 100644 --- a/packages/serverless-workflow-diagram-editor/pom.xml +++ b/packages/serverless-workflow-diagram-editor/pom.xml @@ -31,8 +31,8 @@ ${revision} pom - Stunner Editors Java - Parent - Stunner Editors Java - Parent + KIE Tools :: Serverless Workflow Diagram Editor + GWT- and Stunner-based graphical editor for Serverless Workflow (`.sw.{json,yaml}`) files http://kogito.kie.org 2021 @@ -2053,5 +2053,30 @@ ${env.ghprbTargetBranch} + + + + + use-maven-repo-local-tail + + + kieTools.do-not-use-this-property.ignoreMavenRepoLocalTail + !true + + + + + + + org.apache.maven.plugins + maven-install-plugin + + true + + + + + + diff --git a/packages/serverless-workflow-diagram-editor/serverless-workflow-diagram-editor-parent.iml b/packages/serverless-workflow-diagram-editor/serverless-workflow-diagram-editor-parent.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/serverless-workflow-diagram-editor-parent.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/serverless-workflow-standalone-editor/webpack.build-resources.config.js b/packages/serverless-workflow-standalone-editor/webpack.build-resources.config.js index 6d5ea48456a..80f18e960db 100644 --- a/packages/serverless-workflow-standalone-editor/webpack.build-resources.config.js +++ b/packages/serverless-workflow-standalone-editor/webpack.build-resources.config.js @@ -22,8 +22,8 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const CopyPlugin = require("copy-webpack-plugin"); const patternflyBase = require("@kie-tools-core/patternfly-base"); -module.exports = (env) => [ - merge(common(env), { +module.exports = (webpackEnv) => [ + merge(common(webpackEnv), { entry: { "preprocessor/preprocessor": "./src/preprocessor/preprocessor.ts", }, @@ -34,7 +34,7 @@ module.exports = (env) => [ __filename: true, //Uses current working dir }, }), - merge(common(env), { + merge(common(webpackEnv), { output: { publicPath: "", }, diff --git a/packages/serverless-workflow-standalone-editor/webpack.editor-resources.config.js b/packages/serverless-workflow-standalone-editor/webpack.editor-resources.config.js index 43133134c3e..24b178fa0d3 100644 --- a/packages/serverless-workflow-standalone-editor/webpack.editor-resources.config.js +++ b/packages/serverless-workflow-standalone-editor/webpack.editor-resources.config.js @@ -23,8 +23,8 @@ const patternflyBase = require("@kie-tools-core/patternfly-base"); const FileManagerPlugin = require("filemanager-webpack-plugin"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); -module.exports = (env) => [ - merge(common(env), { +module.exports = (webpackEnv) => [ + merge(common(webpackEnv), { output: { publicPath: "", }, diff --git a/packages/serverless-workflow-standalone-editor/webpack.package-resources.config.js b/packages/serverless-workflow-standalone-editor/webpack.package-resources.config.js index a182723a81e..e288290f12d 100644 --- a/packages/serverless-workflow-standalone-editor/webpack.package-resources.config.js +++ b/packages/serverless-workflow-standalone-editor/webpack.package-resources.config.js @@ -21,11 +21,10 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const path = require("path"); const { env } = require("./env"); -const buildEnv = env; const patternflyBase = require("@kie-tools-core/patternfly-base"); -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { output: { path: path.join(__dirname, "dist"), filename: "[name]/index.js", @@ -42,7 +41,7 @@ module.exports = (env) => historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }], compress: true, - port: buildEnv.standaloneEditors.dev.port, + port: env.standaloneEditors.dev.port, }, ignoreWarnings: [/Failed to parse source map/], }); diff --git a/packages/serverless-workflow-text-editor/dev-webapp/webpack.config.js b/packages/serverless-workflow-text-editor/dev-webapp/webpack.config.js index 6b579a40fe3..93626a0336b 100644 --- a/packages/serverless-workflow-text-editor/dev-webapp/webpack.config.js +++ b/packages/serverless-workflow-text-editor/dev-webapp/webpack.config.js @@ -24,10 +24,9 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), @@ -72,6 +71,6 @@ module.exports = (env) => historyApiFallback: true, static: [{ directory: path.join(__dirname) }], compress: true, - port: buildEnv.serverlessWorkflowTextEditor.dev.port, + port: env.serverlessWorkflowTextEditor.dev.port, }, }); diff --git a/packages/serverless-workflow-vscode-extension/e2e-tests/resources/greeting-flow/pom.xml b/packages/serverless-workflow-vscode-extension/e2e-tests/resources/greeting-flow/pom.xml index 17ee5c338aa..e005d34cb09 100644 --- a/packages/serverless-workflow-vscode-extension/e2e-tests/resources/greeting-flow/pom.xml +++ b/packages/serverless-workflow-vscode-extension/e2e-tests/resources/greeting-flow/pom.xml @@ -32,24 +32,16 @@ UTF-8 UTF-8 quarkus-bom - io.quarkus.platform - 2.13.1.Final + 2.13.1.Final true 3.0.0-M7 - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - ${quarkus.platform.group-id} - quarkus-kogito-bom - ${quarkus.platform.version} + io.quarkus + quarkus-bom + ${version.quarkus} pom import @@ -94,9 +86,9 @@ - ${quarkus.platform.group-id} + io.quarkus quarkus-maven-plugin - ${quarkus.platform.version} + ${version.quarkus} true diff --git a/packages/serverless-workflow-vscode-extension/package.json b/packages/serverless-workflow-vscode-extension/package.json index 601505a268c..50e4a75384e 100644 --- a/packages/serverless-workflow-vscode-extension/package.json +++ b/packages/serverless-workflow-vscode-extension/package.json @@ -80,7 +80,7 @@ "sanitize-filename-ts": "^1.0.2", "selenium-webdriver": "^4.15.0", "typescript": "^5.5.3", - "vscode-extension-tester": "^8.3.1", + "vscode-extension-tester": "^8.8.0", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", diff --git a/packages/serverless-workflow-vscode-extension/webpack.config.js b/packages/serverless-workflow-vscode-extension/webpack.config.js index 791145178d5..b8b113dc1ec 100644 --- a/packages/serverless-workflow-vscode-extension/webpack.config.js +++ b/packages/serverless-workflow-vscode-extension/webpack.config.js @@ -24,8 +24,8 @@ const { merge } = require("webpack-merge"); const { ProvidePlugin } = require("webpack"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "ServerlessWorkflowEditor", libraryTarget: "umd", @@ -37,14 +37,14 @@ const commonConfig = (env) => }, }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension": "./src/extension/extension.ts", }, }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "webworker", entry: { "extension/extensionWeb": "./src/extension/extension.ts", @@ -56,7 +56,7 @@ module.exports = async (env) => [ }), ], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "webview/editors/serverless-workflow/serverless-workflow-diagram-editor-envelope": diff --git a/packages/sonataflow-builder-image/install.js b/packages/sonataflow-builder-image/install.js index 00f6c3a3bbf..bd2a2098f1e 100644 --- a/packages/sonataflow-builder-image/install.js +++ b/packages/sonataflow-builder-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.sonataflowBuilderImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.sonataflowBuilderImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -56,14 +56,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.sonataflowBuilderImage.registry}/${buildEnv.env.sonataflowBuilderImage.account}/${buildEnv.env.sonataflowBuilderImage.name}`; +const imageUrl = `${env.sonataflowBuilderImage.registry}/${env.sonataflowBuilderImage.account}/${env.sonataflowBuilderImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*sonataflow-builder.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync(originalYamlPath, path.join(resourcesPath, `${buildEnv.env.sonataflowBuilderImage.name}-image.yaml`)); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.sonataflowBuilderImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/sonataflow-builder-image/package.json b/packages/sonataflow-builder-image/package.json index d3913462f33..a0378e31d7a 100644 --- a/packages/sonataflow-builder-image/package.json +++ b/packages/sonataflow-builder-image/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm test\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\"", + "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm test\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\" \"rimraf ./dist/tmp-m2\"", "build:dev": "pnpm build", "build:prod": "pnpm build && pnpm image:test", "copy:maven-m2-repo-via-http-image--settings-xml": "run-script-os", @@ -33,16 +33,17 @@ "install": "node install.js && pnpm format", "m2-repo-via-http:container:kill": "(docker container kill m2-repo-via-http || true) && (docker container rm m2-repo-via-http || true)", "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && docker run --name m2-repo-via-http -v \"$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout):/var/www/html\" -dit $(build-env sonataflowBuilderImage.dev.mavenM2RepoViaHttpImage)", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowBuilderImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowBuilderImage.account) KOGITO_IMAGE_NAME=$(build-env sonataflowBuilderImage.name) KOGITO_IMAGE_TAG=$(build-env sonataflowBuilderImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version)", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowBuilderImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowBuilderImage.account) KOGITO_IMAGE_NAME=$(build-env sonataflowBuilderImage.name) KOGITO_IMAGE_TAG=$(build-env sonataflowBuilderImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)", "test": "run-script-os", "test:cleanup": "mv dist-tests/report.xml dist-tests/junit-report.xml || true", "test:linux:darwin": "run-script-if --bool \"$(build-env tests.run)\" --then \"pnpm test:setup\" \"pnpm test:run\" --finally \"pnpm test:cleanup\"", "test:run": "make -C ./build bats || $(build-env tests.ignoreFailures)", - "test:setup": "pnpm copy-assets && pnpm copy-test-assets && mkdir -p dist-tests && rm -rf dist-tests/*", + "test:setup": "pnpm copy-test-assets && mkdir -p dist-tests && rm -rf dist-tests/*", "test:win32": "echo \"Tests are skipped in Windows\"" }, "devDependencies": { "@kie-tools/image-builder": "workspace:*", + "@kie-tools/maven-base": "workspace:*", "@kie-tools/maven-m2-repo-via-http-image": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", diff --git a/packages/sonataflow-builder-image/test-resources/tests/features/sonataflow-builder.feature b/packages/sonataflow-builder-image/test-resources/tests/features/sonataflow-builder.feature index a4e1bdfcf6b..fefd17bc48f 100644 --- a/packages/sonataflow-builder-image/test-resources/tests/features/sonataflow-builder.feature +++ b/packages/sonataflow-builder-image/test-resources/tests/features/sonataflow-builder.feature @@ -12,7 +12,6 @@ Feature: Serverless Workflow builder images | wait | 480 | | request_method | GET | | expected_status_code | 200 | - And container log should contain --no-transfer-progress And container log should contain -Duser.home=/home/kogito And container log should match regex Installed features:.*kogito-serverless-workflow And container log should match regex Installed features:.*kie-addon-knative-eventing-extension diff --git a/packages/sonataflow-deployment-webapp/src/context/AppContextProvider.tsx b/packages/sonataflow-deployment-webapp/src/context/AppContextProvider.tsx index d9e645f007c..f8f8822fc28 100644 --- a/packages/sonataflow-deployment-webapp/src/context/AppContextProvider.tsx +++ b/packages/sonataflow-deployment-webapp/src/context/AppContextProvider.tsx @@ -19,9 +19,10 @@ import React, { PropsWithChildren, useEffect, useMemo, useState } from "react"; import { DEFAULT_APPDATA_VALUES } from "../AppConstants"; -import { AppData, verifyDataIndex } from "../data"; +import { AppData } from "../data"; import { useAppDataPromise } from "../hooks/useAppDataPromise"; import { AppContext } from "./AppContext"; +import { verifyDataIndex } from "@kie-tools/runtime-tools-swf-gateway-api/src/gatewayApi/apis"; export function AppContextProvider(props: PropsWithChildren<{}>) { const appDataPromise = useAppDataPromise(); diff --git a/packages/sonataflow-deployment-webapp/src/data/index.ts b/packages/sonataflow-deployment-webapp/src/data/index.ts index 37aa2884108..505d6362ea9 100644 --- a/packages/sonataflow-deployment-webapp/src/data/index.ts +++ b/packages/sonataflow-deployment-webapp/src/data/index.ts @@ -29,22 +29,3 @@ export async function fetchAppData(): Promise { const response = await fetch(routes.dataJson.path({})); return (await response.json()) as AppData; } - -export async function verifyDataIndex(dataIndexUrl?: string): Promise { - if (!dataIndexUrl) { - return false; - } - - try { - const response = await fetch(dataIndexUrl, { - headers: { - "Content-Type": "application/json", - }, - method: "POST", - body: '{"query":""}', - }); - return response.status === 200; - } catch (e) { - return false; - } -} diff --git a/packages/sonataflow-deployment-webapp/webpack.config.js b/packages/sonataflow-deployment-webapp/webpack.config.js index 04f5504fcd9..5375790ae26 100644 --- a/packages/sonataflow-deployment-webapp/webpack.config.js +++ b/packages/sonataflow-deployment-webapp/webpack.config.js @@ -27,10 +27,9 @@ const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const swEditorAssets = require("@kie-tools/serverless-workflow-diagram-editor-assets"); const { env } = require("./env"); -const buildEnv = env; -module.exports = async (env) => - merge(common(env), { +module.exports = async (webpackEnv) => + merge(common(webpackEnv), { entry: { index: "./src/index.tsx", "serverless-workflow-combined-editor-envelope": "./src/envelope/ServerlessWorkflowCombinedEditorEnvelopeApp.ts", @@ -95,7 +94,7 @@ module.exports = async (env) => historyApiFallback: false, static: [{ directory: path.join(__dirname, "./dist") }, { directory: path.join(__dirname, "./static") }], compress: true, - port: buildEnv.sonataFlowDeploymentWebapp.dev.port, + port: env.sonataFlowDeploymentWebapp.dev.port, client: { overlay: false, }, diff --git a/packages/sonataflow-devmode-image/install.js b/packages/sonataflow-devmode-image/install.js index f701da5c030..baaa6f34bc7 100644 --- a/packages/sonataflow-devmode-image/install.js +++ b/packages/sonataflow-devmode-image/install.js @@ -20,7 +20,7 @@ const { execSync } = require("child_process"); const fs = require("fs"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json")); @@ -33,7 +33,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${buildEnv.env.sonataflowDevModeImage.buildTag} --source-folder ./resources`, + python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.sonataflowDevModeImage.buildTag} --source-folder ./resources`, { stdio: "inherit" } ); @@ -47,14 +47,14 @@ if (imageYamlFiles.length !== 1) { const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]); let imageYaml = fs.readFileSync(originalYamlPath, "utf8"); -const imageUrl = `${buildEnv.env.sonataflowDevModeImage.registry}/${buildEnv.env.sonataflowDevModeImage.account}/${buildEnv.env.sonataflowDevModeImage.name}`; +const imageUrl = `${env.sonataflowDevModeImage.registry}/${env.sonataflowDevModeImage.account}/${env.sonataflowDevModeImage.name}`; // Replace the whole string between quotes ("") with the image name imageYaml = imageYaml.replace(/(?<=")(.*sonataflow-devmode.*)(?=")/gm, imageUrl); // Write file and then rename it to match the image name fs.writeFileSync(originalYamlPath, imageYaml); -fs.renameSync(originalYamlPath, path.join(resourcesPath, `${buildEnv.env.sonataflowDevModeImage.name}-image.yaml`)); +fs.renameSync(originalYamlPath, path.join(resourcesPath, `${env.sonataflowDevModeImage.name}-image.yaml`)); // Replace image URL in .feature files replaceInFile.sync({ diff --git a/packages/sonataflow-devmode-image/package.json b/packages/sonataflow-devmode-image/package.json index 32c092fa850..f34cd49c846 100644 --- a/packages/sonataflow-devmode-image/package.json +++ b/packages/sonataflow-devmode-image/package.json @@ -13,31 +13,32 @@ "url": "https://github.com/apache/incubator-kie-tools/issues" }, "scripts": { - "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\"", + "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\" \"rimraf ./dist/tmp-m2\"", "build:dev": "pnpm build", "build:prod": "pnpm build && pnpm image:test", "copy:maven-m2-repo-via-http-image--settings-xml": "run-script-os", "copy:maven-m2-repo-via-http-image--settings-xml:linux:darwin": "M2_REPO_VIA_HTTP_URL_WITHOUT_PROTOCOL=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' m2-repo-via-http) envsubst < build/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml.envsubst > build/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml && rm build/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml.envsubst", "copy:maven-m2-repo-via-http-image--settings-xml:win32": "echo \"Build skipped on macOS and Windows\"", "copy-assets": "run-script-os", - "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build && pnpm copy-devui-repo && pnpm copy:maven-m2-repo-via-http-image--settings-xml", - "copy-devui-repo": "tar -C ~/.m2/repository/org/apache/kie/ -cvf build/modules/sonataflow/devmode/build-config/sonataflow-quarkus-devui-maven-repo.tar sonataflow && tar -C ~/.m2/repository/org/kie/ -cvf build/modules/sonataflow/devmode/build-config/kie-tools-maven-base-maven-repo.tar kie-tools-maven-base", + "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build && pnpm copy:maven-m2-repo-via-http-image--settings-xml", "copy-test-assets": "run-script-os", "copy-test-assets:linux:darwin": "cp -R test-resources/* build", "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore", "image:build": "run-script-os", - "image:build:linux": "pnpm setup:env make -C ./build build", + "image:build:darwin:linux": "pnpm setup:env make -C ./build build", "image:build:win32": "echo \"Build skipped on Windows\"", "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p build/target/test/results\" \"run-script-os\" --finally \"cp -R build/target/test/results dist-tests-e2e/\"", + "image:test:darwin:win32": "echo \"Tests skipped on macOS and Windows\"", "image:test:linux": "pnpm copy-test-assets && pnpm setup:env make -C ./build test-image", - "image:test:win32": "echo \"Tests skipped on Windows\"", "install": "node install.js && pnpm format", "m2-repo-via-http:container:kill": "(docker container kill m2-repo-via-http || true) && (docker container rm m2-repo-via-http || true)", - "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && docker run --name m2-repo-via-http -v \"$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout):/var/www/html\" -dit $(build-env sonataflowDevModeImage.dev.mavenM2RepoViaHttpImage)", - "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowDevModeImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowDevModeImage.account) KOGITO_IMAGE_NAME=$(build-env sonataflowDevModeImage.name) KOGITO_IMAGE_TAG=$(build-env sonataflowDevModeImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version) SONATAFLOW_QUARKUS_DEVUI_VERSION=$(build-env sonataflowDevModeImage.sonataflowQuarkusDevUiVersion)" + "m2-repo-via-http:container:prepare-m2-repo-volume": "node -e 'require(`@kie-tools/maven-base`).prepareHardLinkedM2ForPackage(`./dist/tmp-m2/repository`, `./node_modules/@kie-tools/sonataflow-quarkus-devui`)'", + "m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && pnpm m2-repo-via-http:container:prepare-m2-repo-volume && docker run --name m2-repo-via-http -v \"./dist/tmp-m2/repository:/var/www/html\" -dit $(build-env sonataflowDevModeImage.dev.mavenM2RepoViaHttpImage)", + "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowDevModeImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowDevModeImage.account) KOGITO_IMAGE_NAME=$(build-env sonataflowDevModeImage.name) KOGITO_IMAGE_TAG=$(build-env sonataflowDevModeImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito) SONATAFLOW_QUARKUS_DEVUI_VERSION=$(build-env sonataflowDevModeImage.sonataflowQuarkusDevUiVersion)" }, "devDependencies": { "@kie-tools/image-builder": "workspace:*", + "@kie-tools/maven-base": "workspace:*", "@kie-tools/maven-m2-repo-via-http-image": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", diff --git a/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/configure b/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/configure index 8c27f782926..e63fdff754f 100644 --- a/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/configure +++ b/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/configure @@ -19,20 +19,3 @@ # set -e -# mvn install:install-file \ -# -Dfile=/tmp/artifacts/sonataflow-quarkus-devui.jar \ -# -DgroupId=org.apache.kie.sonataflow \ -# -DartifactId=sonataflow-quarkus-devui \ -# -Dversion=$SONATAFLOW_QUARKUS_DEVUI_VERSION \ -# -Dpackaging=jar \ -# -DgeneratePom=true - -ls -la /tmp/artifacts - -mkdir -p "${KOGITO_HOME}"/.m2/repository/org/apache/kie/ -mkdir -p "${KOGITO_HOME}"/.m2/repository/org/kie/ -tar xf /tmp/artifacts/sonataflow-quarkus-devui-maven-repo.tar -C "${KOGITO_HOME}"/.m2/repository/org/apache/kie/ -tar xf /tmp/artifacts/kie-tools-maven-base-maven-repo.tar -C "${KOGITO_HOME}"/.m2/repository/org/kie/ - -find "${KOGITO_HOME}"/.m2/repository -name _remote.repositories | xargs rm - diff --git a/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/module.yaml b/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/module.yaml index 36ea5dcdd06..5b271764932 100644 --- a/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/module.yaml +++ b/packages/sonataflow-devmode-image/resources/modules/sonataflow/devmode/build-config/module.yaml @@ -27,13 +27,7 @@ envs: - name: QUARKUS_EXTENSIONS # NOTE: If you change the QUARKUS_EXTENSIONS value remember to update the scripts/logic/build-quarkus-app.sh too! # Follow up issue to remove KOGITO_VERSION: https://issues.redhat.com/browse/KOGITO-9270 - value: org.apache.kie.sonataflow:sonataflow-quarkus:${KOGITO_VERSION},org.kie:kie-addons-quarkus-knative-eventing:${KOGITO_VERSION},smallrye-health,org.apache.kie.sonataflow:sonataflow-quarkus-devui:${SONATAFLOW_QUARKUS_DEVUI_VERSION},org.kie:kie-addons-quarkus-source-files:${KOGITO_VERSION},org.kie:kie-addons-quarkus-process-management:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-jobs-service-embedded:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-data-index-inmemory:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-microprofile-config-service-catalog:${KOGITO_VERSION},org.kie:kie-addons-quarkus-kubernetes:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-knative-serving:${KOGITO_VERSION} - -artifacts: - - name: sonataflow-quarkus-devui-maven-repo.tar - path: ./sonataflow-quarkus-devui-maven-repo.tar - - name: kie-tools-maven-base-maven-repo.tar - path: ./kie-tools-maven-base-maven-repo.tar + value: org.apache.kie.sonataflow:sonataflow-quarkus:${KOGITO_VERSION},org.kie:kie-addons-quarkus-knative-eventing:${KOGITO_VERSION},smallrye-health,org.apache.kie.sonataflow:sonataflow-quarkus-devui:${SONATAFLOW_QUARKUS_DEVUI_VERSION},org.kie:kie-addons-quarkus-source-files:${KOGITO_VERSION},org.kie:kie-addons-quarkus-process-management:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-jobs-service-embedded:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-data-index-inmemory:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-microprofile-config-service-catalog:${KOGITO_VERSION},org.kie:kie-addons-quarkus-kubernetes:${KOGITO_VERSION},org.kie:kogito-addons-quarkus-knative-serving:${KOGITO_VERSION},org.kie:kie-addons-quarkus-monitoring-prometheus:${KOGITO_VERSION},org.kie:kie-addons-quarkus-monitoring-sonataflow:${KOGITO_VERSION} execute: - script: configure diff --git a/packages/sonataflow-devmode-image/test-resources/tests/features/sonataflow-devmode.feature b/packages/sonataflow-devmode-image/test-resources/tests/features/sonataflow-devmode.feature index 7ba91ee955e..f9abddb709d 100644 --- a/packages/sonataflow-devmode-image/test-resources/tests/features/sonataflow-devmode.feature +++ b/packages/sonataflow-devmode-image/test-resources/tests/features/sonataflow-devmode.feature @@ -12,7 +12,6 @@ Feature: Serverless Workflow devmode images | wait | 480 | | request_method | GET | | expected_status_code | 200 | - And container log should contain --no-transfer-progress And container log should contain -Duser.home=/home/kogito -o And container log should contain -Dquarkus.test.continuous-testing=disabled And container log should match regex Installed features:.*kogito-serverless-workflow diff --git a/packages/sonataflow-image-common/install.js b/packages/sonataflow-image-common/install.js index d50e66e5a08..6ba30c8d70d 100644 --- a/packages/sonataflow-image-common/install.js +++ b/packages/sonataflow-image-common/install.js @@ -19,7 +19,7 @@ const { execSync } = require("child_process"); -const buildEnv = require("./env"); +const { env } = require("./env"); const path = require("path"); const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json")); @@ -30,7 +30,7 @@ const activateCmd = execSync( `${activateCmd} && \ - python3 ./resources/scripts/versions_manager.py --bump-to ${buildEnv.env.root.streamName} --source-folder ./resources`, + python3 ./resources/scripts/versions_manager.py --bump-to ${env.root.streamName} --source-folder ./resources`, { stdio: "inherit" } ); diff --git a/packages/sonataflow-image-common/resources/Makefile b/packages/sonataflow-image-common/resources/Makefile index 834de6f6efc..7f72573fb18 100644 --- a/packages/sonataflow-image-common/resources/Makefile +++ b/packages/sonataflow-image-common/resources/Makefile @@ -66,12 +66,6 @@ _create_e2e_dir: rm -rf ../dist-tests-e2e mkdir ../dist-tests-e2e -# Pull kogito-apps repo and build the target kogito-apps depending on the `KOGITO_IMAGE_NAME`s -# Required for kogito-apps images only -.PHONY build-kogito-app: _build_kogito_app -_build_kogito_app: - scripts/build-kogito-apps-components.sh ${KOGITO_IMAGE_NAME} ${KOGITO_VERSION} ${KOGITO_APPS_TARGET_URI}; - # Trigger the image tests .PHONY test-image: _create_e2e_dir _check_kogito_image_name _test_image _test_image: diff --git a/packages/sonataflow-image-common/resources/modules/kogito-maven/common/added/configure-maven.sh b/packages/sonataflow-image-common/resources/modules/kogito-maven/common/added/configure-maven.sh index b2b41b7cba4..8b0334342b4 100644 --- a/packages/sonataflow-image-common/resources/modules/kogito-maven/common/added/configure-maven.sh +++ b/packages/sonataflow-image-common/resources/modules/kogito-maven/common/added/configure-maven.sh @@ -127,7 +127,7 @@ function configure_mirrors() { function configure_maven_download_output() { if [ "${MAVEN_DOWNLOAD_OUTPUT}" != "true" ]; then - export MAVEN_ARGS_APPEND="${MAVEN_ARGS_APPEND} --no-transfer-progress" + export MAVEN_ARGS_APPEND="${MAVEN_ARGS_APPEND}" fi } diff --git a/packages/sonataflow-image-common/resources/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml.envsubst b/packages/sonataflow-image-common/resources/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml.envsubst index e85c5fc1703..ad8a808e6c8 100644 --- a/packages/sonataflow-image-common/resources/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml.envsubst +++ b/packages/sonataflow-image-common/resources/modules/kogito-maven/common/maven/maven-m2-repo-via-http-settings.xml.envsubst @@ -34,74 +34,101 @@ true never + ignore true never + ignore - - - - - kie-tools--maven-m2-repo-via-http - KIE Tools :: Maven M2 Repo via HTTP - http://$M2_REPO_VIA_HTTP_URL_WITHOUT_PROTOCOL/ - default + + apache.snapshots + Apache Snapshot Repository + https://repository.apache.org/snapshots - true - never + false true never - - - - - - kogito-images - + + + central + Central Repository + https://repo.maven.apache.org/maven2 + + false + + apache-public-repository-group Apache Public Repository Group - https://repository.apache.org/content/groups/public/ + https://repo.maven.apache.org/maven2 default - true + false never - true + false + never + + + + jboss-public-repository-group + JBOSS Public Repository Group + https://repo.maven.apache.org/maven2 + default + + false + never + + + false never - + + kie-tools--maven-m2-repo-via-http + KIE Tools :: Maven M2 Repo via HTTP + http://$M2_REPO_VIA_HTTP_URL_WITHOUT_PROTOCOL/ + default + + true + never + ignore + + + true + never + ignore + + apache-public-repository-group Apache Public Repository Group https://repository.apache.org/content/groups/public/ default - true + false never - true + false never - + - kogito-images - kie-tools--maven-m2-repo-via-http-allowed-profile + kie-tools--maven-m2-repo-via-http-allowed-profile diff --git a/packages/sonataflow-image-common/resources/modules/kogito-maven/tests/bats/maven-settings.bats b/packages/sonataflow-image-common/resources/modules/kogito-maven/common/tests/bats/maven-settings.bats similarity index 98% rename from packages/sonataflow-image-common/resources/modules/kogito-maven/tests/bats/maven-settings.bats rename to packages/sonataflow-image-common/resources/modules/kogito-maven/common/tests/bats/maven-settings.bats index 66fb2363532..a986a92642a 100644 --- a/packages/sonataflow-image-common/resources/modules/kogito-maven/tests/bats/maven-settings.bats +++ b/packages/sonataflow-image-common/resources/modules/kogito-maven/common/tests/bats/maven-settings.bats @@ -20,13 +20,13 @@ # imports -source $BATS_TEST_DIRNAME/../../common/added/configure-maven.sh +source $BATS_TEST_DIRNAME/../../added/configure-maven.sh setup() { export KOGITO_HOME=$BATS_TMPDIR/maven mkdir -p ${KOGITO_HOME}/.m2/ - cp $BATS_TEST_DIRNAME/../../common/maven/settings.xml ${KOGITO_HOME}/.m2/ + cp $BATS_TEST_DIRNAME/../../maven/settings.xml ${KOGITO_HOME}/.m2/ export MAVEN_SETTINGS_PATH="${KOGITO_HOME}/.m2/settings.xml" } @@ -163,16 +163,6 @@ function _generate_random_id() { [ "${expected}" = "${result}" ] } -@test "test maven download output logs when MAVEN_DOWNLOAD_OUTPUT is not true" { - prepareEnv - configure_maven_download_output - expected=" --no-transfer-progress" - result="${MAVEN_ARGS_APPEND}" - echo "expected=${expected}" - echo "result=${result}" - [ "${expected}" = "${result}" ] -} - @test "test maven download output logs when MAVEN_DOWNLOAD_OUTPUT is true" { prepareEnv MAVEN_DOWNLOAD_OUTPUT="true" diff --git a/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/add-extension.sh b/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/add-extension.sh index 6dc158d2a08..dc4ab3e7928 100755 --- a/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/add-extension.sh +++ b/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/add-extension.sh @@ -42,6 +42,7 @@ fi "${MAVEN_HOME}"/bin/mvn -B ${MAVEN_ARGS_APPEND} \ -nsu \ + -B \ -s "${MAVEN_SETTINGS_PATH}" \ -DplatformVersion="${QUARKUS_PLATFORM_VERSION}" \ -Dextensions="${extensions}" \ diff --git a/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/build-app.sh b/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/build-app.sh index 671d6e09b1e..d91ceed6ea2 100755 --- a/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/build-app.sh +++ b/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/build-app.sh @@ -59,6 +59,7 @@ cd ${KOGITO_HOME}/serverless-workflow-project "${MAVEN_HOME}"/bin/mvn -B ${MAVEN_ARGS_APPEND} \ -nsu \ + -B \ -s "${MAVEN_SETTINGS_PATH}" \ -DskipTests \ -Dquarkus.container-image.build=false \ diff --git a/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/create-app.sh b/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/create-app.sh index 9d99b521704..5dedc599f2d 100755 --- a/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/create-app.sh +++ b/packages/sonataflow-image-common/resources/modules/sonataflow/common/scripts/added/create-app.sh @@ -36,6 +36,7 @@ source "${script_dir_path}"/configure-jvm-mvn.sh "${MAVEN_HOME}"/bin/mvn -B ${MAVEN_ARGS_APPEND} \ -nsu \ + -B \ -s "${MAVEN_SETTINGS_PATH}" \ io.quarkus.platform:quarkus-maven-plugin:"${QUARKUS_PLATFORM_VERSION}":create ${QUARKUS_CREATE_ARGS} \ -DprojectGroupId="${PROJECT_GROUP_ID}" \ @@ -124,15 +125,13 @@ if [ "${SCRIPT_DEBUG^^}" = "TRUE" ]; then cat pom.xml fi -ls -la "${KOGITO_HOME}"/.m2/repository/org/apache/kie/ -ls -la "${KOGITO_HOME}"/.m2/repository/org/kie/ - # we force the dependencies download beforehand, so we won't have problems when running or building our apps in offline mode # see: # https://quarkus.io/guides/maven-tooling#downloading-maven-artifact-dependencies-for-offline-development-and-testing # https://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html "${MAVEN_HOME}"/bin/mvn -B ${MAVEN_ARGS_APPEND} \ -nsu \ + -B \ -s "${MAVEN_SETTINGS_PATH}" \ -DskipTests=true \ -Dmaven.javadoc.skip=true \ @@ -141,5 +140,6 @@ ls -la "${KOGITO_HOME}"/.m2/repository/org/kie/ # clean up "${MAVEN_HOME}"/bin/mvn -B ${MAVEN_ARGS_APPEND} \ -nsu \ + -B \ -s "${MAVEN_SETTINGS_PATH}" \ clean diff --git a/packages/sonataflow-image-common/resources/scripts/README.md b/packages/sonataflow-image-common/resources/scripts/README.md index 34a4fcd0c85..589ecacfae8 100644 --- a/packages/sonataflow-image-common/resources/scripts/README.md +++ b/packages/sonataflow-image-common/resources/scripts/README.md @@ -63,10 +63,6 @@ Usage: - `--quarkus-version`: Sets the Quarkus version - `--kogito-version`: Sets the Kogito version -## Build Kogito Apps Components - -The [build-kogito-apps-components.sh](build-kogito-apps-components.sh) script pulls and build the target Kogito Apps application, e.g., Data Index. Required to build Kogito Services images in any flavour. - ## Setup Maven The [setup-maven.sh](setup-maven.sh) script configures the internal image Maven repository such as adding new repositories, setup other profiles and so on. diff --git a/packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh b/packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh index 6a96ecb4f8d..12a2f50f03c 100755 --- a/packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh +++ b/packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh @@ -45,7 +45,7 @@ shift $# script_dir_path=$(cd `dirname "${BASH_SOURCE[0]}"`; pwd -P) export NODE_OPTIONS="${NODE_OPTIONS} --max_old_space_size=4096" -APPS_MAVEN_OPTIONS="-Dquarkus.package.type=fast-jar -Dquarkus.build.image=false" +APPS_MAVEN_OPTIONS="-Dquarkus.package.type=fast-jar -Dquarkus.build.image=false -B" # used for all-in-one image extended_context="" diff --git a/packages/sonataflow-image-common/resources/scripts/common.py b/packages/sonataflow-image-common/resources/scripts/common.py index 30cbdc44c93..35ce2c44462 100644 --- a/packages/sonataflow-image-common/resources/scripts/common.py +++ b/packages/sonataflow-image-common/resources/scripts/common.py @@ -268,7 +268,7 @@ def update_label_value_in_file(filename, label_name, label_value): :param label_name: label name to update :param label_value: value to set """ - print("Updating {0} label {1} with value {2}".format(filename, label_name, label_value)) + print(f"Updating {filename} label {label_name} with value {label_value}") try: with open(filename) as yaml_file: data = yaml_loader().load(yaml_file) @@ -281,7 +281,7 @@ def update_label_value_in_file(filename, label_name, label_value): raise -def update_label_value_in_data(data, label_name, label_value, ignore_empty = False): +def update_label_value_in_data(data, label_name, label_value, ignore_empty=False): """ Update label value in data dict if exists :param data: dict to update @@ -296,7 +296,7 @@ def update_label_value_in_data(data, label_name, label_value, ignore_empty = Fal if ignore_empty: if 'labels' not in data: data['labels'] = [] - data['labels'] += [ dict(name=label_name, value=label_value) ] + data['labels'] += [dict(name=label_name, value=label_value)] elif 'labels' in data: for _, label in enumerate(data['labels'], start=0): if label['name'] == label_name: diff --git a/packages/sonataflow-image-common/resources/scripts/setup-maven.sh b/packages/sonataflow-image-common/resources/scripts/setup-maven.sh index 78be682dfe7..d2cf3751a94 100755 --- a/packages/sonataflow-image-common/resources/scripts/setup-maven.sh +++ b/packages/sonataflow-image-common/resources/scripts/setup-maven.sh @@ -48,26 +48,6 @@ configure export MAVEN_OPTIONS="${MAVEN_OPTIONS} -s ${maven_settings_path}" -# Add NPM registry if needed -if [ ! -z "${NPM_REGISTRY_URL}" ]; then - echo "enabling npm repository: ${NPM_REGISTRY_URL}" - npm_profile="\ -\ -internal-npm-registry\ -\ -${NPM_REGISTRY_URL}\ -http://download.devel.redhat.com/rcm-guest/staging/rhba/dist/yarn/\ -http://download.devel.redhat.com/rcm-guest/staging/rhba/dist/node/\ -http://download.devel.redhat.com/rcm-guest/staging/rhba/dist/npm/\ -http://download.devel.redhat.com/rcm-guest/staging/rhba/dist/pnpm/\ -\ -\ -" - sed -i.bak -E "s|()|\1\n${npm_profile}|" "${MAVEN_SETTINGS_PATH}" - sed -i.bak -E "s|()|\1\ninternal-npm-registry|" "${MAVEN_SETTINGS_PATH}" - - rm -rf "${MAVEN_SETTINGS_PATH}/*.bak" -fi cat "${maven_settings_path}" diff --git a/packages/sonataflow-management-console-image/package.json b/packages/sonataflow-management-console-image/package.json index 65bbfe88e66..04933271fc7 100644 --- a/packages/sonataflow-management-console-image/package.json +++ b/packages/sonataflow-management-console-image/package.json @@ -28,7 +28,7 @@ "image:cekit:build:linux": "pnpm image:cekit:copy && pnpm image:cekit:setup:env make -C ./dist-dev build", "image:cekit:build:win32:darwin": "echo \"Build skipped on macOS and Windows\"", "image:cekit:copy": "cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources/* ./dist-dev/ && cp -R resources/* ./dist-dev/", - "image:cekit:setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowManagementConsoleImageEnv.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowManagementConsoleImageEnv.account) KOGITO_IMAGE_NAME=$(build-env sonataflowManagementConsoleImageEnv.name) KOGITO_IMAGE_TAG=$(build-env sonataflowManagementConsoleImageEnv.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env quarkusPlatform.version) KOGITO_VERSION=$(build-env kogitoRuntime.version) SONATAFLOW_MANAGEMENT_CONSOLE_PORT=$(build-env sonataflowManagementConsoleImageEnv.port)" + "image:cekit:setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowManagementConsoleImageEnv.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowManagementConsoleImageEnv.account) KOGITO_IMAGE_NAME=$(build-env sonataflowManagementConsoleImageEnv.name) KOGITO_IMAGE_TAG=$(build-env sonataflowManagementConsoleImageEnv.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito) SONATAFLOW_MANAGEMENT_CONSOLE_PORT=$(build-env sonataflowManagementConsoleImageEnv.port)" }, "devDependencies": { "@kie-tools/image-env-to-json": "workspace:*", diff --git a/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts b/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts index ac51ebae736..f3d602ea355 100644 --- a/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts +++ b/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts @@ -22,7 +22,6 @@ import { EnvJson } from "../src/env/EnvJson"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { env } from "../env"; - const buildEnv: any = env; // build-env is not typed const version = require("../package.json").version; diff --git a/packages/sonataflow-management-console-webapp/webpack.config.ts b/packages/sonataflow-management-console-webapp/webpack.config.ts index 915d98d9708..92fa753a8f8 100644 --- a/packages/sonataflow-management-console-webapp/webpack.config.ts +++ b/packages/sonataflow-management-console-webapp/webpack.config.ts @@ -35,10 +35,10 @@ import { env } from "./env"; const BG_IMAGES_DIRNAME = "bgimages"; const buildEnv: any = env; // build-env is not typed -export default async (env: any, argv: any) => { +export default async (webpackEnv: any, webpackArgv: any) => { return [ { - ...merge(common(env), { + ...merge(common(webpackEnv), { entry: { index: path.resolve(__dirname, "src", "index.tsx"), "serverless-workflow-combined-editor-envelope": diff --git a/packages/sonataflow-operator/Makefile b/packages/sonataflow-operator/Makefile index 538933907c5..6a6bb24435d 100644 --- a/packages/sonataflow-operator/Makefile +++ b/packages/sonataflow-operator/Makefile @@ -1,3 +1,20 @@ +# 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. + # VERSION defines the project version for the bundle. # Update this value when you upgrade the version of your project. # To re-generate a bundle for another specific version without changing the standard setup, you can: @@ -115,7 +132,7 @@ vet: ## Run go vet against code. go vet ./... .PHONY: test -test: manifests generate envtest vet fmt test-api test-workflowproj test-container-builder ## Run tests. +test: manifests generate envtest addheaders vet fmt test-api test-workflowproj test-container-builder ## Run tests. KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(shell go list ./... | grep -v /test/) -coverprofile cover.out .PHONY: test-api diff --git a/packages/sonataflow-operator/api/Makefile b/packages/sonataflow-operator/api/Makefile index 00c73d81848..6f72fad5e6c 100644 --- a/packages/sonataflow-operator/api/Makefile +++ b/packages/sonataflow-operator/api/Makefile @@ -1,3 +1,20 @@ +# 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. + .PHONY: test test: go test $(shell go list ./... | grep -v /test/) -coverprofile cover.out diff --git a/packages/sonataflow-operator/api/v1alpha08/sonataflow_persistence_types.go b/packages/sonataflow-operator/api/v1alpha08/sonataflow_persistence_types.go index d0b08e46799..77c9f0ad3b5 100644 --- a/packages/sonataflow-operator/api/v1alpha08/sonataflow_persistence_types.go +++ b/packages/sonataflow-operator/api/v1alpha08/sonataflow_persistence_types.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package v1alpha08 diff --git a/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_property_types.go b/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_property_types.go index d138ac40c06..11f0636fe2c 100644 --- a/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_property_types.go +++ b/packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_property_types.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package v1alpha08 diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controller-manager-metrics-service_v1_service.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controller-manager-metrics-service_v1_service.yaml index 48f0198e414..e4a087a26cb 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controller-manager-metrics-service_v1_service.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controller-manager-metrics-service_v1_service.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: v1 kind: Service metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controllers-config_v1_configmap.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controllers-config_v1_configmap.yaml index 725423f51ad..2697290b5d3 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controllers-config_v1_configmap.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-controllers-config_v1_configmap.yaml @@ -1,6 +1,23 @@ apiVersion: v1 data: controllers_cfg.yaml: | + # 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. + # The default size of Kaniko PVC when using the internal operator builder manager defaultPvcKanikoSize: 1Gi # How much time (in seconds) to wait for a devmode workflow to start. diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-manager-config_v1_configmap.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-manager-config_v1_configmap.yaml index 3f7526a3928..1e0ec5e16ad 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-manager-config_v1_configmap.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-manager-config_v1_configmap.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: v1 data: controller_manager_config.yaml: | diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml index dc5dac882e3..cfe298b4810 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-sonataflowclusterplatform-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-sonataflowclusterplatform-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml index 776356b7e77..5a9fb372f69 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-sonataflowclusterplatform-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator-sonataflowclusterplatform-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml index 94b7ddc02e6..9a4601357f8 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow-operator.clusterserviceversion.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowbuilds.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowbuilds.yaml index e83477192f2..516d303f9da 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowbuilds.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowbuilds.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowclusterplatforms.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowclusterplatforms.yaml index e76ea83978d..9080fbddd0b 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowclusterplatforms.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowclusterplatforms.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml index c425d5ca31c..378023fd3c2 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflowplatforms.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflows.yaml b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflows.yaml index d66b8b5c72a..bd7cebefd61 100644 --- a/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflows.yaml +++ b/packages/sonataflow-operator/bundle/manifests/sonataflow.org_sonataflows.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/packages/sonataflow-operator/bundle/tests/scorecard/config.yaml b/packages/sonataflow-operator/bundle/tests/scorecard/config.yaml index 10c93fa4d75..caa003d86fc 100644 --- a/packages/sonataflow-operator/bundle/tests/scorecard/config.yaml +++ b/packages/sonataflow-operator/bundle/tests/scorecard/config.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: scorecard.operatorframework.io/v1alpha3 kind: Configuration metadata: diff --git a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowbuilds.yaml b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowbuilds.yaml index c1a21bd445e..f79e1666797 100644 --- a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowbuilds.yaml +++ b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowbuilds.yaml @@ -1,3 +1,20 @@ +# 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. + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowclusterplatforms.yaml b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowclusterplatforms.yaml index 6ed0c78cddf..71fb5b31399 100644 --- a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowclusterplatforms.yaml +++ b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowclusterplatforms.yaml @@ -1,3 +1,20 @@ +# 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. + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml index 1c6766cbbf7..3538abf605a 100644 --- a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml +++ b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml @@ -1,3 +1,20 @@ +# 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. + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflows.yaml b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflows.yaml index 6d506dbf8b7..ae0f2e3cc92 100644 --- a/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflows.yaml +++ b/packages/sonataflow-operator/config/crd/bases/sonataflow.org_sonataflows.yaml @@ -1,3 +1,20 @@ +# 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. + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/packages/sonataflow-operator/config/manager/controllers_cfg.yaml b/packages/sonataflow-operator/config/manager/controllers_cfg.yaml index 8eeab9c9476..b81bca7f69e 100644 --- a/packages/sonataflow-operator/config/manager/controllers_cfg.yaml +++ b/packages/sonataflow-operator/config/manager/controllers_cfg.yaml @@ -1,3 +1,20 @@ +# 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. + # The default size of Kaniko PVC when using the internal operator builder manager defaultPvcKanikoSize: 1Gi # How much time (in seconds) to wait for a devmode workflow to start. diff --git a/packages/sonataflow-operator/config/manifests/bases/sonataflow-operator.clusterserviceversion.yaml b/packages/sonataflow-operator/config/manifests/bases/sonataflow-operator.clusterserviceversion.yaml index 7dc3c1f9b53..7357896e7dd 100644 --- a/packages/sonataflow-operator/config/manifests/bases/sonataflow-operator.clusterserviceversion.yaml +++ b/packages/sonataflow-operator/config/manifests/bases/sonataflow-operator.clusterserviceversion.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: diff --git a/packages/sonataflow-operator/config/rbac/role.yaml b/packages/sonataflow-operator/config/rbac/role.yaml index ccac71b06f4..0cc9ef3d4ca 100644 --- a/packages/sonataflow-operator/config/rbac/role.yaml +++ b/packages/sonataflow-operator/config/rbac/role.yaml @@ -1,3 +1,20 @@ +# 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. + --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/packages/sonataflow-operator/config/samples/sonataflow.org_v1alpha08_sonataflowbuild.yaml b/packages/sonataflow-operator/config/samples/sonataflow.org_v1alpha08_sonataflowbuild.yaml index 1b54d4ab0ec..9009769db40 100644 --- a/packages/sonataflow-operator/config/samples/sonataflow.org_v1alpha08_sonataflowbuild.yaml +++ b/packages/sonataflow-operator/config/samples/sonataflow.org_v1alpha08_sonataflowbuild.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: sonataflow.org/v1alpha08 kind: SonataFlowBuild metadata: diff --git a/packages/sonataflow-operator/container-builder/Makefile b/packages/sonataflow-operator/container-builder/Makefile index c6b29c8df76..96dff21ad3c 100644 --- a/packages/sonataflow-operator/container-builder/Makefile +++ b/packages/sonataflow-operator/container-builder/Makefile @@ -1,3 +1,20 @@ +# 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. + .PHONY: all all: build diff --git a/packages/sonataflow-operator/controllers/cfg/controllers_cfg.go b/packages/sonataflow-operator/controllers/cfg/controllers_cfg.go index e26254fd3ee..a1b620230e0 100644 --- a/packages/sonataflow-operator/controllers/cfg/controllers_cfg.go +++ b/packages/sonataflow-operator/controllers/cfg/controllers_cfg.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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: we use `cfg` instead of `config` or `configuration` in order to have a shorter accessor in the codebase. diff --git a/packages/sonataflow-operator/controllers/cfg/controllers_cfg_test.go b/packages/sonataflow-operator/controllers/cfg/controllers_cfg_test.go index d2d092dc8e9..c763a36f8e2 100644 --- a/packages/sonataflow-operator/controllers/cfg/controllers_cfg_test.go +++ b/packages/sonataflow-operator/controllers/cfg/controllers_cfg_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package cfg diff --git a/packages/sonataflow-operator/controllers/profiles/common/constants/objects.go b/packages/sonataflow-operator/controllers/profiles/common/constants/objects.go index caddd1a10a8..d89cffc9190 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/constants/objects.go +++ b/packages/sonataflow-operator/controllers/profiles/common/constants/objects.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package constants diff --git a/packages/sonataflow-operator/controllers/profiles/common/constants/workflows.go b/packages/sonataflow-operator/controllers/profiles/common/constants/workflows.go index 8087f963bc8..f7c85f359bc 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/constants/workflows.go +++ b/packages/sonataflow-operator/controllers/profiles/common/constants/workflows.go @@ -1,16 +1,19 @@ -// Copyright 2023 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package constants diff --git a/packages/sonataflow-operator/controllers/profiles/common/knative.go b/packages/sonataflow-operator/controllers/profiles/common/knative.go index 5c70cad9c0f..c3cbed72f55 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/knative.go +++ b/packages/sonataflow-operator/controllers/profiles/common/knative.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package common diff --git a/packages/sonataflow-operator/controllers/profiles/common/persistence/postgresql.go b/packages/sonataflow-operator/controllers/profiles/common/persistence/postgresql.go index 94a5ab5ac44..96250571214 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/persistence/postgresql.go +++ b/packages/sonataflow-operator/controllers/profiles/common/persistence/postgresql.go @@ -1,16 +1,19 @@ -// Copyright 2023 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package persistence diff --git a/packages/sonataflow-operator/controllers/profiles/common/properties/knative.go b/packages/sonataflow-operator/controllers/profiles/common/properties/knative.go index 04228e33142..8d5f327195d 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/properties/knative.go +++ b/packages/sonataflow-operator/controllers/profiles/common/properties/knative.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package properties diff --git a/packages/sonataflow-operator/controllers/profiles/common/properties/platform.go b/packages/sonataflow-operator/controllers/profiles/common/properties/platform.go index b705e4c4b38..f629f63f8a7 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/properties/platform.go +++ b/packages/sonataflow-operator/controllers/profiles/common/properties/platform.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package properties diff --git a/packages/sonataflow-operator/controllers/profiles/common/properties/platform_test.go b/packages/sonataflow-operator/controllers/profiles/common/properties/platform_test.go index 8867d43b71c..3606aac9fff 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/properties/platform_test.go +++ b/packages/sonataflow-operator/controllers/profiles/common/properties/platform_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package properties diff --git a/packages/sonataflow-operator/controllers/profiles/common/properties/properties_suite_test.go b/packages/sonataflow-operator/controllers/profiles/common/properties/properties_suite_test.go index 4d5aa706ab0..214384f7e51 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/properties/properties_suite_test.go +++ b/packages/sonataflow-operator/controllers/profiles/common/properties/properties_suite_test.go @@ -1,16 +1,19 @@ -// Copyright 2023 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package properties_test diff --git a/packages/sonataflow-operator/controllers/profiles/common/properties/properties_test.go b/packages/sonataflow-operator/controllers/profiles/common/properties/properties_test.go index 81c91ef89df..54d4826020f 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/properties/properties_test.go +++ b/packages/sonataflow-operator/controllers/profiles/common/properties/properties_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package properties diff --git a/packages/sonataflow-operator/controllers/profiles/common/variables/k8s.go b/packages/sonataflow-operator/controllers/profiles/common/variables/k8s.go index 88ce87c84a7..c32897c0163 100644 --- a/packages/sonataflow-operator/controllers/profiles/common/variables/k8s.go +++ b/packages/sonataflow-operator/controllers/profiles/common/variables/k8s.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package variables diff --git a/packages/sonataflow-operator/controllers/profiles/gitops/alias.go b/packages/sonataflow-operator/controllers/profiles/gitops/alias.go index 396b229041b..9edd22b538a 100644 --- a/packages/sonataflow-operator/controllers/profiles/gitops/alias.go +++ b/packages/sonataflow-operator/controllers/profiles/gitops/alias.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package gitops diff --git a/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops.go b/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops.go index ed4d30f1b6e..690c3b7d56f 100644 --- a/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops.go +++ b/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package gitops diff --git a/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops_test.go b/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops_test.go index fcf1689b752..b245520d5c6 100644 --- a/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops_test.go +++ b/packages/sonataflow-operator/controllers/profiles/gitops/profile_gitops_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package gitops diff --git a/packages/sonataflow-operator/controllers/workflowdef/services.go b/packages/sonataflow-operator/controllers/workflowdef/services.go index 5a0ddfbea92..53b6b8f4147 100644 --- a/packages/sonataflow-operator/controllers/workflowdef/services.go +++ b/packages/sonataflow-operator/controllers/workflowdef/services.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package workflowdef diff --git a/packages/sonataflow-operator/controllers/workflows/constants.go b/packages/sonataflow-operator/controllers/workflows/constants.go index afcf157a1b6..4ed4e5a150f 100644 --- a/packages/sonataflow-operator/controllers/workflows/constants.go +++ b/packages/sonataflow-operator/controllers/workflows/constants.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package workflows diff --git a/packages/sonataflow-operator/controllers/workflows/workflows.go b/packages/sonataflow-operator/controllers/workflows/workflows.go index 9e5045ce35b..ddc45af2282 100644 --- a/packages/sonataflow-operator/controllers/workflows/workflows.go +++ b/packages/sonataflow-operator/controllers/workflows/workflows.go @@ -1,16 +1,19 @@ -// Copyright 2023 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package workflows diff --git a/packages/sonataflow-operator/hack/addheaders.sh b/packages/sonataflow-operator/hack/addheaders.sh index 3e830e29dd1..173bc28d59d 100755 --- a/packages/sonataflow-operator/hack/addheaders.sh +++ b/packages/sonataflow-operator/hack/addheaders.sh @@ -23,4 +23,4 @@ if ! hash addlicense 2>/dev/null; then fi # shellcheck disable=SC2035 -addlicense -c "Apache Software Foundation (ASF)" -l=apache -ignore=test/samples/*.yaml -ignore=container-builder/examples/**/*.yaml hack api controllers utils test container-builder workflowproj +addlicense -f=hack/license-header.txt -ignore=test/samples/*.yaml -ignore=container-builder/examples/**/*.yaml hack api controllers utils test container-builder workflowproj bundle config ./operator.yaml diff --git a/packages/sonataflow-operator/hack/license-header.txt b/packages/sonataflow-operator/hack/license-header.txt new file mode 100644 index 00000000000..90705e02e05 --- /dev/null +++ b/packages/sonataflow-operator/hack/license-header.txt @@ -0,0 +1,16 @@ +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. \ No newline at end of file diff --git a/packages/sonataflow-operator/install.js b/packages/sonataflow-operator/install.js index 2a1d0bb8733..86521e71e5b 100644 --- a/packages/sonataflow-operator/install.js +++ b/packages/sonataflow-operator/install.js @@ -19,13 +19,14 @@ const fs = require("fs"); const path = require("path"); -const buildEnv = require("./env"); +const { env } = require("./env"); const sonataflowPlatformFiles = fs .readdirSync(path.resolve(__dirname, "test/testdata"), { recursive: true, }) .filter((fileName) => fileName.endsWith("02-sonataflow_platform.yaml")); + sonataflowPlatformFiles.forEach((filePath) => { const fullFilePath = path.resolve(__dirname, path.join("test/testdata"), filePath); fs.writeFileSync( @@ -34,11 +35,11 @@ sonataflowPlatformFiles.forEach((filePath) => { .readFileSync(fullFilePath, "utf-8") .replace( /org\.kie:kie-addons-quarkus-persistence-jdbc:[^,\n]*/, - `org.kie:kie-addons-quarkus-persistence-jdbc:${buildEnv.env.kogitoRuntime.version}` + `org.kie:kie-addons-quarkus-persistence-jdbc:${env.versions.kogito}` ) .replace( /org\.kie\.kogito:kogito-addons-quarkus-jobs-knative-eventing:[^,\n]*/, - `org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:${buildEnv.env.kogitoRuntime.version}` + `org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:${env.versions.kogito}` ) ); }); diff --git a/packages/sonataflow-operator/operator.yaml b/packages/sonataflow-operator/operator.yaml index 504b80cc706..f52d204b948 100644 --- a/packages/sonataflow-operator/operator.yaml +++ b/packages/sonataflow-operator/operator.yaml @@ -1,3 +1,20 @@ +# 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. + apiVersion: v1 kind: Namespace metadata: @@ -27021,6 +27038,23 @@ metadata: apiVersion: v1 data: controllers_cfg.yaml: | + # 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. + # The default size of Kaniko PVC when using the internal operator builder manager defaultPvcKanikoSize: 1Gi # How much time (in seconds) to wait for a devmode workflow to start. diff --git a/packages/sonataflow-operator/test/e2e/clusterplatform_test.go b/packages/sonataflow-operator/test/e2e/clusterplatform_test.go index 544cee25e96..5a65fdba0aa 100644 --- a/packages/sonataflow-operator/test/e2e/clusterplatform_test.go +++ b/packages/sonataflow-operator/test/e2e/clusterplatform_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package e2e diff --git a/packages/sonataflow-operator/test/e2e/helpers.go b/packages/sonataflow-operator/test/e2e/helpers.go index 5a78ae0cfc3..4eac38d43bd 100644 --- a/packages/sonataflow-operator/test/e2e/helpers.go +++ b/packages/sonataflow-operator/test/e2e/helpers.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package e2e diff --git a/packages/sonataflow-operator/test/e2e/platform_test.go b/packages/sonataflow-operator/test/e2e/platform_test.go index 3c10e244588..6a11522b22b 100644 --- a/packages/sonataflow-operator/test/e2e/platform_test.go +++ b/packages/sonataflow-operator/test/e2e/platform_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package e2e diff --git a/packages/sonataflow-operator/test/testdata/platform/noservices/preview/ephemeral/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/platform/noservices/preview/ephemeral/02-sonataflow_platform.yaml index 7d7a0c7834d..82235f4cd1a 100644 --- a/packages/sonataflow-operator/test/testdata/platform/noservices/preview/ephemeral/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/platform/noservices/preview/ephemeral/02-sonataflow_platform.yaml @@ -26,7 +26,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSION - value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20240912-SNAPSHOT + value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20241016-SNAPSHOT config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/platform/services/dev/ephemeral/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/platform/services/dev/ephemeral/02-sonataflow_platform.yaml index b191414226d..fd925ab2b08 100644 --- a/packages/sonataflow-operator/test/testdata/platform/services/dev/ephemeral/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/platform/services/dev/ephemeral/02-sonataflow_platform.yaml @@ -26,7 +26,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSION - value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20240912-SNAPSHOT + value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20241016-SNAPSHOT config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/platform/services/dev/postgreSQL/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/platform/services/dev/postgreSQL/02-sonataflow_platform.yaml index ef4f112e9e4..f5d695d1bae 100644 --- a/packages/sonataflow-operator/test/testdata/platform/services/dev/postgreSQL/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/platform/services/dev/postgreSQL/02-sonataflow_platform.yaml @@ -26,7 +26,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSIONS - value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20240912-SNAPSHOT + value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20241016-SNAPSHOT services: dataIndex: enabled: false diff --git a/packages/sonataflow-operator/test/testdata/platform/services/preview/cluster-wide-ephemeral/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/platform/services/preview/cluster-wide-ephemeral/02-sonataflow_platform.yaml index 7e915e2cd76..904419541ce 100644 --- a/packages/sonataflow-operator/test/testdata/platform/services/preview/cluster-wide-ephemeral/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/platform/services/preview/cluster-wide-ephemeral/02-sonataflow_platform.yaml @@ -26,7 +26,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSION - value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20240912-SNAPSHOT + value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20241016-SNAPSHOT config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-data-index/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-data-index/02-sonataflow_platform.yaml index 7c1d15d02de..8d0a11a74c6 100644 --- a/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-data-index/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-data-index/02-sonataflow_platform.yaml @@ -26,7 +26,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSION - value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20240912-SNAPSHOT + value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20241016-SNAPSHOT config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-job-service/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-job-service/02-sonataflow_platform.yaml index 735b2c4150d..cb119bb6d3e 100644 --- a/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-job-service/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/platform/services/preview/ephemeral-job-service/02-sonataflow_platform.yaml @@ -25,7 +25,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSION - value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20240912-SNAPSHOT + value: org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-20241016-SNAPSHOT config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/workflow/persistence/by_service/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/workflow/persistence/by_service/02-sonataflow_platform.yaml index 73f61014068..a9cc3847d80 100644 --- a/packages/sonataflow-operator/test/testdata/workflow/persistence/by_service/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/workflow/persistence/by_service/02-sonataflow_platform.yaml @@ -26,7 +26,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSIONS - value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20240912-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 + value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20241016-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_overwritten_by_service/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_overwritten_by_service/02-sonataflow_platform.yaml index 49d9a7ae895..f10df872ac4 100644 --- a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_overwritten_by_service/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_overwritten_by_service/02-sonataflow_platform.yaml @@ -36,7 +36,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSIONS - value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20240912-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 + value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20241016-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_di_and_js_services/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_di_and_js_services/02-sonataflow_platform.yaml index 4003263627c..8f23dbc2090 100644 --- a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_di_and_js_services/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_di_and_js_services/02-sonataflow_platform.yaml @@ -36,7 +36,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSIONS - value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20240912-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 + value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20241016-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/02-sonataflow_platform.yaml index db0fb8d8284..ee47d71bbb0 100644 --- a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_with_no_persistence_required/02-sonataflow_platform.yaml @@ -36,7 +36,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSIONS - value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20240912-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 + value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20241016-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/02-sonataflow_platform.yaml b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/02-sonataflow_platform.yaml index db0fb8d8284..ee47d71bbb0 100644 --- a/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/02-sonataflow_platform.yaml +++ b/packages/sonataflow-operator/test/testdata/workflow/persistence/from_platform_without_di_and_js_services/02-sonataflow_platform.yaml @@ -36,7 +36,7 @@ spec: template: buildArgs: - name: QUARKUS_EXTENSIONS - value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20240912-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 + value: org.kie:kie-addons-quarkus-persistence-jdbc:999-20241016-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.6,io.quarkus:quarkus-agroal:3.8.6 config: strategyOptions: KanikoBuildCacheEnabled: "true" diff --git a/packages/sonataflow-operator/utils/client.go b/packages/sonataflow-operator/utils/client.go index 9b1cd085687..3e7bc567dad 100644 --- a/packages/sonataflow-operator/utils/client.go +++ b/packages/sonataflow-operator/utils/client.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package utils diff --git a/packages/sonataflow-operator/utils/kubernetes/image.go b/packages/sonataflow-operator/utils/kubernetes/image.go index 93c317c72b7..ce78c3556b8 100644 --- a/packages/sonataflow-operator/utils/kubernetes/image.go +++ b/packages/sonataflow-operator/utils/kubernetes/image.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package kubernetes diff --git a/packages/sonataflow-operator/utils/kubernetes/image_test.go b/packages/sonataflow-operator/utils/kubernetes/image_test.go index e9a4b07315f..dab911a8a37 100644 --- a/packages/sonataflow-operator/utils/kubernetes/image_test.go +++ b/packages/sonataflow-operator/utils/kubernetes/image_test.go @@ -1,16 +1,19 @@ -// Copyright 2024 Apache Software Foundation (ASF) +// 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 // -// Licensed 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 // -// 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. +// 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. package kubernetes diff --git a/packages/sonataflow-operator/workflowproj/Makefile b/packages/sonataflow-operator/workflowproj/Makefile index 21599a40925..09bf8cbe60b 100644 --- a/packages/sonataflow-operator/workflowproj/Makefile +++ b/packages/sonataflow-operator/workflowproj/Makefile @@ -1,3 +1,20 @@ +# 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. + .PHONY: all all: test diff --git a/packages/sonataflow-quarkus-devui/install.js b/packages/sonataflow-quarkus-devui/install.js index 99bfadb8cf8..92178cbb293 100644 --- a/packages/sonataflow-quarkus-devui/install.js +++ b/packages/sonataflow-quarkus-devui/install.js @@ -17,9 +17,10 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.sonataflowQuarkusDevuiExtension.version} +setupMavenConfigFile(` + -Drevision=${env.sonataflowQuarkusDevuiExtension.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); diff --git a/packages/sonataflow-quarkus-devui/package.json b/packages/sonataflow-quarkus-devui/package.json index 0e505282968..531a77e8355 100644 --- a/packages/sonataflow-quarkus-devui/package.json +++ b/packages/sonataflow-quarkus-devui/package.json @@ -17,8 +17,8 @@ "build:dev:darwin:linux": "mvn clean install -DskipTests", "build:dev:win32": "pnpm powershell \"mvn clean install -DskipTests \"", "build:prod": "pnpm lint && run-script-os", - "build:prod:darwin:linux": "mvn clean deploy -DdeployAtEnd -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -Dreproducible", - "build:prod:win32": "pnpm powershell \"mvn clean deploy `-DdeployAtEnd `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dmaven.deploy.skip=$(build-env maven.deploy.skip) `-Dreproducible\"", + "build:prod:darwin:linux": "mvn clean deploy -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -Dreproducible", + "build:prod:win32": "pnpm powershell \"mvn clean deploy `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dmaven.deploy.skip=$(build-env maven.deploy.skip) `-Dreproducible\"", "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command", @@ -30,7 +30,6 @@ "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/serverless-workflow-dev-ui-webapp": "workspace:*", "run-script-os": "^1.1.6" diff --git a/packages/sonataflow-quarkus-devui/pom.xml b/packages/sonataflow-quarkus-devui/pom.xml index 6b712cb4ada..e662ac87e28 100644 --- a/packages/sonataflow-quarkus-devui/pom.xml +++ b/packages/sonataflow-quarkus-devui/pom.xml @@ -33,6 +33,7 @@ org.apache.kie.sonataflow sonataflow-quarkus-devui-parent + ${revision} KIE Tools :: SonataFlow Quarkus Dev UI Extension diff --git a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/pom.xml b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/pom.xml index 89c237fd513..97fcdf93b57 100644 --- a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/pom.xml +++ b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-deployment/pom.xml @@ -63,7 +63,7 @@ io.quarkus - quarkus-rest-client-deployment + quarkus-resteasy-client-deployment io.quarkus @@ -72,19 +72,23 @@ org.apache.kie.sonataflow sonataflow-quarkus-devui + ${project.version} - + org.apache.james apache-mime4j-core - ${version.apache.mime4j} - + io.quarkus quarkus-undertow-deployment @@ -100,11 +104,6 @@ mockito-core test - - org.apache.kie.sonataflow - sonataflow-quarkus-devui - ${project.version} - io.quarkus quarkus-junit5-internal @@ -116,20 +115,18 @@ maven-compiler-plugin - ${compiler-plugin.version} io.quarkus quarkus-extension-processor - ${quarkus.platform.version} + ${version.quarkus} maven-resources-plugin - ${version.resources.plugin} copy-webapp diff --git a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-parent.iml b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-parent.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui-parent.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/pom.xml b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/pom.xml index e50e1e19cbf..8595154bb4e 100644 --- a/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/pom.xml +++ b/packages/sonataflow-quarkus-devui/sonataflow-quarkus-devui/pom.xml @@ -50,7 +50,7 @@ io.quarkus - quarkus-rest-client + quarkus-resteasy-client @@ -130,7 +130,7 @@ io.quarkus quarkus-extension-maven-plugin - ${quarkus.platform.version} + ${version.quarkus} compile @@ -145,13 +145,12 @@ maven-compiler-plugin - ${compiler-plugin.version} io.quarkus quarkus-extension-processor - ${quarkus.platform.version} + ${version.quarkus} diff --git a/packages/storybook-base/src/config/baseConfig.ts b/packages/storybook-base/src/config/baseConfig.ts index 7af3802d885..384d9fe0f3a 100644 --- a/packages/storybook-base/src/config/baseConfig.ts +++ b/packages/storybook-base/src/config/baseConfig.ts @@ -60,7 +60,9 @@ export const baseConfig: ( path.dirname(require.resolve("@storybook/addon-webpack5-compiler-babel/package.json")), ], webpackFinal: async (config) => { - return merge(config, common); + // Preserve Storybook output configurations + const commonConfig = { ...common, output: undefined }; + return merge(config, commonConfig); }, }; }; diff --git a/packages/stunner-editors-dmn-loader/webpack.config.js b/packages/stunner-editors-dmn-loader/webpack.config.js index 007ded04be1..d7c69102038 100644 --- a/packages/stunner-editors-dmn-loader/webpack.config.js +++ b/packages/stunner-editors-dmn-loader/webpack.config.js @@ -22,13 +22,12 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const { env } = require("./env"); -const buildEnv = env; -module.exports = (env) => { - const outputPath = buildEnv.stunnerEditors.dmnLoader.outputPath; +module.exports = (webpackEnv) => { + const outputPath = env.stunnerEditors.dmnLoader.outputPath; console.info(`Stunner Editors :: DMN Loader :: Output path: '${outputPath}'`); - return merge(common(env), { + return merge(common(webpackEnv), { entry: "./src/index.tsx", target: "web", diff --git a/packages/stunner-editors/errai-ui/src/test/resources/less.jar b/packages/stunner-editors/errai-ui/src/test/resources/less.jar deleted file mode 100644 index cdce000cd1d..00000000000 Binary files a/packages/stunner-editors/errai-ui/src/test/resources/less.jar and /dev/null differ diff --git a/packages/stunner-editors/install.js b/packages/stunner-editors/install.js index a9c7ff06ea9..f1cbed01f51 100644 --- a/packages/stunner-editors/install.js +++ b/packages/stunner-editors/install.js @@ -17,10 +17,16 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.stunnerEditors.version} - -Dversion.org.kie.kogito=${buildEnv.env.kogitoRuntime.version} -`); +setupMavenConfigFile( + ` + --batch-mode + -Dstyle.color=always + -Drevision=${env.stunnerEditors.version} + -Dversion.org.kie.kogito=${env.versions.kogito} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} +`, + { ignoreDefault: true } // Default configuration doesn't work for this module. Since this module is not going to last long, we rely on this workaround for a while. +); diff --git a/packages/stunner-editors/package.json b/packages/stunner-editors/package.json index b18d4273885..be5b4b6ab05 100644 --- a/packages/stunner-editors/package.json +++ b/packages/stunner-editors/package.json @@ -33,7 +33,7 @@ "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", + "@kie-tools/maven-base": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/stunner-editors-dmn-loader": "workspace:*", "rimraf": "^3.0.2", diff --git a/packages/stunner-editors/pom.xml b/packages/stunner-editors/pom.xml index bcf725aad35..e5068660c9f 100644 --- a/packages/stunner-editors/pom.xml +++ b/packages/stunner-editors/pom.xml @@ -31,8 +31,8 @@ ${revision} pom - Stunner Editors Java - Parent - Stunner Editors Java - Parent + KIE Tools :: Stunner Editors (BPMN, DMN, and SceSim) + GWT- and Stunner-based graphical editors for .bpmn, .dmn, and .scesim files http://kogito.kie.org 2021 @@ -2103,5 +2103,30 @@ ${env.ghprbTargetBranch} + + + + + use-maven-repo-local-tail + + + kieTools.do-not-use-this-property.ignoreMavenRepoLocalTail + !true + + + + + + + org.apache.maven.plugins + maven-install-plugin + + true + + + + + + diff --git a/packages/stunner-editors/stunner-editors-parent.iml b/packages/stunner-editors/stunner-editors-parent.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/stunner-editors/stunner-editors-parent.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/vscode-extension-common-test-helpers/package.json b/packages/vscode-extension-common-test-helpers/package.json index ee602f25809..576eb4451f2 100644 --- a/packages/vscode-extension-common-test-helpers/package.json +++ b/packages/vscode-extension-common-test-helpers/package.json @@ -35,10 +35,10 @@ "mocha": "^10.6.0", "rimraf": "^3.0.2", "typescript": "^5.5.3", - "vscode-extension-tester": "^8.3.1" + "vscode-extension-tester": "^8.8.0" }, "peerDependencies": { "mocha": "^10.6.0", - "vscode-extension-tester": "^8.3.1" + "vscode-extension-tester": "^8.8.0" } } diff --git a/packages/vscode-extension-dashbuilder-editor/package.json b/packages/vscode-extension-dashbuilder-editor/package.json index 254624cb1ee..24d93d939fc 100644 --- a/packages/vscode-extension-dashbuilder-editor/package.json +++ b/packages/vscode-extension-dashbuilder-editor/package.json @@ -69,7 +69,7 @@ "sanitize-filename-ts": "^1.0.2", "selenium-webdriver": "^4.15.0", "typescript": "^5.5.3", - "vscode-extension-tester": "^8.3.1", + "vscode-extension-tester": "^8.8.0", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", diff --git a/packages/vscode-extension-dashbuilder-editor/webpack.config.js b/packages/vscode-extension-dashbuilder-editor/webpack.config.js index 8b23d8cf429..9c4419e03fd 100644 --- a/packages/vscode-extension-dashbuilder-editor/webpack.config.js +++ b/packages/vscode-extension-dashbuilder-editor/webpack.config.js @@ -24,8 +24,8 @@ const dashbuilderClient = require("@kie-tools/dashbuilder-client"); const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "DashbuilderEditor", libraryTarget: "umd", @@ -37,15 +37,15 @@ const commonConfig = (env) => }, }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension": "./src/extension/extension.ts", }, plugins: [], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "webworker", entry: { "browser/extension": "./src/browser/extension.ts", @@ -57,7 +57,7 @@ module.exports = async (env) => [ }), ], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "webview/DashbuilderEditorEnvelopeApp": "./src/webview/DashbuilderEditorEnvelopeApp.ts", diff --git a/packages/vscode-extension-kie-ba-bundle/webpack.config.js b/packages/vscode-extension-kie-ba-bundle/webpack.config.js index cfe2975d743..50a126aeb13 100644 --- a/packages/vscode-extension-kie-ba-bundle/webpack.config.js +++ b/packages/vscode-extension-kie-ba-bundle/webpack.config.js @@ -20,8 +20,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -module.exports = async (env) => [ - merge(common(env), { +module.exports = async (webpackEnv) => [ + merge(common(webpackEnv), { output: { library: "VsCodeExtensionKieBaBundle", libraryTarget: "umd", diff --git a/packages/vscode-extension-kogito-bundle/webpack.config.js b/packages/vscode-extension-kogito-bundle/webpack.config.js index 5d5fe06b019..fa82d0700d2 100644 --- a/packages/vscode-extension-kogito-bundle/webpack.config.js +++ b/packages/vscode-extension-kogito-bundle/webpack.config.js @@ -20,8 +20,8 @@ const { merge } = require("webpack-merge"); const common = require("@kie-tools-core/webpack-base/webpack.common.config"); -module.exports = async (env) => [ - merge(common(env), { +module.exports = async (webpackEnv) => [ + merge(common(webpackEnv), { output: { library: "KogitoBundle", libraryTarget: "umd", diff --git a/packages/vscode-java-code-completion-extension-plugin/install.js b/packages/vscode-java-code-completion-extension-plugin/install.js index 3fcd2b81a0f..c599d90c1a6 100644 --- a/packages/vscode-java-code-completion-extension-plugin/install.js +++ b/packages/vscode-java-code-completion-extension-plugin/install.js @@ -17,20 +17,25 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); + +const version = env.vscodeJavaCodeCompletionExtensionPlugin.version; + +setupMavenConfigFile(` + -Drevision=${version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} +`); + +installMvnw(); + +// Manifest file + const fs = require("fs"); const path = require("path"); const MANIFEST_FILE = path.resolve("vscode-java-code-completion-extension-plugin-core/META-INF/MANIFEST.MF"); -console.info("[vscode-java-code-completion-extension-plugin-install] Updating '.mvn/maven.config'..."); -const version = buildEnv.env.vscodeJavaCodeCompletionExtensionPlugin.version; - -setup(` - -Drevision=${version} -`); - console.info("[vscode-java-code-completion-extension-plugin-install] Updating manifest file..."); const manifestFile = fs.readFileSync(MANIFEST_FILE, "utf-8"); diff --git a/packages/vscode-java-code-completion-extension-plugin/package.json b/packages/vscode-java-code-completion-extension-plugin/package.json index 1a16d3f4065..8e26cccb065 100644 --- a/packages/vscode-java-code-completion-extension-plugin/package.json +++ b/packages/vscode-java-code-completion-extension-plugin/package.json @@ -24,8 +24,7 @@ "build:prod": "pnpm lint && run-script-os", "build:prod:darwin:linux": "mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dreproducible", "build:prod:win32": "pnpm powershell \"mvn clean install `-DskipTests=$(build-env tests.run --not) `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dreproducible\"", - "install": "node install.js && pnpm install:mvnw", - "install:mvnw": "mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper -f ./", + "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, @@ -33,7 +32,6 @@ "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "run-script-os": "^1.1.6" }, diff --git a/packages/vscode-java-code-completion-extension-plugin/pom.xml b/packages/vscode-java-code-completion-extension-plugin/pom.xml index 556e46a65cf..5aee72ab2b6 100644 --- a/packages/vscode-java-code-completion-extension-plugin/pom.xml +++ b/packages/vscode-java-code-completion-extension-plugin/pom.xml @@ -33,7 +33,8 @@ org.apache.kie vscode-java-code-completion-extension-plugin pom - vscode-java-code-completion-extension-plugin :: parent + + KIE Tools :: VS Code :: Java code completion extension plugin vscode-java-code-completion-extension-plugin parent @@ -42,16 +43,18 @@ 2024-01-12T00:00:00Z - 3.0.5 - ${tycho.version} + 3.0.5 + ${version.tycho} + 0.8.12 + 1.30.1.20231207151730 + + scm:git:https://github.com/apache/incubator-kie-tools.git true - 1.30.1.20231207151730 -Xmx512m ${tycho.test.platformArgs} - 0.8.12 org.eclipse.jdt.ls.* reuseReports ${project.build.directory}/jacoco.exec @@ -81,19 +84,19 @@ org.eclipse.tycho tycho-maven-plugin - ${tycho.version} + ${version.tycho} true org.eclipse.tycho target-platform-configuration - ${tycho.version} + ${version.tycho} org.eclipse.jdt.ls org.eclipse.jdt.ls.tp - ${jdt.ls.version} + ${version.jdt.ls} p2 @@ -103,7 +106,7 @@ org.eclipse.tycho tycho-compiler-plugin - ${tycho.version} + ${version.tycho} -err:-forbidden false @@ -112,7 +115,6 @@ org.codehaus.mojo flatten-maven-plugin - ${version.flatten.plugin} true resolveCiFriendliesOnly @@ -140,7 +142,7 @@ org.eclipse.tycho tycho-packaging-plugin - ${tycho.version} + ${version.tycho} yyyyMMdd-HHmm @@ -151,14 +153,14 @@ org.eclipse.tycho.extras tycho-sourceref-jgit - ${tycho.extras.version} + ${version.tycho.extras} org.eclipse.tycho tycho-surefire-plugin - ${tycho.version} + ${version.tycho} false ${tycho.test.jvmArgs} @@ -168,7 +170,6 @@ - org.apache.maven.plugins maven-source-plugin true @@ -205,7 +206,7 @@ org.eclipse.tycho tycho-source-plugin - ${tycho.version} + ${version.tycho} attach-source @@ -218,7 +219,7 @@ org.jacoco jacoco-maven-plugin - ${jacoco.version} + ${version.jacoco} diff --git a/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin-core/pom.xml b/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin-core/pom.xml index 39260a52c85..db0041557ec 100644 --- a/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin-core/pom.xml +++ b/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin-core/pom.xml @@ -33,37 +33,6 @@ vscode-java-code-completion-extension-plugin :: core vscode-java-code-completion-extension-plugin-core - - 2.3.32 - 3.25.3 - 5.10.2 - 4.11.0 - - - - - - org.freemarker - freemarker - ${version.org.freemarker} - - - org.junit.jupiter - junit-jupiter-engine - ${version.org.junit.jupiter} - - - org.assertj - assertj-core - ${version.org.assertj} - - - org.mockito - mockito-inline - ${version.org.mockito} - - - org.freemarker @@ -90,7 +59,6 @@ ${project.artifactId} - org.apache.maven.plugins maven-dependency-plugin diff --git a/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin.iml b/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/vscode-java-code-completion-extension-plugin/vscode-java-code-completion-extension-plugin.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/webpack-base/webpack.common.config.d.ts b/packages/webpack-base/webpack.common.config.d.ts index c246cd27f3e..2425777a0be 100644 --- a/packages/webpack-base/webpack.common.config.d.ts +++ b/packages/webpack-base/webpack.common.config.d.ts @@ -19,4 +19,4 @@ import * as webpack from "webpack"; -export default function common(env: any): webpack.Configuration; +export default function common(webpackEnv: any): webpack.Configuration; diff --git a/packages/webpack-base/webpack.common.config.js b/packages/webpack-base/webpack.common.config.js index 73d9e5a509d..a10f0c908fe 100644 --- a/packages/webpack-base/webpack.common.config.js +++ b/packages/webpack-base/webpack.common.config.js @@ -20,14 +20,12 @@ const path = require("path"); const webpackBaseEnv = require("./env"); -module.exports = (env) => { - const webpackEnv = env.dev ? webpackBaseEnv.env.webpack.dev : webpackBaseEnv.env.webpack.prod; +module.exports = (webpackEnv) => { + const { transpileOnly, minimize, sourceMaps, mode } = webpackEnv.dev + ? webpackBaseEnv.env.webpack.dev + : webpackBaseEnv.env.webpack.prod; - const transpileOnly = webpackEnv.transpileOnly; - const minimize = webpackEnv.minimize; - const sourceMaps = webpackEnv.sourceMaps; - const mode = webpackEnv.mode; - const live = env.live; + const live = webpackEnv.live; console.info(`Webpack :: ts-loader :: transpileOnly: ${transpileOnly}`); console.info(`Webpack :: minimize: ${minimize}`); diff --git a/packages/yard-editor/dev-webapp/webpack.config.js b/packages/yard-editor/dev-webapp/webpack.config.js index bf2cc9a10ce..46b25cc0a01 100644 --- a/packages/yard-editor/dev-webapp/webpack.config.js +++ b/packages/yard-editor/dev-webapp/webpack.config.js @@ -24,10 +24,9 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const patternflyBase = require("@kie-tools-core/patternfly-base"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const { env } = require("../env"); -const buildEnv = env; -module.exports = (env) => - merge(common(env), { +module.exports = (webpackEnv) => + merge(common(webpackEnv), { mode: "development", entry: { index: path.resolve(__dirname, "./index.tsx"), @@ -74,6 +73,6 @@ module.exports = (env) => historyApiFallback: true, static: [{ directory: path.join(__dirname) }], compress: true, - port: buildEnv.yardEditor.dev.port, + port: env.yardEditor.dev.port, }, }); diff --git a/packages/yard-model/install.js b/packages/yard-model/install.js index aa46eae8f39..33bb69a2439 100644 --- a/packages/yard-model/install.js +++ b/packages/yard-model/install.js @@ -17,9 +17,12 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.yardModel.version} +setupMavenConfigFile(` + -Drevision=${env.yardModel.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} `); + +installMvnw(); diff --git a/packages/yard-model/package.json b/packages/yard-model/package.json index 2d2dda942f5..443ac670af8 100644 --- a/packages/yard-model/package.json +++ b/packages/yard-model/package.json @@ -20,10 +20,7 @@ "build:prod": "pnpm lint && run-script-os", "build:prod:darwin:linux": "mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dreproducible", "build:prod:win32": "pnpm powershell \"mvn clean install `-DskipTests=$(build-env tests.run --not) `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dreproducible\"", - "install": "node install.js && pnpm install:mvnw", - "install:mvnw": "run-script-os", - "install:mvnw:darwin:linux": "mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper", - "install:mvnw:win32": "pnpm powershell \"mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper\"", + "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, @@ -31,7 +28,6 @@ "@kie-tools/maven-base": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", "copy-webpack-plugin": "^11.0.0", "rimraf": "^3.0.2", diff --git a/packages/yard-model/pom.xml b/packages/yard-model/pom.xml index 671c53bcf8f..f387dd807dd 100644 --- a/packages/yard-model/pom.xml +++ b/packages/yard-model/pom.xml @@ -33,6 +33,8 @@ org.kie.kogito yard-model + KIE Tools :: YaRD model + Apache Software License, Version 2.0 @@ -43,8 +45,6 @@ 2024-01-12T00:00:00Z - 0.4 - 3.2.0 11 11 @@ -53,13 +53,11 @@ org.kie.j2cl.tools.yaml.mapper common - ${yaml.mapper} org.kie.j2cl.tools.yaml.mapper processor - ${yaml.mapper} provided @@ -68,7 +66,6 @@ org.codehaus.mojo build-helper-maven-plugin - ${helper.maven.plugin} add-source diff --git a/packages/yard-model/yard-model.iml b/packages/yard-model/yard-model.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/yard-model/yard-model.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/yard-validator-worker/install.js b/packages/yard-validator-worker/install.js index 4247286a3fc..5699ac5486b 100644 --- a/packages/yard-validator-worker/install.js +++ b/packages/yard-validator-worker/install.js @@ -17,9 +17,17 @@ * under the License. */ -const buildEnv = require("./env"); -const { setup } = require("@kie-tools/maven-config-setup-helper"); +const { env } = require("./env"); +const { + setupMavenConfigFile, + installMvnw, + buildTailFromPackageJsonDependencies, + DEFAULT_LOCAL_REPO, +} = require("@kie-tools/maven-base"); -setup(` - -Drevision=${buildEnv.env.yardValidator.version} -`); +setupMavenConfigFile(` + -Drevision=${env.yardValidator.version} + -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()},${DEFAULT_LOCAL_REPO} +`); // For some reason, j2cl-maven-plugin needs the DEFAULT_LOCAL_REPO here as the last tail too. + +installMvnw(); diff --git a/packages/yard-validator-worker/package.json b/packages/yard-validator-worker/package.json index 21edd51a301..ff60a938e51 100644 --- a/packages/yard-validator-worker/package.json +++ b/packages/yard-validator-worker/package.json @@ -21,20 +21,16 @@ "build:prod:darwin:linux": "mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dreproducible", "build:prod:win32": "pnpm powershell \"mvn clean install `-DskipTests=$(build-env tests.run --not) `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Dreproducible\"", "copy:webworker": "copyfiles -f target/worker/yard-validator-worker/yard-validator-worker.js dist", - "install": "node install.js && pnpm install:mvnw", - "install:mvnw": "run-script-os", - "install:mvnw:darwin:linux": "mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper", - "install:mvnw:win32": "pnpm powershell \"mvn -e org.apache.maven.plugins:maven-wrapper-plugin:3.3.0:wrapper\"", + "install": "node install.js", "lint": "echo 'Linting'", "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command" }, "dependencies": { - "@kie-tools/maven-base": "workspace:*" + "@kie-tools/maven-base": "workspace:*", + "@kie-tools/yard-model": "workspace:*" }, "devDependencies": { - "@kie-tools/maven-config-setup-helper": "workspace:*", "@kie-tools/root-env": "workspace:*", - "@kie-tools/yard-model": "workspace:*", "copyfiles": "^2.4.1", "rimraf": "^3.0.2", "run-script-os": "^1.1.6" diff --git a/packages/yard-validator-worker/pom.xml b/packages/yard-validator-worker/pom.xml index 3b48a8bd075..1de848b8e95 100644 --- a/packages/yard-validator-worker/pom.xml +++ b/packages/yard-validator-worker/pom.xml @@ -33,6 +33,8 @@ org.kie.kogito yard-validator-worker + KIE Tools :: YaRD validator worker + Apache Software License, Version 2.0 @@ -43,41 +45,49 @@ 2024-01-12T00:00:00Z - 0.4 2.0.10 - 3.13.0 11 11 - 0.23.0 org.kie.j2cl.tools.yaml.mapper common - 0.4 - - - - org.kie.kogito - yard-model - ${project.version} - - - org.kie.kogito - yard-model - ${project.version} - sources junit junit - ${version.junit} test + + + include-1st-party-dependencies + + + kieTools.do-not-use-this-property.ignore1stPartyDependencies + !true + + + + + org.kie.kogito + yard-model + ${project.version} + + + org.kie.kogito + yard-model + ${project.version} + sources + + + + + @@ -88,7 +98,6 @@ org.kie.j2cl.tools j2cl-maven-plugin - ${j2cl.maven.plugin.version} diff --git a/packages/yard-validator-worker/yard-validator-worker.iml b/packages/yard-validator-worker/yard-validator-worker.iml new file mode 100644 index 00000000000..8773a990784 --- /dev/null +++ b/packages/yard-validator-worker/yard-validator-worker.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/yard-vscode-extension/package.json b/packages/yard-vscode-extension/package.json index f8b1ef49ce4..ecff850f0e5 100644 --- a/packages/yard-vscode-extension/package.json +++ b/packages/yard-vscode-extension/package.json @@ -72,7 +72,7 @@ "sanitize-filename-ts": "^1.0.2", "selenium-webdriver": "^4.15.0", "typescript": "^5.5.3", - "vscode-extension-tester": "^8.3.1", + "vscode-extension-tester": "^8.8.0", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", diff --git a/packages/yard-vscode-extension/webpack.config.js b/packages/yard-vscode-extension/webpack.config.js index 572356d3c1a..3b0adefe944 100644 --- a/packages/yard-vscode-extension/webpack.config.js +++ b/packages/yard-vscode-extension/webpack.config.js @@ -23,8 +23,8 @@ const common = require("@kie-tools-core/webpack-base/webpack.common.config"); const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); const { ProvidePlugin } = require("webpack"); -const commonConfig = (env) => - merge(common(env), { +const commonConfig = (webpackEnv) => + merge(common(webpackEnv), { output: { library: "YardEditor", libraryTarget: "umd", @@ -36,14 +36,14 @@ const commonConfig = (env) => }, }); -module.exports = async (env) => [ - merge(commonConfig(env), { +module.exports = async (webpackEnv) => [ + merge(commonConfig(webpackEnv), { target: "node", entry: { "extension/extension": "./src/extension/extension.ts", }, }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "webworker", entry: { "extension/extensionWeb": "./src/extension/extension.ts", @@ -55,7 +55,7 @@ module.exports = async (env) => [ }), ], }), - merge(commonConfig(env), { + merge(commonConfig(webpackEnv), { target: "web", entry: { "webview/YardEditorEnvelopeApp": "./src/webview/YardEditorEnvelopeApp.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bdd705df8d9..960b8e2a541 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -309,9 +309,6 @@ importers: specifier: workspace:* version: link:../../packages/maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../../packages/maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../../packages/root-env @@ -334,9 +331,6 @@ importers: '@kie-tools/kogito-task-console': specifier: workspace:* version: link:../../packages/kogito-task-console - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../../packages/maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../../packages/root-env @@ -488,9 +482,6 @@ importers: specifier: workspace:* version: link:../../packages/sonataflow-quarkus-devui devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../../packages/maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../../packages/root-env @@ -997,7 +988,7 @@ importers: version: 7.4.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + version: 7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -1691,9 +1682,6 @@ importers: '@kie-tools/dashbuilder-component-assembler': specifier: workspace:* version: link:../dashbuilder-component-assembler - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -2997,9 +2985,6 @@ importers: '@kie-tools/image-builder': specifier: workspace:* version: link:../image-builder - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -3196,10 +3181,14 @@ importers: version: 1.1.2 packages/dev-deployment-kogito-quarkus-blank-app: - devDependencies: - '@kie-tools/maven-config-setup-helper': + dependencies: + '@kie-tools/jbpm-quarkus-devui': specifier: workspace:* - version: link:../maven-config-setup-helper + version: link:../jbpm-quarkus-devui + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base + devDependencies: '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -3219,9 +3208,9 @@ importers: '@kie-tools/image-builder': specifier: workspace:* version: link:../image-builder - '@kie-tools/maven-config-setup-helper': + '@kie-tools/maven-base': specifier: workspace:* - version: link:../maven-config-setup-helper + version: link:../maven-base '@kie-tools/maven-m2-repo-via-http-image': specifier: workspace:* version: link:../maven-m2-repo-via-http-image @@ -3346,8 +3335,8 @@ importers: specifier: '>=17.0.2 <19.0.0' version: 17.0.2(react@17.0.2) react-error-boundary: - specifier: ^4.0.11 - version: 4.0.12(react@17.0.2) + specifier: ^4.0.13 + version: 4.0.13(react@17.0.2) reactflow: specifier: ^11.8.3 version: 11.10.1(@types/react@17.0.21)(immer@10.0.3(patch_hash=utu5oov26wz5mjuays57tp3ybu))(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -3414,7 +3403,7 @@ importers: version: 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + version: 7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@types/d3-drag': specifier: ^3.0.3 version: 3.0.7 @@ -3673,7 +3662,7 @@ importers: version: 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + version: 7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@types/jest-when': specifier: ^3.5.5 version: 3.5.5 @@ -3859,6 +3848,9 @@ importers: '@kie-tools/xml-parser-ts': specifier: workspace:* version: link:../xml-parser-ts + uuid: + specifier: ^8.3.2 + version: 8.3.2 devDependencies: '@babel/core': specifier: ^7.16.0 @@ -3899,6 +3891,9 @@ importers: '@types/react': specifier: ^17.0.6 version: 17.0.21 + '@types/uuid': + specifier: ^8.3.0 + version: 8.3.0 jest: specifier: ^29.7.0 version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) @@ -4031,9 +4026,6 @@ importers: specifier: workspace:* version: link:../maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -4427,9 +4419,6 @@ importers: specifier: workspace:* version: link:../maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -4728,47 +4717,77 @@ importers: specifier: ^5.5.3 version: 5.5.3 - packages/form-dmn: - dependencies: - '@kie-tools-core/i18n': - specifier: workspace:* - version: link:../i18n - '@kie-tools-core/notifications': - specifier: workspace:* - version: link:../notifications - '@kie-tools/dmn-runner': + packages/form-code-generator: + devDependencies: + '@kie-tools/eslint': specifier: workspace:* - version: link:../dmn-runner - '@kie-tools/extended-services-api': + version: link:../eslint + '@kie-tools/jest-base': specifier: workspace:* - version: link:../extended-services-api - '@kie-tools/form': + version: link:../jest-base + '@kie-tools/root-env': specifier: workspace:* - version: link:../form - '@kie-tools/i18n-common-dictionary': + version: link:../root-env + '@kie-tools/tsconfig': specifier: workspace:* - version: link:../i18n-common-dictionary - '@kie-tools/uniforms-patternfly': + version: link:../tsconfig + '@testing-library/jest-dom': + specifier: ^6.4.6 + version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/jest-when': + specifier: ^3.5.5 + version: 3.5.5 + '@types/lodash': + specifier: ^4.14.168 + version: 4.14.202 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) + jest-environment-jsdom: + specifier: ^29.7.0 + version: 29.7.0 + jest-junit: + specifier: ^16.0.0 + version: 16.0.0 + jest-when: + specifier: ^3.6.0 + version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + rimraf: + specifier: ^3.0.2 + version: 3.0.2 + run-script-os: + specifier: ^1.1.6 + version: 1.1.6 + ts-jest: + specifier: ^29.1.5 + version: 29.1.5(@babel/core@7.24.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.9))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) + typescript: + specifier: ^5.5.3 + version: 5.5.3 + + packages/form-code-generator-bootstrap4-theme: + dependencies: + '@kie-tools/form-code-generator': specifier: workspace:* - version: link:../uniforms-patternfly - '@patternfly/react-core': - specifier: ^4.276.6 - version: 4.276.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - '@patternfly/react-icons': - specifier: ^4.93.6 - version: 4.93.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - deep-object-diff: - specifier: ^1.1.9 - version: 1.1.9 + version: link:../form-code-generator lodash: specifier: ^4.17.21 version: 4.17.21 + prettier: + specifier: ^2.8.8 + version: 2.8.8 react: specifier: '>=17.0.2 <19.0.0' version: 17.0.2 react-dom: specifier: '>=17.0.2 <19.0.0' version: 17.0.2(react@17.0.2) + underscore: + specifier: ^1.13.1 + version: 1.13.1 uniforms: specifier: ^3.10.2 version: 3.10.2(react@17.0.2) @@ -4778,13 +4797,13 @@ importers: devDependencies: '@babel/core': specifier: ^7.16.0 - version: 7.16.12 + version: 7.24.9 '@babel/preset-env': specifier: ^7.16.0 - version: 7.16.11(@babel/core@7.16.12) + version: 7.24.7(@babel/core@7.24.9) '@babel/preset-react': specifier: ^7.16.0 - version: 7.16.0(@babel/core@7.16.12) + version: 7.22.15(@babel/core@7.24.9) '@kie-tools-core/webpack-base': specifier: workspace:* version: link:../webpack-base @@ -4812,21 +4831,27 @@ importers: '@types/jest-when': specifier: ^3.5.5 version: 3.5.5 - '@types/json-schema': - specifier: ^7.0.11 - version: 7.0.15 '@types/lodash': specifier: ^4.14.168 - version: 4.14.169 + version: 4.14.202 + '@types/prettier': + specifier: ^2.7.3 + version: 2.7.3 '@types/react': specifier: ^17.0.6 version: 17.0.21 '@types/react-dom': specifier: ^17.0.5 version: 17.0.8 - copyfiles: - specifier: ^2.4.1 - version: 2.4.1 + '@types/simpl-schema': + specifier: ^1.12.0 + version: 1.12.2 + '@types/underscore': + specifier: ^1.11.2 + version: 1.11.2 + copy-webpack-plugin: + specifier: ^11.0.0 + version: 11.0.0(webpack@5.94.0) jest: specifier: ^29.7.0 version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) @@ -4839,30 +4864,54 @@ importers: jest-when: specifier: ^3.6.0 version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + raw-loader: + specifier: ^4.0.2 + version: 4.0.2(webpack@5.94.0) rimraf: specifier: ^3.0.2 version: 3.0.2 + simpl-schema: + specifier: ^1.12.0 + version: 1.12.0 ts-jest: specifier: ^29.1.5 - version: 29.1.5(@babel/core@7.16.12)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.16.12))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) + version: 29.1.5(@babel/core@7.24.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.9))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 + uniforms-bridge-simple-schema-2: + specifier: ^3.10.2 + version: 3.10.2(react@17.0.2) + webpack: + specifier: ^5.94.0 + version: 5.94.0 + webpack-dev-server: + specifier: ^4.15.1 + version: 4.15.1(webpack@5.94.0) + webpack-merge: + specifier: ^5.9.0 + version: 5.10.0 + webpack-node-externals: + specifier: ^3.0.0 + version: 3.0.0 - packages/form-generation-tool: + packages/form-code-generator-patternfly-theme: dependencies: - '@kie-tools/uniforms-bootstrap4-codegen': - specifier: workspace:* - version: link:../uniforms-bootstrap4-codegen - '@kie-tools/uniforms-patternfly-codegen': + '@kie-tools/form-code-generator': specifier: workspace:* - version: link:../uniforms-patternfly-codegen - inquirer: - specifier: ^8.1.1 - version: 8.2.0 + version: link:../form-code-generator lodash: specifier: ^4.17.21 version: 4.17.21 + prettier: + specifier: ^2.8.8 + version: 2.8.8 + react: + specifier: '>=17.0.2 <19.0.0' + version: 17.0.2 + react-dom: + specifier: '>=17.0.2 <19.0.0' + version: 17.0.2(react@17.0.2) uniforms: specifier: ^3.10.2 version: 3.10.2(react@17.0.2) @@ -4872,13 +4921,13 @@ importers: devDependencies: '@babel/core': specifier: ^7.16.0 - version: 7.16.12 + version: 7.24.9 '@babel/preset-env': specifier: ^7.16.0 - version: 7.16.11(@babel/core@7.16.12) + version: 7.24.7(@babel/core@7.24.9) '@babel/preset-react': specifier: ^7.16.0 - version: 7.16.0(@babel/core@7.16.12) + version: 7.22.15(@babel/core@7.24.9) '@kie-tools-core/webpack-base': specifier: workspace:* version: link:../webpack-base @@ -4896,10 +4945,10 @@ importers: version: link:../tsconfig '@testing-library/jest-dom': specifier: ^6.4.6 - version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) - '@types/inquirer': - specifier: ^7.3.2 - version: 7.3.3 + version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + '@testing-library/react': + specifier: ^12.1.5 + version: 12.1.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -4908,10 +4957,25 @@ importers: version: 3.5.5 '@types/lodash': specifier: ^4.14.168 - version: 4.14.169 + version: 4.14.202 + '@types/prettier': + specifier: ^2.7.3 + version: 2.7.3 + '@types/react': + specifier: ^17.0.6 + version: 17.0.21 + '@types/react-dom': + specifier: ^17.0.5 + version: 17.0.8 + '@types/simpl-schema': + specifier: ^1.12.0 + version: 1.12.2 + copy-webpack-plugin: + specifier: ^11.0.0 + version: 11.0.0(webpack@5.94.0(webpack-cli@4.10.0)) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) + version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -4920,22 +4984,25 @@ importers: version: 16.0.0 jest-when: specifier: ^3.6.0 - version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) - pkg: - specifier: ^5.8.1 - version: 5.8.1(encoding@0.1.13) + version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + raw-loader: + specifier: ^4.0.2 + version: 4.0.2(webpack@5.94.0(webpack-cli@4.10.0)) rimraf: specifier: ^3.0.2 version: 3.0.2 - run-script-os: - specifier: ^1.1.6 - version: 1.1.6 + simpl-schema: + specifier: ^1.12.0 + version: 1.12.0 ts-jest: specifier: ^29.1.5 - version: 29.1.5(@babel/core@7.16.12)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.16.12))(jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) + version: 29.1.5(@babel/core@7.24.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.9))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 + uniforms-bridge-simple-schema-2: + specifier: ^3.10.2 + version: 3.10.2(react@17.0.2) webpack: specifier: ^5.94.0 version: 5.94.0(webpack-cli@4.10.0) @@ -4947,12 +5014,133 @@ importers: version: 4.15.1(webpack-cli@4.10.0)(webpack@5.94.0) webpack-merge: specifier: ^5.9.0 - version: 5.9.0 + version: 5.10.0 webpack-node-externals: specifier: ^3.0.0 version: 3.0.0 - packages/i18n: + packages/form-dmn: + dependencies: + '@kie-tools-core/i18n': + specifier: workspace:* + version: link:../i18n + '@kie-tools-core/notifications': + specifier: workspace:* + version: link:../notifications + '@kie-tools/dmn-runner': + specifier: workspace:* + version: link:../dmn-runner + '@kie-tools/extended-services-api': + specifier: workspace:* + version: link:../extended-services-api + '@kie-tools/form': + specifier: workspace:* + version: link:../form + '@kie-tools/i18n-common-dictionary': + specifier: workspace:* + version: link:../i18n-common-dictionary + '@kie-tools/uniforms-patternfly': + specifier: workspace:* + version: link:../uniforms-patternfly + '@patternfly/react-core': + specifier: ^4.276.6 + version: 4.276.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) + '@patternfly/react-icons': + specifier: ^4.93.6 + version: 4.93.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) + deep-object-diff: + specifier: ^1.1.9 + version: 1.1.9 + lodash: + specifier: ^4.17.21 + version: 4.17.21 + react: + specifier: '>=17.0.2 <19.0.0' + version: 17.0.2 + react-dom: + specifier: '>=17.0.2 <19.0.0' + version: 17.0.2(react@17.0.2) + uniforms: + specifier: ^3.10.2 + version: 3.10.2(react@17.0.2) + uniforms-bridge-json-schema: + specifier: ^3.10.2 + version: 3.10.2(react@17.0.2) + devDependencies: + '@babel/core': + specifier: ^7.16.0 + version: 7.16.12 + '@babel/preset-env': + specifier: ^7.16.0 + version: 7.16.11(@babel/core@7.16.12) + '@babel/preset-react': + specifier: ^7.16.0 + version: 7.16.0(@babel/core@7.16.12) + '@kie-tools-core/webpack-base': + specifier: workspace:* + version: link:../webpack-base + '@kie-tools/eslint': + specifier: workspace:* + version: link:../eslint + '@kie-tools/jest-base': + specifier: workspace:* + version: link:../jest-base + '@kie-tools/root-env': + specifier: workspace:* + version: link:../root-env + '@kie-tools/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@testing-library/jest-dom': + specifier: ^6.4.6 + version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + '@testing-library/react': + specifier: ^12.1.5 + version: 12.1.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2) + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/jest-when': + specifier: ^3.5.5 + version: 3.5.5 + '@types/json-schema': + specifier: ^7.0.11 + version: 7.0.15 + '@types/lodash': + specifier: ^4.14.168 + version: 4.14.169 + '@types/react': + specifier: ^17.0.6 + version: 17.0.21 + '@types/react-dom': + specifier: ^17.0.5 + version: 17.0.8 + copyfiles: + specifier: ^2.4.1 + version: 2.4.1 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) + jest-environment-jsdom: + specifier: ^29.7.0 + version: 29.7.0 + jest-junit: + specifier: ^16.0.0 + version: 16.0.0 + jest-when: + specifier: ^3.6.0 + version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + rimraf: + specifier: ^3.0.2 + version: 3.0.2 + ts-jest: + specifier: ^29.1.5 + version: 29.1.5(@babel/core@7.16.12)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.16.12))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) + typescript: + specifier: ^5.5.3 + version: 5.5.3 + + packages/i18n: dependencies: react: specifier: '>=17.0.2 <19.0.0' @@ -5248,15 +5436,82 @@ importers: specifier: ^5.9.0 version: 5.9.0 + packages/jbpm-form-code-generator-themes: + dependencies: + '@kie-tools/form-code-generator': + specifier: workspace:* + version: link:../form-code-generator + '@kie-tools/form-code-generator-bootstrap4-theme': + specifier: workspace:* + version: link:../form-code-generator-bootstrap4-theme + '@kie-tools/form-code-generator-patternfly-theme': + specifier: workspace:* + version: link:../form-code-generator-patternfly-theme + lodash: + specifier: ^4.17.21 + version: 4.17.21 + uniforms: + specifier: ^3.10.2 + version: 3.10.2(react@17.0.2) + uniforms-bridge-json-schema: + specifier: ^3.10.2 + version: 3.10.2(react@17.0.2) + devDependencies: + '@kie-tools/eslint': + specifier: workspace:* + version: link:../eslint + '@kie-tools/jest-base': + specifier: workspace:* + version: link:../jest-base + '@kie-tools/root-env': + specifier: workspace:* + version: link:../root-env + '@kie-tools/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@testing-library/jest-dom': + specifier: ^6.4.6 + version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + '@types/jest-when': + specifier: ^3.5.5 + version: 3.5.5 + '@types/lodash': + specifier: ^4.14.168 + version: 4.14.202 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) + jest-environment-jsdom: + specifier: ^29.7.0 + version: 29.7.0 + jest-junit: + specifier: ^16.0.0 + version: 16.0.0 + jest-when: + specifier: ^3.6.0 + version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) + rimraf: + specifier: ^3.0.2 + version: 3.0.2 + run-script-os: + specifier: ^1.1.6 + version: 1.1.6 + ts-jest: + specifier: ^29.1.5 + version: 29.1.5(@babel/core@7.24.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.9))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) + typescript: + specifier: ^5.5.3 + version: 5.5.3 + packages/jbpm-quarkus-devui: dependencies: '@kie-tools/maven-base': specifier: workspace:* version: link:../maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -5734,8 +5989,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 vscode-extension-tester: - specifier: ^8.3.1 - version: 8.3.1(mocha@10.6.0)(typescript@5.5.3) + specifier: ^8.8.0 + version: 8.8.0(mocha@10.6.0)(typescript@5.5.3) webpack: specifier: ^5.94.0 version: 5.94.0(webpack-cli@4.10.0) @@ -6097,6 +6352,13 @@ importers: version: 1.1.2 packages/kn-plugin-workflow: + dependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base + '@kie-tools/sonataflow-quarkus-devui': + specifier: workspace:* + version: link:../sonataflow-quarkus-devui devDependencies: '@kie-tools/root-env': specifier: workspace:* @@ -6143,6 +6405,9 @@ importers: packages/kogito-data-index-ephemeral-image: devDependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/python-venv': specifier: workspace:* version: link:../python-venv @@ -6167,6 +6432,9 @@ importers: packages/kogito-data-index-postgresql-image: devDependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/python-venv': specifier: workspace:* version: link:../python-venv @@ -6191,6 +6459,9 @@ importers: packages/kogito-jit-runner-image: devDependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/python-venv': specifier: workspace:* version: link:../python-venv @@ -6215,6 +6486,9 @@ importers: packages/kogito-jobs-service-allinone-image: devDependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/python-venv': specifier: workspace:* version: link:../python-venv @@ -6239,6 +6513,9 @@ importers: packages/kogito-jobs-service-ephemeral-image: devDependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/python-venv': specifier: workspace:* version: link:../python-venv @@ -6263,6 +6540,9 @@ importers: packages/kogito-jobs-service-postgresql-image: devDependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/python-venv': specifier: workspace:* version: link:../python-venv @@ -6378,9 +6658,6 @@ importers: packages/maven-base: devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -6388,8 +6665,6 @@ importers: specifier: ^1.1.6 version: 1.1.6 - packages/maven-config-setup-helper: {} - packages/maven-m2-repo-via-http-image: devDependencies: '@kie-tools/image-builder': @@ -9045,6 +9320,9 @@ importers: '@kie-tools/boxed-expression-component': specifier: workspace:* version: link:../boxed-expression-component + '@kie-tools/dmn-marshaller': + specifier: workspace:* + version: link:../dmn-marshaller '@kie-tools/i18n-common-dictionary': specifier: workspace:* version: link:../i18n-common-dictionary @@ -9060,6 +9338,9 @@ importers: '@patternfly/react-styles': specifier: ^4.92.6 version: 4.92.6 + immer: + specifier: ^10.0.3 + version: 10.0.3(patch_hash=utu5oov26wz5mjuays57tp3ybu) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -9075,6 +9356,9 @@ importers: uuid: specifier: ^8.3.2 version: 8.3.2 + zustand: + specifier: ^4.4.2 + version: 4.4.2(patch_hash=7tws22nsyaxzkdpquvgytzpdve)(@types/react@17.0.21)(immer@10.0.3(patch_hash=utu5oov26wz5mjuays57tp3ybu))(react@17.0.2) devDependencies: '@babel/core': specifier: ^7.16.0 @@ -9123,7 +9407,7 @@ importers: version: 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + version: 7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@types/lodash': specifier: ^4.14.168 version: 4.14.169 @@ -9148,9 +9432,15 @@ importers: cross-env: specifier: ^7.0.3 version: 7.0.3 + deep-object-diff: + specifier: ^1.1.9 + version: 1.1.9 file-loader: specifier: ^6.2.0 version: 6.2.0(webpack@5.94.0(webpack-cli@4.10.0)) + react-error-boundary: + specifier: ^4.0.13 + version: 4.0.13(react@17.0.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -9176,6 +9466,85 @@ importers: specifier: ^5.9.0 version: 5.9.0 + packages/scesim-editor-envelope: + dependencies: + '@kie-tools-core/editor': + specifier: workspace:* + version: link:../editor + '@kie-tools-core/envelope': + specifier: workspace:* + version: link:../envelope + '@kie-tools-core/envelope-bus': + specifier: workspace:* + version: link:../envelope-bus + '@kie-tools-core/keyboard-shortcuts': + specifier: workspace:* + version: link:../keyboard-shortcuts + '@kie-tools-core/notifications': + specifier: workspace:* + version: link:../notifications + '@kie-tools-core/react-hooks': + specifier: workspace:* + version: link:../react-hooks + '@kie-tools-core/workspace': + specifier: workspace:* + version: link:../workspace + '@kie-tools/boxed-expression-component': + specifier: workspace:* + version: link:../boxed-expression-component + '@kie-tools/dmn-marshaller': + specifier: workspace:* + version: link:../dmn-marshaller + '@kie-tools/scesim-editor': + specifier: workspace:* + version: link:../scesim-editor + '@kie-tools/scesim-marshaller': + specifier: workspace:* + version: link:../scesim-marshaller + '@kie-tools/xml-parser-ts': + specifier: workspace:* + version: link:../xml-parser-ts + '@patternfly/react-core': + specifier: ^4.276.6 + version: 4.276.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) + react: + specifier: '>=17.0.2 <19.0.0' + version: 17.0.2 + react-dom: + specifier: '>=17.0.2 <19.0.0' + version: 17.0.2(react@17.0.2) + devDependencies: + '@babel/core': + specifier: ^7.16.0 + version: 7.24.9 + '@babel/preset-env': + specifier: ^7.16.0 + version: 7.24.7(@babel/core@7.24.9) + '@babel/preset-react': + specifier: ^7.16.0 + version: 7.22.15(@babel/core@7.24.9) + '@kie-tools/eslint': + specifier: workspace:* + version: link:../eslint + '@kie-tools/root-env': + specifier: workspace:* + version: link:../root-env + '@kie-tools/tsconfig': + specifier: workspace:* + version: link:../tsconfig + '@types/react': + specifier: ^17.0.6 + version: 17.0.21 + '@types/react-dom': + specifier: ^17.0.5 + version: 17.0.8 + rimraf: + specifier: ^3.0.2 + version: 3.0.2 + typescript: + specifier: ^5.5.3 + version: 5.5.3 + packages/scesim-marshaller: dependencies: '@kie-tools/xml-parser-ts': @@ -9654,13 +10023,13 @@ importers: packages/serverless-logic-web-tools-swf-deployment-quarkus-app: dependencies: + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/sonataflow-quarkus-devui': specifier: workspace:* version: link:../sonataflow-quarkus-devui devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -9673,9 +10042,9 @@ importers: '@kie-tools/image-builder': specifier: workspace:* version: link:../image-builder - '@kie-tools/maven-config-setup-helper': + '@kie-tools/maven-base': specifier: workspace:* - version: link:../maven-config-setup-helper + version: link:../maven-base '@kie-tools/maven-m2-repo-via-http-image': specifier: workspace:* version: link:../maven-m2-repo-via-http-image @@ -10081,9 +10450,9 @@ importers: packages/serverless-workflow-diagram-editor: devDependencies: - '@kie-tools/maven-config-setup-helper': + '@kie-tools/maven-base': specifier: workspace:* - version: link:../maven-config-setup-helper + version: link:../maven-base '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -10844,8 +11213,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 vscode-extension-tester: - specifier: ^8.3.1 - version: 8.3.1(mocha@10.6.0)(typescript@5.5.3) + specifier: ^8.8.0 + version: 8.8.0(mocha@10.6.0)(typescript@5.5.3) webpack: specifier: ^5.94.0 version: 5.94.0(webpack-cli@4.10.0) @@ -10864,6 +11233,9 @@ importers: '@kie-tools/image-builder': specifier: workspace:* version: link:../image-builder + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/maven-m2-repo-via-http-image': specifier: workspace:* version: link:../maven-m2-repo-via-http-image @@ -11114,6 +11486,9 @@ importers: '@kie-tools/image-builder': specifier: workspace:* version: link:../image-builder + '@kie-tools/maven-base': + specifier: workspace:* + version: link:../maven-base '@kie-tools/maven-m2-repo-via-http-image': specifier: workspace:* version: link:../maven-m2-repo-via-http-image @@ -11512,9 +11887,6 @@ importers: specifier: workspace:* version: link:../maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -11577,7 +11949,7 @@ importers: version: 3.0.3(webpack@5.94.0(esbuild@0.18.20)) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.4.6(@babel/core@7.23.9)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-hot-middleware@2.25.4) + version: 7.4.6(@babel/core@7.23.9)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-hot-middleware@2.25.4) '@storybook/theming': specifier: ^7.3.2 version: 7.4.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -11602,9 +11974,9 @@ importers: packages/stunner-editors: devDependencies: - '@kie-tools/maven-config-setup-helper': + '@kie-tools/maven-base': specifier: workspace:* - version: link:../maven-config-setup-helper + version: link:../maven-base '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -11820,127 +12192,6 @@ importers: packages/tsconfig: {} - packages/uniforms-bootstrap4-codegen: - dependencies: - lodash: - specifier: ^4.17.21 - version: 4.17.21 - prettier: - specifier: ^2.8.8 - version: 2.8.8 - react: - specifier: '>=17.0.2 <19.0.0' - version: 17.0.2 - react-dom: - specifier: '>=17.0.2 <19.0.0' - version: 17.0.2(react@17.0.2) - underscore: - specifier: ^1.13.1 - version: 1.13.1 - uniforms: - specifier: ^3.10.2 - version: 3.10.2(react@17.0.2) - uniforms-bridge-simple-schema-2: - specifier: ^3.10.2 - version: 3.10.2(react@17.0.2) - devDependencies: - '@babel/core': - specifier: ^7.16.0 - version: 7.16.12 - '@babel/preset-env': - specifier: ^7.16.0 - version: 7.16.11(@babel/core@7.16.12) - '@babel/preset-react': - specifier: ^7.16.0 - version: 7.16.0(@babel/core@7.16.12) - '@kie-tools-core/webpack-base': - specifier: workspace:* - version: link:../webpack-base - '@kie-tools/eslint': - specifier: workspace:* - version: link:../eslint - '@kie-tools/jest-base': - specifier: workspace:* - version: link:../jest-base - '@kie-tools/root-env': - specifier: workspace:* - version: link:../root-env - '@kie-tools/tsconfig': - specifier: workspace:* - version: link:../tsconfig - '@testing-library/jest-dom': - specifier: ^6.4.6 - version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) - '@testing-library/react': - specifier: ^12.1.5 - version: 12.1.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - '@types/jest': - specifier: ^29.5.12 - version: 29.5.12 - '@types/jest-when': - specifier: ^3.5.5 - version: 3.5.5 - '@types/lodash': - specifier: ^4.14.168 - version: 4.14.169 - '@types/prettier': - specifier: ^2.7.3 - version: 2.7.3 - '@types/react': - specifier: ^17.0.6 - version: 17.0.21 - '@types/react-dom': - specifier: ^17.0.5 - version: 17.0.8 - '@types/simpl-schema': - specifier: ^1.12.0 - version: 1.12.0 - '@types/underscore': - specifier: ^1.11.2 - version: 1.11.2 - copy-webpack-plugin: - specifier: ^11.0.0 - version: 11.0.0(webpack@5.94.0) - jest: - specifier: ^29.7.0 - version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-environment-jsdom: - specifier: ^29.7.0 - version: 29.7.0 - jest-junit: - specifier: ^16.0.0 - version: 16.0.0 - jest-when: - specifier: ^3.6.0 - version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) - raw-loader: - specifier: ^4.0.2 - version: 4.0.2(webpack@5.94.0) - rimraf: - specifier: ^3.0.2 - version: 3.0.2 - simpl-schema: - specifier: ^1.12.0 - version: 1.12.0 - ts-jest: - specifier: ^29.1.5 - version: 29.1.5(@babel/core@7.16.12)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.16.12))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) - typescript: - specifier: ^5.5.3 - version: 5.5.3 - webpack: - specifier: ^5.94.0 - version: 5.94.0 - webpack-dev-server: - specifier: ^4.15.1 - version: 4.15.1(webpack@5.94.0) - webpack-merge: - specifier: ^5.9.0 - version: 5.9.0 - webpack-node-externals: - specifier: ^3.0.0 - version: 3.0.0 - packages/uniforms-patternfly: dependencies: '@types/invariant': @@ -12050,124 +12301,6 @@ importers: specifier: ^5.9.0 version: 5.9.0 - packages/uniforms-patternfly-codegen: - dependencies: - lodash: - specifier: ^4.17.21 - version: 4.17.21 - prettier: - specifier: ^2.8.8 - version: 2.8.8 - react: - specifier: '>=17.0.2 <19.0.0' - version: 17.0.2 - react-dom: - specifier: '>=17.0.2 <19.0.0' - version: 17.0.2(react@17.0.2) - uniforms: - specifier: ^3.10.2 - version: 3.10.2(react@17.0.2) - uniforms-bridge-simple-schema-2: - specifier: ^3.10.2 - version: 3.10.2(react@17.0.2) - devDependencies: - '@babel/core': - specifier: ^7.16.0 - version: 7.16.12 - '@babel/preset-env': - specifier: ^7.16.0 - version: 7.16.11(@babel/core@7.16.12) - '@babel/preset-react': - specifier: ^7.16.0 - version: 7.16.0(@babel/core@7.16.12) - '@kie-tools-core/webpack-base': - specifier: workspace:* - version: link:../webpack-base - '@kie-tools/eslint': - specifier: workspace:* - version: link:../eslint - '@kie-tools/jest-base': - specifier: workspace:* - version: link:../jest-base - '@kie-tools/root-env': - specifier: workspace:* - version: link:../root-env - '@kie-tools/tsconfig': - specifier: workspace:* - version: link:../tsconfig - '@testing-library/jest-dom': - specifier: ^6.4.6 - version: 6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) - '@testing-library/react': - specifier: ^12.1.5 - version: 12.1.5(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - '@types/jest': - specifier: ^29.5.12 - version: 29.5.12 - '@types/jest-when': - specifier: ^3.5.5 - version: 3.5.5 - '@types/lodash': - specifier: ^4.14.168 - version: 4.14.169 - '@types/prettier': - specifier: ^2.7.3 - version: 2.7.3 - '@types/react': - specifier: ^17.0.6 - version: 17.0.21 - '@types/react-dom': - specifier: ^17.0.5 - version: 17.0.8 - '@types/simpl-schema': - specifier: ^1.12.0 - version: 1.12.0 - copy-webpack-plugin: - specifier: ^11.0.0 - version: 11.0.0(webpack@5.94.0(webpack-cli@4.10.0)) - jest: - specifier: ^29.7.0 - version: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-environment-jsdom: - specifier: ^29.7.0 - version: 29.7.0 - jest-junit: - specifier: ^16.0.0 - version: 16.0.0 - jest-when: - specifier: ^3.6.0 - version: 3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))) - raw-loader: - specifier: ^4.0.2 - version: 4.0.2(webpack@5.94.0(webpack-cli@4.10.0)) - rimraf: - specifier: ^3.0.2 - version: 3.0.2 - simpl-schema: - specifier: ^1.12.0 - version: 1.12.0 - ts-jest: - specifier: ^29.1.5 - version: 29.1.5(@babel/core@7.16.12)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.16.12))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3) - typescript: - specifier: ^5.5.3 - version: 5.5.3 - webpack: - specifier: ^5.94.0 - version: 5.94.0(webpack-cli@4.10.0) - webpack-cli: - specifier: ^4.10.0 - version: 4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0) - webpack-dev-server: - specifier: ^4.15.1 - version: 4.15.1(webpack-cli@4.10.0)(webpack@5.94.0) - webpack-merge: - specifier: ^5.9.0 - version: 5.9.0 - webpack-node-externals: - specifier: ^3.0.0 - version: 3.0.0 - packages/unitables: dependencies: '@kie-tools-core/i18n': @@ -12499,8 +12632,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 vscode-extension-tester: - specifier: ^8.3.1 - version: 8.3.1(mocha@10.6.0)(typescript@5.5.3) + specifier: ^8.8.0 + version: 8.8.0(mocha@10.6.0)(typescript@5.5.3) packages/vscode-extension-dashbuilder-editor: dependencies: @@ -12623,8 +12756,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 vscode-extension-tester: - specifier: ^8.3.1 - version: 8.3.1(mocha@10.6.0)(typescript@5.5.3) + specifier: ^8.8.0 + version: 8.8.0(mocha@10.6.0)(typescript@5.5.3) webpack: specifier: ^5.94.0 version: 5.94.0(webpack-cli@4.10.0) @@ -12746,9 +12879,6 @@ importers: specifier: workspace:* version: link:../maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -13290,9 +13420,6 @@ importers: specifier: workspace:* version: link:../maven-base devDependencies: - '@kie-tools/maven-config-setup-helper': - specifier: workspace:* - version: link:../maven-config-setup-helper '@kie-tools/root-env': specifier: workspace:* version: link:../root-env @@ -13345,16 +13472,13 @@ importers: '@kie-tools/maven-base': specifier: workspace:* version: link:../maven-base - devDependencies: - '@kie-tools/maven-config-setup-helper': + '@kie-tools/yard-model': specifier: workspace:* - version: link:../maven-config-setup-helper + version: link:../yard-model + devDependencies: '@kie-tools/root-env': specifier: workspace:* version: link:../root-env - '@kie-tools/yard-model': - specifier: workspace:* - version: link:../yard-model copyfiles: specifier: ^2.4.1 version: 2.4.1 @@ -13492,8 +13616,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 vscode-extension-tester: - specifier: ^8.3.1 - version: 8.3.1(mocha@10.6.0)(typescript@5.5.3) + specifier: ^8.8.0 + version: 8.8.0(mocha@10.6.0)(typescript@5.5.3) webpack: specifier: ^5.94.0 version: 5.94.0(webpack-cli@4.10.0) @@ -16305,6 +16429,9 @@ packages: '@base2/pretty-print-object@1.0.1': resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} + '@bazel/runfiles@5.8.1': + resolution: {integrity: sha512-NDdfpdQ6rZlylgv++iMn5FkObC/QlBQvipinGLSOguTYpRywmieOyJ29XHvUilspwTFSILWpoE9CqMGkHXug1g==} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -18235,14 +18362,14 @@ packages: peerDependencies: openapi-types: '>=7' - '@redhat-developer/locators@1.1.3': - resolution: {integrity: sha512-wO+qoL7daG40vJkzX400YcvxFLOInxmfgbViCiUtj42ihwEr/k2aBKNDOxsJqq2kzQ5HWkxFJqmxQx80aYnaQg==} + '@redhat-developer/locators@1.6.0': + resolution: {integrity: sha512-MdV7Rhh1/9J44tuwGsqYsSvP9Dk9Dgrs1g4yQpdJRRFm6pa0m8ntnKdBG8bpVxmmTCgWe+/nsdJtKXynPBaPrA==} peerDependencies: '@redhat-developer/page-objects': '>=1.0.0' selenium-webdriver: '>=4.6.1' - '@redhat-developer/page-objects@1.1.3': - resolution: {integrity: sha512-oqntfrz02Gv4PbBBYPqkW00OHYCAM3AbHx67sFPeO2DaQO5SzaRwiS1CJ97jUGNiALjsaw0SgFpjRpHoOYwyRA==} + '@redhat-developer/page-objects@1.6.0': + resolution: {integrity: sha512-BD8cXANSWbYN82VDhJQVckGWiNAgs3F4YKdFnDxDa7FLSWydkDnaQ6EfNG+sVGhhDR89RtQpFBOhxSNp726EHA==} peerDependencies: selenium-webdriver: '>=4.6.1' typescript: '>=4.6.2' @@ -19430,9 +19557,6 @@ packages: '@types/http-proxy@1.17.14': resolution: {integrity: sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==} - '@types/inquirer@7.3.3': - resolution: {integrity: sha512-HhxyLejTHMfohAuhRun4csWigAMjXTmRyiJTU1Y/I1xmggikFMkOUoMQRlFm+zQcPEGHSs3io/0FAmNZf8EymQ==} - '@types/invariant@2.2.35': resolution: {integrity: sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==} @@ -19643,8 +19767,8 @@ packages: '@types/selenium-webdriver@4.1.20': resolution: {integrity: sha512-WxzARWDZVTbXlJgwYGhNoiV4OuHDabctSQmK5V88LqjW9TJiLETcknxRZ2xB1toecQnu0T2jt1pPXnSYkaWYiw==} - '@types/selenium-webdriver@4.1.24': - resolution: {integrity: sha512-oR5MVATv+P2dmhceZJPDm99MmOC9yAK8YpIgJbHEFQ/MbSPC1lA6Ohw441WNUcQ6B1fMAOMu0u59fRKKj9AGGg==} + '@types/selenium-webdriver@4.1.26': + resolution: {integrity: sha512-PUgqsyNffal0eAU0bzGlh37MJo558aporAPZoKqBeB/pF7zhKl1S3zqza0GpwFqgoigNxWhEIJzru75eeYco/w==} '@types/semver@6.2.3': resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} @@ -19703,9 +19827,6 @@ packages: '@types/testing-library__jest-dom@5.14.9': resolution: {integrity: sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw==} - '@types/through@0.0.30': - resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} - '@types/tough-cookie@4.0.2': resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==} @@ -19897,9 +20018,9 @@ packages: engines: {node: '>= 14'} hasBin: true - '@vscode/vsce@2.29.0': - resolution: {integrity: sha512-63+aEO8SpjE6qKiIh2Cqy/P9zC7+USElGwpEdkyPp89xIBDBr5IqeNS3zkD3mp3wZqbvHIpJsCCNu74WQirYCg==} - engines: {node: '>= 16'} + '@vscode/vsce@3.1.1': + resolution: {integrity: sha512-N62Ca9ElRPLUUzf7l9CeEBlLrYzFPRQq7huKk4pVW+LjIOSXfFIPudixn5QvZcz+yXDOh15IopI3K2o3y9666Q==} + engines: {node: '>= 20'} hasBin: true '@webassemblyjs/ast@1.12.1': @@ -21518,8 +21639,8 @@ packages: commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - compare-versions@6.1.0: - resolution: {integrity: sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==} + compare-versions@6.1.1: + resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==} component-emitter@1.3.0: resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} @@ -22522,6 +22643,9 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + duplexer2@0.1.4: + resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} + duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} @@ -23671,6 +23795,11 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true + glob@11.0.0: + resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + engines: {node: 20 || >=22} + hasBin: true + glob@7.2.0: resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} @@ -24207,10 +24336,6 @@ packages: resolution: {integrity: sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - inquirer@8.2.0: - resolution: {integrity: sha512-0crLweprevJ02tTuA6ThpoAERAGyVILC4sS74uib58Xf/zSr1/ZWtmm7D5CI+bSQEaA04f0K7idaHpQbSWgiVQ==} - engines: {node: '>=8.0.0'} - inquirer@8.2.4: resolution: {integrity: sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==} engines: {node: '>=12.0.0'} @@ -24674,6 +24799,10 @@ packages: resolution: {integrity: sha512-qH3nOSj8q/8+Eg8LUPOq3C+6HWkpUioIjDsq1+D4zY91oZvpPttw8GwtF1nReRYKXl+1AORyFqtm2f5Q1SB6/Q==} engines: {node: 14 >=14.21 || 16 >=16.20 || >=18} + jackspeak@4.0.2: + resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} + engines: {node: 20 || >=22} + jake@10.8.7: resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} engines: {node: '>=10'} @@ -25297,6 +25426,9 @@ packages: linkify-it@3.0.3: resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} + linkify-it@5.0.0: + resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} + listr2@3.14.0: resolution: {integrity: sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==} engines: {node: '>=10.0.0'} @@ -25490,6 +25622,10 @@ packages: resolution: {integrity: sha512-voV4dDrdVZVNz84n39LFKDaRzfwhdzJ7akpyXfTMxCgRUp07U3lcJUXRlhTKP17rgt09sUzLi5iCitpEAr+6ug==} engines: {node: 14 || 16 || 18 || 20 || >=22} + lru-cache@11.0.1: + resolution: {integrity: sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==} + engines: {node: 20 || >=22} + lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -25574,6 +25710,10 @@ packages: resolution: {integrity: sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==} hasBin: true + markdown-it@14.1.0: + resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} + hasBin: true + markdown-table@3.0.2: resolution: {integrity: sha512-y8j3a5/DkJCmS5x4dMCQL+OR0+2EAq3DOtio1COSHsmW2BGXnNCK3v12hJt1LrUz5iZH5g0LmuYOjDdI+czghA==} @@ -25610,6 +25750,9 @@ packages: mdurl@1.0.1: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} + mdurl@2.0.0: + resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} + media-typer@0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} @@ -25780,6 +25923,10 @@ packages: minimalistic-crypto-utils@1.0.1: resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + minimatch@3.0.4: resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} @@ -26657,6 +26804,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} + path-temp@2.0.0: resolution: {integrity: sha512-92olbatybjsHTGB2CUnAM7s0mU/27gcMfLNA7t09UftndUdxywlQKur3fzXEPpfLrgZD3I2Bt8+UmiL7YDEgXQ==} engines: {node: '>=8.15'} @@ -27234,6 +27385,10 @@ packages: pumpify@1.5.1: resolution: {integrity: sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==} + punycode.js@2.3.1: + resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} + engines: {node: '>=6'} + punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} @@ -27456,8 +27611,8 @@ packages: peerDependencies: react: '>=16.13.1' - react-error-boundary@4.0.12: - resolution: {integrity: sha512-kJdxdEYlb7CPC1A0SeUY38cHpjuu6UkvzKiAmqmOFL21VRfMhOcWxTCBgLVCO0VEMh9JhFNcVaXlV4/BTpiwOA==} + react-error-boundary@4.0.13: + resolution: {integrity: sha512-b6PwbdSv8XeOSYvjt8LpgpKrZ0yGdtZokYwkwV2wlcZbxgopHX/hgPl5VgpnoVOWd868n1hktM8Qm4b+02MiLQ==} peerDependencies: react: '>=16.13.1' @@ -28102,10 +28257,6 @@ packages: resolution: {integrity: sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==} hasBin: true - rxjs@6.6.7: - resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} - engines: {npm: '>=2.0.0'} - rxjs@7.5.2: resolution: {integrity: sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==} @@ -28250,8 +28401,8 @@ packages: resolution: {integrity: sha512-BNG1bq+KWiBGHcJ/wULi0eKY0yaDqFIbEmtbsYJmfaEghdCkXBsx1akgOorhNwjBipOr0uwpvNXqT6/nzl+zjg==} engines: {node: '>= 14.20.0'} - selenium-webdriver@4.22.0: - resolution: {integrity: sha512-GNbrkCHmy249ai885wgXqTfqL2lZnclUH/P8pwTDIqzyFxU3YhDiN7p/c9tMFA4NhgRdEBO2QCG+CWmG7xr/Mw==} + selenium-webdriver@4.25.0: + resolution: {integrity: sha512-zl9IX93caOT8wbcCpZzAkEtYa+hNgJ4C5GUN8uhpzggqRLvsg1asfKi0p1uNZC8buYVvsBZbx8S+9MjVAjs4oA==} engines: {node: '>= 14.21.0'} selfsigned@2.4.1: @@ -29371,8 +29522,8 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - type-fest@4.21.0: - resolution: {integrity: sha512-ADn2w7hVPcK6w1I0uWnM//y1rLXZhzB9mr0a3OirzclKF1Wp6VzevUmzz/NRAWunOT6E8HrnpGY7xOfc6K57fA==} + type-fest@4.26.1: + resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} engines: {node: '>=16'} type-is@1.6.18: @@ -29438,6 +29589,9 @@ packages: uc.micro@1.0.6: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} + uc.micro@2.1.0: + resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} @@ -29584,6 +29738,9 @@ packages: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} + unzipper@0.12.3: + resolution: {integrity: sha512-PZ8hTS+AqcGxsaQntl3IRBw65QrBI6lxzqDEL7IAo/XCEqRTKGfOX56Vea5TH9SZczRVxuzk1re04z/YjuYCJA==} + update-browserslist-db@1.0.13: resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true @@ -29911,8 +30068,8 @@ packages: resolution: {integrity: sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==} engines: {node: '>=0.10.0'} - vscode-extension-tester@8.3.1: - resolution: {integrity: sha512-SJfCwBHJhC37tFxAlssdlCyrC6iEe1tqMn0oWFU4Wuc12sgHWAf6Sdj0dsDMifBZKkua7HYX4OrirJ1kbsBtCw==} + vscode-extension-tester@8.8.0: + resolution: {integrity: sha512-P8tY/pPJMU5WbVEBuIabmD5wTpULLH3Nr3upSAIHPXHj+WRYZnvB3/nCN5FCmE85o8uhyFlRMjdhe4hmrHTX7w==} hasBin: true peerDependencies: mocha: '>=5.2.0' @@ -31001,13 +31158,13 @@ snapshots: '@ardatan/relay-compiler@12.0.0(encoding@0.1.13)(graphql@14.3.1)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/generator': 7.23.6 '@babel/parser': 7.23.9 - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@babel/traverse': 7.23.9 '@babel/types': 7.23.9 - babel-preset-fbjs: 3.4.0(@babel/core@7.23.9) + babel-preset-fbjs: 3.4.0(@babel/core@7.24.9) chalk: 4.1.2 fb-watchman: 2.0.1 fbjs: 3.0.2(encoding@0.1.13) @@ -31035,17 +31192,17 @@ snapshots: '@azure/abort-controller@1.1.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@azure/abort-controller@2.1.2': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@azure/core-auth@1.7.2': dependencies: '@azure/abort-controller': 2.1.2 '@azure/core-util': 1.9.0 - tslib: 2.6.2 + tslib: 2.7.0 '@azure/core-client@1.9.2': dependencies: @@ -31055,7 +31212,7 @@ snapshots: '@azure/core-tracing': 1.1.2 '@azure/core-util': 1.9.0 '@azure/logger': 1.1.2 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - supports-color @@ -31067,19 +31224,19 @@ snapshots: '@azure/core-util': 1.9.0 '@azure/logger': 1.1.2 http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.2 - tslib: 2.6.2 + https-proxy-agent: 7.0.5 + tslib: 2.7.0 transitivePeerDependencies: - supports-color '@azure/core-tracing@1.1.2': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@azure/core-util@1.9.0': dependencies: '@azure/abort-controller': 2.1.2 - tslib: 2.6.2 + tslib: 2.7.0 '@azure/identity@4.3.0': dependencies: @@ -31096,13 +31253,13 @@ snapshots: jws: 4.0.0 open: 8.4.0 stoppable: 1.1.0 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - supports-color '@azure/logger@1.1.2': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@azure/msal-browser@3.18.0': dependencies: @@ -31453,19 +31610,6 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-member-expression-to-functions': 7.24.8 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.23.9) - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/traverse': 7.25.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/helper-create-class-features-plugin@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -31548,13 +31692,6 @@ snapshots: regexpu-core: 5.3.2 semver: 6.3.1 - '@babel/helper-create-regexp-features-plugin@7.25.2(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-annotate-as-pure': 7.24.7 - regexpu-core: 5.3.2 - semver: 6.3.1 - '@babel/helper-create-regexp-features-plugin@7.25.2(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -31638,17 +31775,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - debug: 4.3.6 - lodash.debounce: 4.0.8 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color - '@babel/helper-define-polyfill-provider@0.6.2(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -31803,16 +31929,6 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 - '@babel/helper-module-transforms@7.25.2(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-transforms@7.25.2(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -31886,15 +32002,6 @@ snapshots: '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-wrap-function': 7.22.20 - '@babel/helper-remap-async-to-generator@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-wrap-function': 7.25.0 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/helper-remap-async-to-generator@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -31948,15 +32055,6 @@ snapshots: '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-replace-supers@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-member-expression-to-functions': 7.24.8 - '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/helper-replace-supers@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -32125,14 +32223,6 @@ snapshots: dependencies: '@babel/types': 7.25.2 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.3(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.3(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -32179,11 +32269,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -32236,15 +32321,6 @@ snapshots: '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-transform-optional-chaining': 7.23.4(@babel/core@7.23.9) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-transform-optional-chaining': 7.24.8(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -32275,14 +32351,6 @@ snapshots: '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -32339,12 +32407,6 @@ snapshots: '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.18.10) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.24.9)': dependencies: '@babel/core': 7.24.9 @@ -32513,14 +32575,14 @@ snapshots: '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.18.10) '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.18.10) - '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.23.9)': + '@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.24.9)': dependencies: '@babel/compat-data': 7.23.5 - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.9) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.9) + '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.24.9) '@babel/plugin-proposal-optional-catch-binding@7.16.7(@babel/core@7.16.12)': dependencies: @@ -32916,11 +32978,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-import-attributes@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-import-attributes@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33337,11 +33394,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-arrow-functions@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-arrow-functions@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33376,16 +33428,6 @@ snapshots: '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.9) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.9) - '@babel/plugin-transform-async-generator-functions@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-remap-async-to-generator': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-async-generator-functions@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33448,15 +33490,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.23.9) - '@babel/plugin-transform-async-to-generator@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-remap-async-to-generator': 7.25.0(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-async-to-generator@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33505,11 +33538,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-block-scoped-functions@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-block-scoped-functions@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33550,11 +33578,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-block-scoping@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-block-scoping@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33583,14 +33606,6 @@ snapshots: '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-class-properties@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-class-properties@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33628,15 +33643,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-transform-class-static-block@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-class-static-block@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33729,18 +33735,6 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 - '@babel/plugin-transform-classes@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.23.9) - '@babel/traverse': 7.25.3 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-classes@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33799,12 +33793,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/template': 7.23.9 - '@babel/plugin-transform-computed-properties@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/template': 7.25.0 - '@babel/plugin-transform-computed-properties@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33847,11 +33835,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-destructuring@7.24.8(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-destructuring@7.24.8(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33916,12 +33899,6 @@ snapshots: '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.24.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-dotall-regex@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-dotall-regex@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33964,11 +33941,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-duplicate-keys@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-duplicate-keys@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -33997,12 +33969,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-dynamic-import@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-dynamic-import@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34051,14 +34017,6 @@ snapshots: '@babel/helper-builder-binary-assignment-operator-visitor': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-exponentiation-operator@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.24.7 - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-exponentiation-operator@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34093,12 +34051,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-export-namespace-from@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-export-namespace-from@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34173,14 +34125,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/plugin-transform-for-of@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-for-of@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34239,15 +34183,6 @@ snapshots: '@babel/helper-function-name': 7.23.0 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-function-name@7.25.1(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-function-name@7.25.1(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34284,12 +34219,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-json-strings@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-json-strings@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34332,11 +34261,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-literals@7.25.2(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-literals@7.25.2(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34365,12 +34289,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-transform-logical-assignment-operators@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-transform-logical-assignment-operators@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34413,11 +34331,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-member-expression-literals@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-member-expression-literals@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34466,14 +34379,6 @@ snapshots: '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-modules-amd@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-modules-amd@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34555,15 +34460,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 - '@babel/plugin-transform-modules-commonjs@7.24.8(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-simple-access': 7.24.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-modules-commonjs@7.24.8(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34632,16 +34528,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-validator-identifier': 7.22.20 - '@babel/plugin-transform-modules-systemjs@7.25.0(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-validator-identifier': 7.24.7 - '@babel/traverse': 7.25.3 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-modules-systemjs@7.25.0(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34698,14 +34584,6 @@ snapshots: '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-modules-umd@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-module-transforms': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-modules-umd@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34750,12 +34628,6 @@ snapshots: '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-named-capturing-groups-regex@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-named-capturing-groups-regex@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34798,11 +34670,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-new-target@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-new-target@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34831,12 +34698,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-nullish-coalescing-operator@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-nullish-coalescing-operator@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34867,12 +34728,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-transform-numeric-separator@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-transform-numeric-separator@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34912,14 +34767,6 @@ snapshots: '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-transform-object-rest-spread@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-object-rest-spread@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -34972,14 +34819,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-replace-supers': 7.22.20(@babel/core@7.23.9) - '@babel/plugin-transform-object-super@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-replace-supers': 7.25.0(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-object-super@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35014,12 +34853,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-optional-catch-binding@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-optional-catch-binding@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35053,15 +34886,6 @@ snapshots: '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-optional-chaining@7.24.8(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-optional-chaining@7.24.8(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35125,11 +34949,6 @@ snapshots: '@babel/core': 7.24.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-parameters@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-parameters@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35158,14 +34977,6 @@ snapshots: '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-private-methods@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-private-methods@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35206,16 +35017,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-transform-private-property-in-object@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-annotate-as-pure': 7.24.7 - '@babel/helper-create-class-features-plugin': 7.25.0(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-private-property-in-object@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35266,11 +35067,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-property-literals@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-property-literals@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35281,9 +35077,9 @@ snapshots: '@babel/core': 7.24.9 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-react-constant-elements@7.17.12(@babel/core@7.23.9)': + '@babel/plugin-transform-react-constant-elements@7.17.12(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-transform-react-display-name@7.16.0(@babel/core@7.16.12)': @@ -35321,6 +35117,11 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-transform-react-display-name@7.22.5(@babel/core@7.24.9)': + dependencies: + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-transform-react-jsx-development@7.16.0(@babel/core@7.16.12)': dependencies: '@babel/core': 7.16.12 @@ -35356,6 +35157,11 @@ snapshots: '@babel/core': 7.23.9 '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.9) + '@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.24.9)': + dependencies: + '@babel/core': 7.24.9 + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.24.9) + '@babel/plugin-transform-react-jsx@7.16.0(@babel/core@7.16.12)': dependencies: '@babel/core': 7.16.12 @@ -35470,6 +35276,12 @@ snapshots: '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-transform-react-pure-annotations@7.22.5(@babel/core@7.24.9)': + dependencies: + '@babel/core': 7.24.9 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-transform-regenerator@7.17.9(@babel/core@7.16.12)': dependencies: '@babel/core': 7.16.12 @@ -35504,12 +35316,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 regenerator-transform: 0.15.2 - '@babel/plugin-transform-regenerator@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - regenerator-transform: 0.15.2 - '@babel/plugin-transform-regenerator@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35552,11 +35358,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-reserved-words@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-reserved-words@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35609,11 +35410,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-shorthand-properties@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-shorthand-properties@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35660,14 +35456,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/plugin-transform-spread@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - transitivePeerDependencies: - - supports-color - '@babel/plugin-transform-spread@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35714,11 +35502,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-sticky-regex@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-sticky-regex@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35759,11 +35542,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-template-literals@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-template-literals@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35804,11 +35582,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-typeof-symbol@7.24.8(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-typeof-symbol@7.24.8(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35889,11 +35662,6 @@ snapshots: '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-unicode-escapes@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-unicode-escapes@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35922,12 +35690,6 @@ snapshots: '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-unicode-property-regex@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-unicode-property-regex@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -35976,12 +35738,6 @@ snapshots: '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-unicode-regex@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-unicode-regex@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -36012,12 +35768,6 @@ snapshots: '@babel/helper-create-regexp-features-plugin': 7.22.15(@babel/core@7.23.9) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-transform-unicode-sets-regex@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-create-regexp-features-plugin': 7.25.2(@babel/core@7.23.9) - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-unicode-sets-regex@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -36529,93 +36279,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/preset-env@7.24.7(@babel/core@7.23.9)': - dependencies: - '@babel/compat-data': 7.25.2 - '@babel/core': 7.23.9 - '@babel/helper-compilation-targets': 7.25.2 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/helper-validator-option': 7.24.8 - '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.3(@babel/core@7.23.9) - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.9) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.9) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.9) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-import-assertions': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-syntax-import-attributes': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.9) - '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.23.9) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-async-generator-functions': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-async-to-generator': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-transform-class-properties': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-class-static-block': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-dotall-regex': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-duplicate-keys': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-dynamic-import': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-exponentiation-operator': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-export-namespace-from': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.23.9) - '@babel/plugin-transform-json-strings': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.23.9) - '@babel/plugin-transform-logical-assignment-operators': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-modules-amd': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-modules-systemjs': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-transform-modules-umd': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-named-capturing-groups-regex': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-new-target': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-nullish-coalescing-operator': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-numeric-separator': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-object-rest-spread': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-optional-catch-binding': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-optional-chaining': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-private-methods': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-private-property-in-object': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-regenerator': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-reserved-words': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-sticky-regex': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-typeof-symbol': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-escapes': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-property-regex': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-regex': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-unicode-sets-regex': 7.24.7(@babel/core@7.23.9) - '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.23.9) - babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.23.9) - babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.23.9) - babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.23.9) - core-js-compat: 3.37.1 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/preset-env@7.24.7(@babel/core@7.24.7)': dependencies: '@babel/compat-data': 7.25.2 @@ -36950,6 +36613,16 @@ snapshots: '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.23.9) '@babel/plugin-transform-react-pure-annotations': 7.22.5(@babel/core@7.23.9) + '@babel/preset-react@7.22.15(@babel/core@7.24.9)': + dependencies: + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.24.9) + '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-transform-react-pure-annotations': 7.22.5(@babel/core@7.24.9) + '@babel/preset-typescript@7.23.0(@babel/core@7.16.12)': dependencies: '@babel/core': 7.16.12 @@ -36995,15 +36668,6 @@ snapshots: '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.24.9) '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.24.9) - '@babel/register@7.22.15(@babel/core@7.23.9)': - dependencies: - '@babel/core': 7.23.9 - clone-deep: 4.0.1 - find-cache-dir: 2.1.0 - make-dir: 2.1.0 - pirates: 4.0.6 - source-map-support: 0.5.21 - '@babel/register@7.22.15(@babel/core@7.24.9)': dependencies: '@babel/core': 7.24.9 @@ -37168,6 +36832,8 @@ snapshots: '@base2/pretty-print-object@1.0.1': {} + '@bazel/runfiles@5.8.1': {} + '@bcoe/v8-coverage@0.2.3': {} '@chevrotain/types@9.1.0': {} @@ -38316,41 +37982,6 @@ snapshots: - supports-color - ts-node - '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.14.2 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.3.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.5 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - '@jest/environment@29.7.0': dependencies: '@jest/fake-timers': 29.7.0 @@ -38415,6 +38046,7 @@ snapshots: v8-to-istanbul: 9.1.3 transitivePeerDependencies: - supports-color + optional: true '@jest/reporters@29.7.0(node-notifier@8.0.2)': dependencies: @@ -38494,7 +38126,7 @@ snapshots: '@jest/transform@29.7.0': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 @@ -39053,7 +38685,7 @@ snapshots: dependencies: playwright: 1.45.2 - '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0))': + '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0))': dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 @@ -39068,11 +38700,11 @@ snapshots: webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) optionalDependencies: '@types/webpack': 4.41.39 - type-fest: 4.21.0 + type-fest: 4.26.1 webpack-dev-server: 4.15.1(webpack-cli@4.10.0)(webpack@5.94.0) webpack-hot-middleware: 2.25.4 - '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.21.0)(webpack-hot-middleware@2.25.4)(webpack@5.94.0(esbuild@0.18.20))': + '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-hot-middleware@2.25.4)(webpack@5.94.0(esbuild@0.18.20))': dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 @@ -39087,10 +38719,10 @@ snapshots: webpack: 5.94.0(esbuild@0.18.20) optionalDependencies: '@types/webpack': 4.41.39 - type-fest: 4.21.0 + type-fest: 4.26.1 webpack-hot-middleware: 2.25.4 - '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0))': + '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0))': dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 @@ -39105,11 +38737,11 @@ snapshots: webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) optionalDependencies: '@types/webpack': 4.41.39 - type-fest: 4.21.0 + type-fest: 4.26.1 webpack-dev-server: 4.15.1(webpack-cli@4.10.0)(webpack@5.94.0) webpack-hot-middleware: 2.25.4 - '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0))': + '@pmmmwh/react-refresh-webpack-plugin@0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0))': dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 @@ -39124,7 +38756,7 @@ snapshots: webpack: 5.94.0(webpack-cli@4.10.0) optionalDependencies: '@types/webpack': 4.41.39 - type-fest: 4.21.0 + type-fest: 4.26.1 webpack-dev-server: 4.15.1(webpack-cli@4.10.0)(webpack@5.94.0) webpack-hot-middleware: 2.25.4 @@ -39914,15 +39546,15 @@ snapshots: '@radix-ui/number@1.0.1': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/primitive@1.0.1': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-arrow@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -39932,7 +39564,7 @@ snapshots: '@radix-ui/react-collection@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-compose-refs': 1.0.1(@types/react@17.0.21)(react@17.0.2) '@radix-ui/react-context': 1.0.1(@types/react@17.0.21)(react@17.0.2) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -39945,28 +39577,28 @@ snapshots: '@radix-ui/react-compose-refs@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-context@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-direction@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-dismissable-layer@1.0.4(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@17.0.21)(react@17.0.2) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -39980,14 +39612,14 @@ snapshots: '@radix-ui/react-focus-guards@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-focus-scope@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-compose-refs': 1.0.1(@types/react@17.0.21)(react@17.0.2) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@17.0.21)(react@17.0.2) @@ -39999,7 +39631,7 @@ snapshots: '@radix-ui/react-id@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@17.0.21)(react@17.0.2) react: 17.0.2 optionalDependencies: @@ -40007,7 +39639,7 @@ snapshots: '@radix-ui/react-popper@1.1.2(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@floating-ui/react-dom': 2.0.2(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@radix-ui/react-arrow': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@radix-ui/react-compose-refs': 1.0.1(@types/react@17.0.21)(react@17.0.2) @@ -40026,7 +39658,7 @@ snapshots: '@radix-ui/react-portal@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -40036,7 +39668,7 @@ snapshots: '@radix-ui/react-primitive@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-slot': 1.0.2(@types/react@17.0.21)(react@17.0.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -40046,7 +39678,7 @@ snapshots: '@radix-ui/react-roving-focus@1.0.4(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-collection': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@radix-ui/react-compose-refs': 1.0.1(@types/react@17.0.21)(react@17.0.2) @@ -40064,7 +39696,7 @@ snapshots: '@radix-ui/react-select@1.2.2(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/number': 1.0.1 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-collection': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -40094,7 +39726,7 @@ snapshots: '@radix-ui/react-separator@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -40104,7 +39736,7 @@ snapshots: '@radix-ui/react-slot@1.0.2(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-compose-refs': 1.0.1(@types/react@17.0.21)(react@17.0.2) react: 17.0.2 optionalDependencies: @@ -40112,7 +39744,7 @@ snapshots: '@radix-ui/react-toggle-group@1.0.4(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-context': 1.0.1(@types/react@17.0.21)(react@17.0.2) '@radix-ui/react-direction': 1.0.1(@types/react@17.0.21)(react@17.0.2) @@ -40128,7 +39760,7 @@ snapshots: '@radix-ui/react-toggle@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@17.0.21)(react@17.0.2) @@ -40140,7 +39772,7 @@ snapshots: '@radix-ui/react-toolbar@1.0.4(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-context': 1.0.1(@types/react@17.0.21)(react@17.0.2) '@radix-ui/react-direction': 1.0.1(@types/react@17.0.21)(react@17.0.2) @@ -40156,14 +39788,14 @@ snapshots: '@radix-ui/react-use-callback-ref@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-use-controllable-state@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@17.0.21)(react@17.0.2) react: 17.0.2 optionalDependencies: @@ -40171,7 +39803,7 @@ snapshots: '@radix-ui/react-use-escape-keydown@1.0.3(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@17.0.21)(react@17.0.2) react: 17.0.2 optionalDependencies: @@ -40179,21 +39811,21 @@ snapshots: '@radix-ui/react-use-layout-effect@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-use-previous@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 optionalDependencies: '@types/react': 17.0.21 '@radix-ui/react-use-rect@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/rect': 1.0.1 react: 17.0.2 optionalDependencies: @@ -40201,7 +39833,7 @@ snapshots: '@radix-ui/react-use-size@1.0.1(@types/react@17.0.21)(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@17.0.21)(react@17.0.2) react: 17.0.2 optionalDependencies: @@ -40209,7 +39841,7 @@ snapshots: '@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@17.0.8)(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -40219,7 +39851,7 @@ snapshots: '@radix-ui/rect@1.0.1': dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 '@reactflow/background@11.3.6(@types/react@17.0.21)(immer@10.0.3(patch_hash=utu5oov26wz5mjuays57tp3ybu))(react-dom@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: @@ -40329,18 +39961,19 @@ snapshots: call-me-maybe: 1.0.2 openapi-types: 7.2.3 - '@redhat-developer/locators@1.1.3(@redhat-developer/page-objects@1.1.3(selenium-webdriver@4.22.0)(typescript@5.5.3))(selenium-webdriver@4.22.0)': + '@redhat-developer/locators@1.6.0(@redhat-developer/page-objects@1.6.0(selenium-webdriver@4.25.0)(typescript@5.5.3))(selenium-webdriver@4.25.0)': dependencies: - '@redhat-developer/page-objects': 1.1.3(selenium-webdriver@4.22.0)(typescript@5.5.3) - selenium-webdriver: 4.22.0 + '@redhat-developer/page-objects': 1.6.0(selenium-webdriver@4.25.0)(typescript@5.5.3) + selenium-webdriver: 4.25.0 - '@redhat-developer/page-objects@1.1.3(selenium-webdriver@4.22.0)(typescript@5.5.3)': + '@redhat-developer/page-objects@1.6.0(selenium-webdriver@4.25.0)(typescript@5.5.3)': dependencies: clipboardy: 4.0.0 clone-deep: 4.0.1 - compare-versions: 6.1.0 + compare-versions: 6.1.1 fs-extra: 11.2.0 - selenium-webdriver: 4.22.0 + selenium-webdriver: 4.25.0 + type-fest: 4.26.1 typescript: 5.5.3 '@repeaterjs/repeater@3.0.4': {} @@ -40883,7 +40516,7 @@ snapshots: '@storybook/builder-webpack5@7.4.6(@types/react-dom@17.0.8)(@types/react@17.0.21)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@storybook/addons': 7.4.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@storybook/channels': 7.4.6 '@storybook/client-api': 7.4.6 @@ -40903,7 +40536,7 @@ snapshots: '@swc/core': 1.3.92 '@types/node': 16.18.58 '@types/semver': 7.5.2 - babel-loader: 9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)) + babel-loader: 9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)) babel-plugin-named-exports-order: 0.0.2 browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 @@ -40943,7 +40576,7 @@ snapshots: '@storybook/builder-webpack5@7.4.6(@types/react-dom@17.0.8)(@types/react@17.0.21)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@storybook/addons': 7.4.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2) '@storybook/channels': 7.4.6 '@storybook/client-api': 7.4.6 @@ -40963,7 +40596,7 @@ snapshots: '@swc/core': 1.3.92 '@types/node': 16.18.58 '@types/semver': 7.5.2 - babel-loader: 9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + babel-loader: 9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) babel-plugin-named-exports-order: 0.0.2 browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 @@ -41003,7 +40636,7 @@ snapshots: '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(esbuild@0.18.20)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@storybook/channels': 7.6.13 '@storybook/client-logger': 7.6.13 '@storybook/core-common': 7.6.13(encoding@0.1.13) @@ -41015,7 +40648,7 @@ snapshots: '@swc/core': 1.3.92 '@types/node': 18.17.18 '@types/semver': 7.5.2 - babel-loader: 9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + babel-loader: 9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 cjs-module-lexer: 1.2.3 @@ -41053,7 +40686,7 @@ snapshots: '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@storybook/channels': 7.6.13 '@storybook/client-logger': 7.6.13 '@storybook/core-common': 7.6.13(encoding@0.1.13) @@ -41065,7 +40698,7 @@ snapshots: '@swc/core': 1.3.92 '@types/node': 18.17.18 '@types/semver': 7.5.2 - babel-loader: 9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + babel-loader: 9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 cjs-module-lexer: 1.2.3 @@ -41103,7 +40736,7 @@ snapshots: '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@storybook/channels': 7.6.13 '@storybook/client-logger': 7.6.13 '@storybook/core-common': 7.6.13(encoding@0.1.13) @@ -41115,7 +40748,7 @@ snapshots: '@swc/core': 1.3.92 '@types/node': 18.17.18 '@types/semver': 7.5.2 - babel-loader: 9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))) + babel-loader: 9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))) browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 cjs-module-lexer: 1.2.3 @@ -41269,8 +40902,8 @@ snapshots: '@storybook/cli@7.6.13(encoding@0.1.13)': dependencies: - '@babel/core': 7.23.9 - '@babel/preset-env': 7.24.7(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@babel/preset-env': 7.24.7(@babel/core@7.24.9) '@babel/types': 7.23.9 '@ndelangen/get-tarball': 3.0.9 '@storybook/codemod': 7.6.13 @@ -41297,7 +40930,7 @@ snapshots: get-port: 5.1.1 giget: 1.1.3 globby: 11.1.0 - jscodeshift: 0.15.1(@babel/preset-env@7.24.7(@babel/core@7.23.9)) + jscodeshift: 0.15.1(@babel/preset-env@7.24.7(@babel/core@7.24.9)) leven: 3.1.0 ora: 5.4.1 prettier: 2.8.8 @@ -41330,8 +40963,8 @@ snapshots: '@storybook/codemod@7.4.6': dependencies: - '@babel/core': 7.23.9 - '@babel/preset-env': 7.24.7(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@babel/preset-env': 7.24.7(@babel/core@7.24.9) '@babel/types': 7.23.9 '@storybook/csf': 0.1.2 '@storybook/csf-tools': 7.4.6 @@ -41340,7 +40973,7 @@ snapshots: '@types/cross-spawn': 6.0.3 cross-spawn: 7.0.3 globby: 11.1.0 - jscodeshift: 0.14.0(@babel/preset-env@7.24.7(@babel/core@7.23.9)) + jscodeshift: 0.14.0(@babel/preset-env@7.24.7(@babel/core@7.24.9)) lodash: 4.17.21 prettier: 2.8.8 recast: 0.23.4 @@ -41349,8 +40982,8 @@ snapshots: '@storybook/codemod@7.6.13': dependencies: - '@babel/core': 7.23.9 - '@babel/preset-env': 7.24.7(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@babel/preset-env': 7.24.7(@babel/core@7.24.9) '@babel/types': 7.23.9 '@storybook/csf': 0.1.2 '@storybook/csf-tools': 7.6.13 @@ -41359,7 +40992,7 @@ snapshots: '@types/cross-spawn': 6.0.3 cross-spawn: 7.0.3 globby: 11.1.0 - jscodeshift: 0.15.1(@babel/preset-env@7.24.7(@babel/core@7.23.9)) + jscodeshift: 0.15.1(@babel/preset-env@7.24.7(@babel/core@7.24.9)) lodash: 4.17.21 prettier: 2.8.8 recast: 0.23.4 @@ -41823,11 +41456,11 @@ snapshots: '@storybook/postinstall@7.4.6': {} - '@storybook/preset-react-webpack@7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.16.12) '@babel/preset-react': 7.22.15(@babel/core@7.16.12) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) '@storybook/core-webpack': 7.4.6 '@storybook/docs-tools': 7.4.6 '@storybook/node-logger': 7.4.6 @@ -41860,11 +41493,11 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/preset-react-webpack@7.4.6(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.4.6(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.23.9) '@babel/preset-react': 7.22.15(@babel/core@7.23.9) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.21.0)(webpack-hot-middleware@2.25.4)(webpack@5.94.0(esbuild@0.18.20)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-hot-middleware@2.25.4)(webpack@5.94.0(esbuild@0.18.20)) '@storybook/core-webpack': 7.4.6(encoding@0.1.13) '@storybook/docs-tools': 7.4.6(encoding@0.1.13) '@storybook/node-logger': 7.4.6 @@ -41897,11 +41530,11 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/preset-react-webpack@7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.18.10) '@babel/preset-react': 7.22.15(@babel/core@7.18.10) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0)) '@storybook/core-webpack': 7.6.13(encoding@0.1.13) '@storybook/docs-tools': 7.6.13(encoding@0.1.13) '@storybook/node-logger': 7.6.13 @@ -41935,11 +41568,11 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.23.0) '@babel/preset-react': 7.22.15(@babel/core@7.23.0) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) '@storybook/core-webpack': 7.6.13(encoding@0.1.13) '@storybook/docs-tools': 7.6.13(encoding@0.1.13) '@storybook/node-logger': 7.6.13 @@ -41973,11 +41606,11 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.23.9) '@babel/preset-react': 7.22.15(@babel/core@7.23.9) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.21.0)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0)) '@storybook/core-webpack': 7.6.13(encoding@0.1.13) '@storybook/docs-tools': 7.6.13(encoding@0.1.13) '@storybook/node-logger': 7.6.13 @@ -42101,10 +41734,10 @@ snapshots: react: 17.0.2 react-dom: 17.0.2(react@17.0.2) - '@storybook/react-webpack5@7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@storybook/builder-webpack5': 7.4.6(@types/react-dom@17.0.8)(@types/react@17.0.21)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) - '@storybook/preset-react-webpack': 7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + '@storybook/preset-react-webpack': 7.4.6(@babel/core@7.16.12)(@swc/core@1.3.92)(@types/webpack@4.41.39)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@storybook/react': 7.4.6(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 16.18.58 react: 17.0.2 @@ -42129,10 +41762,10 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/react-webpack5@7.4.6(@babel/core@7.23.9)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.4.6(@babel/core@7.23.9)(@types/react-dom@17.0.8)(@types/react@17.0.21)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-hot-middleware@2.25.4)': dependencies: '@storybook/builder-webpack5': 7.4.6(@types/react-dom@17.0.8)(@types/react@17.0.21)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) - '@storybook/preset-react-webpack': 7.4.6(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-hot-middleware@2.25.4) + '@storybook/preset-react-webpack': 7.4.6(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-hot-middleware@2.25.4) '@storybook/react': 7.4.6(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 16.18.58 react: 17.0.2 @@ -42157,10 +41790,10 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/react-webpack5@7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) - '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.18.10)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 18.17.18 react: 17.0.2 @@ -42183,10 +41816,10 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/react-webpack5@7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(esbuild@0.18.20)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) - '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 18.17.18 react: 17.0.2 @@ -42209,10 +41842,10 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/react-webpack5@7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) - '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.21.0)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 18.17.18 react: 17.0.2 @@ -42421,49 +42054,49 @@ snapshots: '@types/express': 4.17.17 file-system-cache: 2.3.0 - '@svgr/babel-plugin-add-jsx-attribute@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-add-jsx-attribute@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-remove-jsx-attribute@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-remove-jsx-attribute@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-remove-jsx-empty-expression@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-remove-jsx-empty-expression@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-replace-jsx-attribute-value@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-replace-jsx-attribute-value@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-svg-dynamic-title@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-svg-dynamic-title@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-svg-em-dimensions@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-svg-em-dimensions@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-transform-react-native-svg@6.0.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-transform-react-native-svg@6.0.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-plugin-transform-svg-component@6.2.0(@babel/core@7.23.9)': + '@svgr/babel-plugin-transform-svg-component@6.2.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 - '@svgr/babel-preset@6.2.0(@babel/core@7.23.9)': + '@svgr/babel-preset@6.2.0(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.23.9 - '@svgr/babel-plugin-add-jsx-attribute': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-remove-jsx-attribute': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-remove-jsx-empty-expression': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-replace-jsx-attribute-value': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-svg-dynamic-title': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-svg-em-dimensions': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-transform-react-native-svg': 6.0.0(@babel/core@7.23.9) - '@svgr/babel-plugin-transform-svg-component': 6.2.0(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@svgr/babel-plugin-add-jsx-attribute': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-remove-jsx-attribute': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-remove-jsx-empty-expression': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-replace-jsx-attribute-value': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-svg-dynamic-title': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-svg-em-dimensions': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-transform-react-native-svg': 6.0.0(@babel/core@7.24.9) + '@svgr/babel-plugin-transform-svg-component': 6.2.0(@babel/core@7.24.9) '@svgr/core@6.2.1': dependencies: @@ -42480,8 +42113,8 @@ snapshots: '@svgr/plugin-jsx@6.2.1(@svgr/core@6.2.1)': dependencies: - '@babel/core': 7.23.9 - '@svgr/babel-preset': 6.2.0(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@svgr/babel-preset': 6.2.0(@babel/core@7.24.9) '@svgr/core': 6.2.1 '@svgr/hast-util-to-babel-ast': 6.2.1 svg-parser: 2.0.4 @@ -42497,11 +42130,11 @@ snapshots: '@svgr/webpack@6.2.1': dependencies: - '@babel/core': 7.23.9 - '@babel/plugin-transform-react-constant-elements': 7.17.12(@babel/core@7.23.9) - '@babel/preset-env': 7.23.9(@babel/core@7.23.9) - '@babel/preset-react': 7.22.15(@babel/core@7.23.9) - '@babel/preset-typescript': 7.23.0(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@babel/plugin-transform-react-constant-elements': 7.17.12(@babel/core@7.24.9) + '@babel/preset-env': 7.24.7(@babel/core@7.24.9) + '@babel/preset-react': 7.22.15(@babel/core@7.24.9) + '@babel/preset-typescript': 7.23.0(@babel/core@7.24.9) '@svgr/core': 6.2.1 '@svgr/plugin-jsx': 6.2.1(@svgr/core@6.2.1) '@svgr/plugin-svgo': 6.2.0(@svgr/core@6.2.1) @@ -42611,21 +42244,6 @@ snapshots: '@types/jest': 29.5.12 jest: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - '@testing-library/jest-dom@6.4.6(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))': - dependencies: - '@adobe/css-tools': 4.4.0 - '@babel/runtime': 7.23.6 - aria-query: 5.1.3 - chalk: 3.0.0 - css.escape: 1.5.1 - dom-accessibility-api: 0.6.3 - lodash: 4.17.21 - redent: 3.0.0 - optionalDependencies: - '@jest/globals': 29.7.0 - '@types/jest': 29.5.12 - jest: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - '@testing-library/react-hooks@8.0.1(@types/react@17.0.21)(react-dom@17.0.2(react@17.0.2))(react-test-renderer@17.0.2(react@17.0.2))(react@17.0.2)': dependencies: '@babel/runtime': 7.23.6 @@ -43025,11 +42643,6 @@ snapshots: dependencies: '@types/node': 20.14.13 - '@types/inquirer@7.3.3': - dependencies: - '@types/through': 0.0.30 - rxjs: 6.6.7 - '@types/invariant@2.2.35': {} '@types/istanbul-lib-coverage@2.0.1': {} @@ -43268,10 +42881,10 @@ snapshots: dependencies: '@types/ws': 8.5.5 - '@types/selenium-webdriver@4.1.24': + '@types/selenium-webdriver@4.1.26': dependencies: - '@types/node': 20.14.2 - '@types/ws': 8.5.5 + '@types/node': 20.14.13 + '@types/ws': 8.5.12 '@types/semver@6.2.3': {} @@ -43335,10 +42948,6 @@ snapshots: dependencies: '@types/jest': 29.5.12 - '@types/through@0.0.30': - dependencies: - '@types/node': 20.14.2 - '@types/tough-cookie@4.0.2': {} '@types/treeify@1.0.0': {} @@ -43593,7 +43202,7 @@ snapshots: optionalDependencies: keytar: 7.9.0 - '@vscode/vsce@2.29.0': + '@vscode/vsce@3.1.1': dependencies: '@azure/identity': 4.3.0 '@vscode/vsce-sign': 2.0.4 @@ -43603,16 +43212,16 @@ snapshots: cockatiel: 3.1.3 commander: 6.2.1 form-data: 4.0.0 - glob: 7.2.3 + glob: 11.0.0 hosted-git-info: 4.1.0 - jsonc-parser: 3.2.0 + jsonc-parser: 3.3.1 leven: 3.1.0 - markdown-it: 12.3.2 + markdown-it: 14.1.0 mime: 1.6.0 minimatch: 3.1.2 parse-semver: 1.1.1 read: 1.0.7 - semver: 7.5.4 + semver: 7.6.3 tmp: 0.2.3 typed-rest-client: 1.8.4 url-join: 4.0.1 @@ -44705,10 +44314,6 @@ snapshots: tunnel: 0.0.6 typed-rest-client: 1.8.4 - babel-core@7.0.0-bridge.0(@babel/core@7.23.9): - dependencies: - '@babel/core': 7.23.9 - babel-core@7.0.0-bridge.0(@babel/core@7.24.9): dependencies: '@babel/core': 7.24.9 @@ -44795,6 +44400,7 @@ snapshots: slash: 3.0.0 transitivePeerDependencies: - supports-color + optional: true babel-jest@29.7.0(@babel/core@7.24.9): dependencies: @@ -44808,7 +44414,6 @@ snapshots: slash: 3.0.0 transitivePeerDependencies: - supports-color - optional: true babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)): dependencies: @@ -44817,47 +44422,54 @@ snapshots: schema-utils: 4.2.0 webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) - babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)): + babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(esbuild@0.18.20)): dependencies: '@babel/core': 7.23.9 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + webpack: 5.94.0(esbuild@0.18.20) - babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(webpack-cli@4.10.0)): dependencies: '@babel/core': 7.23.9 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + webpack: 5.94.0(webpack-cli@4.10.0) - babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): + babel-loader@9.1.3(@babel/core@7.24.7)(webpack@5.92.1(esbuild@0.21.5)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.7 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) + webpack: 5.92.1(esbuild@0.21.5) - babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(esbuild@0.18.20)): + babel-loader@9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.94.0(esbuild@0.18.20) + webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) - babel-loader@9.1.3(@babel/core@7.23.9)(webpack@5.94.0(webpack-cli@4.10.0)): + babel-loader@9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.94.0(webpack-cli@4.10.0) + webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) - babel-loader@9.1.3(@babel/core@7.24.7)(webpack@5.92.1(esbuild@0.21.5)): + babel-loader@9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.92.1(esbuild@0.21.5) + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + + babel-loader@9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + '@babel/core': 7.24.9 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) babel-plugin-add-react-displayname@0.0.5: {} @@ -44903,7 +44515,7 @@ snapshots: babel-plugin-macros@2.8.0: dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 cosmiconfig: 6.0.0 resolve: 1.22.8 @@ -44936,15 +44548,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.23.9): - dependencies: - '@babel/compat-data': 7.25.2 - '@babel/core': 7.23.9 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.23.9) - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.24.7): dependencies: '@babel/compat-data': 7.25.2 @@ -44990,14 +44593,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-plugin-polyfill-corejs3@0.10.4(@babel/core@7.23.9): - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.23.9) - core-js-compat: 3.37.1 - transitivePeerDependencies: - - supports-color - babel-plugin-polyfill-corejs3@0.10.4(@babel/core@7.24.7): dependencies: '@babel/core': 7.24.7 @@ -45104,13 +44699,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.23.9): - dependencies: - '@babel/core': 7.23.9 - '@babel/helper-define-polyfill-provider': 0.6.2(@babel/core@7.23.9) - transitivePeerDependencies: - - supports-color - babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.24.7): dependencies: '@babel/core': 7.24.7 @@ -45233,6 +44821,7 @@ snapshots: '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.9) + optional: true babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.9): dependencies: @@ -45249,37 +44838,36 @@ snapshots: '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.9) '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.9) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.9) - optional: true - babel-preset-fbjs@3.4.0(@babel/core@7.23.9): + babel-preset-fbjs@3.4.0(@babel/core@7.24.9): dependencies: - '@babel/core': 7.23.9 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.9) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.23.9) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.9) - '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.23.9) - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.9) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.23.9) - '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.23.9) - '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.23.9) - '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.23.9) - '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.23.9) - '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.9) - '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.23.9) + '@babel/core': 7.24.9 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.9) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.24.9) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.9) + '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.9) + '@babel/plugin-transform-arrow-functions': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-block-scoped-functions': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-block-scoping': 7.25.0(@babel/core@7.24.9) + '@babel/plugin-transform-classes': 7.25.0(@babel/core@7.24.9) + '@babel/plugin-transform-computed-properties': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-destructuring': 7.24.8(@babel/core@7.24.9) + '@babel/plugin-transform-flow-strip-types': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-transform-for-of': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-function-name': 7.25.1(@babel/core@7.24.9) + '@babel/plugin-transform-literals': 7.25.2(@babel/core@7.24.9) + '@babel/plugin-transform-member-expression-literals': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.24.9) + '@babel/plugin-transform-object-super': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-parameters': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-property-literals': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-react-display-name': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.24.9) + '@babel/plugin-transform-shorthand-properties': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-spread': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-template-literals': 7.24.7(@babel/core@7.24.9) babel-plugin-syntax-trailing-function-commas: 7.0.0-beta.0 transitivePeerDependencies: - supports-color @@ -45322,13 +44910,13 @@ snapshots: '@babel/core': 7.23.9 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.9) + optional: true babel-preset-jest@29.6.3(@babel/core@7.24.9): dependencies: '@babel/core': 7.24.9 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.9) - optional: true balanced-match@0.4.2: {} @@ -45768,10 +45356,10 @@ snapshots: cacheable-request@10.2.11: dependencies: - '@types/http-cache-semantics': 4.0.1 + '@types/http-cache-semantics': 4.0.4 get-stream: 7.0.0 http-cache-semantics: 4.1.1 - keyv: 4.5.2 + keyv: 4.5.4 mimic-response: 4.0.0 normalize-url: 8.0.0 responselike: 3.0.0 @@ -46223,7 +45811,7 @@ snapshots: commondir@1.0.1: {} - compare-versions@6.1.0: {} + compare-versions@6.1.1: {} component-emitter@1.3.0: {} @@ -47208,7 +46796,7 @@ snapshots: date-fns@2.30.0: dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 date-format@4.0.3: {} @@ -47554,7 +47142,7 @@ snapshots: dom-helpers@5.2.0: dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 csstype: 3.0.11 dom-serialize@2.2.1: @@ -47628,6 +47216,10 @@ snapshots: typescript: 5.5.3 yargs: 17.7.2 + duplexer2@0.1.4: + dependencies: + readable-stream: 2.3.7 + duplexer@0.1.2: {} duplexify@3.7.1: @@ -49295,6 +48887,15 @@ snapshots: package-json-from-dist: 1.0.0 path-scurry: 1.11.1 + glob@11.0.0: + dependencies: + foreground-child: 3.1.1 + jackspeak: 4.0.2 + minimatch: 10.0.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.0 + path-scurry: 2.0.0 + glob@7.2.0: dependencies: fs.realpath: 1.0.0 @@ -49591,7 +49192,7 @@ snapshots: history@5.3.0: dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 hmac-drbg@1.0.1: dependencies: @@ -50023,23 +49624,6 @@ snapshots: ini@4.1.3: {} - inquirer@8.2.0: - dependencies: - ansi-escapes: 4.3.2 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-width: 3.0.0 - external-editor: 3.1.0 - figures: 3.2.0 - lodash: 4.17.21 - mute-stream: 0.0.8 - ora: 5.4.1 - run-async: 2.4.1 - rxjs: 7.5.2 - string-width: 4.2.3 - strip-ansi: 6.0.1 - through: 2.3.8 - inquirer@8.2.4: dependencies: ansi-escapes: 4.3.2 @@ -50418,7 +50002,7 @@ snapshots: istanbul-lib-instrument@5.1.0: dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/parser': 7.23.9 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 @@ -50428,7 +50012,7 @@ snapshots: istanbul-lib-instrument@6.0.2: dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.24.9 '@babel/parser': 7.23.9 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 @@ -50477,6 +50061,10 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@4.0.2: + dependencies: + '@isaacs/cliui': 8.0.2 + jake@10.8.7: dependencies: async: 3.2.3 @@ -50643,31 +50231,12 @@ snapshots: - supports-color - ts-node - jest-cli@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - exit: 0.1.2 - import-local: 3.0.2 - jest-config: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jest-config@29.7.0(@types/node@20.14.2): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50695,10 +50264,10 @@ snapshots: jest-config@29.7.0(@types/node@20.14.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50726,10 +50295,10 @@ snapshots: jest-config@29.7.0(@types/node@20.14.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@22.5.2)(typescript@5.5.3)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50757,10 +50326,10 @@ snapshots: jest-config@29.7.0(@types/node@20.14.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50788,10 +50357,10 @@ snapshots: jest-config@29.7.0(@types/node@20.14.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50819,10 +50388,10 @@ snapshots: jest-config@29.7.0(@types/node@20.14.2)(ts-node@10.9.2(@types/node@22.5.2)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50850,10 +50419,10 @@ snapshots: jest-config@29.7.0(@types/node@22.5.2): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50881,10 +50450,10 @@ snapshots: jest-config@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@22.5.2)(typescript@5.5.3)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50912,10 +50481,10 @@ snapshots: jest-config@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -50943,10 +50512,10 @@ snapshots: jest-config@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)): dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.9) chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 @@ -51182,15 +50751,15 @@ snapshots: jest-snapshot@29.7.0: dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/generator': 7.23.6 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.9) - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.9) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.24.9) + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.24.9) '@babel/types': 7.23.9 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.9) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.9) chalk: 4.1.2 expect: 29.7.0 graceful-fs: 4.2.11 @@ -51260,10 +50829,6 @@ snapshots: dependencies: jest: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-when@3.6.0(jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3))): - dependencies: - jest: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-worker@25.5.0: dependencies: merge-stream: 2.0.0 @@ -51371,18 +50936,6 @@ snapshots: - supports-color - ts-node - jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)): - dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - '@jest/types': 29.6.3 - import-local: 3.0.2 - jest-cli: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jiti@1.17.1: {} jiti@1.21.6: {} @@ -51419,7 +50972,7 @@ snapshots: jsbn@1.1.0: {} - jscodeshift@0.14.0(@babel/preset-env@7.24.7(@babel/core@7.23.9)): + jscodeshift@0.14.0(@babel/preset-env@7.24.7(@babel/core@7.24.9)): dependencies: '@babel/core': 7.24.9 '@babel/parser': 7.25.3 @@ -51427,7 +50980,7 @@ snapshots: '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.24.9) '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.24.9) '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.24.9) - '@babel/preset-env': 7.24.7(@babel/core@7.23.9) + '@babel/preset-env': 7.24.7(@babel/core@7.24.9) '@babel/preset-flow': 7.22.15(@babel/core@7.24.9) '@babel/preset-typescript': 7.23.0(@babel/core@7.24.9) '@babel/register': 7.22.15(@babel/core@7.24.9) @@ -51444,15 +50997,15 @@ snapshots: transitivePeerDependencies: - supports-color - jscodeshift@0.14.0(@babel/preset-env@7.24.7(@babel/core@7.24.9)): + jscodeshift@0.15.1(@babel/preset-env@7.24.7(@babel/core@7.24.9)): dependencies: '@babel/core': 7.24.9 - '@babel/parser': 7.25.3 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.9) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.24.9) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.24.9) + '@babel/parser': 7.23.9 + '@babel/plugin-transform-class-properties': 7.24.7(@babel/core@7.24.9) '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.24.9) - '@babel/preset-env': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-nullish-coalescing-operator': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-optional-chaining': 7.24.8(@babel/core@7.24.9) + '@babel/plugin-transform-private-methods': 7.24.7(@babel/core@7.24.9) '@babel/preset-flow': 7.22.15(@babel/core@7.24.9) '@babel/preset-typescript': 7.23.0(@babel/core@7.24.9) '@babel/register': 7.22.15(@babel/core@7.24.9) @@ -51460,31 +51013,6 @@ snapshots: chalk: 4.1.2 flow-parser: 0.218.0 graceful-fs: 4.2.11 - micromatch: 4.0.8 - neo-async: 2.6.2 - node-dir: 0.1.17 - recast: 0.21.5 - temp: 0.8.4 - write-file-atomic: 2.4.3 - transitivePeerDependencies: - - supports-color - - jscodeshift@0.15.1(@babel/preset-env@7.24.7(@babel/core@7.23.9)): - dependencies: - '@babel/core': 7.23.9 - '@babel/parser': 7.23.9 - '@babel/plugin-transform-class-properties': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-nullish-coalescing-operator': 7.24.7(@babel/core@7.23.9) - '@babel/plugin-transform-optional-chaining': 7.24.8(@babel/core@7.23.9) - '@babel/plugin-transform-private-methods': 7.24.7(@babel/core@7.23.9) - '@babel/preset-flow': 7.22.15(@babel/core@7.23.9) - '@babel/preset-typescript': 7.23.0(@babel/core@7.23.9) - '@babel/register': 7.22.15(@babel/core@7.23.9) - babel-core: 7.0.0-bridge.0(@babel/core@7.23.9) - chalk: 4.1.2 - flow-parser: 0.218.0 - graceful-fs: 4.2.11 micromatch: 4.0.5 neo-async: 2.6.2 node-dir: 0.1.17 @@ -51492,7 +51020,7 @@ snapshots: temp: 0.8.4 write-file-atomic: 2.4.3 optionalDependencies: - '@babel/preset-env': 7.24.7(@babel/core@7.23.9) + '@babel/preset-env': 7.24.7(@babel/core@7.24.9) transitivePeerDependencies: - supports-color @@ -52003,6 +51531,10 @@ snapshots: dependencies: uc.micro: 1.0.6 + linkify-it@5.0.0: + dependencies: + uc.micro: 2.1.0 + listr2@3.14.0(enquirer@2.3.6): dependencies: cli-truncate: 2.1.0 @@ -52221,6 +51753,8 @@ snapshots: lru-cache@10.4.2: {} + lru-cache@11.0.1: {} + lru-cache@4.1.5: dependencies: pseudomap: 1.0.2 @@ -52334,6 +51868,15 @@ snapshots: mdurl: 1.0.1 uc.micro: 1.0.6 + markdown-it@14.1.0: + dependencies: + argparse: 2.0.1 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 + markdown-table@3.0.2: {} markdown-to-jsx@7.3.2(react@17.0.2): @@ -52368,6 +51911,8 @@ snapshots: mdurl@1.0.1: {} + mdurl@2.0.0: {} + media-typer@0.3.0: {} mem@6.1.1: @@ -52518,6 +52063,10 @@ snapshots: minimalistic-crypto-utils@1.0.1: {} + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + minimatch@3.0.4: dependencies: brace-expansion: 1.1.11 @@ -53604,6 +53153,11 @@ snapshots: lru-cache: 10.4.2 minipass: 7.1.2 + path-scurry@2.0.0: + dependencies: + lru-cache: 11.0.1 + minipass: 7.1.2 + path-temp@2.0.0: dependencies: unique-string: 2.0.0 @@ -54183,6 +53737,8 @@ snapshots: inherits: 2.0.4 pump: 2.0.1 + punycode.js@2.3.1: {} + punycode@1.4.1: {} punycode@2.3.0: {} @@ -54460,9 +54016,9 @@ snapshots: react-docgen@5.4.3: dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/generator': 7.23.6 - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 ast-types: 0.14.2 commander: 2.20.3 doctrine: 3.0.0 @@ -54475,7 +54031,7 @@ snapshots: react-docgen@7.0.3: dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.9 '@babel/traverse': 7.23.9 '@babel/types': 7.23.9 '@types/babel__core': 7.20.5 @@ -54535,9 +54091,9 @@ snapshots: '@babel/runtime': 7.23.6 react: 17.0.2 - react-error-boundary@4.0.12(react@17.0.2): + react-error-boundary@4.0.13(react@17.0.2): dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 react: 17.0.2 react-fast-compare@2.0.4: {} @@ -54992,11 +54548,11 @@ snapshots: regenerator-transform@0.15.1: dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 regenerator-transform@0.15.2: dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 regex-not@1.0.2: dependencies: @@ -55040,7 +54596,7 @@ snapshots: relay-runtime@12.0.0(encoding@0.1.13): dependencies: - '@babel/runtime': 7.23.6 + '@babel/runtime': 7.24.7 fbjs: 3.0.2(encoding@0.1.13) invariant: 2.2.4 transitivePeerDependencies: @@ -55297,10 +54853,6 @@ snapshots: run-script-os@1.1.6: {} - rxjs@6.6.7: - dependencies: - tslib: 1.14.1 - rxjs@7.5.2: dependencies: tslib: 2.3.1 @@ -55476,8 +55028,9 @@ snapshots: - bufferutil - utf-8-validate - selenium-webdriver@4.22.0: + selenium-webdriver@4.25.0: dependencies: + '@bazel/runfiles': 5.8.1 jszip: 3.10.1 tmp: 0.2.3 ws: 8.18.0 @@ -56900,24 +56453,6 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.16.12) - ts-jest@29.1.5(@babel/core@7.16.12)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.16.12))(jest@29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3): - dependencies: - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.5.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.5.4 - typescript: 5.5.3 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.16.12 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.16.12) - ts-jest@29.1.5(@babel/core@7.18.10)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.18.10))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3): dependencies: bs-logger: 0.2.6 @@ -57309,8 +56844,7 @@ snapshots: type-fest@2.19.0: {} - type-fest@4.21.0: - optional: true + type-fest@4.26.1: {} type-is@1.6.18: dependencies: @@ -57398,6 +56932,8 @@ snapshots: uc.micro@1.0.6: {} + uc.micro@2.1.0: {} + uglify-js@3.17.4: optional: true @@ -57556,6 +57092,14 @@ snapshots: untildify@4.0.0: {} + unzipper@0.12.3: + dependencies: + bluebird: 3.7.2 + duplexer2: 0.1.4 + fs-extra: 11.2.0 + graceful-fs: 4.2.11 + node-int64: 0.4.0 + update-browserslist-db@1.0.13(browserslist@4.23.0): dependencies: browserslist: 4.23.0 @@ -57957,26 +57501,27 @@ snapshots: void-elements@2.0.1: {} - vscode-extension-tester@8.3.1(mocha@10.6.0)(typescript@5.5.3): + vscode-extension-tester@8.8.0(mocha@10.6.0)(typescript@5.5.3): dependencies: - '@redhat-developer/locators': 1.1.3(@redhat-developer/page-objects@1.1.3(selenium-webdriver@4.22.0)(typescript@5.5.3))(selenium-webdriver@4.22.0) - '@redhat-developer/page-objects': 1.1.3(selenium-webdriver@4.22.0)(typescript@5.5.3) - '@types/selenium-webdriver': 4.1.24 - '@vscode/vsce': 2.29.0 + '@redhat-developer/locators': 1.6.0(@redhat-developer/page-objects@1.6.0(selenium-webdriver@4.25.0)(typescript@5.5.3))(selenium-webdriver@4.25.0) + '@redhat-developer/page-objects': 1.6.0(selenium-webdriver@4.25.0)(typescript@5.5.3) + '@types/selenium-webdriver': 4.1.26 + '@vscode/vsce': 3.1.1 c8: 10.1.2 commander: 12.1.0 - compare-versions: 6.1.0 + compare-versions: 6.1.1 find-up: 7.0.0 fs-extra: 11.2.0 - glob: 10.4.5 + glob: 11.0.0 got: 13.0.0 hpagent: 1.2.0 js-yaml: 4.1.0 mocha: 10.6.0 sanitize-filename: 1.6.3 - selenium-webdriver: 4.22.0 + selenium-webdriver: 4.25.0 targz: 1.0.1 typescript: 5.5.3 + unzipper: 0.12.3 transitivePeerDependencies: - bufferutil - monocart-coverage-reports diff --git a/repo/MANUAL.md b/repo/MANUAL.md new file mode 100644 index 00000000000..f283ede6f04 --- /dev/null +++ b/repo/MANUAL.md @@ -0,0 +1,367 @@ + + +# KIE Tools :: Manual + +This document contains all information related to the `kie-tools` as a Git repository. It describes its directory +structure, concepts like "packages" and specifics on important tools like Maven, TypeScript, and Container images. + +--- + +### Directory structure + +| File | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `packages/`
`examples/` | **Where the source code is**. There’s no distinction between these two dirs, except from the name and the convention as to where to put stuff. No dangling files are allowed inside these dirs, only other dirs containing packages. There is no package hierarchy. Both dirs have a flat structure. | +| `repo/`
`scripts/` | Related to the monorepo itself. `repo` contains files describing the monorepo structure (I.e., packages DAG, for enabling partial clones with sparse checkout). `scripts` contains code to make the monorepo run smoothly. (E.g., `update-version-to` or `bootstrap`). | +| `docs/`
`gifs/` | Files referenced externally in READMEs, for instance. Could be unified into a single directory only, probably with a better name. | +| `package.json`
`pnpm-workspace.yaml` | Together they define the monorepo structure and make some commands available at the root dir. The root `package.json` acts like the glue holding everything together. It declares dependencies that are necessary for the monorepo to operate. Packages inside `scripts` are part of these dependencies. | +| `.envrc`
`devbox.lock`
`devbox.json` | Direnv and Devbox configuration files. See these instructions to set it up. See [NIX_DEV_ENV.md](./../../NIX_DEV_ENV.md) | +| `.ci/` | Jeknins configuration for Apache release jobs | +| `.github/` | GitHub configuration | +| `.asf.yaml` | Apache Software Foundation (ASF) YAML for configuring GitHub features, as no one has access to the Settings tab of repos under the Apache organization. | +| `.vscode/`
`_intellij-project/` | IDE configuration | +| `.gitattributes`
`.gitignore`
`packages/*/.gitignore`
`examples/*/.gitignore` | Git stuff. `.gitignore` files must either by at the root of the repo, or at the root of a package. | +| `.husky/`
`prettier.config.js`
`.prettierignore`
`packages/*/.prettierignore`
`examples/*/.prettierignore` | Code formatters configuration.
**Done**: Prettier defaults, package.json, XML
**To do**: Java, Go, Containerfiles, Python | +| `.npmrc`
`.syncpackrc.json`
`patches/`
`pnpm-lock.yaml` | Related to NPM dependencies. .npmrc addresses https://github.com/pnpm/pnpm/issues/6300 and prevents 3rd party package binaries inside `node_modules` to access packages they don’t declare as dependencies via extend-note-path=false. Syncpack makes sure all `package.json` files declare the same version of dependencies. `patches` contains manual patches we do to NPM dependencies on `node_modules/.pnpm` `pnpm-lock.yaml` keeps NPM dependencies pinned to a specific version to make the monorepo future-proof. | +| `.build-env-root` | Marker file used to not go looking for `build-env` configurations outside of the monorepo. More details about `build-env` below. | + +--- + +### Concepts + +The monorepo is built on top of the `Package` abstraction, defined by `package.json` files. This is borrowed from NPM, and in fact, important for using `pnpm` as a script runner. A package is the smallest unit present in the monorepo. Configuration should always be done through environment variables, which can be read and consumed by virtually anything. All build configurations and parameters are defined as Environment Variables and accessed exclusively through `build-env`, a small CLI tool we built. + +**Packages** + +- `package.json` + - `$schema` **(required)** + - Always points to `/repo/package.json.schema.json` + - Allows for better IDE support for properties on this file. + - `name` **(required)** + - Type: string + - Can be plain (my-package) or scoped (@my-scope/my-package). Usually separated by dashes. + - See https://docs.npmjs.com/cli/v10/configuring-npm/package-json#name for more details. + - `version` **(required)** + - Type: string + - In SemVer format. + - Should never be edited manually. It is `0.0.0` on `main`. + - To update it, run this command at the root: + - pnpm update-version-to [new-version] [pnpm filter?] + - `private` (optional) + - Type: boolean + - Whether this package should be published to NPM. + - `scripts → build:dev` **(required)** + - Type: string (`bash` and/or `cmd` commands) + - Builds skipping everything. Used to build upstream. + - `scripts → build:prod` **(required)** + - Type: string (`bash` and/or `cmd` commands) + - Builds targeting a release. + - `scripts → install` (optional) + - Type: string (`bash` and/or `cmd` commands) + - Runs when the root bootstrap script installs dependencies. + - `kieTools → requiredPreinstalledCliCommands` **(required)** + - Type: string[] + - List of commands necessary to build this package. + - `dependencies` (optional) + - Type: Map + - Lists the RUNTIME dependencies of this package. + - Dependencies from inside the monorepo have version `"workspace:*"`. This is a `pnpm` feature. + - Dependencies from outside the monorepo have fixed versions. + - Dependencies do come transitively when users do `npm install @my-scope/my-package`. + - `devDependencies` (optional) + - Type: Map + - Lists the DEVELOPMENT / BUILD dependencies of this package. + - Dependencies from inside the monorepo have version `"workspace:*"`. This is a `pnpm` feature. + - Dependencies from outside the monorepo have fixed versions. + - devDependencies don’t come transitively when users do `npm install @my-scope/my-package`. + - Any other property accepted by NPM + - Only relevant for NPM packages, of course. + - See https://docs.npmjs.com/cli/v10/configuring-npm/package-json +- `env/index.js` + - Use if you need to configure `build:dev` and `build:prod` scripts. (E.g., skipping tests or changing the port of an app) + - Mapping of environment variables to JSON + - We never read the environment variables directly. Always through the JSON defined by `env/index.js` + - Scoped per-package. Can’t access other packages by mistake. +- `dist*` directories + - Where build results usually end up. +- …and whatever else the package needs + - Other than the `package.json` and the correct place to put test reports in JUnit XML format, packages are free to structure themselves in any way they need. + - Refer to [Conventions](#Conventions) to know more about how packages are structured. + +**Environment variables** + +- Everything is configurable through environment variables + - Platform-agnostic + - CI-friendly +- `build-env` is a utility script for easily maintaining the set of used environment variables by each package + - `build-env myPackage.myEnvVar` will print the value mapped by `env/index.js`. + - It goes up recursively on the directory structure looking for `env/index.js` files. + - Once it finds one, or the `.build-env-root` marker file, it stops. + - There’s no automatic merging. Combining `env/index.js` files is done manually. Composition over inheritance! + +--- + +### Conventions + +1. **`0.0.0` is the development version at `main`** + - SemVer-compatible. + - Will absolutely never be resolved as "higher" than any published version. + - Other branches will follow their stream name, with `999` replacing the variable part. E.g., `10.0.x` branch has version `10.0.999`. +1. **`package.json → version` is the source of truth for a package version** + - It is always in SemVer format. + - All language/tool-specific files must be derived from whatever version is defined on `package.json`. This ensures that the `update-version` script works as intended, as it simply updates the `package.json` version and runs a `bootstrap`. + - Defining an `install` script that reads from `package.json` is the best way to configure language/tool-specific files that contain a version. + - Maven packages, for example, rely on the Maven recommended CI-friendly setup. This is also compatible with the upcoming Maven 4. + - If your technology needs a version in another format different from SemVer, you’ll need to derive it from the SemVer string present on `package.json → version` +1. **`build:dev` and `build:prod` scripts must produce everything that dependent packages might need** + - The difference between them is the amount of expensive checks/optimizations they do, but they must be able to produce a full version of the package equally. + - An example is running linters or triggering compiler optimizations. In the very beginning, `build:dev` used to be called `build:fast`, so that kind of gives an idea of why there are two scripts. + - Build:prod should be understood as a "full build", where everything you possibly want to do when building a package is done. + - It’s not uncommon for build:dev and build:prod scripts to be identical. +1. **`build:dev` and `build:prod` must be "thread-safe"** + - Building packages in parallel is one of the things that makes the monorepo fast. Always assume other packages are building at the same time as your package. + - If you follow the rules above, you’ll hardly hit a problem, unless you’re using a tool/command that can’t be run in parallel. In this case, finding an alternative way to achieve the results you want is going to be necessary, as we can’t assume a package will be built in isolation. + - As of April 2024, the monorepo CI runs on the free tier of GitHub Actions, where machines have 2 available cores. Due to memory constraints, we run a sequential build. Locally, however, everyone has multiple cores available, and usually a lot of memory, so most people do `pnpm -r build:dev` locally after bootstrapping. +1. **Environment variables are exclusively read through `build-env`, never directly.** + - This ensures encapsulation and good reports during `pnpm bootstrap`. +1. **There are no nested packages. Each package has one, and one only, `package.json` file.** + - The package structure does not allow nested packages. + - The monorepo has a flat structure architecture. +1. **Packages can’t reference other monorepo files outside of their directories using `..` on paths** + - Packages should only have knowledge about its own directory structure, never upwards. + - Use `node_modules`, don’t ever do `../my-other-package/some/nested/dir`. Do `./node_modules/my-other-package/some/nested/dir`, or `./node_modules/@my-scope/my-package/some/nested/dir`. + - This ensures packages only have access to what they declare as dependencies on their `package.json` files. +1. **Packages can’t mutate the monorepo’s file system outside of its directory structure** + - The `node_modules` directory has a lot of symbolic links to directories that are shared between all packages. So changing it can potentially pollute the global scope and result in unpredictable behavior. + - As a general rule, see the `node_modules` dir as read-only. +1. **Generated code is either ignored or versioned on Git.** + - If files are produced either during `bootstrap`, they must be either ignored by Git, or committed. Running `pnpm bootstrap` on a clean clone must never change any versioned file. If files are generated during `build`, they should not be versio in Git. +1. **Test results must be reported in JUnit XML format** + - JUnit XMLs became the de-facto standard for test result reporting. + - Having every test case reported using this format means we’ll always get good introspection and compatibility with test management tools, like Buildkite or TestRail. + +--- + +### General good practices + +1. Define the `package.json → kieTools → requiredPreinstalledCliCommands` property with what your package needs to be built. + - This won’t fail any of the steps, but there’s a nice report on the `bootstrap` script that helps users understand their environment. +1. Prefer downloading stuff on scripts other than `install` + - Ideally, any external resource you might need for the build should be fetched during the `bootstrap` script. Packages can hook into the root-level `bootstrap` script by defining an `install` script on their package.json file. + - This allows the monorepo build to fail faster when there’s a problem fetching an external resource. +1. Make sure your package is buildable and testable on Windows, macOS, and Linux + - macOS x86 is being discontinued, but GitHub Actions still uses it, and unfortunately we can’t use the new Arm-based runners, as they’re not compatible with Docker yet. +1. Follow the environment variables naming convention. + - As of April 2024, the convention is `PACKAGE_NAME__configurationName`; but + - In the future, it will be better to change this to `KIE_TOOLS__packageName__configurationName`. +1. Use the same name for the package directory and `package.json → name` + - In practice, the name of the directory doesn’t have meaning, but helps us navigate the repo. +1. Don’t use mutable versions anywhere + - `latest`, `dev`, or `-SNAPSHOT` versions change with time, and can make the build break unexpectedly. + - More than that, when building an older tag or commit, pointing to `latest` will likely not work. + - Beware of unspecified versions too, as they often default to `latest`. +1. Configure dependencies to have the same single version available to all packages + - Pretty much like https://opensource.google/documentation/reference/thirdparty/oneversion + - Try to keep the version string in a single place, or at least enforce it to be exactly the same as other declarations, like we do with Syncpack in the CI for NPM dependencies. +1. Keep packages small + - Smaller packages can be installed, built, tested, and packaged much faster, and contribute positively to parallelization when running tasks +1. Make sure `package.json → build:dev` and `package.json → start` are friendly to debugging. + - Check if source maps are available. + - Check if obfuscation is turned off. + +--- + +### Scripts + +A few scripts are available for general purpose usage on `kie-tools`. They're built prior to everything else and are available in the top-level `node_modules` dir, meaning any script can access them. They don't need to be declared as dependencies too since they're already a dependency of the root `package.json`. All of them can be invoked with `pnpm [script-name]`. + +- Used for everyday development + - [bootstrap](../scripts/bootstrap/README.md): Runs when we execute `pnpm bootstrap`. + - [build-env](../scripts/build-env/README.md): Environment variables management. + - [run-script-if](../scripts/run-script-if/README.md): Shell-friendly conditional command execution +- Used when cloning `kie-tools` + - [sparse-checkout](../scripts/sparse-checkout/README.md): Partially clone `kie-tools` and work on a subset of its packages. +- Mostly used by our automations + - [check-junit-report-results](../scripts/check-junit-report-results/README.md): Checks JUnit XML files to see if tests failed. Used on our CI. + - [update-kogito-version](../scripts/update-kogito-version/README.md): Updates the version of Kogito Maven dependencies. (E.g., `999-20241016-SNAPSHOT`, `999-SNAPSHOT` or `10.0.0`) + - [update-stream-name](../scripts/update-stream-name/README.md): Updates this repo's stream name. (E.g., `main` or `10.0.x`) + - [update-version](../scripts/update-version/README.md): Updates this repo's version (E.g., `0.0.0` or `10.0.999`) + +--- + +### Specifics # Maven + +To comply with the repository's conventions and concepts, like Packages, Maven usage has been mapped and documented here for reference. + +#### @kie-tools/maven-base + +Foundational package for other Maven-based packages to base themselves on. + +Used for writing `.mvn/maven.config` with `-Drevision`, `-Dmaven.repo.local.tail` and other necessary properties. +And for centralized `` and other necessary standard configurations + +All Maven-based packages should declare it as a `dependency` on their `package.json` files and its `pom.xml` as parent. + +```xml + + org.kie + kie-tools-maven-base + ${revision} + ./node_modules/@kie-tools/maven-base/pom.xml + +``` + +#### flatten-maven-plugin + +Due to CI friendly versions as well. Present on `maven-base` already, no need to configure it individually. +https://www.mojohaus.org/flatten-maven-plugin/ + +#### package.json → scripts → install: + +Has to be at least `node install.js`, using `@kie-tools/maven-base` to set up properties like `-Drevision`, `-Dmaven.repo.local.tail`. + +#### package.json → scripts → build:dev: + +Has to be at least `mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)` +Needs to install so that other Maven repos can reference it. + +#### package.json → scripts → build:prod: + +Has to be at least `mvn clean deploy -DdeployAtEnd -Dmaven.deploy.skip=$(build-env maven.deploy.skip) -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)` +This is important for the Release jobs to correctly deploy it. Of course, deploy is skipped by default, so it acts like `mvn clean install ...`. + +#### package.json → dependencies: + +If your Maven package depends on other Maven packages, you need to declare those in the `dependencies` section, not on `devDependencies`. +This ensures the release scripts know what other Maven packages need to be published alongside yours, and makes it easier to configure `-Dmaven.repo.local.tail` via `buildTailFromPackageJsonDependencies()` + +### Development + +This section contains relevant topics about developing packages hosted on KIE Tools. + +#### Setting up your environment + +- Nix.dev, Devbox, and `direnv` _**(recommended!)**_ + - See [NIX_DEV_ENV.md](./../../NIX_DEV_ENV.md) +- Traditional + - See [the top-level README.md](../../README.md#step-0-install-the-necessary-tools) + +#### Recommended IDEs + +- IntelliJ IDEA + - See [the top-level IntelliJ IDEA project](./../../_intellij-project/README.md) +- VS Code + - // TODO + +#### Running + +Usually, packages that can be developed individually (E.g., apps of any kind, or libraries with dedicated development apps) define a script called `start` on their `package.json`, for example, developing the DMN Editor can be done in these steps: + +1. `pnpm bootstrap -F dmn-editor...` +1. `pnpm -F dmn-editor^... build:dev` +1. `pnpm -F dmn-editor start` + +#### Changing libraries + +Packages that don’t contain an app (so-called libraries) can be developed in conjunction with apps that can be run. When developing libraries, they need to be rebuilt so that apps can be re-run with the changed version of the libraries you’re developing, and you can see the changes in effect. To do that, you can keep track of the libraries you’re building, and simply rebuild them with: + +`pnpm -F my-library build:dev` + +If you’re changing multiple libraries and don’t want to rebuild one by one, you can do: + +`pnpm -F my-app^... build:dev` + +This is much less error-prone, as you won’t forget to build one of the libraries that you might’ve changed. + +If your app doesn’t support live-reloading, you’ll need to re-run it too. If it does, rebuilding the libraries is enough. + +#### Multi-package live reloading + +Some webpack-based apps can be run with a special --env live parameter, so that rebuilding libraries is not necessary. This is great for developing the Boxed Expression Editor using the `dmn-editor` Storybook, + +`pnpm -F dmn-editor start --env live` + +#### (A) Adding a new package + +Simply add a directory with a `package.json` inside it, give it the properties you need and run `pnpm bootstrap` at the root dir. It is going to be part of the build now. + +#### (D) Removing a package + +If this package is public (I.e., doesn’t define "private": "true" on its `package.json`), it means it is published to the NPM registry, and there might be people depending on it. We should always publish a last version with an updated README telling people that the package was deleted, and what they should do about it. + +Ideally, we should deprecate packages before completely removing them. + +Private packages are never consumed directly, and can be removed without any additional process. The build will fail if there are references to the removed package that weren’t removed too. + +#### (M) Renaming a package + +Should be treated as removing and adding it. Don’t forget to rename the package directory AND `package.json → name`. + +If this package is public, consider leaving behind a package with the old name containing deprecation notices, and pointing to the new name. + +Adding a dependency to an existing package + +Change `package.json` manually and run `pnpm bootstrap` at the root directory. + +#### Formatting the code + +In practice, you don’t need to worry about this, as a pre-commit hook will format the changed files when you do `git commit`. + +The CI will also check if your code is properly formatted. + +#### Skipping tests + +- Conventionally, `build:dev` doesn’t run tests. +- If you really need to do `build:prod` locally, you can use the following environment variables to skip tests, as they usually take a while to run: + - `export KIE_TOOLS_BUILD__runTests=false` or + - `export KIE_TOOLS_BUILD__runEndToEndTests=false` + - Tests won’t run at all. + - `export KIE_TOOLS_BUILD__ignoreTestFailures=true` or + - `export KIE_TOOLS_BUILD__ignoreEndToEndTestFailures=true` + - Tests will run, but a failing test won’t fail the build. + +#### Understanding a package’s relationship with other packages + +- `pnpm list --depth Infinity --only-projects [pnpm filter?]` + - Will display the relationship the filtered packages have with other packages inside the repo. + - This is very similar to `mvn dependency:tree`. + +--- + +### Dependency management & security + +It’s really important to understand that the software toolchain has flaws, and we’re all exposed to downloading malicious code from time to time. + +There are, however, some things we can do to prevent ourselves from being in a dangerous situation. + +- Dependency management tools, like Maven, `pnpm`, or `pip`, have mechanisms to help us be safer. + - Lock files + - Commit SHA references + - Fixed versions + - Checksums +- When adding a dependency to the monorepo, be thoughtful about who’s behind that dependency and what methods you’re using to download it. +- Prefer projects that are very widely known, active and have a healthy community around it. +- Think about the scope of this dependency. + - Is this going to be used for development; or + - Will users need to install it to be able to run our packages? +- Licenses + - See https://www.apache.org/licenses/ + +--- + +Feel free to proposed changes to this manual by sending a PR directly to this file. diff --git a/repo/README.md b/repo/README.md index 27195b6d740..01dbe86e23b 100644 --- a/repo/README.md +++ b/repo/README.md @@ -15,12 +15,18 @@ under the License. --> +This directory contains files related to the `kie-tools` monorepo itself. + +#### Manual + +The manual for the `kie-tools` repository. See [MANUAL.md](./MANUAL.md) + #### Repo dependencies version The related `build-dependencies-version.json` contains a centralized view of all required tools to correctly build the project. CI\CD tasks should rely on this file only, avoiding to hard-coding these version or store them in another place. Be aware that any key addition, change or removal can have an impact on CI\CD process -that rely on this file. Any tool version update must be update on this file as well, to guarantee the same +that rely on this file. Any tool version update must be updated on this file as well, to guarantee the same condition in all building processes. #### Packages dependency graph diff --git a/repo/graph.dot b/repo/graph.dot index 9f5337da9e1..6d5c8fa636e 100644 --- a/repo/graph.dot +++ b/repo/graph.dot @@ -96,7 +96,6 @@ digraph G { "@kie-tools/dev-deployment-dmn-form-webapp-image" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; "@kie-tools/image-env-to-json" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; "@kie-tools/dev-deployment-kogito-quarkus-blank-app" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; - "@kie-tools/maven-config-setup-helper" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; "@kie-tools/dev-deployment-kogito-quarkus-blank-app-image" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; "@kie-tools/maven-m2-repo-via-http-image" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; "@kie-tools/dmn-editor" [ color = "blue", fontcolor = "blue", style = "rounded" ]; @@ -119,12 +118,13 @@ digraph G { "extended-services-vscode-extension" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools-core/monaco-editor" [ color = "purple", fontcolor = "purple", style = "rounded" ]; "@kie-tools/form" [ color = "blue", fontcolor = "blue", style = "rounded" ]; - "@kie-tools/form-generation-tool" [ color = "blue", fontcolor = "blue", style = "rounded" ]; - "@kie-tools/uniforms-bootstrap4-codegen" [ color = "blue", fontcolor = "blue", style = "rounded" ]; - "@kie-tools/uniforms-patternfly-codegen" [ color = "blue", fontcolor = "blue", style = "rounded" ]; + "@kie-tools/form-code-generator" [ color = "blue", fontcolor = "blue", style = "rounded" ]; + "@kie-tools/form-code-generator-bootstrap4-theme" [ color = "blue", fontcolor = "blue", style = "rounded" ]; + "@kie-tools/form-code-generator-patternfly-theme" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools-core/i18n" [ color = "purple", fontcolor = "purple", style = "rounded" ]; "@kie-tools/import-java-classes-component" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools-core/vscode-java-code-completion" [ color = "purple", fontcolor = "purple", style = "rounded" ]; + "@kie-tools/jbpm-form-code-generator-themes" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/runtime-tools-process-dev-ui-webapp" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/jobs-service-webapp" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/yaml-language-server" [ color = "blue", fontcolor = "blue", style = "rounded" ]; @@ -168,6 +168,7 @@ digraph G { "@kie-tools/runtime-tools-swf-webapp-components" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/scesim-editor" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/scesim-marshaller" [ color = "blue", fontcolor = "blue", style = "rounded" ]; + "@kie-tools/scesim-editor-envelope" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/serverless-logic-web-tools" [ color = "black", fontcolor = "black", style = "dashed, rounded" ]; "@kie-tools/text-editor" [ color = "blue", fontcolor = "blue", style = "rounded" ]; "@kie-tools/yard-editor" [ color = "blue", fontcolor = "blue", style = "rounded" ]; @@ -335,8 +336,7 @@ digraph G { "@kie-tools/dev-deployment-dmn-form-webapp-image" -> "@kie-tools/dev-deployment-dmn-form-webapp" [ style = "solid", color = "black" ]; "@kie-tools/dev-deployment-dmn-form-webapp-image" -> "@kie-tools/image-env-to-json" [ style = "solid", color = "black" ]; "@kie-tools/dev-deployment-dmn-form-webapp-image" -> "@kie-tools/image-builder" [ style = "dashed", color = "black" ]; - "@kie-tools/dev-deployment-kogito-quarkus-blank-app" -> "@kie-tools/maven-config-setup-helper" [ style = "dashed", color = "black" ]; - "@kie-tools/dev-deployment-kogito-quarkus-blank-app" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ]; + "@kie-tools/dev-deployment-kogito-quarkus-blank-app" -> "@kie-tools/jbpm-quarkus-devui" [ style = "solid", color = "black" ]; "@kie-tools/dev-deployment-kogito-quarkus-blank-app-image" -> "@kie-tools/dev-deployment-base-image" [ style = "solid", color = "black" ]; "@kie-tools/dev-deployment-kogito-quarkus-blank-app-image" -> "@kie-tools/dev-deployment-kogito-quarkus-blank-app" [ style = "solid", color = "black" ]; "@kie-tools/dev-deployment-kogito-quarkus-blank-app-image" -> "@kie-tools/maven-m2-repo-via-http-image" [ style = "dashed", color = "black" ]; @@ -386,9 +386,14 @@ digraph G { "@kie-tools/form" -> "@kie-tools/dmn-runner" [ style = "solid", color = "blue" ]; "@kie-tools/form" -> "@kie-tools/i18n-common-dictionary" [ style = "solid", color = "blue" ]; "@kie-tools/form" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; + "@kie-tools/form-code-generator" -> "@kie-tools/eslint" [ style = "dashed", color = "blue" ]; + "@kie-tools/form-code-generator" -> "@kie-tools/jest-base" [ style = "dashed", color = "blue" ]; + "@kie-tools/form-code-generator" -> "@kie-tools/tsconfig" [ style = "dashed", color = "blue" ]; + "@kie-tools/form-code-generator-bootstrap4-theme" -> "@kie-tools/form-code-generator" [ style = "solid", color = "blue" ]; + "@kie-tools/form-code-generator-bootstrap4-theme" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; + "@kie-tools/form-code-generator-patternfly-theme" -> "@kie-tools/form-code-generator" [ style = "solid", color = "blue" ]; + "@kie-tools/form-code-generator-patternfly-theme" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; "@kie-tools/form-dmn" -> "@kie-tools/form" [ style = "solid", color = "blue" ]; - "@kie-tools/form-generation-tool" -> "@kie-tools/uniforms-bootstrap4-codegen" [ style = "solid", color = "blue" ]; - "@kie-tools/form-generation-tool" -> "@kie-tools/uniforms-patternfly-codegen" [ style = "solid", color = "blue" ]; "@kie-tools-core/i18n" -> "@kie-tools/eslint" [ style = "dashed", color = "purple" ]; "@kie-tools-core/i18n" -> "@kie-tools/jest-base" [ style = "dashed", color = "purple" ]; "@kie-tools-core/i18n" -> "@kie-tools/tsconfig" [ style = "dashed", color = "purple" ]; @@ -402,6 +407,8 @@ digraph G { "@kie-tools/import-java-classes-component" -> "@kie-tools-core/monaco-editor" [ style = "dashed", color = "blue" ]; "@kie-tools/import-java-classes-component" -> "@kie-tools-core/patternfly-base" [ style = "dashed", color = "blue" ]; "@kie-tools/import-java-classes-component" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; + "@kie-tools/jbpm-form-code-generator-themes" -> "@kie-tools/form-code-generator-bootstrap4-theme" [ style = "solid", color = "blue" ]; + "@kie-tools/jbpm-form-code-generator-themes" -> "@kie-tools/form-code-generator-patternfly-theme" [ style = "solid", color = "blue" ]; "@kie-tools/jbpm-quarkus-devui" -> "@kie-tools/maven-base" [ style = "solid", color = "black" ]; "@kie-tools/jbpm-quarkus-devui" -> "@kie-tools/runtime-tools-process-dev-ui-webapp" [ style = "dashed", color = "black" ]; "@kie-tools/jest-base" -> "@kie-tools/root-env" [ style = "dashed", color = "blue" ]; @@ -439,11 +446,17 @@ digraph G { "@kie-tools/kie-sandbox-webapp-image" -> "@kie-tools/image-builder" [ style = "dashed", color = "black" ]; "@kie-tools/kn-plugin-workflow" -> "@kie-tools/sonataflow-operator" [ style = "dashed", color = "black" ]; "@kie/kogito-base-builder-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; + "@kie/kogito-data-index-ephemeral-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie/kogito-data-index-ephemeral-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; + "@kie/kogito-data-index-postgresql-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie/kogito-data-index-postgresql-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; + "@kie/kogito-jit-runner-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie/kogito-jit-runner-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; + "@kie/kogito-jobs-service-allinone-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie/kogito-jobs-service-allinone-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; + "@kie/kogito-jobs-service-ephemeral-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie/kogito-jobs-service-ephemeral-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; + "@kie/kogito-jobs-service-postgresql-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie/kogito-jobs-service-postgresql-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; "@kie-tools/kogito-management-console" -> "@kie-tools/image-builder" [ style = "dashed", color = "black" ]; "@kie-tools/kogito-management-console" -> "@kie-tools/image-env-to-json" [ style = "dashed", color = "black" ]; @@ -452,7 +465,6 @@ digraph G { "@kie-tools/kogito-task-console" -> "@kie-tools/image-env-to-json" [ style = "dashed", color = "black" ]; "@kie-tools/kogito-task-console" -> "@kie-tools/runtime-tools-task-console-webapp" [ style = "dashed", color = "black" ]; "@kie-tools-core/kubernetes-bridge" -> "@kie-tools/cors-proxy-api" [ style = "solid", color = "purple" ]; - "@kie-tools/maven-base" -> "@kie-tools/maven-config-setup-helper" [ style = "dashed", color = "black" ]; "@kie-tools/maven-base" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ]; "@kie-tools/maven-m2-repo-via-http-image" -> "@kie-tools/image-builder" [ style = "dashed", color = "black" ]; "@kie-tools/maven-m2-repo-via-http-image" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ]; @@ -523,6 +535,9 @@ digraph G { "@kie-tools/runtime-tools-task-console-webapp" -> "@kie-tools/runtime-tools-shared-webapp-components" [ style = "solid", color = "blue" ]; "@kie-tools/scesim-editor" -> "@kie-tools/boxed-expression-component" [ style = "solid", color = "blue" ]; "@kie-tools/scesim-editor" -> "@kie-tools/scesim-marshaller" [ style = "solid", color = "blue" ]; + "@kie-tools/scesim-editor-envelope" -> "@kie-tools-core/editor" [ style = "solid", color = "blue" ]; + "@kie-tools/scesim-editor-envelope" -> "@kie-tools-core/react-hooks" [ style = "solid", color = "blue" ]; + "@kie-tools/scesim-editor-envelope" -> "@kie-tools/scesim-editor" [ style = "solid", color = "blue" ]; "@kie-tools/scesim-marshaller" -> "@kie-tools/xml-parser-ts-codegen" [ style = "dashed", color = "blue" ]; "@kie-tools/serverless-logic-web-tools" -> "@kie-tools-core/kubernetes-bridge" [ style = "solid", color = "black" ]; "@kie-tools/serverless-logic-web-tools" -> "@kie-tools-core/workspaces-git-fs" [ style = "solid", color = "black" ]; @@ -558,8 +573,7 @@ digraph G { "@kie-tools/serverless-workflow-dev-ui-webapp" -> "@kie-tools/runtime-tools-swf-webapp-components" [ style = "solid", color = "black" ]; "@kie-tools/serverless-workflow-dev-ui-webapp" -> "@kie-tools/serverless-workflow-dev-ui-monitoring-webapp" [ style = "solid", color = "black" ]; "@kie-tools/serverless-workflow-dev-ui-webapp" -> "@kie-tools/sonataflow-dev-app" [ style = "dashed", color = "black" ]; - "@kie-tools/serverless-workflow-diagram-editor" -> "@kie-tools/maven-config-setup-helper" [ style = "dashed", color = "black" ]; - "@kie-tools/serverless-workflow-diagram-editor" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ]; + "@kie-tools/serverless-workflow-diagram-editor" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie-tools/serverless-workflow-diagram-editor-assets" -> "@kie-tools/serverless-workflow-diagram-editor" [ style = "dashed", color = "blue" ]; "@kie-tools/serverless-workflow-diagram-editor-assets" -> "@kie-tools/serverless-workflow-diagram-editor-envelope" [ style = "dashed", color = "blue" ]; "@kie-tools/serverless-workflow-diagram-editor-envelope" -> "@kie-tools/kie-bc-editors" [ style = "solid", color = "blue" ]; @@ -576,6 +590,7 @@ digraph G { "swf-vscode-extension" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; "swf-vscode-extension" -> "@kie-tools/serverless-workflow-diagram-editor-assets" [ style = "dashed", color = "blue" ]; "swf-vscode-extension" -> "@kie-tools/vscode-extension-common-test-helpers" [ style = "dashed", color = "blue" ]; + "@kie-tools/sonataflow-builder-image" -> "@kie-tools/maven-base" [ style = "dashed", color = "black" ]; "@kie-tools/sonataflow-builder-image" -> "@kie-tools/maven-m2-repo-via-http-image" [ style = "dashed", color = "black" ]; "@kie-tools/sonataflow-builder-image" -> "@kie-tools/sonataflow-image-common" [ style = "dashed", color = "black" ]; "sonataflow-deployment-webapp" -> "@kie-tools-core/react-hooks" [ style = "solid", color = "blue" ]; @@ -616,17 +631,9 @@ digraph G { "@kie-tools-core/switch-expression-ts" -> "@kie-tools/jest-base" [ style = "dashed", color = "purple" ]; "@kie-tools-core/switch-expression-ts" -> "@kie-tools/tsconfig" [ style = "dashed", color = "purple" ]; "@kie-tools/text-editor" -> "@kie-tools-core/editor" [ style = "solid", color = "blue" ]; - "@kie-tools/uniforms-bootstrap4-codegen" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-bootstrap4-codegen" -> "@kie-tools/eslint" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-bootstrap4-codegen" -> "@kie-tools/jest-base" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-bootstrap4-codegen" -> "@kie-tools/tsconfig" [ style = "dashed", color = "blue" ]; "@kie-tools/uniforms-patternfly" -> "@kie-tools/eslint" [ style = "dashed", color = "blue" ]; "@kie-tools/uniforms-patternfly" -> "@kie-tools/jest-base" [ style = "dashed", color = "blue" ]; "@kie-tools/uniforms-patternfly" -> "@kie-tools/tsconfig" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-patternfly-codegen" -> "@kie-tools-core/webpack-base" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-patternfly-codegen" -> "@kie-tools/eslint" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-patternfly-codegen" -> "@kie-tools/jest-base" [ style = "dashed", color = "blue" ]; - "@kie-tools/uniforms-patternfly-codegen" -> "@kie-tools/tsconfig" [ style = "dashed", color = "blue" ]; "@kie-tools/unitables" -> "@kie-tools/boxed-expression-component" [ style = "solid", color = "blue" ]; "@kie-tools/unitables" -> "@kie-tools/dmn-runner" [ style = "solid", color = "blue" ]; "@kie-tools/unitables-dmn" -> "@kie-tools/unitables" [ style = "solid", color = "blue" ]; @@ -670,7 +677,7 @@ digraph G { "@kie-tools/yard-model" -> "@kie-tools/maven-base" [ style = "solid", color = "black" ]; "@kie-tools/yard-validator" -> "@kie-tools-core/notifications" [ style = "solid", color = "blue" ]; "@kie-tools/yard-validator" -> "@kie-tools/yard-validator-worker" [ style = "dashed", color = "blue" ]; - "@kie-tools/yard-validator-worker" -> "@kie-tools/yard-model" [ style = "dashed", color = "black" ]; + "@kie-tools/yard-validator-worker" -> "@kie-tools/yard-model" [ style = "solid", color = "black" ]; "yard-vscode-extension" -> "@kie-tools-core/vscode-extension" [ style = "solid", color = "blue" ]; "yard-vscode-extension" -> "@kie-tools/yard-editor" [ style = "solid", color = "blue" ]; "yard-vscode-extension" -> "@kie-tools/vscode-extension-common-test-helpers" [ style = "dashed", color = "blue" ]; diff --git a/repo/graph.json b/repo/graph.json index fef9a5e3db9..d7f93f2dcd1 100644 --- a/repo/graph.json +++ b/repo/graph.json @@ -86,7 +86,6 @@ { "id": "@kie-tools/cors-proxy-image" }, { "id": "@kie-tools/dashbuilder" }, { "id": "@kie-tools/dashbuilder-component-assembler" }, - { "id": "@kie-tools/maven-config-setup-helper" }, { "id": "@kie-tools/dashbuilder-component-echarts" }, { "id": "@kie-tools/dashbuilder-component-map" }, { "id": "@kie-tools/dashbuilder-component-svg-heatmap" }, @@ -132,10 +131,11 @@ { "id": "@kie-tools/extended-services" }, { "id": "@kie-tools/extended-services-java" }, { "id": "extended-services-vscode-extension" }, - { "id": "@kie-tools/form-generation-tool" }, - { "id": "@kie-tools/uniforms-bootstrap4-codegen" }, - { "id": "@kie-tools/uniforms-patternfly-codegen" }, + { "id": "@kie-tools/form-code-generator" }, + { "id": "@kie-tools/form-code-generator-bootstrap4-theme" }, + { "id": "@kie-tools/form-code-generator-patternfly-theme" }, { "id": "@kie-tools/import-java-classes-component" }, + { "id": "@kie-tools/jbpm-form-code-generator-themes" }, { "id": "@kie-tools/runtime-tools-process-webapp-components" }, { "id": "@kie-tools/runtime-tools-shared-webapp-components" }, { "id": "@kie-tools/jobs-service-webapp" }, @@ -176,6 +176,7 @@ { "id": "@kie-tools/runtime-tools-swf-webapp-components" }, { "id": "@kie-tools/scesim-editor" }, { "id": "@kie-tools/scesim-marshaller" }, + { "id": "@kie-tools/scesim-editor-envelope" }, { "id": "@kie-tools/serverless-logic-web-tools" }, { "id": "@kie-tools/text-editor" }, { "id": "@kie-tools/yard-editor" }, @@ -415,11 +416,6 @@ "target": "@kie-tools/runtime-tools-process-dev-ui-webapp", "weight": 1 }, - { - "source": "@kie-tools/maven-base", - "target": "@kie-tools/maven-config-setup-helper", - "weight": 1 - }, { "source": "@kie-tools/maven-base", "target": "@kie-tools/root-env", @@ -1457,12 +1453,7 @@ }, { "source": "@kie-tools/dev-deployment-kogito-quarkus-blank-app", - "target": "@kie-tools/maven-config-setup-helper", - "weight": 1 - }, - { - "source": "@kie-tools/dev-deployment-kogito-quarkus-blank-app", - "target": "@kie-tools/root-env", + "target": "@kie-tools/jbpm-quarkus-devui", "weight": 1 }, { @@ -1626,53 +1617,38 @@ "weight": 1 }, { - "source": "@kie-tools/form-generation-tool", - "target": "@kie-tools/uniforms-bootstrap4-codegen", - "weight": 1 - }, - { - "source": "@kie-tools/form-generation-tool", - "target": "@kie-tools/uniforms-patternfly-codegen", - "weight": 1 - }, - { - "source": "@kie-tools/uniforms-bootstrap4-codegen", - "target": "@kie-tools-core/webpack-base", - "weight": 1 - }, - { - "source": "@kie-tools/uniforms-bootstrap4-codegen", + "source": "@kie-tools/form-code-generator", "target": "@kie-tools/eslint", "weight": 1 }, { - "source": "@kie-tools/uniforms-bootstrap4-codegen", + "source": "@kie-tools/form-code-generator", "target": "@kie-tools/jest-base", "weight": 1 }, { - "source": "@kie-tools/uniforms-bootstrap4-codegen", + "source": "@kie-tools/form-code-generator", "target": "@kie-tools/tsconfig", "weight": 1 }, { - "source": "@kie-tools/uniforms-patternfly-codegen", - "target": "@kie-tools-core/webpack-base", + "source": "@kie-tools/form-code-generator-bootstrap4-theme", + "target": "@kie-tools/form-code-generator", "weight": 1 }, { - "source": "@kie-tools/uniforms-patternfly-codegen", - "target": "@kie-tools/eslint", + "source": "@kie-tools/form-code-generator-bootstrap4-theme", + "target": "@kie-tools-core/webpack-base", "weight": 1 }, { - "source": "@kie-tools/uniforms-patternfly-codegen", - "target": "@kie-tools/jest-base", + "source": "@kie-tools/form-code-generator-patternfly-theme", + "target": "@kie-tools/form-code-generator", "weight": 1 }, { - "source": "@kie-tools/uniforms-patternfly-codegen", - "target": "@kie-tools/tsconfig", + "source": "@kie-tools/form-code-generator-patternfly-theme", + "target": "@kie-tools-core/webpack-base", "weight": 1 }, { @@ -1700,6 +1676,16 @@ "target": "@kie-tools-core/webpack-base", "weight": 1 }, + { + "source": "@kie-tools/jbpm-form-code-generator-themes", + "target": "@kie-tools/form-code-generator-bootstrap4-theme", + "weight": 1 + }, + { + "source": "@kie-tools/jbpm-form-code-generator-themes", + "target": "@kie-tools/form-code-generator-patternfly-theme", + "weight": 1 + }, { "source": "@kie-tools/runtime-tools-process-webapp-components", "target": "@kie-tools/runtime-tools-process-enveloped-components", @@ -1940,6 +1926,11 @@ "target": "@kie/kogito-jobs-service-postgresql-image", "weight": 1 }, + { + "source": "@kie-tools/sonataflow-builder-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie-tools/sonataflow-builder-image", "target": "@kie-tools/maven-m2-repo-via-http-image", @@ -1965,21 +1956,41 @@ "target": "@kie-tools/sonataflow-quarkus-devui", "weight": 1 }, + { + "source": "@kie/kogito-data-index-ephemeral-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie/kogito-data-index-ephemeral-image", "target": "@kie-tools/sonataflow-image-common", "weight": 1 }, + { + "source": "@kie/kogito-data-index-postgresql-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie/kogito-data-index-postgresql-image", "target": "@kie-tools/sonataflow-image-common", "weight": 1 }, + { + "source": "@kie/kogito-jobs-service-ephemeral-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie/kogito-jobs-service-ephemeral-image", "target": "@kie-tools/sonataflow-image-common", "weight": 1 }, + { + "source": "@kie/kogito-jobs-service-postgresql-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie/kogito-jobs-service-postgresql-image", "target": "@kie-tools/sonataflow-image-common", @@ -2000,11 +2011,21 @@ "target": "@kie-tools/root-env", "weight": 1 }, + { + "source": "@kie/kogito-jit-runner-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie/kogito-jit-runner-image", "target": "@kie-tools/sonataflow-image-common", "weight": 1 }, + { + "source": "@kie/kogito-jobs-service-allinone-image", + "target": "@kie-tools/maven-base", + "weight": 1 + }, { "source": "@kie/kogito-jobs-service-allinone-image", "target": "@kie-tools/sonataflow-image-common", @@ -2160,6 +2181,21 @@ "target": "@kie-tools/xml-parser-ts-codegen", "weight": 1 }, + { + "source": "@kie-tools/scesim-editor-envelope", + "target": "@kie-tools-core/editor", + "weight": 1 + }, + { + "source": "@kie-tools/scesim-editor-envelope", + "target": "@kie-tools-core/react-hooks", + "weight": 1 + }, + { + "source": "@kie-tools/scesim-editor-envelope", + "target": "@kie-tools/scesim-editor", + "weight": 1 + }, { "source": "@kie-tools/serverless-logic-web-tools", "target": "@kie-tools-core/kubernetes-bridge", @@ -2372,12 +2408,7 @@ }, { "source": "@kie-tools/serverless-workflow-diagram-editor", - "target": "@kie-tools/maven-config-setup-helper", - "weight": 1 - }, - { - "source": "@kie-tools/serverless-workflow-diagram-editor", - "target": "@kie-tools/root-env", + "target": "@kie-tools/maven-base", "weight": 1 }, { @@ -2643,13 +2674,16 @@ ["extended-services-vscode-extension", "packages/extended-services-vscode-extension"], ["@kie-tools/feel-input-component", "packages/feel-input-component"], ["@kie-tools/form", "packages/form"], + ["@kie-tools/form-code-generator", "packages/form-code-generator"], + ["@kie-tools/form-code-generator-bootstrap4-theme", "packages/form-code-generator-bootstrap4-theme"], + ["@kie-tools/form-code-generator-patternfly-theme", "packages/form-code-generator-patternfly-theme"], ["@kie-tools/form-dmn", "packages/form-dmn"], - ["@kie-tools/form-generation-tool", "packages/form-generation-tool"], ["@kie-tools-core/i18n", "packages/i18n"], ["@kie-tools/i18n-common-dictionary", "packages/i18n-common-dictionary"], ["@kie-tools/image-builder", "packages/image-builder"], ["@kie-tools/image-env-to-json", "packages/image-env-to-json"], ["@kie-tools/import-java-classes-component", "packages/import-java-classes-component"], + ["@kie-tools/jbpm-form-code-generator-themes", "packages/jbpm-form-code-generator-themes"], ["@kie-tools/jbpm-quarkus-devui", "packages/jbpm-quarkus-devui"], ["@kie-tools/jest-base", "packages/jest-base"], ["@kie-tools/jobs-service-webapp", "packages/jobs-service-webapp"], @@ -2676,7 +2710,6 @@ ["@kie-tools/kogito-task-console", "packages/kogito-task-console"], ["@kie-tools-core/kubernetes-bridge", "packages/kubernetes-bridge"], ["@kie-tools/maven-base", "packages/maven-base"], - ["@kie-tools/maven-config-setup-helper", "packages/maven-config-setup-helper"], ["@kie-tools/maven-m2-repo-via-http-image", "packages/maven-m2-repo-via-http-image"], ["@kie-tools-core/monaco-editor", "packages/monaco-editor"], ["@kie-tools-core/notifications", "packages/notifications"], @@ -2705,6 +2738,7 @@ ["@kie-tools/runtime-tools-swf-webapp-components", "packages/runtime-tools-swf-webapp-components"], ["@kie-tools/runtime-tools-task-console-webapp", "packages/runtime-tools-task-console-webapp"], ["@kie-tools/scesim-editor", "packages/scesim-editor"], + ["@kie-tools/scesim-editor-envelope", "packages/scesim-editor-envelope"], ["@kie-tools/scesim-marshaller", "packages/scesim-marshaller"], ["@kie-tools/serverless-logic-web-tools", "packages/serverless-logic-web-tools"], [ @@ -2766,9 +2800,7 @@ ["@kie-tools-core/switch-expression-ts", "packages/switch-expression-ts"], ["@kie-tools/text-editor", "packages/text-editor"], ["@kie-tools/tsconfig", "packages/tsconfig"], - ["@kie-tools/uniforms-bootstrap4-codegen", "packages/uniforms-bootstrap4-codegen"], ["@kie-tools/uniforms-patternfly", "packages/uniforms-patternfly"], - ["@kie-tools/uniforms-patternfly-codegen", "packages/uniforms-patternfly-codegen"], ["@kie-tools/unitables", "packages/unitables"], ["@kie-tools/unitables-dmn", "packages/unitables-dmn"], ["@kie-tools-core/vscode-extension", "packages/vscode-extension"], diff --git a/repo/repo.iml b/repo/repo.iml new file mode 100644 index 00000000000..8021953ed9f --- /dev/null +++ b/repo/repo.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/scripts/bootstrap/README.md b/scripts/bootstrap/README.md index 4aac48ac515..36be386450e 100644 --- a/scripts/bootstrap/README.md +++ b/scripts/bootstrap/README.md @@ -17,6 +17,12 @@ ## @kie-tools-scripts/bootstrap +Wires the repository together through `node_modules` and runs `install` scripts on every package, respecting topological order. + +### Usage + +`pnpm bootstrap [pnpm-filter?]` + --- Apache KIE (incubating) is an effort undergoing incubation at The Apache Software diff --git a/scripts/check-junit-report-results/README.md b/scripts/check-junit-report-results/README.md index 8b944946b1d..b215c6b0b2f 100644 --- a/scripts/check-junit-report-results/README.md +++ b/scripts/check-junit-report-results/README.md @@ -17,6 +17,15 @@ ## @kie-tools-scripts/check-junit-report-results +GitHub script that checks whether supplied JUnit XML files contain failing tests. This package is meant to be used inside GitHub Actions workflows. + +### Usage + +```js +const script = require("./scripts/check-junit-report-results/src/index.js"); +await script({ core, glob, patterns }); +``` + --- Apache KIE (incubating) is an effort undergoing incubation at The Apache Software diff --git a/scripts/scripts.iml b/scripts/scripts.iml new file mode 100644 index 00000000000..487f26dcc83 --- /dev/null +++ b/scripts/scripts.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/sparse-checkout/README.md b/scripts/sparse-checkout/README.md index 51b80ae1480..1aecdb81e2b 100644 --- a/scripts/sparse-checkout/README.md +++ b/scripts/sparse-checkout/README.md @@ -15,7 +15,7 @@ under the License. --> -# KIE Tools :: Sparse checkout +## @kie-tools-scripts/sparse-checkout Sparse checkout lets you partially clone the KIE Tools monorepo. Doing a sparse checkout will help you save time and disk space, while also reducing the amount of code you need to deal with when developing. @@ -23,7 +23,7 @@ This script will look at `repo/graph.json` to decide what packages need to be do Keep in mind that sparse checkouts make Git behave a little differently for some commands. Read more at https://git-scm.com/docs/git-sparse-checkout. -## Usage +### Usage - zsh diff --git a/packages/maven-config-setup-helper/README.md b/scripts/update-kogito-version/README.md similarity index 87% rename from packages/maven-config-setup-helper/README.md rename to scripts/update-kogito-version/README.md index c056b4b62fb..ab3821f640a 100644 --- a/packages/maven-config-setup-helper/README.md +++ b/scripts/update-kogito-version/README.md @@ -15,11 +15,13 @@ under the License. --> -## @kie-tools/maven-config-setup-helper +## @kie-tools-scripts/update-version -This package helps to write `.mvn/maven.config` file idempotently without loosing its previous value. +Updates the default value of `KOGITO_RUNTIME_version` of `packages/root-env` and runs `pnpm bootstrap` at the end. -It achieves that by creating a copy of the original file at `.mvn/maven.config.original`, so when writing to `.mvn/maven.config`, it combines the original file with the new contents. +### Usage + +`pnpm update-kogito-version-to --maven [new-version]` --- diff --git a/packages/uniforms-bootstrap4-codegen/README.md b/scripts/update-stream-name/README.md similarity index 91% rename from packages/uniforms-bootstrap4-codegen/README.md rename to scripts/update-stream-name/README.md index 8e8ff6ded24..896ef3f9279 100644 --- a/packages/uniforms-bootstrap4-codegen/README.md +++ b/scripts/update-stream-name/README.md @@ -15,9 +15,13 @@ under the License. --> -## Uniforms Bootstrap 4 Codegen +## @kie-tools-scripts/update-version -This module contains the [Uniforms](https://uniforms.tools) theme contain to generate Bootstrap 4 forms for the `@kie-tools/form-generation-tool`. +Updates the default value of `KIE_TOOLS_BUILD__streamName` of `packages/root-env` and runs `pnpm bootstrap` at the end. + +### Usage + +`pnpm update-stream-name-to [stream-name]` --- diff --git a/scripts/update-version/README.md b/scripts/update-version/README.md index 32dd00d9d8c..4ff693ff754 100644 --- a/scripts/update-version/README.md +++ b/scripts/update-version/README.md @@ -17,6 +17,12 @@ ## @kie-tools-scripts/update-version +Updates the `version` property of `package.json` files and runs `pnpm bootstrap` at the end. + +### Usage + +`pnpm update-version-to [version-in-semver-format] [pnpm-filter?]` + --- Apache KIE (incubating) is an effort undergoing incubation at The Apache Software