From d9bf5784826ff80623700e14156a8a2cd041bde5 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Fri, 13 Sep 2024 20:42:23 +0200 Subject: [PATCH 01/15] feat(engine): types for modules --- .gitignore | 6 ++- jest.config.js | 1 + package.json | 5 ++- src/config-server/package.json | 5 ++- src/config-server/tsconfig.json | 8 ++++ src/engine/native/espruino/package.json | 7 +++- src/engine/native/espruino/tsconfig.json | 8 ++++ .../node/native-capabilities/package.json | 7 +++- .../node/native-capabilities/tsconfig.json | 8 ++++ .../native/node/native-config/package.json | 7 +++- .../native/node/native-config/tsconfig.json | 8 ++++ .../native/node/native-console/package.json | 7 +++- .../native/node/native-console/tsconfig.json | 8 ++++ .../native/node/native-express/package.json | 7 +++- .../native/node/native-express/tsconfig.json | 8 ++++ src/engine/native/node/native-fs/package.json | 7 +++- .../native/node/native-fs/tsconfig.json | 8 ++++ .../native/node/native-koa/package.json | 7 +++- .../native/node/native-koa/tsconfig.json | 8 ++++ .../native/node/native-machine/package.json | 7 +++- .../native/node/native-machine/tsconfig.json | 8 ++++ .../native/node/native-mdns/package.json | 7 +++- .../native/node/native-mdns/tsconfig.json | 8 ++++ .../native/node/native-module/package.json | 1 + .../native/node/native-module/tsconfig.json | 8 ++++ .../native/node/native-mqtt/package.json | 7 +++- .../native/node/native-mqtt/tsconfig.json | 8 ++++ .../native/node/native-vm2/package.json | 10 ++++- .../native/node/native-vm2/tsconfig.json | 8 ++++ src/engine/native/node/native/package.json | 7 +++- src/engine/native/node/native/tsconfig.json | 8 ++++ src/engine/native/node/package.json | 7 +++- src/engine/native/node/tsconfig.json | 8 ++++ .../native/node/webpack.injector.config.ts | 11 ++++- .../native/node/webpack.native.config.js | 11 ++++- src/engine/native/web/server/package.json | 8 ++-- src/engine/native/web/server/tsconfig.json | 8 ++++ .../universal/capabilities/package.json | 7 +++- .../universal/capabilities/tsconfig.json | 8 ++++ src/engine/universal/core/package.json | 5 ++- src/engine/universal/core/tsconfig.json | 8 ++++ src/engine/universal/decider/package.json | 7 +++- src/engine/universal/decider/tsconfig.json | 8 ++++ .../universal/distribution/package.json | 5 +++ .../universal/distribution/tsconfig.json | 8 ++++ src/engine/universal/machine/package.json | 7 +++- src/engine/universal/machine/tsconfig.json | 8 ++++ src/engine/universal/monitoring/package.json | 7 +++- src/engine/universal/monitoring/tsconfig.json | 8 ++++ src/engine/universal/system/package.json | 7 +++- src/engine/universal/system/tsconfig.json | 8 ++++ src/engine/universal/ui/package.json | 5 ++- src/engine/universal/ui/tsconfig.json | 8 ++++ .../universal/webpack.universal.config.js | 11 ++++- .../constraint-parser-xml-json/package.json | 5 ++- .../constraint-parser-xml-json/tsconfig.json | 8 ++++ .../package.json | 5 ++- .../tsconfig.json | 8 ++++ .../server/webpack.server.backend.config.cjs | 11 ++++- tsconfig.json | 11 ++++- turbo.json | 13 ++++++ yarn.lock | 42 +++++++++++++++++++ 62 files changed, 461 insertions(+), 37 deletions(-) create mode 100644 src/config-server/tsconfig.json create mode 100644 src/engine/native/espruino/tsconfig.json create mode 100644 src/engine/native/node/native-capabilities/tsconfig.json create mode 100644 src/engine/native/node/native-config/tsconfig.json create mode 100644 src/engine/native/node/native-console/tsconfig.json create mode 100644 src/engine/native/node/native-express/tsconfig.json create mode 100644 src/engine/native/node/native-fs/tsconfig.json create mode 100644 src/engine/native/node/native-koa/tsconfig.json create mode 100644 src/engine/native/node/native-machine/tsconfig.json create mode 100644 src/engine/native/node/native-mdns/tsconfig.json create mode 100644 src/engine/native/node/native-module/tsconfig.json create mode 100644 src/engine/native/node/native-mqtt/tsconfig.json create mode 100644 src/engine/native/node/native-vm2/tsconfig.json create mode 100644 src/engine/native/node/native/tsconfig.json create mode 100644 src/engine/native/node/tsconfig.json create mode 100644 src/engine/native/web/server/tsconfig.json create mode 100644 src/engine/universal/capabilities/tsconfig.json create mode 100644 src/engine/universal/core/tsconfig.json create mode 100644 src/engine/universal/decider/tsconfig.json create mode 100644 src/engine/universal/distribution/tsconfig.json create mode 100644 src/engine/universal/machine/tsconfig.json create mode 100644 src/engine/universal/monitoring/tsconfig.json create mode 100644 src/engine/universal/system/tsconfig.json create mode 100644 src/engine/universal/ui/tsconfig.json create mode 100644 src/helper-modules/constraint-parser-xml-json/tsconfig.json create mode 100644 src/helper-modules/process-performance-calculator/tsconfig.json create mode 100644 turbo.json diff --git a/.gitignore b/.gitignore index a7bcceada..48a749767 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,8 @@ package-lock.json dataEval.json # Ignore generated credentials from google-github-actions/auth -gha-creds-*.json \ No newline at end of file +gha-creds-*.json + +# Turborepo +.turbo +@types diff --git a/jest.config.js b/jest.config.js index d606e17fa..cab1d33db 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,6 +5,7 @@ const ignorePaths = [ '/.yarn-cache', '/src/management-system', '/src/management-system-v2/.next/', + '@types', ]; let projects = [ diff --git a/package.json b/package.json index c93466e08..936ac2b05 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "private": true, + "name": "PROCEED", "workspaces": { "packages": [ "src/engine/universal/*", @@ -44,6 +45,7 @@ "dev-web": "yarn build && cd src/engine/native/web/server && yarn serve", "dev-many": "node src/engine/e2e_tests/process/deployment/startEngines.js", "build": "cd src/engine/native/node && webpack --config webpack.native.config.js && webpack --config webpack.injector.config.ts && ts-node ./build-injector.js && cd ../../universal && NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.universal.config.js", + "build-engine-types": "turbo build --filter \"./src/engine/**/\"", "build-ms": "cd src/management-system-v2 && yarn build", "build-web": "yarn build && cd src/engine/native/web/server && yarn build", "docker:run": "docker container run --publish 33029:33029 --rm --network host --detach --name engine proceed/engine:latest", @@ -112,6 +114,7 @@ "webpack-dev-server": "^3.2.1" }, "dependencies": { - "react-resizable": "^3.0.5" + "react-resizable": "^3.0.5", + "turbo": "2.1.1" } } diff --git a/src/config-server/package.json b/src/config-server/package.json index 0aab292fd..09e684f15 100644 --- a/src/config-server/package.json +++ b/src/config-server/package.json @@ -26,5 +26,8 @@ "express": "^4.17.1", "request": "^2.88.0" }, - "devDependencies": {} + "scripts": { + "build": "tsc", + "dev": "tsc --watch" + } } diff --git a/src/config-server/tsconfig.json b/src/config-server/tsconfig.json new file mode 100644 index 000000000..5c1ae9954 --- /dev/null +++ b/src/config-server/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/espruino/package.json b/src/engine/native/espruino/package.json index bb388e8bb..0626f6c0e 100644 --- a/src/engine/native/espruino/package.json +++ b/src/engine/native/espruino/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "", "main": "espruino.js", + "types": "./@types/espruino.d.ts", "scripts": { "dev": "nodemon src/dev.js --watch src", "build:pixl": "uglifyjs src/pixl.js --compress --mangle -o ./build/bundle.js ", @@ -34,5 +35,9 @@ "webpack-bundle-analyzer": "^3.3.2", "webpack-cli": "^3.3.5" }, - "dependencies": {} + "dependencies": {}, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" + } } diff --git a/src/engine/native/espruino/tsconfig.json b/src/engine/native/espruino/tsconfig.json new file mode 100644 index 000000000..5d32aae5f --- /dev/null +++ b/src/engine/native/espruino/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-capabilities/package.json b/src/engine/native/node/native-capabilities/package.json index 893a5125c..3608a09b9 100644 --- a/src/engine/native/node/native-capabilities/package.json +++ b/src/engine/native/node/native-capabilities/package.json @@ -2,10 +2,15 @@ "name": "@proceed/native-capabilities", "version": "1.0.0", "description": "Native module that implements the `capability` command.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/native-module": "^1.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-capabilities/tsconfig.json b/src/engine/native/node/native-capabilities/tsconfig.json new file mode 100644 index 000000000..9082a6eb7 --- /dev/null +++ b/src/engine/native/node/native-capabilities/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./src"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-config/package.json b/src/engine/native/node/native-config/package.json index 391c56ceb..fb0648b5a 100644 --- a/src/engine/native/node/native-config/package.json +++ b/src/engine/native/node/native-config/package.json @@ -2,10 +2,15 @@ "name": "@proceed/native-config", "version": "1.0.0", "description": "Native module that implements the `config` command.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/native-module": "^1.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-config/tsconfig.json b/src/engine/native/node/native-config/tsconfig.json new file mode 100644 index 000000000..5aea28d50 --- /dev/null +++ b/src/engine/native/node/native-config/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./src", "./src/config_default.json"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-console/package.json b/src/engine/native/node/native-console/package.json index 3e4c6ede8..2a6f041a8 100644 --- a/src/engine/native/node/native-console/package.json +++ b/src/engine/native/node/native-console/package.json @@ -2,10 +2,15 @@ "name": "@proceed/native-console", "version": "1.0.0", "description": "Native module that implements the `console_log` command.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/native-module": "^1.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-console/tsconfig.json b/src/engine/native/node/native-console/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-console/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-express/package.json b/src/engine/native/node/native-express/package.json index 4bd2abb68..c95b74aea 100644 --- a/src/engine/native/node/native-express/package.json +++ b/src/engine/native/node/native-express/package.json @@ -2,7 +2,8 @@ "name": "@proceed/native-express", "version": "1.0.0", "description": "Native module that implements the `serve` and `respond` commands.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { @@ -12,5 +13,9 @@ "busboy": "^0.3.1", "body-parser": "^1.19.0", "stoppable": "^1.1.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-express/tsconfig.json b/src/engine/native/node/native-express/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-express/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-fs/package.json b/src/engine/native/node/native-fs/package.json index 2fd818dd5..cad22bc0f 100644 --- a/src/engine/native/node/native-fs/package.json +++ b/src/engine/native/node/native-fs/package.json @@ -2,7 +2,8 @@ "name": "@proceed/native-fs", "version": "1.0.0", "description": "Native module that implements the `read` and `write`commands.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { @@ -11,5 +12,9 @@ }, "devDependencies": { "@types/jest": "^25.1.3" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-fs/tsconfig.json b/src/engine/native/node/native-fs/tsconfig.json new file mode 100644 index 000000000..9082a6eb7 --- /dev/null +++ b/src/engine/native/node/native-fs/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./src"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-koa/package.json b/src/engine/native/node/native-koa/package.json index 2ccdb77e0..9f242971a 100644 --- a/src/engine/native/node/native-koa/package.json +++ b/src/engine/native/node/native-koa/package.json @@ -2,7 +2,8 @@ "name": "@proceed/native-koa", "version": "1.0.0", "description": "Native module that implements the `serve` and `respond` commands.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { @@ -13,5 +14,9 @@ "koa-bodyparser": "^4.2.1", "busboy": "0.3.1", "stoppable": "^1.1.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-koa/tsconfig.json b/src/engine/native/node/native-koa/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-koa/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-machine/package.json b/src/engine/native/node/native-machine/package.json index 8e77be146..9e00a001c 100644 --- a/src/engine/native/node/native-machine/package.json +++ b/src/engine/native/node/native-machine/package.json @@ -2,7 +2,8 @@ "name": "@proceed/native-machine", "version": "1.0.0", "description": "Native module that implements the `read_device_info` command.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { @@ -10,5 +11,9 @@ "machine-uuid": "^1.2.0", "systeminformation": "^4.30.1", "ping": "^0.3.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-machine/tsconfig.json b/src/engine/native/node/native-machine/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-machine/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-mdns/package.json b/src/engine/native/node/native-mdns/package.json index c755a532d..0018d9b28 100644 --- a/src/engine/native/node/native-mdns/package.json +++ b/src/engine/native/node/native-mdns/package.json @@ -2,12 +2,17 @@ "name": "@proceed/native-mdns", "version": "1.0.0", "description": "Native module that implements the `discover` and `publish` commands.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/native-module": "^1.0.0", "bonjour-service": "1.1.1", "@darkobits/adeiu": "0.3.1" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-mdns/tsconfig.json b/src/engine/native/node/native-mdns/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-mdns/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-module/package.json b/src/engine/native/node/native-module/package.json index 2462f2ddf..bce089827 100644 --- a/src/engine/native/node/native-module/package.json +++ b/src/engine/native/node/native-module/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "Native module class for use in the @proceed/native part", "main": "src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT" } diff --git a/src/engine/native/node/native-module/tsconfig.json b/src/engine/native/node/native-module/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-module/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-mqtt/package.json b/src/engine/native/node/native-mqtt/package.json index 06dd3b1a0..b9daab83d 100644 --- a/src/engine/native/node/native-mqtt/package.json +++ b/src/engine/native/node/native-mqtt/package.json @@ -2,11 +2,16 @@ "name": "@proceed/native-mqtt", "version": "1.0.0", "description": "Native module that implements the `publish`, `subscribe` and 'unsubscribe' commands.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/native-module": "^1.0.0", "async-mqtt": "^2.6.3" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-mqtt/tsconfig.json b/src/engine/native/node/native-mqtt/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-mqtt/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native-vm2/package.json b/src/engine/native/node/native-vm2/package.json index eb5cf65c3..5a60cd854 100644 --- a/src/engine/native/node/native-vm2/package.json +++ b/src/engine/native/node/native-vm2/package.json @@ -2,12 +2,20 @@ "name": "@proceed/native-vm2", "version": "1.0.0", "description": "Native module that provides a vm2 script executor for the engine.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/native-module": "^1.0.0", "vm2": "^3.8.4", "neo-bpmn-engine": "^8.2.2" + }, + "devDependencies": { + "@proceed/core": "^1.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native-vm2/tsconfig.json b/src/engine/native/node/native-vm2/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native-vm2/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/native/package.json b/src/engine/native/node/native/package.json index d7b14f16a..e7c1a96c9 100644 --- a/src/engine/native/node/native/package.json +++ b/src/engine/native/node/native/package.json @@ -2,11 +2,16 @@ "name": "@proceed/native", "version": "1.0.0", "description": "Native part for the PROCEED engine implemented in NodeJS.", - "main": "src/index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/core": "^1.0.0", "is-valid-path": "^0.1.1" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/native/tsconfig.json b/src/engine/native/node/native/tsconfig.json new file mode 100644 index 000000000..e012518ad --- /dev/null +++ b/src/engine/native/node/native/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/package.json b/src/engine/native/node/package.json index 723f53cae..233a6d150 100644 --- a/src/engine/native/node/package.json +++ b/src/engine/native/node/package.json @@ -21,8 +21,13 @@ "url": "https://github.com/PROCEED-Labs/proceed.git", "directory": "src/management-system/" }, - "main": "index.js", + "main": "./index.js", + "types": "./@types/index.d.ts", "dependencies": { "vm2": "3.9.2" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/native/node/tsconfig.json b/src/engine/native/node/tsconfig.json new file mode 100644 index 000000000..5d32aae5f --- /dev/null +++ b/src/engine/native/node/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/native/node/webpack.injector.config.ts b/src/engine/native/node/webpack.injector.config.ts index fef8a44f0..7da1cac2e 100644 --- a/src/engine/native/node/webpack.injector.config.ts +++ b/src/engine/native/node/webpack.injector.config.ts @@ -28,7 +28,16 @@ module.exports = { rules: [ { test: /\.tsx?$/, - use: 'ts-loader', + use: [ + { + loader: 'ts-loader', + options: { + compilerOptions: { + emitDeclarationOnly: false, + }, + }, + }, + ], exclude: /node_modules/, }, ], diff --git a/src/engine/native/node/webpack.native.config.js b/src/engine/native/node/webpack.native.config.js index 18147ca62..4b3a2f263 100644 --- a/src/engine/native/node/webpack.native.config.js +++ b/src/engine/native/node/webpack.native.config.js @@ -15,7 +15,16 @@ module.exports = { rules: [ { test: /\.tsx?$/, - use: 'ts-loader', + use: [ + { + loader: 'ts-loader', + options: { + compilerOptions: { + emitDeclarationOnly: false, + }, + }, + }, + ], exclude: /node_modules/, }, ], diff --git a/src/engine/native/web/server/package.json b/src/engine/native/web/server/package.json index a3f04a30a..7e209d814 100644 --- a/src/engine/native/web/server/package.json +++ b/src/engine/native/web/server/package.json @@ -2,12 +2,14 @@ "name": "web", "version": "0.0.1", "description": "Native part of PROCEED engine for web browser.", - "main": "index.js", + "main": "./src/index.js", + "types": "./@types/src/index.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { - "build": "webpack --config webpack.config.js", - "serve": "webpack --config webpack.config.js && node server.js" + "build": "webpack --config webpack.config.js && tsc", + "serve": "webpack --config webpack.config.js && node server.js", + "dev": "tsc --watch" }, "dependencies": { "@proceed/native-capabilities": "^1.0.0", diff --git a/src/engine/native/web/server/tsconfig.json b/src/engine/native/web/server/tsconfig.json new file mode 100644 index 000000000..677091beb --- /dev/null +++ b/src/engine/native/web/server/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../../tsconfig.json", + "include": ["src", "**/*.json"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/capabilities/package.json b/src/engine/universal/capabilities/package.json index 9b5db5952..1193ce2ce 100644 --- a/src/engine/universal/capabilities/package.json +++ b/src/engine/universal/capabilities/package.json @@ -2,12 +2,15 @@ "name": "@proceed/capabilities", "version": "1.0.0", "description": "", - "main": "module.js", + "main": "./module.js", + "types": "./@types/module.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { "test": "jest", - "lint": "eslint ." + "lint": "eslint .", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "jsonld": "^1.6.2", diff --git a/src/engine/universal/capabilities/tsconfig.json b/src/engine/universal/capabilities/tsconfig.json new file mode 100644 index 000000000..5d32aae5f --- /dev/null +++ b/src/engine/universal/capabilities/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/core/package.json b/src/engine/universal/core/package.json index e618efe7f..4170efc0c 100644 --- a/src/engine/universal/core/package.json +++ b/src/engine/universal/core/package.json @@ -2,10 +2,13 @@ "name": "@proceed/core", "version": "1.0.0", "main": "./src/module.js", + "types": "./@types/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { - "start": "echo 'Do not start the engine module directly!\nInstead do yarn dev.'" + "start": "echo 'Do not start the engine module directly!\nInstead do yarn dev.'", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "@proceed/capabilities": "^1.0.0", diff --git a/src/engine/universal/core/tsconfig.json b/src/engine/universal/core/tsconfig.json new file mode 100644 index 000000000..5d32aae5f --- /dev/null +++ b/src/engine/universal/core/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/decider/package.json b/src/engine/universal/decider/package.json index 4b78eb3d3..cac9d53df 100644 --- a/src/engine/universal/decider/package.json +++ b/src/engine/universal/decider/package.json @@ -2,12 +2,15 @@ "name": "@proceed/decider", "version": "1.0.0", "description": "This module handles the evaluations of task, process, user and environment constraints", - "main": "module.js", + "main": "./module.js", + "types": "./@types/module.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { "test": "jest", - "lint": "eslint ." + "lint": "eslint .", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "@proceed/capabilities": "^1.0.0", diff --git a/src/engine/universal/decider/tsconfig.json b/src/engine/universal/decider/tsconfig.json new file mode 100644 index 000000000..5d32aae5f --- /dev/null +++ b/src/engine/universal/decider/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/distribution/package.json b/src/engine/universal/distribution/package.json index 0ac9b4db8..a844bce65 100644 --- a/src/engine/universal/distribution/package.json +++ b/src/engine/universal/distribution/package.json @@ -3,10 +3,15 @@ "version": "1.0.0", "description": "PROCEED distribution module", "main": "src/module.js", + "types": "@types/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/system": "^1.0.0", "@proceed/machine": "^1.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/universal/distribution/tsconfig.json b/src/engine/universal/distribution/tsconfig.json new file mode 100644 index 000000000..103ec3733 --- /dev/null +++ b/src/engine/universal/distribution/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + }, + "include": ["./src"] +} diff --git a/src/engine/universal/machine/package.json b/src/engine/universal/machine/package.json index 718602d86..fcf703855 100644 --- a/src/engine/universal/machine/package.json +++ b/src/engine/universal/machine/package.json @@ -2,11 +2,14 @@ "name": "@proceed/machine", "version": "1.0.0", "description": "monitoring and configuration", - "main": "module.js", + "main": "./module.js", + "types": "./@types/module.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "@proceed/system": "^1.0.0" diff --git a/src/engine/universal/machine/tsconfig.json b/src/engine/universal/machine/tsconfig.json new file mode 100644 index 000000000..953d49e5d --- /dev/null +++ b/src/engine/universal/machine/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["**/*", "./configuration/defaultProfile.json"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/monitoring/package.json b/src/engine/universal/monitoring/package.json index ab92f9b73..424fef8fa 100644 --- a/src/engine/universal/monitoring/package.json +++ b/src/engine/universal/monitoring/package.json @@ -2,10 +2,15 @@ "name": "@proceed/monitoring", "version": "1.0.0", "description": "Monitoring module for the PROCEED engine", - "main": "src/module.js", + "main": "./src/module.js", + "types": "./@types/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { "@proceed/system": "^1.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/universal/monitoring/tsconfig.json b/src/engine/universal/monitoring/tsconfig.json new file mode 100644 index 000000000..d5ee1a151 --- /dev/null +++ b/src/engine/universal/monitoring/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./src"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/system/package.json b/src/engine/universal/system/package.json index 6e6d799f4..8d17920f6 100644 --- a/src/engine/universal/system/package.json +++ b/src/engine/universal/system/package.json @@ -2,7 +2,8 @@ "name": "@proceed/system", "version": "1.0.0", "description": "Proceed system framework.", - "main": "src/module.js", + "main": "./src/module.js", + "types": "./@types/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { @@ -11,5 +12,9 @@ }, "devDependencies": { "@types/uuid": "^9.0.1" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch" } } diff --git a/src/engine/universal/system/tsconfig.json b/src/engine/universal/system/tsconfig.json new file mode 100644 index 000000000..d5ee1a151 --- /dev/null +++ b/src/engine/universal/system/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./src"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/ui/package.json b/src/engine/universal/ui/package.json index 9c69d404e..ceb4bc074 100644 --- a/src/engine/universal/ui/package.json +++ b/src/engine/universal/ui/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "User Interface module for the PROCEED engine", "main": "./module.js", + "types": "./@types/module.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { @@ -11,7 +12,9 @@ "dev-logging": "cross-env TARGET=logging webpack-dev-server --mode=development --open --config ./src/display-items/webpack.config.js", "build-tasklist": "cross-env TARGET=tasklist webpack --config ./src/display-items/webpack.config.js", "build-configuration": "cross-env TARGET=configuration webpack --config ./src/display-items/webpack.config.js", - "build-logging": "cross-env TARGET=logging webpack --config ./src/display-items/webpack.config.js" + "build-logging": "cross-env TARGET=logging webpack --config ./src/display-items/webpack.config.js", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "@proceed/distribution": "^1.0.0", diff --git a/src/engine/universal/ui/tsconfig.json b/src/engine/universal/ui/tsconfig.json new file mode 100644 index 000000000..d5ee1a151 --- /dev/null +++ b/src/engine/universal/ui/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["./src"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/engine/universal/webpack.universal.config.js b/src/engine/universal/webpack.universal.config.js index 6ecae7f46..af5a5513c 100644 --- a/src/engine/universal/webpack.universal.config.js +++ b/src/engine/universal/webpack.universal.config.js @@ -16,7 +16,16 @@ module.exports = { rules: [ { test: /\.tsx?$/, - use: 'ts-loader', + use: [ + { + loader: 'ts-loader', + options: { + compilerOptions: { + emitDeclarationOnly: false, + }, + }, + }, + ], exclude: /node_modules/, }, ], diff --git a/src/helper-modules/constraint-parser-xml-json/package.json b/src/helper-modules/constraint-parser-xml-json/package.json index d97e23ee4..d7e09ed59 100644 --- a/src/helper-modules/constraint-parser-xml-json/package.json +++ b/src/helper-modules/constraint-parser-xml-json/package.json @@ -6,9 +6,12 @@ "homepage": "https://proceed.snet.tu-berlin.de/", "description": "This library transforms the PROCEED process constraints from XML to JSON or vice versa", "main": "parser.js", + "types": "@types/parser.d.ts", "scripts": { "test": "jest", - "lint": "eslint ." + "lint": "eslint .", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "fast-xml-parser": "3.15.0" diff --git a/src/helper-modules/constraint-parser-xml-json/tsconfig.json b/src/helper-modules/constraint-parser-xml-json/tsconfig.json new file mode 100644 index 000000000..dd52c2e0b --- /dev/null +++ b/src/helper-modules/constraint-parser-xml-json/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/helper-modules/process-performance-calculator/package.json b/src/helper-modules/process-performance-calculator/package.json index cbdfa9a2d..b92bfc265 100644 --- a/src/helper-modules/process-performance-calculator/package.json +++ b/src/helper-modules/process-performance-calculator/package.json @@ -5,8 +5,11 @@ "author": "Luisa Wittig", "license": "ISC", "main": "index.js", + "types": "@types/index.d.ts", "scripts": { - "test": "jest" + "test": "jest", + "build": "tsc", + "dev": "tsc --watch" }, "dependencies": { "bpmn-moddle": "^6.0.0" diff --git a/src/helper-modules/process-performance-calculator/tsconfig.json b/src/helper-modules/process-performance-calculator/tsconfig.json new file mode 100644 index 000000000..dd52c2e0b --- /dev/null +++ b/src/helper-modules/process-performance-calculator/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "declarationDir": "./@types", + "emitDeclarationOnly": true + } +} diff --git a/src/management-system/src/backend/server/webpack.server.backend.config.cjs b/src/management-system/src/backend/server/webpack.server.backend.config.cjs index be05fdb33..0fba6506c 100644 --- a/src/management-system/src/backend/server/webpack.server.backend.config.cjs +++ b/src/management-system/src/backend/server/webpack.server.backend.config.cjs @@ -17,7 +17,16 @@ module.exports = { rules: [ { test: /\.tsx?$/, - use: 'ts-loader', + use: [ + { + loader: 'ts-loader', + options: { + compilerOptions: { + emitDeclarationOnly: false, + }, + }, + }, + ], exclude: /node_modules/, }, ], diff --git a/tsconfig.json b/tsconfig.json index 2e4cd8f6f..acd1683b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,11 +4,18 @@ "module": "CommonJS", "outDir": "dist", "allowJs": true, + "checkJs": false, "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, - "target": "es6" + "target": "es6", + "moduleDetection": "force", + "declaration": true, + "declarationMap": true, + "skipLibCheck": true, + "strict": false, + "noImplicitAny": false }, - "exclude": ["src/management-system-v2/**/*"], + "exclude": ["src/management-system-v2/**/*", "**/@types", "node_modules/**/*"], "include": ["src/**/*", "tests/**/*"] } diff --git a/turbo.json b/turbo.json new file mode 100644 index 000000000..e5d5d46e8 --- /dev/null +++ b/turbo.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://turbo.build/schema.json", + "tasks": { + "build": { + "dependsOn": ["^build"], + "outputs": ["**/@types"] + }, + "dev": { + "persistent": true, + "cache": false + } + } +} diff --git a/yarn.lock b/yarn.lock index 07682a6d6..f23da8b59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21993,6 +21993,48 @@ tunnel@^0.0.6: resolved "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz" integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== +turbo-darwin-64@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-2.1.1.tgz#da7fcfa7fb8a94ad5c33e8518e2b898a6525826d" + integrity sha512-aYNuJpZlCoi0Htd79fl/2DywpewGKijdXeOfg9KzNuPVKzSMYlAXuAlNGh0MKjiOcyqxQGL7Mq9LFhwA0VpDpQ== + +turbo-darwin-arm64@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-2.1.1.tgz#a80fe457ab7baf838f054382d2f3ef03e51a13de" + integrity sha512-tifJKD8yHY48rHXPMcM8o1jI/Jk2KCaXiNjTKvvy9Zsim61BZksNVLelIbrRoCGwAN6PUBZO2lGU5iL/TQJ5Pw== + +turbo-linux-64@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-2.1.1.tgz#2f97a1078e73e39ebf080985f3bebe53814bafbc" + integrity sha512-Js6d/bSQe9DuV9c7ITXYpsU/ADzFHABdz1UIHa7Oqjj9VOEbFeA9WpAn0c+mdJrVD+IXJFbbDZUjN7VYssmtcg== + +turbo-linux-arm64@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-2.1.1.tgz#8527a9bfe189957398ccaf05669ccd924e732d31" + integrity sha512-LidzTCq0yvQ+N8w8Qub9FmhQ/mmEIeoqFi7DSupekEV2EjvE9jw/zYc9Pk67X+g7dHVfgOnvVzmrjChdxpFePw== + +turbo-windows-64@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-2.1.1.tgz#fe92cfddcf9d37e9649d67573e06072cd0c2c732" + integrity sha512-GKc9ZywKwy4xLDhwXd6H07yzl0TB52HjXMrFLyHGhCVnf/w0oq4sLJv2sjbvuarPjsyx4xnCBJ3m3oyL2XmFtA== + +turbo-windows-arm64@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo-windows-arm64/-/turbo-windows-arm64-2.1.1.tgz#5a20090208a337a1dbeaae8e22341ac684620c6d" + integrity sha512-oFKkMj11KKUv3xSK9/fhAEQTxLUp1Ol1EOktwc32+SFtEU0uls7kosAz0b+qe8k3pJGEMFdDPdqoEjyJidbxtQ== + +turbo@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-2.1.1.tgz#b1e71f8fefa9d1c60b77b2fbdebd35702555593d" + integrity sha512-u9gUDkmR9dFS8b5kAYqIETK4OnzsS4l2ragJ0+soSMHh6VEeNHjTfSjk1tKxCqLyziCrPogadxP680J+v6yGHw== + optionalDependencies: + turbo-darwin-64 "2.1.1" + turbo-darwin-arm64 "2.1.1" + turbo-linux-64 "2.1.1" + turbo-linux-arm64 "2.1.1" + turbo-windows-64 "2.1.1" + turbo-windows-arm64 "2.1.1" + tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" From 59112e43bb6ac9cfa088c91c8041ae01ced385cf Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Fri, 13 Sep 2024 21:49:41 +0200 Subject: [PATCH 02/15] fix(engine/web): correct import for proceed engine --- src/engine/native/web/server/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/native/web/server/src/index.js b/src/engine/native/web/server/src/index.js index d4353dbcb..b162eafd3 100644 --- a/src/engine/native/web/server/src/index.js +++ b/src/engine/native/web/server/src/index.js @@ -4,8 +4,8 @@ import { Console } from './modules/web-console/console.module'; import { Config } from './modules/web-config/config.module'; import { Machine } from './modules/web-machine/machine.module'; -// PROCEED Engine needs to be builded before -const PROCEED = require('../../../../../../build/engine/universal'); +// PROCEED Engine needs to be built before +const PROCEED = require('../../../../../../build/engine/proceed-engine.js'); const socket = io(); From f133bcf5f5b69969d7deabb4c81f0959dfe6fa1b Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Fri, 13 Sep 2024 21:57:18 +0200 Subject: [PATCH 03/15] fix(engine/native-module): build scripts --- src/engine/native/node/native-module/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/native/node/native-module/package.json b/src/engine/native/node/native-module/package.json index bce089827..ca2a0b6b1 100644 --- a/src/engine/native/node/native-module/package.json +++ b/src/engine/native/node/native-module/package.json @@ -5,5 +5,9 @@ "main": "src/index.js", "types": "./@types/src/index.d.ts", "author": "PROCEED Project", - "license": "MIT" + "license": "MIT", + "scripts": { + "build": "tsc", + "dev": "tsc --watch" + } } From 2ff9286256151325304f1515b69bc6256a8e123e Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Sat, 14 Sep 2024 11:50:30 +0200 Subject: [PATCH 04/15] fix: type paths --- src/config-server/package.json | 1 + src/engine/native/espruino/package.json | 7 +------ src/engine/native/espruino/tsconfig.json | 8 -------- src/engine/native/node/native-capabilities/package.json | 2 +- src/engine/native/node/native-config/package.json | 2 +- src/engine/native/node/native-console/package.json | 2 +- src/engine/native/node/native-express/package.json | 2 +- src/engine/native/node/native-fs/package.json | 2 +- src/engine/native/node/native-koa/package.json | 2 +- src/engine/native/node/native-machine/package.json | 2 +- src/engine/native/node/native-mdns/package.json | 2 +- src/engine/native/node/native-module/package.json | 2 +- src/engine/native/node/native-mqtt/package.json | 2 +- src/engine/native/node/native-vm2/package.json | 2 +- src/engine/native/node/native/package.json | 2 +- src/engine/native/web/server/tsconfig.json | 4 +++- src/engine/universal/core/src/module.js | 3 ++- src/engine/universal/core/tsconfig.json | 3 ++- src/engine/universal/distribution/package.json | 2 +- src/engine/universal/distribution/tsconfig.json | 3 ++- src/engine/universal/monitoring/package.json | 2 +- src/engine/universal/system/package.json | 2 +- src/engine/universal/system/src/module.js | 6 +++++- src/engine/universal/system/tsconfig.json | 2 +- src/engine/universal/ui/tsconfig.json | 3 ++- .../constraint-parser-xml-json/package.json | 2 +- .../process-performance-calculator/package.json | 2 +- tsconfig.json | 1 + 28 files changed, 37 insertions(+), 38 deletions(-) delete mode 100644 src/engine/native/espruino/tsconfig.json diff --git a/src/config-server/package.json b/src/config-server/package.json index 09e684f15..19c66d178 100644 --- a/src/config-server/package.json +++ b/src/config-server/package.json @@ -6,6 +6,7 @@ "description": "The central storage server for advanced use cases in the PROCEED project. It mainly stores config data used for multiple companies to cooperate", "license": "MIT", "main": "./configServer.js", + "types": "./@types/configServer.d.ts", "scripts": { "dev": "node ./configServer.js" }, diff --git a/src/engine/native/espruino/package.json b/src/engine/native/espruino/package.json index 0626f6c0e..bb388e8bb 100644 --- a/src/engine/native/espruino/package.json +++ b/src/engine/native/espruino/package.json @@ -3,7 +3,6 @@ "version": "1.0.0", "description": "", "main": "espruino.js", - "types": "./@types/espruino.d.ts", "scripts": { "dev": "nodemon src/dev.js --watch src", "build:pixl": "uglifyjs src/pixl.js --compress --mangle -o ./build/bundle.js ", @@ -35,9 +34,5 @@ "webpack-bundle-analyzer": "^3.3.2", "webpack-cli": "^3.3.5" }, - "dependencies": {}, - "scripts": { - "build": "tsc", - "dev": "tsc --watch" - } + "dependencies": {} } diff --git a/src/engine/native/espruino/tsconfig.json b/src/engine/native/espruino/tsconfig.json deleted file mode 100644 index 5d32aae5f..000000000 --- a/src/engine/native/espruino/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../../../tsconfig.json", - "include": ["./**/*"], - "compilerOptions": { - "declarationDir": "./@types", - "emitDeclarationOnly": true - } -} diff --git a/src/engine/native/node/native-capabilities/package.json b/src/engine/native/node/native-capabilities/package.json index 3608a09b9..40627f1c4 100644 --- a/src/engine/native/node/native-capabilities/package.json +++ b/src/engine/native/node/native-capabilities/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `capability` command.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-config/package.json b/src/engine/native/node/native-config/package.json index fb0648b5a..35133c61d 100644 --- a/src/engine/native/node/native-config/package.json +++ b/src/engine/native/node/native-config/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `config` command.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-console/package.json b/src/engine/native/node/native-console/package.json index 2a6f041a8..b56b52cd9 100644 --- a/src/engine/native/node/native-console/package.json +++ b/src/engine/native/node/native-console/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `console_log` command.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-express/package.json b/src/engine/native/node/native-express/package.json index c95b74aea..abe8d0015 100644 --- a/src/engine/native/node/native-express/package.json +++ b/src/engine/native/node/native-express/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `serve` and `respond` commands.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-fs/package.json b/src/engine/native/node/native-fs/package.json index cad22bc0f..e1ca4d069 100644 --- a/src/engine/native/node/native-fs/package.json +++ b/src/engine/native/node/native-fs/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `read` and `write`commands.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-koa/package.json b/src/engine/native/node/native-koa/package.json index 9f242971a..546798473 100644 --- a/src/engine/native/node/native-koa/package.json +++ b/src/engine/native/node/native-koa/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `serve` and `respond` commands.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-machine/package.json b/src/engine/native/node/native-machine/package.json index 9e00a001c..6958adb06 100644 --- a/src/engine/native/node/native-machine/package.json +++ b/src/engine/native/node/native-machine/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `read_device_info` command.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-mdns/package.json b/src/engine/native/node/native-mdns/package.json index 0018d9b28..0a0260e8f 100644 --- a/src/engine/native/node/native-mdns/package.json +++ b/src/engine/native/node/native-mdns/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `discover` and `publish` commands.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-module/package.json b/src/engine/native/node/native-module/package.json index ca2a0b6b1..b5d126090 100644 --- a/src/engine/native/node/native-module/package.json +++ b/src/engine/native/node/native-module/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module class for use in the @proceed/native part", "main": "src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "scripts": { diff --git a/src/engine/native/node/native-mqtt/package.json b/src/engine/native/node/native-mqtt/package.json index b9daab83d..006cdf8cb 100644 --- a/src/engine/native/node/native-mqtt/package.json +++ b/src/engine/native/node/native-mqtt/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that implements the `publish`, `subscribe` and 'unsubscribe' commands.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native-vm2/package.json b/src/engine/native/node/native-vm2/package.json index 5a60cd854..cab8d8eaf 100644 --- a/src/engine/native/node/native-vm2/package.json +++ b/src/engine/native/node/native-vm2/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native module that provides a vm2 script executor for the engine.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/node/native/package.json b/src/engine/native/node/native/package.json index e7c1a96c9..395d5239a 100644 --- a/src/engine/native/node/native/package.json +++ b/src/engine/native/node/native/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Native part for the PROCEED engine implemented in NodeJS.", "main": "./src/index.js", - "types": "./@types/src/index.d.ts", + "types": "./@types/index.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/native/web/server/tsconfig.json b/src/engine/native/web/server/tsconfig.json index 677091beb..058e9acdd 100644 --- a/src/engine/native/web/server/tsconfig.json +++ b/src/engine/native/web/server/tsconfig.json @@ -1,8 +1,10 @@ { "extends": "../../../../../tsconfig.json", "include": ["src", "**/*.json"], + "exclude": ["../../../../../build/**/*", "@types"], "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "rootDir": "." } } diff --git a/src/engine/universal/core/src/module.js b/src/engine/universal/core/src/module.js index eb967f96a..8c078cc65 100644 --- a/src/engine/universal/core/src/module.js +++ b/src/engine/universal/core/src/module.js @@ -1,4 +1,5 @@ const system = require('@proceed/system'); +/** @type{import('@proceed/system/src/ipc/ipc.ts').default} */ const IPC = require('@proceed/system/src/ipc/ipc.ts').default; const { config, logging } = require('@proceed/machine'); const { information: machineInformation } = require('@proceed/machine'); @@ -25,7 +26,7 @@ const logger = logging.getLogger(configObject); module.exports = { /** - * Initializes the universal part of the PROCEED engine. Dependending on the + * Initializes the universal part of the PROCEED engine. Depending on the * options, the discovery and networking can delay the opening of the * communication channels to a later point using the `silentMode` key. * @param {object} options The options for the engine start up diff --git a/src/engine/universal/core/tsconfig.json b/src/engine/universal/core/tsconfig.json index 5d32aae5f..5587983fd 100644 --- a/src/engine/universal/core/tsconfig.json +++ b/src/engine/universal/core/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../../../tsconfig.json", - "include": ["./**/*"], + "include": ["./src"], + "exclude": ["../../../../FeatureFlags.js", "./@types/**/*"], "compilerOptions": { "declarationDir": "./@types", "emitDeclarationOnly": true diff --git a/src/engine/universal/distribution/package.json b/src/engine/universal/distribution/package.json index a844bce65..3ddfce8c5 100644 --- a/src/engine/universal/distribution/package.json +++ b/src/engine/universal/distribution/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "PROCEED distribution module", "main": "src/module.js", - "types": "@types/src/module.d.ts", + "types": "./@types/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/universal/distribution/tsconfig.json b/src/engine/universal/distribution/tsconfig.json index 103ec3733..019c915e8 100644 --- a/src/engine/universal/distribution/tsconfig.json +++ b/src/engine/universal/distribution/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../../../tsconfig.json", "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "rootDir": "." }, "include": ["./src"] } diff --git a/src/engine/universal/monitoring/package.json b/src/engine/universal/monitoring/package.json index 424fef8fa..bb4424143 100644 --- a/src/engine/universal/monitoring/package.json +++ b/src/engine/universal/monitoring/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Monitoring module for the PROCEED engine", "main": "./src/module.js", - "types": "./@types/src/module.d.ts", + "types": "./@types/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/universal/system/package.json b/src/engine/universal/system/package.json index 8d17920f6..660ab9916 100644 --- a/src/engine/universal/system/package.json +++ b/src/engine/universal/system/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Proceed system framework.", "main": "./src/module.js", - "types": "./@types/src/module.d.ts", + "types": "./@types/universal/system/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/universal/system/src/module.js b/src/engine/universal/system/src/module.js index f2c705669..0a2f0edd1 100644 --- a/src/engine/universal/system/src/module.js +++ b/src/engine/universal/system/src/module.js @@ -1,17 +1,21 @@ const Network = require('./network'); const HTTP = require('./http'); const Data = require('./data'); +/** @type{import('./capability.ts').default} */ const Capability = require('./capability.ts').default; +/** @type{import('./console.ts').default} */ const Console = require('./console.ts').default; +/** @type{import('./config.ts').default} */ const Config = require('./config.ts').default; const Machine = require('./machine'); const Discovery = require('./discovery'); +/** @type{import('./timer.ts').default} */ const Timer = require('./timer.ts').default; const Messaging = require('./messaging'); const { setIPC } = require('./system.ts'); /** - * Detects the environemnt and sets the `environment` property accordingly. + * Detects the environment and sets the `environment` property accordingly. * Private for now, since it should only be called once, but could be reused. * @private */ diff --git a/src/engine/universal/system/tsconfig.json b/src/engine/universal/system/tsconfig.json index d5ee1a151..dc90a0c7e 100644 --- a/src/engine/universal/system/tsconfig.json +++ b/src/engine/universal/system/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../../../tsconfig.json", - "include": ["./src"], + "include": ["./src", "../core", "../distribution/"], "compilerOptions": { "declarationDir": "./@types", "emitDeclarationOnly": true diff --git a/src/engine/universal/ui/tsconfig.json b/src/engine/universal/ui/tsconfig.json index d5ee1a151..768525c5d 100644 --- a/src/engine/universal/ui/tsconfig.json +++ b/src/engine/universal/ui/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../../../tsconfig.json", - "include": ["./src"], + "include": ["./**/*"], + "exclude": ["../../../../FeatureFlags.js", "@types"], "compilerOptions": { "declarationDir": "./@types", "emitDeclarationOnly": true diff --git a/src/helper-modules/constraint-parser-xml-json/package.json b/src/helper-modules/constraint-parser-xml-json/package.json index d7e09ed59..1f6c0ed1b 100644 --- a/src/helper-modules/constraint-parser-xml-json/package.json +++ b/src/helper-modules/constraint-parser-xml-json/package.json @@ -6,7 +6,7 @@ "homepage": "https://proceed.snet.tu-berlin.de/", "description": "This library transforms the PROCEED process constraints from XML to JSON or vice versa", "main": "parser.js", - "types": "@types/parser.d.ts", + "types": "./@types/parser.d.ts", "scripts": { "test": "jest", "lint": "eslint .", diff --git a/src/helper-modules/process-performance-calculator/package.json b/src/helper-modules/process-performance-calculator/package.json index b92bfc265..d11668fed 100644 --- a/src/helper-modules/process-performance-calculator/package.json +++ b/src/helper-modules/process-performance-calculator/package.json @@ -5,7 +5,7 @@ "author": "Luisa Wittig", "license": "ISC", "main": "index.js", - "types": "@types/index.d.ts", + "types": "./@types/index.d.ts", "scripts": { "test": "jest", "build": "tsc", diff --git a/tsconfig.json b/tsconfig.json index acd1683b5..3eef235bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "checkJs": false, "moduleResolution": "node", "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "target": "es6", "moduleDetection": "force", From 997fb8207b037781cc38828236ef8eead91eac45 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Sat, 28 Sep 2024 19:05:17 +0200 Subject: [PATCH 05/15] fix(types): ignore built feature flags --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 48a749767..541f259c7 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,5 @@ gha-creds-*.json # Turborepo .turbo @types +FeatureFlags.d.ts +FeatureFlags.d.ts.map From c0d8daa0da571966b94a0d91655a42eca00d3439 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 30 Sep 2024 12:28:53 +0200 Subject: [PATCH 06/15] fixed typescript config bugs --- src/engine/universal/core/tsconfig.json | 5 +++-- src/engine/universal/distribution/tsconfig.json | 1 + src/engine/universal/system/package.json | 2 +- src/engine/universal/system/tsconfig.json | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/engine/universal/core/tsconfig.json b/src/engine/universal/core/tsconfig.json index 5587983fd..f359c57d1 100644 --- a/src/engine/universal/core/tsconfig.json +++ b/src/engine/universal/core/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../../tsconfig.json", "include": ["./src"], - "exclude": ["../../../../FeatureFlags.js", "./@types/**/*"], + "exclude": ["../../../../FeatureFlags.js", "./@types", "**/node_modules"], "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "rootDir": "." } } diff --git a/src/engine/universal/distribution/tsconfig.json b/src/engine/universal/distribution/tsconfig.json index 019c915e8..9250e0bd8 100644 --- a/src/engine/universal/distribution/tsconfig.json +++ b/src/engine/universal/distribution/tsconfig.json @@ -1,5 +1,6 @@ { "extends": "../../../../tsconfig.json", + "exclude": ["../../../../FeatureFlags.js"], "compilerOptions": { "declarationDir": "./@types", "emitDeclarationOnly": true, diff --git a/src/engine/universal/system/package.json b/src/engine/universal/system/package.json index 660ab9916..df0967229 100644 --- a/src/engine/universal/system/package.json +++ b/src/engine/universal/system/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "Proceed system framework.", "main": "./src/module.js", - "types": "./@types/universal/system/src/module.d.ts", + "types": "./@types/system/src/module.d.ts", "author": "PROCEED Project", "license": "MIT", "dependencies": { diff --git a/src/engine/universal/system/tsconfig.json b/src/engine/universal/system/tsconfig.json index dc90a0c7e..dc08bfc4f 100644 --- a/src/engine/universal/system/tsconfig.json +++ b/src/engine/universal/system/tsconfig.json @@ -1,8 +1,10 @@ { "extends": "../../../../tsconfig.json", - "include": ["./src", "../core", "../distribution/"], + "include": ["./src/", "../core/src", "../distribution/src/"], + "exclude": ["./@types/system/src/module.d.ts"], "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "rootDir": ".." } } From 01d05ce4934a9a39e9da74c1d04a1a79e6e2b9cb Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 30 Sep 2024 12:34:04 +0200 Subject: [PATCH 07/15] feat(engine): build types after install and merge --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 936ac2b05..dc6bc91ae 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "test-all": "yarn test-engine && yarn test-ms && yarn test-e2e", "jsdoc": "jsdoc -c ./jsdoc.config.json --pedantic", "android-prepare": "cd src/engine/universal && webpack --output-path ../native/android/app/src/main/assets --config webpack.universal.config.js", - "build-android": "yarn android-prepare && cd src/engine/native/android && ./gradlew assembleDebug" + "build-android": "yarn android-prepare && cd src/engine/native/android && ./gradlew assembleDebug", + "postinstall": "yarn build && yarn build-engine-types" }, "lint-staged": { "*": "prettier --check --ignore-path .eslintignore" @@ -67,7 +68,8 @@ "husky": { "hooks": { "pre-commit": "lint-staged", - "pre-push": "yarn test-engine && yarn test-ms" + "pre-push": "yarn test-engine && yarn test-ms", + "post-merge": "yarn build && yarn build-engine-types" } }, "devDependencies": { From 6f0e931f6f3fb009c12f0c37bbb9809be708adfb Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 21 Oct 2024 10:15:42 +0200 Subject: [PATCH 08/15] refactor(engine/types): only use tsconfig for building types --- src/engine/universal/system/package.json | 4 ++-- .../universal/system/{tsconfig.json => tsconfig.types.json} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename src/engine/universal/system/{tsconfig.json => tsconfig.types.json} (100%) diff --git a/src/engine/universal/system/package.json b/src/engine/universal/system/package.json index df0967229..d18b9b27e 100644 --- a/src/engine/universal/system/package.json +++ b/src/engine/universal/system/package.json @@ -14,7 +14,7 @@ "@types/uuid": "^9.0.1" }, "scripts": { - "build": "tsc", - "dev": "tsc --watch" + "build": "tsc -p ./tsconfig.types.json", + "dev": "tsc -p ./tsconfig.types.json --watch" } } diff --git a/src/engine/universal/system/tsconfig.json b/src/engine/universal/system/tsconfig.types.json similarity index 100% rename from src/engine/universal/system/tsconfig.json rename to src/engine/universal/system/tsconfig.types.json From 061e135772a0985febca0761ff0da9d60283ab8e Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 21 Oct 2024 10:27:22 +0200 Subject: [PATCH 09/15] test --- src/engine/universal/core/package.json | 2 +- .../universal/core/{tsconfig.json => tsconfig.types.json} | 4 +--- src/engine/universal/distribution/tsconfig.json | 2 +- src/engine/universal/system/tsconfig.types.json | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) rename src/engine/universal/core/{tsconfig.json => tsconfig.types.json} (50%) diff --git a/src/engine/universal/core/package.json b/src/engine/universal/core/package.json index 4170efc0c..4b8d8f209 100644 --- a/src/engine/universal/core/package.json +++ b/src/engine/universal/core/package.json @@ -7,7 +7,7 @@ "license": "MIT", "scripts": { "start": "echo 'Do not start the engine module directly!\nInstead do yarn dev.'", - "build": "tsc", + "build": "tsc -p ./tsconfig.types.json", "dev": "tsc --watch" }, "dependencies": { diff --git a/src/engine/universal/core/tsconfig.json b/src/engine/universal/core/tsconfig.types.json similarity index 50% rename from src/engine/universal/core/tsconfig.json rename to src/engine/universal/core/tsconfig.types.json index f359c57d1..d5ee1a151 100644 --- a/src/engine/universal/core/tsconfig.json +++ b/src/engine/universal/core/tsconfig.types.json @@ -1,10 +1,8 @@ { "extends": "../../../../tsconfig.json", "include": ["./src"], - "exclude": ["../../../../FeatureFlags.js", "./@types", "**/node_modules"], "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true, - "rootDir": "." + "emitDeclarationOnly": true } } diff --git a/src/engine/universal/distribution/tsconfig.json b/src/engine/universal/distribution/tsconfig.json index 9250e0bd8..909ab8629 100644 --- a/src/engine/universal/distribution/tsconfig.json +++ b/src/engine/universal/distribution/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../../../tsconfig.json", - "exclude": ["../../../../FeatureFlags.js"], + "exclude": ["../../../../FeatureFlags.js", "**/__tests__/**"], "compilerOptions": { "declarationDir": "./@types", "emitDeclarationOnly": true, diff --git a/src/engine/universal/system/tsconfig.types.json b/src/engine/universal/system/tsconfig.types.json index dc08bfc4f..ec3af0a5a 100644 --- a/src/engine/universal/system/tsconfig.types.json +++ b/src/engine/universal/system/tsconfig.types.json @@ -4,7 +4,6 @@ "exclude": ["./@types/system/src/module.d.ts"], "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true, - "rootDir": ".." + "emitDeclarationOnly": true } } From c6e08c7bf7d614b219f2e6c0298b197c429294b8 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Fri, 15 Nov 2024 11:16:28 +0100 Subject: [PATCH 10/15] fix(engine/web): types --- src/engine/native/web/server/tsconfig.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/engine/native/web/server/tsconfig.json b/src/engine/native/web/server/tsconfig.json index 058e9acdd..677091beb 100644 --- a/src/engine/native/web/server/tsconfig.json +++ b/src/engine/native/web/server/tsconfig.json @@ -1,10 +1,8 @@ { "extends": "../../../../../tsconfig.json", "include": ["src", "**/*.json"], - "exclude": ["../../../../../build/**/*", "@types"], "compilerOptions": { "declarationDir": "./@types", - "emitDeclarationOnly": true, - "rootDir": "." + "emitDeclarationOnly": true } } From 5689e7fb2691bad8cc5fa0d992bb0bd4eba8f3d2 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Sun, 19 Jan 2025 23:34:40 +0100 Subject: [PATCH 11/15] add engine build outputs to @types when webpack bundles the engine it inevitably produces ts->js outputs, i'm saving those to types, so that they get ignored during the pipeline --- src/engine/native/node/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/native/node/tsconfig.json b/src/engine/native/node/tsconfig.json index 5d32aae5f..8101393cf 100644 --- a/src/engine/native/node/tsconfig.json +++ b/src/engine/native/node/tsconfig.json @@ -3,6 +3,7 @@ "include": ["./**/*"], "compilerOptions": { "declarationDir": "./@types", + "outDir": "./@types", "emitDeclarationOnly": true } } From 26beef803557423e2b044bcc2e6b3e52dba51908 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 20 Jan 2025 10:28:37 +0100 Subject: [PATCH 12/15] fix merge conflict --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index c2b4ff483..a55cd9603 100644 --- a/package.json +++ b/package.json @@ -50,12 +50,8 @@ "dev-ms-old-iam": "cd src/management-system && yarn web:dev-iam", "dev-web": "yarn build && cd src/engine/native/web/server && yarn serve", "dev-many": "node src/engine/e2e_tests/process/deployment/startEngines.js", -<<<<<<< HEAD "build": "cd src/engine/native/node && webpack --config webpack.native.config.js && webpack --config webpack.injector.config.ts && ts-node ./build-injector.js && cd ../../universal && NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.universal.config.js", "build-engine-types": "turbo build --filter \"./src/engine/**/\"", -======= - "build": "cd src/engine/native/node && webpack --config webpack.native.config.js && webpack --config webpack.injector.config.ts && cd ../../universal && NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.universal.config.js", ->>>>>>> origin/main "build-ms": "cd src/management-system-v2 && yarn build", "build-web": "yarn build && cd src/engine/native/web/server && yarn build", "docker:run": "docker container run --publish 33029:33029 --rm --network host --detach --name engine proceed/engine:latest", From aa0d34e322bf545a02f4e4e4368051520cd249d9 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 20 Jan 2025 10:38:30 +0100 Subject: [PATCH 13/15] correct build script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a55cd9603..5e6dbd979 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "dev-ms-old-iam": "cd src/management-system && yarn web:dev-iam", "dev-web": "yarn build && cd src/engine/native/web/server && yarn serve", "dev-many": "node src/engine/e2e_tests/process/deployment/startEngines.js", - "build": "cd src/engine/native/node && webpack --config webpack.native.config.js && webpack --config webpack.injector.config.ts && ts-node ./build-injector.js && cd ../../universal && NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.universal.config.js", + "build": "cd src/engine/native/node && webpack --config webpack.native.config.js && webpack --config webpack.injector.config.ts && cd ../../universal && NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.universal.config.js", "build-engine-types": "turbo build --filter \"./src/engine/**/\"", "build-ms": "cd src/management-system-v2 && yarn build", "build-web": "yarn build && cd src/engine/native/web/server && yarn build", From 573516db5cb0832e03be331b6c989a2c279671e7 Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Mon, 20 Jan 2025 11:22:04 +0100 Subject: [PATCH 14/15] fix: remove vm2 --- .../native/node/native-vm2/package.json | 21 ------------------- .../native/node/native-vm2/tsconfig.json | 8 ------- 2 files changed, 29 deletions(-) delete mode 100644 src/engine/native/node/native-vm2/package.json delete mode 100644 src/engine/native/node/native-vm2/tsconfig.json diff --git a/src/engine/native/node/native-vm2/package.json b/src/engine/native/node/native-vm2/package.json deleted file mode 100644 index cab8d8eaf..000000000 --- a/src/engine/native/node/native-vm2/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@proceed/native-vm2", - "version": "1.0.0", - "description": "Native module that provides a vm2 script executor for the engine.", - "main": "./src/index.js", - "types": "./@types/index.d.ts", - "author": "PROCEED Project", - "license": "MIT", - "dependencies": { - "@proceed/native-module": "^1.0.0", - "vm2": "^3.8.4", - "neo-bpmn-engine": "^8.2.2" - }, - "devDependencies": { - "@proceed/core": "^1.0.0" - }, - "scripts": { - "build": "tsc", - "dev": "tsc --watch" - } -} diff --git a/src/engine/native/node/native-vm2/tsconfig.json b/src/engine/native/node/native-vm2/tsconfig.json deleted file mode 100644 index e012518ad..000000000 --- a/src/engine/native/node/native-vm2/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../../../../tsconfig.json", - "include": ["./**/*"], - "compilerOptions": { - "declarationDir": "./@types", - "emitDeclarationOnly": true - } -} From 899e73bf0ee76495cac61e1fd614357aa7e4dcff Mon Sep 17 00:00:00 2001 From: Felipe Trost Date: Tue, 21 Jan 2025 18:02:52 +0100 Subject: [PATCH 15/15] fix: build outputs unexpected dist folder --- src/engine/universal/webpack.universal.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/universal/webpack.universal.config.js b/src/engine/universal/webpack.universal.config.js index af5a5513c..4b291497c 100644 --- a/src/engine/universal/webpack.universal.config.js +++ b/src/engine/universal/webpack.universal.config.js @@ -21,7 +21,7 @@ module.exports = { loader: 'ts-loader', options: { compilerOptions: { - emitDeclarationOnly: false, + outDir: '@types', // do to the tsconfigs ts-loader inevitably emits js files, we put them in the @types so that they are ignored }, }, },