Skip to content

Commit

Permalink
feat: add/remove vscode configurations and update dependencies (#395)
Browse files Browse the repository at this point in the history
* feat(modeler): add configuration option for aligning diagram to origin
* chore(deps): update deps
  • Loading branch information
peterhnm authored Oct 12, 2023
1 parent 2784c04 commit 7a45044
Show file tree
Hide file tree
Showing 30 changed files with 45,158 additions and 19,247 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
6 changes: 4 additions & 2 deletions apps/miranum-bpmn-modeler-webview/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ function createBpmnModeler(executionPlatformVersion: ExecutionPlatformVersion):
propertiesPanel: {
parent: "#js-properties-panel",
},
// disableAdjustOrigin: true,
alignToOrigin: {
alignOnSave: false,
offset: 150,
tolerance: 50,
},
additionalModules: [
...commonModules,
Expand All @@ -361,9 +362,10 @@ function createBpmnModeler(executionPlatformVersion: ExecutionPlatformVersion):
case ExecutionPlatformVersion.Camunda8: {
bpmnModeler = new BpmnModeler8({
container: "#js-canvas",
// disableAdjustOrigin: true,
alignToOrigin: {
alignOnSave: false,
offset: 150,
tolerance: 50,
},
propertiesPanel: {
parent: "#js-properties-panel",
Expand Down
8 changes: 0 additions & 8 deletions apps/miranum-cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@
}
}
},
"generateDocs": {
"executor": "nx:run-commands",
"options": {
"commands": [
"typedoc --options ./apps/miranum-cli/typedoc.json --out dist/apps/miranum-cli/docs/cliCommands"
]
}
},
"deploy": {
"executor": "nx:run-commands",
"dependsOn": [
Expand Down
186 changes: 162 additions & 24 deletions apps/miranum-cli/tests/generateApi.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateFile, generateProject } from "../src/app/generate/api";
import * as fs from "fs";
import * as fs from "node:fs";
import { shouldNotWork, sleep } from "./testHelpers";
import { Command } from "commander";

Expand All @@ -19,11 +19,19 @@ const projectName = "test-project";
const dirPath = `${myGenerations}/${projectName}`;

describe("generate bpmn project", () => {
it(`should work`, async () => {
it(`should work`, async () => {
checkExistence(dirPath, false);

const program = generateProject();
program.parse(["node", appPath, "generate", "--name", projectName, "--path", myGenerations]);
program.parse([
"node",
appPath,
"generate",
"--name",
projectName,
"--path",
myGenerations,
]);

await sleep(1500);
expect(program.args).toEqual(["generate"]);
Expand All @@ -34,14 +42,27 @@ describe("generate bpmn project", () => {
});

it("should not work, due to unknown option", () => {
shouldNotWork(generateProject(), "generate",
["node", appPath, "generate", "--name", projectName, "--path", myGenerations, "--randomArgument"],
shouldNotWork(
generateProject(),
"generate",
[
"node",
appPath,
"generate",
"--name",
projectName,
"--path",
myGenerations,
"--randomArgument",
],
"error: unknown option '--randomArgument'",
);
});

it(`should not work, due to missing argument`, async () => {
shouldNotWork(generateProject(), "generate",
shouldNotWork(
generateProject(),
"generate",
["node", appPath, "generate", "--path", myGenerations],
"error: required option '-n, --name <name>' not specified",
);
Expand All @@ -50,11 +71,41 @@ describe("generate bpmn project", () => {

describe("generate file", () => {
const filesToGenerate: FileHelper[] = [
{ name: "my-process", type: "bpmn", extension: ".bpmn", dir: "", content: `name="my-process" isExecutable="true">\n <bpmn:documentation></bpmn:documentation>` },
{ name: "my-decision-table", type: "dmn", extension: ".dmn", dir: "", content: `name="Decision 1">\n <decisionTable id="DecisionTable_1shndzu">\n <input id="Input_1">` },
{ name: "my-form", type: "form", extension: ".form", dir: "forms", content: `"key": "my-form",\n "schema": {\n "type": "object",\n "x-display": "stepper",` },
{ name: "my-config", type: "config", extension: ".config.json", dir: "configs", content: `"key": "my-config",\n "statusDokument": "",\n "statusConfig": [],\n "configs": [` },
{ name: "my-element-template", type: "element-template", extension: ".json", dir: "element-templates", content: `"name": "my-element-template",` },
{
name: "my-process",
type: "bpmn",
extension: ".bpmn",
dir: "",
content: `name="my-process" isExecutable="true">\n <bpmn:documentation></bpmn:documentation>`,
},
{
name: "my-decision-table",
type: "dmn",
extension: ".dmn",
dir: "",
content: `name="Decision 1">\n <decisionTable id="DecisionTable_1shndzu">\n <input id="Input_1">`,
},
{
name: "my-form",
type: "form",
extension: ".form",
dir: "forms",
content: `"key": "my-form",\n "schema": {\n "type": "object",\n "x-display": "stepper",`,
},
{
name: "my-config",
type: "config",
extension: ".config.json",
dir: "configs",
content: `"key": "my-config",\n "statusDokument": "",\n "statusConfig": [],\n "configs": [`,
},
{
name: "my-element-template",
type: "element-template",
extension: ".json",
dir: "element-templates",
content: `"name": "my-element-template",`,
},
];

for (const file of filesToGenerate) {
Expand All @@ -64,50 +115,131 @@ describe("generate file", () => {
const expectedFilePath = `${myGenerations}/${file.name}${file.extension}`;
checkExistence(expectedFilePath, false);

program.parse(["node", appPath, "generate-file", "--type", file.type, "--name", file.name, "--path", myGenerations]);
program.parse([
"node",
appPath,
"generate-file",
"--type",
file.type,
"--name",
file.name,
"--path",
myGenerations,
]);

await sleep(1500);
fileChecks(program, file, ["generate-file"], myGenerations, expectedFilePath);
fileChecks(
program,
file,
["generate-file"],
myGenerations,
expectedFilePath,
);
fs.rm(expectedFilePath, () => {});
});

it(`generate ${file.type} on top-level`, async () => {
generateProject().parse(["node", appPath, "generate", "--name", projectName, "--path", myGenerations]);
generateProject().parse([
"node",
appPath,
"generate",
"--name",
projectName,
"--path",
myGenerations,
]);
const expectedFilePath = `${dirPath}/${file.dir}/${file.name}${file.extension}`;

await sleep(1500);
checkExistence(expectedFilePath, false);
program.parse(["node", appPath, "generate-file", "--type", file.type, "--name", file.name, "--path", dirPath]);
program.parse([
"node",
appPath,
"generate-file",
"--type",
file.type,
"--name",
file.name,
"--path",
dirPath,
]);

await sleep(1500);
fileChecks(program, file, ["generate-file"], dirPath, expectedFilePath);
cleanUpDir();
});

it(`generate ${file.type} in subfolder`, async () => {
generateProject().parse(["node", appPath, "generate", "--name", projectName, "--path", myGenerations]);
generateProject().parse([
"node",
appPath,
"generate",
"--name",
projectName,
"--path",
myGenerations,
]);
const expectedFilePath = `${dirPath}/forms/${file.name}${file.extension}`;

await sleep(1500);
checkExistence(expectedFilePath, false);
program.parse(["node", appPath, "generate-file", "--type", file.type, "--name", file.name, "--path", `${dirPath}/forms`]);
program.parse([
"node",
appPath,
"generate-file",
"--type",
file.type,
"--name",
file.name,
"--path",
`${dirPath}/forms`,
]);

await sleep(1500);
fileChecks(program, file, ["generate-file"], `${dirPath}/forms`, expectedFilePath);
fileChecks(
program,
file,
["generate-file"],
`${dirPath}/forms`,
expectedFilePath,
);
cleanUpDir();
});
}

it("should not work, due to unknown option", () => {
shouldNotWork(generateFile(), "generate-file",
["node", appPath, "generate-file", "--type", "bpmn", "--name", "name", "--path", myGenerations, "--randomArgument"],
shouldNotWork(
generateFile(),
"generate-file",
[
"node",
appPath,
"generate-file",
"--type",
"bpmn",
"--name",
"name",
"--path",
myGenerations,
"--randomArgument",
],
"error: unknown option '--randomArgument'",
);
});

it(`should not work, due to missing argument`, async () => {
shouldNotWork(generateFile(), "generate-file",
["node", appPath, "generate-file", "--type", "bpmn", "--path", myGenerations],
shouldNotWork(
generateFile(),
"generate-file",
[
"node",
appPath,
"generate-file",
"--type",
"bpmn",
"--path",
myGenerations,
],
"error: required option '-n, --name <name>' not specified",
);
});
Expand All @@ -121,7 +253,7 @@ function checkArgsAndPath(program: Command, args: string[], path: string) {

function checkExistence(path: string, expectation: boolean) {
try {
fs.open(path, () => {});
fs.open(path, "r", () => {});
expect(expectation).toBe(true);
} catch (e) {
expect(expectation).toBe(false);
Expand All @@ -134,7 +266,13 @@ function checkContent(path: string, content: string) {
});
}

function fileChecks(program: Command, file: FileHelper, args: string[], inputPath: string, expectedPath: string) {
function fileChecks(
program: Command,
file: FileHelper,
args: string[],
inputPath: string,
expectedPath: string,
) {
checkArgsAndPath(program, args, inputPath);
expect(program.opts().type).toBe(file.type);
expect(program.opts().name).toBe(file.name);
Expand Down
2 changes: 1 addition & 1 deletion apps/miranum-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ process application in one place.
It provides a UI that helps you to scaffold a new digitization project and deploying your process artefacts.
In order to help you with your first steps with **Miranum Console**, we have created tutorials that you can be found [here](https://www.miranum.io/docs/guides/quick-start/miranum-ide/miranum-ide-quickstart).

<img src="https://github.com/Miragon/miranum-ide/blob/2c577b4cafc64e1db74d74795e24268bd3442391/apps/miranum-console/docs/console.gif?raw=true" width="850" /><br>
<img src="docs/console.webp" alt="console.webp" width="850" /><br>

## Features

Expand Down
Binary file removed apps/miranum-console/docs/console.gif
Binary file not shown.
Binary file added apps/miranum-console/docs/console.webp
Binary file not shown.
8 changes: 8 additions & 0 deletions apps/miranum-extension-pack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

* **\[Miranum Modeler\]** Configuration to enable the alignment of the diagram at the origin (#395)

### Changed

* Update dependencies

## [0.5.4] - 2023-09-19

### Changed
Expand Down
11 changes: 8 additions & 3 deletions apps/miranum-forms-webview/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
"extends": [
"../../.eslintrc.json",
"plugin:vue/essential",
"prettier",
"@vue/typescript/recommended",
"prettier"
"@vue/eslint-config-prettier"
],
"rules": {},
"ignorePatterns": ["!**/*"],
"ignorePatterns": [
"!**/*"
],
"env": {
"node": true
},
"overrides": [
{
"files": ["**/*.spec.{j,t}s?(x)"],
"files": [
"**/*.spec.{j,t}s?(x)"
],
"env": {
"jest": true
}
Expand Down
6 changes: 3 additions & 3 deletions apps/miranum-forms-webview/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Vue from "vue";
import App from "./App.vue";
import vuetify from "./plugins/vuetify";
import "./plugins/vjsf"
import "./plugins/digiwf-forms"
import "./plugins/vjsf";
import "./plugins/digiwf-forms";

Vue.config.productionTip = false;

new Vue({
vuetify,
render: h => h(App)
render: (h) => h(App),
}).$mount("#app");
4 changes: 2 additions & 2 deletions apps/miranum-forms-webview/src/plugins/digiwf-forms.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import "@muenchen/digiwf-form-renderer/dist/style.css"
import "@muenchen/digiwf-form-builder/dist/style.css"
import "@muenchen/digiwf-form-renderer/dist/style.css";
import "@muenchen/digiwf-form-builder/dist/style.css";
2 changes: 1 addition & 1 deletion apps/miranum-forms-webview/src/plugins/vjsf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import "@koumoul/vjsf/lib/VJsf.css";
import "@koumoul/vjsf/lib/deps/third-party.js";

// eslint-disable-next-line vue/multi-word-component-names
Vue.component("Jsf", VJsf)
Vue.component("Jsf", VJsf);
Loading

0 comments on commit 7a45044

Please sign in to comment.