From ecc648b71234d5e7de22ad49397cbdb2f2d628aa Mon Sep 17 00:00:00 2001 From: Tobias Ortmayr Date: Wed, 27 Mar 2024 09:50:50 +0100 Subject: [PATCH] GLSP-1179 Switch to composite ts build Part of eclipse-glsp/glsp/issues/1179 --- example/workflow/extension/package.json | 8 +-- example/workflow/extension/tsconfig.json | 11 +++- example/workflow/web-extension/package.json | 8 +-- example/workflow/web-extension/tsconfig.json | 11 +++- example/workflow/webview/package.json | 5 +- example/workflow/webview/tsconfig.json | 8 ++- package.json | 12 ++-- .../vscode-integration-webview/package.json | 2 - .../vscode-integration-webview/tsconfig.json | 8 ++- packages/vscode-integration/package.json | 2 - packages/vscode-integration/tsconfig.json | 3 +- tsconfig.json | 24 ++++++++ yarn.lock | 57 +++++++++++++++++-- 13 files changed, 126 insertions(+), 33 deletions(-) create mode 100644 tsconfig.json diff --git a/example/workflow/extension/package.json b/example/workflow/extension/package.json index b0ed6a5..2989a46 100644 --- a/example/workflow/extension/package.json +++ b/example/workflow/extension/package.json @@ -29,15 +29,15 @@ "dist" ], "scripts": { - "build": "tsc -b && yarn bundle", + "build": "yarn compile && yarn bundle", "bundle": "webpack", "bundle:prod": "webpack --config ./webpack.prod.js", "clean": "rimraf lib tsconfig.tsbuildinfo dist", + "compile": "tsc -b", "lint": "eslint --ext .ts,.tsx ./src", - "lint:ci": "yarn lint -o eslint.xml -f checkstyle", "package": "vsce package --yarn", - "prepare": "yarn clean && yarn build", - "watch": "tsc -w" + "watch": "tsc -w", + "watch:bundle": "webpack --watch" }, "contributes": { "commands": [ diff --git a/example/workflow/extension/tsconfig.json b/example/workflow/extension/tsconfig.json index 63e6763..ab51422 100644 --- a/example/workflow/extension/tsconfig.json +++ b/example/workflow/extension/tsconfig.json @@ -1,9 +1,14 @@ { "extends": "@eclipse-glsp/ts-config", "compilerOptions": { + "composite": true, "rootDir": "src", - "outDir": "lib", - "resolveJsonModule": true + "outDir": "lib" }, - "include": ["src", "server", "dist"] + "include": ["src", "dist"], + "references": [ + { + "path": "../../../packages/vscode-integration" + } + ] } diff --git a/example/workflow/web-extension/package.json b/example/workflow/web-extension/package.json index 16fb523..2964358 100644 --- a/example/workflow/web-extension/package.json +++ b/example/workflow/web-extension/package.json @@ -30,15 +30,15 @@ "dist" ], "scripts": { - "build": "tsc -b && yarn bundle", + "build": "yarn compile && yarn bundle", "bundle": "webpack", "bundle:prod": "webpack --config ./webpack.prod.js", "clean": "rimraf lib tsconfig.tsbuildinfo ", + "compile": "tsc-b", "lint": "eslint --ext .ts,.tsx ./src", - "lint:ci": "yarn lint -o eslint.xml -f checkstyle", "package": "vsce package --yarn", - "prepare": "yarn clean && yarn build", - "watch": "tsc -w" + "watch": "tsc -w", + "watch:bundle": "webpack --watch" }, "contributes": { "commands": [ diff --git a/example/workflow/web-extension/tsconfig.json b/example/workflow/web-extension/tsconfig.json index 898a24b..ab51422 100644 --- a/example/workflow/web-extension/tsconfig.json +++ b/example/workflow/web-extension/tsconfig.json @@ -1,9 +1,14 @@ { "extends": "@eclipse-glsp/ts-config", "compilerOptions": { + "composite": true, "rootDir": "src", - "outDir": "lib", - "resolveJsonModule": true + "outDir": "lib" }, - "include": ["src", "dist"] + "include": ["src", "dist"], + "references": [ + { + "path": "../../../packages/vscode-integration" + } + ] } diff --git a/example/workflow/webview/package.json b/example/workflow/webview/package.json index e591f32..72eb356 100644 --- a/example/workflow/webview/package.json +++ b/example/workflow/webview/package.json @@ -28,13 +28,12 @@ } ], "scripts": { - "build": "tsc -b && yarn bundle", + "build": "yarn compile && yarn bundle", "bundle": "webpack", "bundle:prod": "webpack --config ./webpack.prod.js", "clean": "rimraf lib tsconfig.tsbuildinfo dist", + "compile": "tsc -b", "lint": "eslint --ext .ts,.tsx ./src", - "lint:ci": "yarn lint -o eslint.xml -f checkstyle", - "prepare": "yarn clean && yarn build", "watch": "tsc -w" }, "devDependencies": { diff --git a/example/workflow/webview/tsconfig.json b/example/workflow/webview/tsconfig.json index 2521a40..e2505b7 100644 --- a/example/workflow/webview/tsconfig.json +++ b/example/workflow/webview/tsconfig.json @@ -1,8 +1,14 @@ { "extends": "@eclipse-glsp/ts-config/tsconfig.json", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, - "include": ["src"] + "include": ["src"], + "references": [ + { + "path": "../../../packages/vscode-integration-webview" + } + ] } diff --git a/package.json b/package.json index a5c2fb6..ab1478a 100644 --- a/package.json +++ b/package.json @@ -6,20 +6,21 @@ ], "scripts": { "all": "yarn install && yarn lint", - "build": "lerna run build", + "build": "yarn compile && yarn bundle", "bundle": " lerna run bundle", "bundle:prod": "lerna run bundle:prod", "check:headers": "glsp checkHeaders . -t lastCommit", "check:pr": "yarn all && yarn check:headers", "clean": "lerna run clean && rimraf logs/*.log", - "lint": "lerna run lint", - "lint:ci": "lerna run lint:ci", - "prepare": "lerna run prepare", + "compile": "tsc -b", + "lint": "eslint --ext .ts,.tsx .", + "lint:ci": "yarn lint -o eslint.xml -f checkstyle", + "prepare": "yarn build", "publish:latest": "lerna publish from-git --no-git-reset --no-git-tag-version --no-push", "publish:next": "lerna publish preminor --exact --canary --preid next --dist-tag next --no-git-reset --no-git-tag-version --no-push --ignore-scripts --yes", "publish:prepare": "lerna version --ignore-scripts --yes --no-push", "upgrade:next": "yarn upgrade -p \"@eclipse-glsp.*|sprotty.*\" --next ", - "watch": "lerna run --parallel watch", + "watch": "concurrently --kill-others -n tsc,extension,web-extension -c red,yellow.green \"tsc -b -w --preserveWatchOutput\" \"yarn -s workflow watch:bundle\" \"yarn -s workflow:web watch:bundle\"", "workflow": "yarn --cwd example/workflow/extension", "workflow:web": "yarn --cwd example/workflow/web-extension" }, @@ -27,6 +28,7 @@ "@eclipse-glsp/dev": "2.0.0", "@types/node": "16", "@types/vscode": "^1.54.0", + "concurrently": "^8.2.2", "lerna": "^7.0.0", "typescript": "^5.0.4" }, diff --git a/packages/vscode-integration-webview/package.json b/packages/vscode-integration-webview/package.json index 883d394..dc00507 100644 --- a/packages/vscode-integration-webview/package.json +++ b/packages/vscode-integration-webview/package.json @@ -37,8 +37,6 @@ "build": "tsc -b", "clean": "rimraf lib tsconfig.tsbuildinfo ", "lint": "eslint --ext .ts,.tsx ./src", - "lint:ci": "yarn lint -o eslint.xml -f checkstyle", - "prepare": "yarn clean && yarn build", "watch": "tsc -w" }, "dependencies": { diff --git a/packages/vscode-integration-webview/tsconfig.json b/packages/vscode-integration-webview/tsconfig.json index a3edcd2..bd9bac4 100644 --- a/packages/vscode-integration-webview/tsconfig.json +++ b/packages/vscode-integration-webview/tsconfig.json @@ -1,8 +1,14 @@ { "extends": "@eclipse-glsp/ts-config", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, - "include": ["src"] + "include": ["src"], + "references": [ + { + "path": "../vscode-integration" + } + ] } diff --git a/packages/vscode-integration/package.json b/packages/vscode-integration/package.json index 2975c58..132c278 100644 --- a/packages/vscode-integration/package.json +++ b/packages/vscode-integration/package.json @@ -42,8 +42,6 @@ "build": "tsc -b", "clean": "rimraf lib tsconfig.tsbuildinfo ", "lint": "eslint --ext .ts,.tsx ./src", - "lint:ci": "yarn lint -o eslint.xml -f checkstyle", - "prepare": "yarn clean && yarn build", "watch": "tsc -w" }, "dependencies": { diff --git a/packages/vscode-integration/tsconfig.json b/packages/vscode-integration/tsconfig.json index 2521a40..4268093 100644 --- a/packages/vscode-integration/tsconfig.json +++ b/packages/vscode-integration/tsconfig.json @@ -1,6 +1,7 @@ { - "extends": "@eclipse-glsp/ts-config/tsconfig.json", + "extends": "@eclipse-glsp/ts-config", "compilerOptions": { + "composite": true, "rootDir": "src", "outDir": "lib" }, diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..4766031 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "@eclipse-glsp/ts-config", + "include": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { + "path": "./packages/vscode-integration" + }, + { + "path": "./packages/vscode-integration-webview" + }, + { + "path": "./example/workflow/extension" + }, + { + "path": "./example/workflow/web-extension" + }, + { + "path": "./example/workflow/webview" + } + ] +} diff --git a/yarn.lock b/yarn.lock index f3f163d..6af8034 100644 --- a/yarn.lock +++ b/yarn.lock @@ -160,6 +160,13 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== +"@babel/runtime@^7.21.0": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.1.tgz#431f9a794d173b53720e69a6464abc6f0e2a5c57" + integrity sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" @@ -2016,7 +2023,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2295,6 +2302,21 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" +concurrently@^8.2.2: + 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" @@ -2464,6 +2486,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" @@ -6325,6 +6354,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.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + regexp.prototype.flags@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" @@ -6440,7 +6474,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.5.5: +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== @@ -6591,6 +6625,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" @@ -6757,6 +6796,11 @@ source-map@^0.7.4: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== +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== + spawn-wrap@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" @@ -6978,7 +7022,7 @@ style-loader@^3.3.1: resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.3.tgz#bba8daac19930169c0c9c96706749a597ae3acff" integrity sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw== -supports-color@8.1.1, supports-color@^8.0.0: +supports-color@8.1.1, 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== @@ -7166,6 +7210,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" @@ -7926,7 +7975,7 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.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==