Skip to content

Commit

Permalink
kie-issues#1126: Create Sonataflow management console base packages (#29
Browse files Browse the repository at this point in the history
)

* creation of sonataflow-management-console-image-env

* Fix historyApiFallback for devServer
  • Loading branch information
fantonangeli authored Aug 13, 2024
1 parent 2652973 commit 8c80f40
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 30 deletions.
48 changes: 48 additions & 0 deletions packages/sonataflow-management-console-image-env/README.md
Original file line number Diff line number Diff line change
@@ -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.
-->

## @kie-tools/sonataflow-management-console-image-env

---

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
-

- 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
58 changes: 58 additions & 0 deletions packages/sonataflow-management-console-image-env/env/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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 { varsWithName, getOrDefault, composeEnv } = require("@kie-tools-scripts/build-env");

const rootEnv = require("@kie-tools/root-env/env");

module.exports = composeEnv([rootEnv], {
vars: varsWithName({
SONATAFLOW_MANAGEMENT_CONSOLE__registry: {
default: "docker.io",
description: "E.g., `docker.io` or `quay.io`.",
},
SONATAFLOW_MANAGEMENT_CONSOLE__account: {
default: "apache",
description: "E.g,. `apache` or `kie-tools-bot`",
},
SONATAFLOW_MANAGEMENT_CONSOLE__name: {
default: "incubator-kie-sonataflow-management-console",
description: "Name of the image itself.",
},
SONATAFLOW_MANAGEMENT_CONSOLE__buildTag: {
default: rootEnv.env.root.streamName,
description: "Tag version of this image. E.g., `main` or `10.0.x` or `10.0.0",
},
SONATAFLOW_MANAGEMENT_CONSOLE__port: {
default: 8080,
description: "The internal container port.",
},
}),
get env() {
return {
sonataflowManagementConsoleImageEnv: {
registry: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__registry),
account: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__account),
name: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__name),
buildTag: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__buildTag),
port: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__port),
},
};
},
});
18 changes: 18 additions & 0 deletions packages/sonataflow-management-console-image-env/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"private": true,
"name": "@kie-tools/sonataflow-management-console-image-env",
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"homepage": "https://github.com/apache/incubator-kie-tools",
"repository": {
"type": "git",
"url": "https://github.com/apache/incubator-kie-tools.git"
},
"bugs": {
"url": "https://github.com/apache/incubator-kie-tools/issues"
},
"devDependencies": {
"@kie-tools/root-env": "workspace:*"
}
}
30 changes: 2 additions & 28 deletions packages/sonataflow-management-console-image/env/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,11 @@ const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/b

const rootEnv = require("@kie-tools/root-env/env");

module.exports = composeEnv([rootEnv], {
vars: varsWithName({
SONATAFLOW_MANAGEMENT_CONSOLE__registry: {
default: "docker.io",
description: "E.g., `docker.io` or `quay.io`.",
},
SONATAFLOW_MANAGEMENT_CONSOLE__account: {
default: "apache",
description: "E.g,. `apache` or `kie-tools-bot`",
},
SONATAFLOW_MANAGEMENT_CONSOLE__name: {
default: "incubator-kie-sonataflow-management-console",
description: "Name of the image itself.",
},
SONATAFLOW_MANAGEMENT_CONSOLE__buildTag: {
default: rootEnv.env.root.streamName,
description: "Tag version of this image. E.g., `main` or `10.0.x` or `10.0.0",
},
SONATAFLOW_MANAGEMENT_CONSOLE__port: {
default: 8080,
description: "The internal container port.",
},
}),
module.exports = composeEnv([rootEnv, require("@kie-tools/sonataflow-management-console-image-env/env")], {
vars: varsWithName({}),
get env() {
return {
sonataflowManagementConsoleImage: {
registry: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__registry),
account: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__account),
name: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__name),
buildTag: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__buildTag),
port: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE__port),
version: require("../package.json").version,
},
};
Expand Down
3 changes: 2 additions & 1 deletion packages/sonataflow-management-console-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
"copy:webapp-assets:linux:darwin": "cp -R ./node_modules/@kie-tools/sonataflow-management-console-webapp/dist/ ./dist-dev/sonataflow-management-console-webapp",
"copy:webapp-assets:win32": "pnpm powershell \"Copy-Item -R ./node_modules/@kie-tools/sonataflow-management-console-webapp/dist/ ./dist-dev/sonataflow-management-console-webapp\"",
"env-json:schema:generate": "ts-json-schema-generator --tsconfig ./node_modules/@kie-tools/sonataflow-management-console-webapp/tsconfig.json --path ./node_modules/@kie-tools/sonataflow-management-console-webapp/src/env/EnvJson.ts --type EnvJson --id EnvJson --out ./dist-dev/EnvJson.schema.json",
"image:docker:build": "kie-tools--image-builder build -r \"$(build-env sonataflowManagementConsoleImage.registry)\" -a \"$(build-env sonataflowManagementConsoleImage.account)\" -n \"$(build-env sonataflowManagementConsoleImage.name)\" -t \"$(build-env sonataflowManagementConsoleImage.buildTag)\" --build-arg SONATAFLOW_MANAGEMENT_CONSOLE_PORT=\"$(build-env sonataflowManagementConsoleImage.port)\""
"image:docker:build": "kie-tools--image-builder build -r \"$(build-env sonataflowManagementConsoleImageEnv.registry)\" -a \"$(build-env sonataflowManagementConsoleImageEnv.account)\" -n \"$(build-env sonataflowManagementConsoleImageEnv.name)\" -t \"$(build-env sonataflowManagementConsoleImageEnv.buildTag)\" --build-arg SONATAFLOW_MANAGEMENT_CONSOLE_PORT=\"$(build-env sonataflowManagementConsoleImageEnv.port)\""
},
"devDependencies": {
"@kie-tools/image-builder": "workspace:*",
"@kie-tools/image-env-to-json": "workspace:*",
"@kie-tools/root-env": "workspace:*",
"@kie-tools/sonataflow-management-console-image-env": "workspace:*",
"@kie-tools/sonataflow-management-console-webapp": "workspace:*",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default async (env: any, argv: any) => {
host: buildEnv.sonataflowManagementConsoleWebapp.host,
port: buildEnv.sonataflowManagementConsoleWebapp.port,
compress: true,
historyApiFallback: true,
historyApiFallback: false,
hot: true,
client: {
overlay: {
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions repo/graph.dot
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ digraph G {
"@kie-tools/sonataflow-image-common" [ color = "black", fontcolor = "black", style = "dashed, rounded" ];
"@kie-tools/sonataflow-devmode-image" [ color = "black", fontcolor = "black", style = "dashed, rounded" ];
"@kie-tools/sonataflow-management-console-image" [ color = "black", fontcolor = "black", style = "dashed, rounded" ];
"@kie-tools/sonataflow-management-console-image-env" [ color = "black", fontcolor = "black", style = "dashed, rounded" ];
"@kie-tools/sonataflow-management-console-webapp" [ color = "blue", fontcolor = "blue", style = "rounded" ];
"@kie-tools/stunner-editors-dmn-loader" [ color = "blue", fontcolor = "blue", style = "rounded" ];
"@kie-tools/unitables" [ color = "blue", fontcolor = "blue", style = "rounded" ];
Expand Down Expand Up @@ -560,7 +561,9 @@ digraph G {
"@kie-tools/sonataflow-image-common" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ];
"@kie-tools/sonataflow-management-console-image" -> "@kie-tools/image-builder" [ style = "dashed", color = "black" ];
"@kie-tools/sonataflow-management-console-image" -> "@kie-tools/image-env-to-json" [ style = "dashed", color = "black" ];
"@kie-tools/sonataflow-management-console-image" -> "@kie-tools/sonataflow-management-console-image-env" [ style = "dashed", color = "black" ];
"@kie-tools/sonataflow-management-console-image" -> "@kie-tools/sonataflow-management-console-webapp" [ style = "dashed", color = "black" ];
"@kie-tools/sonataflow-management-console-image-env" -> "@kie-tools/root-env" [ style = "dashed", color = "black" ];
"@kie-tools/sonataflow-management-console-webapp" -> "@kie-tools-core/react-hooks" [ style = "solid", color = "blue" ];
"@kie-tools/sonataflow-management-console-webapp" -> "@kie-tools/runtime-tools-process-webapp-components" [ style = "solid", color = "blue" ];
"@kie-tools/sonataflow-management-console-webapp" -> "@kie-tools/runtime-tools-shared-webapp-components" [ style = "solid", color = "blue" ];
Expand Down
12 changes: 12 additions & 0 deletions repo/graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
{ "id": "@kie-tools/serverless-workflow-service-catalog" },
{ "id": "swf-vscode-extension" },
{ "id": "@kie-tools/sonataflow-management-console-image" },
{ "id": "@kie-tools/sonataflow-management-console-image-env" },
{ "id": "@kie-tools/sonataflow-management-console-webapp" },
{ "id": "vscode-extension-dashbuilder-editor" },
{ "id": "vscode-extension-kie-ba-bundle" },
Expand Down Expand Up @@ -2328,11 +2329,21 @@
"target": "@kie-tools/image-env-to-json",
"weight": 1
},
{
"source": "@kie-tools/sonataflow-management-console-image",
"target": "@kie-tools/sonataflow-management-console-image-env",
"weight": 1
},
{
"source": "@kie-tools/sonataflow-management-console-image",
"target": "@kie-tools/sonataflow-management-console-webapp",
"weight": 1
},
{
"source": "@kie-tools/sonataflow-management-console-image-env",
"target": "@kie-tools/root-env",
"weight": 1
},
{
"source": "@kie-tools/sonataflow-management-console-webapp",
"target": "@kie-tools-core/react-hooks",
Expand Down Expand Up @@ -2617,6 +2628,7 @@
["@kie-tools/sonataflow-devmode-image", "packages/sonataflow-devmode-image"],
["@kie-tools/sonataflow-image-common", "packages/sonataflow-image-common"],
["@kie-tools/sonataflow-management-console-image", "packages/sonataflow-management-console-image"],
["@kie-tools/sonataflow-management-console-image-env", "packages/sonataflow-management-console-image-env"],
["@kie-tools/sonataflow-management-console-webapp", "packages/sonataflow-management-console-webapp"],
["@kie-tools/sonataflow-mock-server", "packages/sonataflow-mock-server"],
["@kie-tools/sonataflow-operator", "packages/sonataflow-operator"],
Expand Down

0 comments on commit 8c80f40

Please sign in to comment.