diff --git a/.github/actions/env-to-json/index.js b/.github/actions/env-to-json/index.js index 81973aa0547..1f621c1b4f4 100644 --- a/.github/actions/env-to-json/index.js +++ b/.github/actions/env-to-json/index.js @@ -20,7 +20,7 @@ const fs = require("fs"); function filterObjectProperties(object, prefix) { return Object.keys(object) - .filter(key => key.startsWith(prefix)) + .filter((key) => key.startsWith(prefix)) .reduce((obj, key) => { const keyToSave = key.replace(prefix, ""); obj[keyToSave] = object[key]; @@ -34,7 +34,7 @@ try { console.log(JSON.stringify(json, null, 4)); - fs.writeFile(path, JSON.stringify(json), "utf8", function(err) { + fs.writeFile(path, JSON.stringify(json), "utf8", function (err) { if (err) { console.log("An error occurred while writing JSON Object to File."); return console.log(err); diff --git a/.github/actions/json-to-output/index.js b/.github/actions/json-to-output/index.js index 2525b8c5ac9..32190b275f8 100644 --- a/.github/actions/json-to-output/index.js +++ b/.github/actions/json-to-output/index.js @@ -24,7 +24,7 @@ try { const jsonString = fs.readFileSync(path); const json = JSON.parse(jsonString); - Object.keys(json).forEach(key => { + Object.keys(json).forEach((key) => { core.setOutput(key, json[key]); console.log("Set output '" + key + "' to '" + json[key] + "'"); }); diff --git a/.github/workflows/it-tests.yml b/.github/workflows/it-tests.yml index ead52667845..a17c4e34acb 100644 --- a/.github/workflows/it-tests.yml +++ b/.github/workflows/it-tests.yml @@ -102,14 +102,14 @@ jobs: - name: Run integration tests run: npx lerna run test:it --scope '@kogito-tooling/online-editor' --stream - - name: Archive it test screenshots + - name: Archive it test screenshots if: failure() - uses: actions/upload-artifact@v1 - with: - name: online-editor-it-tests-screenshots-${{ matrix.os }} + uses: actions/upload-artifact@v1 + with: + name: online-editor-it-tests-screenshots-${{ matrix.os }} path: packages/online-editor/it-tests/screenshots - - name: Archive it test videos + - name: Archive it test videos if: failure() uses: actions/upload-artifact@v1 with: diff --git a/.github/workflows/publish_maven_bpmn_editor_unpacked.yml b/.github/workflows/publish_maven_bpmn_editor_unpacked.yml index a80eef6ef35..72e6699f3c4 100644 --- a/.github/workflows/publish_maven_bpmn_editor_unpacked.yml +++ b/.github/workflows/publish_maven_bpmn_editor_unpacked.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: mvnVersion: - description: 'Maven version' + description: "Maven version" required: true npmVersion: - description: 'NPM version' + description: "NPM version" required: true jobs: @@ -21,4 +21,4 @@ jobs: mvn package -B -ntp -Dversion.bpmn.webapp=${{ github.event.inputs.mvnVersion }} npm version ${{ github.event.inputs.npmVersion }} echo "//registry.npmjs.org/:_authToken=${{ secrets.KIEGROUP_NPM_TOKEN }}" > ~/.npmrc - npm publish --access public \ No newline at end of file + npm publish --access public diff --git a/.github/workflows/publish_maven_dmn_editor_unpacked.yml b/.github/workflows/publish_maven_dmn_editor_unpacked.yml index f137a273b84..c0425c3d3bd 100644 --- a/.github/workflows/publish_maven_dmn_editor_unpacked.yml +++ b/.github/workflows/publish_maven_dmn_editor_unpacked.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: mvnVersion: - description: 'Maven version' + description: "Maven version" required: true npmVersion: - description: 'NPM version' + description: "NPM version" required: true jobs: @@ -21,4 +21,4 @@ jobs: mvn package -B -ntp -Dversion.dmn.webapp=${{ github.event.inputs.mvnVersion }} npm version ${{ github.event.inputs.npmVersion }} echo "//registry.npmjs.org/:_authToken=${{ secrets.KIEGROUP_NPM_TOKEN }}" > ~/.npmrc - npm publish --access public \ No newline at end of file + npm publish --access public diff --git a/.github/workflows/publish_maven_editors_snapshot_version.yml b/.github/workflows/publish_maven_editors_snapshot_version.yml index 4cc2ec478f5..ea96979a822 100644 --- a/.github/workflows/publish_maven_editors_snapshot_version.yml +++ b/.github/workflows/publish_maven_editors_snapshot_version.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: kogitoToolingForkToUpdate: - description: 'PR Fork to update (optional)' + description: "PR Fork to update (optional)" required: false kogitoToolingBranchToUpdate: - description: 'PR Branch to update (optional)' + description: "PR Branch to update (optional)" required: false jobs: @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-java@v1 with: - java-version: '8' + java-version: "8" - name: Checkout droolsjbpm-build-bootstrap uses: actions/checkout@v2 @@ -47,7 +47,7 @@ jobs: path: ${{ github.workspace }}/kie-wb-common repository: kiegroup/kie-wb-common fetch-depth: 0 - + - name: Checkout drools-wb uses: actions/checkout@v2 with: @@ -115,7 +115,7 @@ jobs: NPM_VERSION=`echo $MVN_VERSION-$DATE.$TIME` echo $NPM_VERSION echo ::set-output name=version::$NPM_VERSION - + - name: Publish BPMN Editor run: | cd ${{ github.workspace }}/kogito-tooling/.github/supporting-files/publish_maven_editors_snapshot_version/bpmn-editor-unpacked @@ -124,7 +124,7 @@ jobs: npm version ${{ steps.newEditorsVersionOnNpm.outputs.version }} echo "//registry.npmjs.org/:_authToken=${{ secrets.KIEGROUP_NPM_TOKEN }}" > ~/.npmrc npm publish --access public --tag snapshot - + - name: Publish DMN Editor run: | cd ${{ github.workspace }}/kogito-tooling/.github/supporting-files/publish_maven_editors_snapshot_version/dmn-editor-unpacked @@ -133,7 +133,7 @@ jobs: npm version ${{ steps.newEditorsVersionOnNpm.outputs.version }} echo "//registry.npmjs.org/:_authToken=${{ secrets.KIEGROUP_NPM_TOKEN }}" > ~/.npmrc npm publish --access public --tag snapshot - + - name: Publish SceSim Editor run: | cd ${{ github.workspace }}/kogito-tooling/.github/supporting-files/publish_maven_editors_snapshot_version/scesim-editor-unpacked @@ -180,8 +180,3 @@ jobs: git add . git commit -m "Update Editors to ${{ steps.newEditorsVersionOnNpm.outputs.version }}" git push - - - - - diff --git a/.github/workflows/publish_maven_quarkus_runner_unpacked.yml b/.github/workflows/publish_maven_quarkus_runner_unpacked.yml index 56c397e4480..cfb0fe2de3d 100644 --- a/.github/workflows/publish_maven_quarkus_runner_unpacked.yml +++ b/.github/workflows/publish_maven_quarkus_runner_unpacked.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: mvnVersion: - description: 'Maven version' + description: "Maven version" required: true npmVersion: - description: 'NPM version' + description: "NPM version" required: true jobs: @@ -21,4 +21,4 @@ jobs: mvn package -B -ntp -Dversion.quarkus.runner=${{ github.event.inputs.mvnVersion }} npm version ${{ github.event.inputs.npmVersion }} echo "//registry.npmjs.org/:_authToken=${{ secrets.KIEGROUP_NPM_TOKEN }}" > ~/.npmrc - npm publish --access public \ No newline at end of file + npm publish --access public diff --git a/.github/workflows/publish_maven_scesim_editor_unpacked.yml b/.github/workflows/publish_maven_scesim_editor_unpacked.yml index e66c6cfc485..db5e1b172f0 100644 --- a/.github/workflows/publish_maven_scesim_editor_unpacked.yml +++ b/.github/workflows/publish_maven_scesim_editor_unpacked.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: mvnVersion: - description: 'Maven version' + description: "Maven version" required: true npmVersion: - description: 'NPM version' + description: "NPM version" required: true jobs: @@ -21,4 +21,4 @@ jobs: mvn package -B -ntp -Dversion.scesim.webapp=${{ github.event.inputs.mvnVersion }} npm version ${{ github.event.inputs.npmVersion }} echo "//registry.npmjs.org/:_authToken=${{ secrets.KIEGROUP_NPM_TOKEN }}" > ~/.npmrc - npm publish --access public \ No newline at end of file + npm publish --access public diff --git a/.github/workflows/pull_request_full_downstream_ci.yml b/.github/workflows/pull_request_full_downstream_ci.yml index fa88dafed90..f6c11271e15 100644 --- a/.github/workflows/pull_request_full_downstream_ci.yml +++ b/.github/workflows/pull_request_full_downstream_ci.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/setup-java@v1 with: - java-version: '8' + java-version: "8" - name: Increase inotify watches run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p @@ -328,7 +328,7 @@ jobs: name: hub-app-linux-fdb path: ${{ github.workspace }}/kogito-tooling/packages/hub/out/Business Modeler Hub Preview-linux-x64.tar.gz - - name: 'Checkout kogito-online-ci' + - name: "Checkout kogito-online-ci" if: github.repository == 'kiegroup/kogito-tooling' uses: actions/checkout@v2 with: @@ -338,7 +338,7 @@ jobs: ref: gh-pages # For this step to work properly, you have to add the owner of KOGITO_TOOLING_BOT_TOKEN as collaborator on 'kogito-online-ci'. - - name: 'Update kogito-online-ci resources' + - name: "Update kogito-online-ci resources" if: github.repository == 'kiegroup/kogito-tooling' run: | cd ${{ github.workspace }}/kogito-online-ci diff --git a/README.md b/README.md index 856b3cfcdb0..0d01578c87d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -Kogito ------- +## Kogito **Kogito** is the next generation of business automation platform focused on cloud-native development, deployment and execution. @@ -13,8 +12,7 @@ Kogito [![License](https://img.shields.io/github/license/kiegroup/kogito-tooling.svg)](https://github.com/kiegroup/kogito-tooling/blob/master/LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/kogito_kie.svg?label=Follow&style=social)](https://twitter.com/kogito_kie?lang=en) -Quick Links ------------ +## Quick Links **Homepage:** http://kogito.kie.org @@ -26,81 +24,82 @@ Quick Links **Drools:** https://www.drools.org/ - -Getting Started ---------------- +## Getting Started This module contains a number of examples that you can take a look at and try out yourself. - Please take a look at the readme of each individual example for more details on how the example works and how to run it yourself (either locally or on Kubernetes): +Please take a look at the readme of each individual example for more details on how the example works and how to run it yourself (either locally or on Kubernetes): + - Process + Quarkus: [README.md](https://github.com/kiegroup/kogito-examples/tree/master/process-quarkus-example/README.md) - Process + Spring Boot: [README.md](https://github.com/kiegroup/kogito-examples/tree/master/process-springboot-example/README.md) - Process + Rules + Quarkus: [README.md](https://github.com/kiegroup/kogito-examples/tree/master/onboarding-example/README.md) - Onboarding example combining one process and two decision services - Rules + Quarkus: [README.md](https://github.com/kiegroup/kogito-examples/tree/master/rules-quarkus-helloworld/README.md) - Rule Unit + Quarkus: [README.md](https://github.com/kiegroup/kogito-examples/tree/master/ruleunit-quarkus-example/README.md) -Releases --------------------- +## Releases In Kogito Tooling [releases page](https://github.com/kiegroup/kogito-tooling/releases) you will find extensions and released tooling packages. - -Build from source --------------------- +## Build from source 1. Check out the source: - ``` - git clone git@github.com:kiegroup/kogito-tooling.git - ``` - - > If you don't have a GitHub account use this command instead: - > ``` - > git clone https://github.com/kiegroup/kogito-tooling.git - > ``` + + ``` + git clone git@github.com:kiegroup/kogito-tooling.git + ``` + + > If you don't have a GitHub account use this command instead: + > + > ``` + > git clone https://github.com/kiegroup/kogito-tooling.git + > ``` 1. Build with Yarn: - ```bash - cd kogito-tooling - yarn run init - - #prod - yarn run build:prod - - # dev - yarn run build # skips integration tests and production packing - yarn run build:fast # skips lint and unit tests - ``` - - > **NOTE**: It's necessary to have the Git tags fetched when building with `build:prod`. - - > Final artifacts will be on `packages/*/dist` directories. - -Develop --------------------- - -> **NOTE:** We recommend using *LTS* version of Node.js when developing this project. Our CI uses Node `12.16.3` and Yarn `1.19.1`. + + ```bash + cd kogito-tooling + yarn run init + + #prod + yarn run build:prod + + # dev + yarn run build # skips integration tests and production packing + yarn run build:fast # skips lint and unit tests + ``` + + > **NOTE**: It's necessary to have the Git tags fetched when building with `build:prod`. + + > Final artifacts will be on `packages/*/dist` directories. + +## Develop + +> **NOTE:** We recommend using _LTS_ version of Node.js when developing this project. Our CI uses Node `12.16.3` and Yarn `1.19.1`. > **NOTE:** This repo now consumes NPM packages containing the exploded WARs of the BPMN, DMN, and SceSim Editors. For this reason, if you want to use a local build of one of them during development, you can use some environment variables to point to the exploded WAR directories. +> > - BPMN: `EXTERNAL_RESOURCE_PATH__bpmnEditor` > - DMN: `EXTERNAL_RESOURCE_PATH__dmnEditor` > - SceSim: `EXTERNAL_RESOURCE_PATH__scesimEditor` > > **Example:** > -> $ export EXTERNAL_RESOURCE_PATH__bpmnEditor=/Users/tiago/redhat/kie-wb-common/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/target/kie-wb-common-stunner-bpmn-kogito-runtime -> -> $ export EXTERNAL_RESOURCE_PATH__dmnEditor=/Users/tiago/redhat/kie-wb-common/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/target/kie-wb-common-dmn-webapp-kogito-runtime/ +> $ export EXTERNAL_RESOURCE_PATH\_\_bpmnEditor=/Users/tiago/redhat/kie-wb-common/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-kogito-runtime/target/kie-wb-common-stunner-bpmn-kogito-runtime +> +> $ export EXTERNAL_RESOURCE_PATH\_\_dmnEditor=/Users/tiago/redhat/kie-wb-common/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-runtime/target/kie-wb-common-dmn-webapp-kogito-runtime/ > > $ yarn run init && yarn run build:prod > > This is only necessary for these GWT-based Editors. - + ##### VS Code Extension + 1. After you've successfully built the project following the instructions above, open the `packages/vscode-extension-pack-kogito-kie-editors` folder on VS Code. Use a new VS Code window so that the `packages/vscode-extension-pack-kogito-kie-editors` folder shows up as root in the VS Code explorer. 2. From there, you can Run the extension or the integration tests by using the `Debug` menu/section. You can also use the respective shortcuts (F5 to start debugging, for instance). 3. **NOTE:** To run the VS Code extension in development mode, you need `webpack` and `webpack-cli` to be globally installed on NPM. Normally you can do that with `npm install -g webpack@4.41.2 webpack-cli@3.3.10`, but `sudo` may be required depending on your installation. 4. **Remember!** If you make changes to packages other than `packages/vscode-extension-pack-kogito-kie-editors`, you have to manually rebuild them before relaunching the extension on VS Code. ##### Chrome Extension + 1. After you've successfully built the project following the instructions above, open the `packages/chrome-extension-pack-kogito-kie-editors` folder on your favourite IDE. You can import the entire repo as well if you want to make changes to other packages. 2. Run `yarn build:fast` on `packages/chrome-extension-pack-kogito-kie-editors`. This will create a version of the Chrome Extension that fetches the envelope locally. 3. Open a terminal and run `yarn run serve-envelope` on `packages/chrome-extension-pack-kogito-kie-editors`. This will start a `webpack-dev-server` instance with the editors and their envelope. We use that because we don't pack the Chrome Extension bundle with the editors inside. Instead, we fetch them from GitHub pages. @@ -109,44 +108,43 @@ Develop 6. From now on you can use the development version of the extension. **Remember!** After each change, you have to rebuild the changed modules and hit the "Refresh" button of the extension card. ##### Online Editor + 1. After you've successfully built the project following the instructions above, go to `packages/online-editor`. 2. Open a terminal and run `yarn start`. This will start a `webpack-dev-server` instance with the Online Editor resources. 3. From now on you can use the development version of the Online Editor by accessing `https://localhost:9001`. ##### Desktop and Hub + 1. After you've successfully built the project following the instructions above, go to `packages/desktop` or `packages/hub`. They work exactly the same. 2. To start the application in development mode, you can run `yarn start`. If you make changes and want to reload the app, run `yarn run build:fast && yarn start`. This will recompile the module and restart the Electron app. Remember: if you make changes to other modules, you have to build them too! 3. To build and package the application for production (i.e. generating an executable), you can run `yarn run build:prod`. This will pack the application for the current OS. If you want to pack the application for a different OS, run `yarn run pack:linux`, for example. See `package.json` for more details. ##### Standalone Editors + 1. After you've successfully built the project following the instructions above, go to `packages/kie-editors-standalone`. 2. Open a terminal and run `yarn start --config webpack.package-resources.config.js`. This will start a `webpack-dev-server` instance with the Standalone Editors test page. 3. From now on you can use the development version of the Standalone DMN Editor by accessing `https://localhost:9001/resources/dmn` and the Standalone BPMN Editor by accessing `https://localhost:9001/resources/bpmn`. +## Contribute -Contribute --------------------- - When opening PRs, please make sure to provide a detailed description of the issue along with the JIRA, if there's one. -- If you are a member of [kiegroup](https://github.com/kiegroup) and want to test a change you made in our tooling, you -can go to our [Run FDB issue](https://github.com/kiegroup/kogito-tooling/issues/221) and make a comment following the -format `Build: {github-username}/{branch-name}`. This will trigger a job that will fetch the forks (1) of `{github-username}`, -merge `{branch-name}` into master, and build them. -In a few seconds you should see a new comment on the same issue, saying that a new build was triggered for you. The -GitHub Actions bot will also provide a link so you can follow the build logs and download artifacts, and another link to -access an Online Editor instance (2) containing your changes, once it's finished running. +- If you are a member of [kiegroup](https://github.com/kiegroup) and want to test a change you made in our tooling, you + can go to our [Run FDB issue](https://github.com/kiegroup/kogito-tooling/issues/221) and make a comment following the + format `Build: {github-username}/{branch-name}`. This will trigger a job that will fetch the forks (1) of `{github-username}`, + merge `{branch-name}` into master, and build them. + In a few seconds you should see a new comment on the same issue, saying that a new build was triggered for you. The + GitHub Actions bot will also provide a link so you can follow the build logs and download artifacts, and another link to + access an Online Editor instance (2) containing your changes, once it's finished running. (1) This process considers the following repositories: `droolsjbpm-build-bootstrap`, `kie-soup`, `appformer`, `kie-wb-common`, `drools-wb` and `kogito-tooling`. -(2) The Online Editor instance will be accessible for 30 days. +(2) The Online Editor instance will be accessible for 30 days. -Contributing to Kogito --------------------- +## Contributing to Kogito All contributions are welcome! Before you start please read the [Developing Drools and jBPM](https://github.com/kiegroup/droolsjbpm-build-bootstrap/blob/master/README.md) guide. - -Guides --------------------- +## Guides Here are some of the most notable ones for quick reference: diff --git a/lerna.json b/lerna.json index 23f63454d56..cf054638fa0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,6 @@ { "version": "0.8.4", - "packages": [ - "packages/*" - ], + "packages": ["packages/*"], "npmClient": "yarn", "useWorkspaces": true } diff --git a/packages/vscode-extension-pack-kogito-kie-editors/.mocharc.json b/packages/vscode-extension-pack-kogito-kie-editors/.mocharc.json index 4223741f2d1..9d2ba2c64ca 100644 --- a/packages/vscode-extension-pack-kogito-kie-editors/.mocharc.json +++ b/packages/vscode-extension-pack-kogito-kie-editors/.mocharc.json @@ -1,7 +1,7 @@ { - "retries": 1, - "reporter": "xunit", - "reporterOptions": { - "output": "./it-tests/results/junit.xml" - } -} \ No newline at end of file + "retries": 1, + "reporter": "xunit", + "reporterOptions": { + "output": "./it-tests/results/junit.xml" + } +} diff --git a/tslint.json b/tslint.json index 73162f23761..10829784191 100644 --- a/tslint.json +++ b/tslint.json @@ -1,10 +1,6 @@ { "defaultSeverity": "error", - "extends": [ - "tslint:recommended", - "tslint-react", - "tslint-config-prettier" - ], + "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"], "jsRules": {}, "rules": { "forin": false, @@ -13,10 +9,7 @@ "ordered-imports": false, "object-literal-sort-keys": false, "no-console": false, - "interface-name": [ - true, - "never-prefix" - ], + "interface-name": [true, "never-prefix"], "max-classes-per-file": false, "jsx-no-lambda": false, "member-ordering": [ diff --git a/unpack-maven-packages.js b/unpack-maven-packages.js index 401754cdc08..37132f13238 100755 --- a/unpack-maven-packages.js +++ b/unpack-maven-packages.js @@ -16,34 +16,41 @@ * limitations under the License. */ -const decompress = require('decompress'); -const http = require('http'); +const decompress = require("decompress"); +const http = require("http"); const https = require("https"); -const fs = require('fs'); -const path = require('path'); +const fs = require("fs"); +const path = require("path"); const download = function (url, dest, cb) { const file = fs.createWriteStream(dest); - (url.startsWith("https://") ? https : http).get(url, function (response) { - response.pipe(file); - file.on('finish', function () { - file.close(cb(dest)); + (url.startsWith("https://") ? https : http) + .get(url, function (response) { + response.pipe(file); + file.on("finish", function () { + file.close(cb(dest)); + }); + }) + .on("error", function (err) { + console.error("[ERROR] Error downloading file", err); + if (cb) cb(dest); }); - }).on('error', function (err) { - console.error("[ERROR] Error downloading file", err); - if (cb) cb(dest); - }); }; const urls = process.argv.slice(2); fs.mkdirSync("unpacked"); -urls.forEach(url => download(url, path.join(".", "unpacked", url.substring(url.lastIndexOf('/') + 1)), file => { - console.log(`${file} downloaded. Uncompressing it...`); +urls.forEach((url) => + download( + url, + path.join(".", "unpacked", url.substring(url.lastIndexOf("/") + 1)), + (file) => { + console.log(`${file} downloaded. Uncompressing it...`); - decompress(file, `${file.replace(/\./g, "_")}`) - .then( - () => console.log(`File ${file} unpacked.`), - error => console.error(`Error unpackaging file ${file}.`, error) - ) -})); + decompress(file, `${file.replace(/\./g, "_")}`).then( + () => console.log(`File ${file} unpacked.`), + (error) => console.error(`Error unpackaging file ${file}.`, error) + ); + } + ) +); diff --git a/update_version_to.js b/update_version_to.js index 8afef8a3b6d..b41accc0928 100755 --- a/update_version_to.js +++ b/update_version_to.js @@ -19,14 +19,18 @@ const util = require("util"); const exec = util.promisify(require("child_process").exec); const prettier = require("prettier"); -const CHROME_EXTENSION_MANIFEST_DEV_JSON = "./packages/chrome-extension-pack-kogito-kie-editors/manifest.dev.json"; -const CHROME_EXTENSION_MANIFEST_PROD_JSON = "./packages/chrome-extension-pack-kogito-kie-editors/manifest.prod.json"; +const CHROME_EXTENSION_MANIFEST_DEV_JSON = + "./packages/chrome-extension-pack-kogito-kie-editors/manifest.dev.json"; +const CHROME_EXTENSION_MANIFEST_PROD_JSON = + "./packages/chrome-extension-pack-kogito-kie-editors/manifest.prod.json"; const LERNA_JSON = "./lerna.json"; // async function updatePackages(lernaVersionArg) { - await exec(`npx lerna version ${lernaVersionArg} --no-push --no-git-tag-version --exact --yes`); + await exec( + `npx lerna version ${lernaVersionArg} --no-push --no-git-tag-version --exact --yes` + ); return require(LERNA_JSON).version; } @@ -34,7 +38,9 @@ async function updateChromeExtensionManifest(version, manifestPath) { const manifest = require(manifestPath); manifest.version = version; - const formattedManifest = prettier.format(JSON.stringify(manifest), { parser: "json" }); + const formattedManifest = prettier.format(JSON.stringify(manifest), { + parser: "json" + }); fs.writeFileSync(manifestPath, formattedManifest); return version; } @@ -53,16 +59,22 @@ function red(str) { Promise.resolve() .then(() => updatePackages(lernaVersionArg)) - .then(version => updateChromeExtensionManifest(version, CHROME_EXTENSION_MANIFEST_DEV_JSON)) - .then(version => updateChromeExtensionManifest(version, CHROME_EXTENSION_MANIFEST_PROD_JSON)) - .then(version => { + .then((version) => + updateChromeExtensionManifest(version, CHROME_EXTENSION_MANIFEST_DEV_JSON) + ) + .then((version) => + updateChromeExtensionManifest(version, CHROME_EXTENSION_MANIFEST_PROD_JSON) + ) + .then((version) => { console.error(""); console.info(`Updated to '${version}'.`); }) - .catch(error => { + .catch((error) => { console.error(error); console.error(""); - console.error(...red("Error updating versions. There might be undesired changes.")); + console.error( + ...red("Error updating versions. There might be undesired changes.") + ); }) .finally(() => { console.error(""); diff --git a/webpack.common.config.js b/webpack.common.config.js index 140119e174f..30aa87dc5cd 100644 --- a/webpack.common.config.js +++ b/webpack.common.config.js @@ -24,7 +24,11 @@ module.exports = { filename: "[name].js" }, stats: { - excludeAssets: [name => !name.endsWith(".js"), /gwt-editors\/.*/, /editors\/.*/], + excludeAssets: [ + (name) => !name.endsWith(".js"), + /gwt-editors\/.*/, + /editors\/.*/ + ], excludeModules: true }, performance: { @@ -33,7 +37,11 @@ module.exports = { }, resolve: { extensions: [".tsx", ".ts", ".js", ".jsx"], - modules: [path.resolve("../../node_modules"), path.resolve("./node_modules"), path.resolve("./src")] + modules: [ + path.resolve("../../node_modules"), + path.resolve("./node_modules"), + path.resolve("./src") + ] }, module: { rules: [