Skip to content

Commit

Permalink
env and more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagobento committed Oct 1, 2024
1 parent d441742 commit d6d7c38
Show file tree
Hide file tree
Showing 127 changed files with 558 additions and 526 deletions.
9 changes: 4 additions & 5 deletions examples/base64png-editor-chrome-extension/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ 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",
},
devServer: {
compress: true,
https: true,
port: buildEnv.exampleChromeExtension.envelope.port,
port: env.exampleChromeExtension.envelope.port,
},
plugins: [
new CopyPlugin({
Expand Down
10 changes: 5 additions & 5 deletions examples/base64png-editor-vscode-extension/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions examples/dmn-editor-standalone-examples/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

const buildEnv = require("./env");
const { env } = require("./env");
const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");

setupMavenConfigFile(`
-Drevision=${buildEnv.env.droolsProcessUsertasksQuarkusExample.version}
-Drevision=${env.droolsProcessUsertasksQuarkusExample.version}
-Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()}
`);
8 changes: 4 additions & 4 deletions examples/jbpm-compact-architecture-example/mvn.bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
* under the License.
*/

const buildEnv = require("./env");
const { env } = require("./env");
const { setupMavenConfigFile, setPomProperty, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");

setupMavenConfigFile(`
-Drevision=${buildEnv.env.jbpmCompactArchitectureExample.version}
-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,
});
4 changes: 2 additions & 2 deletions examples/sonataflow-greeting-quarkus-example/mvn.bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

const buildEnv = require("./env");
const { env } = require("./env");
const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");

setupMavenConfigFile(`
-Drevision=${buildEnv.env.sonataflowGreetingQuarkus.version}
-Drevision=${env.sonataflowGreetingQuarkus.version}
-Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()}
`);
10 changes: 5 additions & 5 deletions examples/todo-list-view-vscode-extension/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions examples/uniforms-patternfly/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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/],
}),
Expand Down
7 changes: 3 additions & 4 deletions examples/webapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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/],
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/boxed-expression-component/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
12 changes: 6 additions & 6 deletions packages/bpmn-vscode-extension/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -57,7 +57,7 @@ module.exports = async (env) => [
}),
],
}),
merge(commonConfig(env), {
merge(commonConfig(webpackEnv), {
target: "web",
entry: {
"webview/BpmnEditorEnvelopeApp": "./src/webview/BpmnEditorEnvelopeApp.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/chrome-extension-pack-kogito-kie-editors/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -40,20 +39,20 @@ 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}`);

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",
Expand All @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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.");
Expand Down
Loading

0 comments on commit d6d7c38

Please sign in to comment.