diff --git a/.gitignore b/.gitignore index a73163a1..a06be01f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ coverage/ npm-debug.log yarn-error.log .DS_Store +**/*.tsbuildinfo \ No newline at end of file diff --git a/package.json b/package.json index cbf10118..2521857e 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "private": true, "scripts": { - "prepare": "lerna run prepare", + "prepare": "yarn run clean && yarn run build", "clean": "lerna run clean", - "build": "lerna run build", + "build": "tsc --build tsconfig.build.json && yarn --cwd examples build", + "watch": "concurrently -n sprotty,examples -c blue,green, \"yarn --cwd examples watch\" \"tsc -b tsconfig.build.json -w\"", "lint": "eslint {**/src/**/*.ts,**/src/**/*.tsx}", "lint:fix": "eslint {**/src/**/*.ts,**/src/**/*.tsx} --fix", "test": "vitest run", @@ -16,6 +17,7 @@ "@typescript-eslint/eslint-plugin": "^6.10.0", "@typescript-eslint/parser": "^6.10.0", "eslint": "^8.53.0", + "concurrently": "~8.2.1", "eslint-config-prettier": "^9.0.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-no-null": "^1.0.2", diff --git a/packages/generator-sprotty/package.json b/packages/generator-sprotty/package.json index 1df61344..da616476 100644 --- a/packages/generator-sprotty/package.json +++ b/packages/generator-sprotty/package.json @@ -38,7 +38,6 @@ "yeoman-test": "^7.4.0" }, "scripts": { - "prepare": "yarn run clean && yarn run build", "clean": "rimraf app", "build": "tsc --skipLibCheck", "watch": "tsc --watch --skipLibCheck", diff --git a/packages/generator-sprotty/tsconfig.json b/packages/generator-sprotty/tsconfig.json index 817b3857..98f2c485 100644 --- a/packages/generator-sprotty/tsconfig.json +++ b/packages/generator-sprotty/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "app" + "rootDir": "src", + "outDir": "app", + "composite": true }, "include": [ "src" diff --git a/packages/sprotty-elk/package.json b/packages/sprotty-elk/package.json index e62f6331..89d4f985 100644 --- a/packages/sprotty-elk/package.json +++ b/packages/sprotty-elk/package.json @@ -28,8 +28,7 @@ "inversify": "^6.0.1" }, "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "rimraf lib artifacts", + "clean": "rimraf lib artifacts tsconfig.tsbuildinfo", "build": "tsc -p ./tsconfig.json", "test": "vitest run --config ../../vite.config.ts", "watch": "tsc -w -p ./tsconfig.json" diff --git a/packages/sprotty-elk/tsconfig.json b/packages/sprotty-elk/tsconfig.json index c045697f..5c828aca 100644 --- a/packages/sprotty-elk/tsconfig.json +++ b/packages/sprotty-elk/tsconfig.json @@ -1,10 +1,12 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "rootDir": "src", "outDir": "lib", "types": [ "node" - ] + ], + "composite": true }, "include": [ "src" @@ -12,5 +14,9 @@ "exclude": [ "**/*.spec.ts", "**/*.spec.tsx" + ], + "references": [ + { "path": "../sprotty-protocol/tsconfig.json"}, + { "path": "../sprotty/tsconfig.json" } ] } \ No newline at end of file diff --git a/packages/sprotty-protocol/package.json b/packages/sprotty-protocol/package.json index dbe27309..c6f23fcc 100644 --- a/packages/sprotty-protocol/package.json +++ b/packages/sprotty-protocol/package.json @@ -23,8 +23,7 @@ }, "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "rimraf lib artifacts", + "clean": "rimraf lib artifacts tsconfig.tsbuildinfo", "build": "tsc -p ./tsconfig.json", "test": "vitest run --config ../../vite.config.ts", "watch": "tsc -w -p ./tsconfig.json" diff --git a/packages/sprotty-protocol/tsconfig.json b/packages/sprotty-protocol/tsconfig.json index 9f98a077..070f9ce3 100644 --- a/packages/sprotty-protocol/tsconfig.json +++ b/packages/sprotty-protocol/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "lib" + "rootDir": "src", + "outDir": "lib", + "composite": true }, "include": [ "src" diff --git a/packages/sprotty/package.json b/packages/sprotty/package.json index 64bd7ecf..415aa57f 100644 --- a/packages/sprotty/package.json +++ b/packages/sprotty/package.json @@ -37,8 +37,7 @@ "snabbdom-to-html": "^7.1.0" }, "scripts": { - "prepare": "yarn run clean && yarn run build", - "clean": "rimraf lib artifacts", + "clean": "rimraf lib artifacts tsconfig.tsbuildinfo", "build": "tsc -p ./tsconfig.json", "test": "vitest run --config ../../vite.config.ts", "watch": "tsc -w -p ./tsconfig.json" diff --git a/packages/sprotty/tsconfig.json b/packages/sprotty/tsconfig.json index c3247b30..5ff721b3 100644 --- a/packages/sprotty/tsconfig.json +++ b/packages/sprotty/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "lib" + "rootDir": "src", + "outDir": "lib", + "composite": true }, "include": [ "src" @@ -9,5 +11,8 @@ "exclude": [ "**/*.spec.ts", "**/*.spec.tsx", + ], + "references": [ + { "path": "../sprotty-protocol/tsconfig.json" } ] } \ No newline at end of file diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..133ed7cb --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "files": [], + "references": [ + { "path": "./packages/sprotty-protocol/tsconfig.json" }, + { "path": "./packages/sprotty/tsconfig.json" }, + { "path": "./packages/sprotty-elk/tsconfig.json" }, + { "path": "./packages/generator-sprotty/tsconfig.json" }, + ] +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 215fc39b..b7d20fe4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -37,6 +37,13 @@ chalk "^2.4.2" js-tokens "^4.0.0" +"@babel/runtime@^7.21.0": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" + integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== + dependencies: + regenerator-runtime "^0.14.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -2076,6 +2083,21 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" +concurrently@~8.2.1: + version "8.2.2" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-8.2.2.tgz#353141985c198cfa5e4a3ef90082c336b5851784" + integrity sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg== + dependencies: + chalk "^4.1.2" + date-fns "^2.30.0" + lodash "^4.17.21" + rxjs "^7.8.1" + shell-quote "^1.8.1" + spawn-command "0.0.2" + supports-color "^8.1.1" + tree-kill "^1.2.2" + yargs "^17.7.2" + console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -2234,6 +2256,13 @@ dargs@^7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== +date-fns@^2.30.0: + version "2.30.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" + integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== + dependencies: + "@babel/runtime" "^7.21.0" + dateformat@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -5306,6 +5335,11 @@ reflect-metadata@^0.1.13: resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5402,7 +5436,7 @@ rxjs@^6.4.0: dependencies: tslib "^1.9.0" -rxjs@^7.2.0, rxjs@^7.5.5: +rxjs@^7.2.0, rxjs@^7.5.5, rxjs@^7.8.1: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== @@ -5517,6 +5551,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shell-quote@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" + integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== + shelljs@^0.8.5: version "0.8.5" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" @@ -5659,6 +5698,11 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +spawn-command@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" + integrity sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ== + spdx-correct@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" @@ -5841,7 +5885,7 @@ supports-color@^7.1.0, supports-color@^7.2.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0: +supports-color@^8.0.0, supports-color@^8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -6012,6 +6056,11 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" @@ -6552,7 +6601,7 @@ yargs@16.2.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.6.2: +yargs@^17.6.2, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==