This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
The following commit(s) were added to refs/heads/main by this push: new 33b86458 Change for supporting development in windows #971 & #902 (#1102) 33b86458 is described below commit 33b86458fc9b18d32af1ef5c89966e981b7a732d Author: Vidhya Sagar <36588343+vidhyasag...@users.noreply.github.com> AuthorDate: Mon Feb 5 23:22:16 2024 +0800 Change for supporting development in windows #971 & #902 (#1102) * fix test issue in code #971 * Update DEV.md updated info for working in windows * Update DEV.md style update * Update DEV.md imprived guide for local development * Update DEV.md markdown fix --- docs/DEV.md | 33 +++++++++++++++++++++++++++++++++ karavan-core/test/plain.spec.ts | 6 ++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/docs/DEV.md b/docs/DEV.md index d6c0b1be..4b590d0a 100644 --- a/docs/DEV.md +++ b/docs/DEV.md @@ -51,3 +51,36 @@ npm update && npm install npm install -g @vscode/vsce vsce package ``` + +## To run karavan-web in the local machine for debugging + +#### Prerequisite +Docker Engine 24+ + +1. Make the following change in package.json line 5-12 (needed only for Windows) +``` + "scripts": { + "copy-designer": "xcopy ..\\..\\..\\..\\..\\karavan-designer\\src\\designer src\\designer /E/H/Y", + "copy-knowledgebase": "xcopy ..\\..\\..\\..\\..\\karavan-designer\\src\\knowledgebase src\\knowledgebase /E/H/Y", + "copy-topology": "xcopy ..\\..\\..\\..\\..\\karavan-designer\\src\\topology src\\topology /E/H/Y", + "copy-code": " npm run copy-designer && npm run copy-knowledgebase && npm run copy-topology", + "start": "set PORT=3003 && npm run copy-code && react-scripts start", + "build": "npm run copy-code && DISABLE_ESLINT_PLUGIN=true react-scripts build" + }, +``` + +2. Add local profile config to the application.properties +``` +# Local +%local.karavan.image-registry=localhost:5000 +%local.karavan.infinispan.hosts=localhost:11222 +%local.karavan.git-repository=http://localhost:3000/karavan/karavan.git +%local.karavan.image-registry-install=true +%local.karavan.git-install-gitea=true +%local.quarkus.http.host=localhost +``` + +3. Run ./karavan-web/karavan-app in Quarkus Dev mode +``` +mvn clean compile quarkus:dev -Dquarkus.profile=local,public +``` diff --git a/karavan-core/test/plain.spec.ts b/karavan-core/test/plain.spec.ts index 26936164..9942c780 100644 --- a/karavan-core/test/plain.spec.ts +++ b/karavan-core/test/plain.spec.ts @@ -18,8 +18,6 @@ import {expect} from 'chai'; import * as fs from 'fs'; import 'mocha'; import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml"; -import {Integration} from "../src/core/model/IntegrationDefinition"; -import {FinallyDefinition} from "../lib/model/CamelDefinition"; describe('Plain YAML to integration', () => { @@ -57,7 +55,7 @@ describe('Plain YAML to integration', () => { const i = CamelDefinitionYaml.yamlToIntegration("test1.yaml", yaml1); (i.spec.flows?.at(0)).autoStartup = false; const y = CamelDefinitionYaml.integrationToYaml(i); - expect(y).to.equal(yaml2); + expect(y).to.equal(yaml2.replaceAll("\r\n", "\n")); // replace for Windows compatibility }); it('YAML <-> Integration', () => { @@ -68,7 +66,7 @@ describe('Plain YAML to integration', () => { expect(i.spec.flows?.length).to.equal(1); expect(i.type).to.equal('plain'); const yaml2 = CamelDefinitionYaml.integrationToYaml(i); - expect(yaml.replace("\r\n", "\n")).to.equal(yaml2); // replace for Windows compatibility + expect(yaml.replaceAll("\r\n", "\n")).to.equal(yaml2); // replace for Windows compatibility }); });