From c43d2dab0c22b95c43a3987ccadc4ccfc9f33b93 Mon Sep 17 00:00:00 2001 From: Venryx Date: Mon, 17 Jun 2024 13:06:36 -0700 Subject: [PATCH] * Added wvc.tsc script. (helpful for external users of "web-vcore" package) --- Packages/.vscode/tasks.json | 23 ++++++++++++++++++++++- Packages/web-vcore/package.json | 3 ++- package-scripts.js | 8 ++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Packages/.vscode/tasks.json b/Packages/.vscode/tasks.json index 00ce7f9f9..ec93423d1 100644 --- a/Packages/.vscode/tasks.json +++ b/Packages/.vscode/tasks.json @@ -8,7 +8,7 @@ //"problemMatcher": "$tsc-watch", // The below are needed so that tsc's errors (as shown in Terminal and Problems panels) are resolved properly. (caused by our unusual usage, of opening vscode window #1 in "./Packages") - // It's needed here only because tsc requires working directly to be "./Packages/client". (because it doesn't allow specifying both "--build" and "--project") + // It's needed here only because tsc requires working directory to be "./Packages/client". (because it doesn't allow specifying both "--build" and "--project") "options": { "cwd": "${workspaceRoot}/client" }, @@ -80,5 +80,26 @@ "isBackground": true, "group": "build" }, + + // wvc + { + "label": "wvc.tsc (for external wvc users)", + "type": "shell", + "command": "npm start wvc.tsc", + + //"problemMatcher": "$tsc-watch", + // The below are needed so that tsc's errors (as shown in Terminal and Problems panels) are resolved properly. (caused by our unusual usage, of opening vscode window #1 in "./Packages") + // It's needed here only because tsc requires working directory to be "./Packages/client". (because it doesn't allow specifying both "--build" and "--project") + "options": { + "cwd": "${workspaceRoot}/web-vcore" + }, + "problemMatcher": { + "base": "$tsc-watch", + "fileLocation": ["relative", "${workspaceRoot}/web-vcore"] + }, + + "isBackground": true, + "group": "build" + }, ] } \ No newline at end of file diff --git a/Packages/web-vcore/package.json b/Packages/web-vcore/package.json index 9afd2c4f9..2e617fe3e 100644 --- a/Packages/web-vcore/package.json +++ b/Packages/web-vcore/package.json @@ -23,6 +23,7 @@ ".yalc" ], "scripts": { + "start": "cd ../.. && npx nps", "@comment_postinstall": "Behavior of the node-js subscript below: if '.git' doesn't exist under web-vcore, it's installed as a dep, so do nothing -- else, return error-code 1, causing patch-package to run.", "postinstall_old": "node -e \"let wvcAsDep = !require('fs').existsSync('.git'); if (!wvcAsDep) process.exit(1);\" || patch-package", "postinstall_old2": "node ./Scripts/@CJS/ApplyPatches.js", @@ -101,7 +102,7 @@ "html-webpack-plugin": "5.6.0", "immer": "^7.0.7", "ip": "^1.1.5", - "js-vextensions": "1.0.77", + "js-vextensions": "1.0.78", "lodash": "^4.17.15", "mini-css-extract-plugin": "^1.6.0", "mobx": "^6.3.2", diff --git a/package-scripts.js b/package-scripts.js index 81ce6da86..db8e0f3ee 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -88,6 +88,14 @@ Object.assign(scripts, { }, }); +// these scripts are currently only needed when working on external (ie. non-debate-map) projects that user the web-vcore package +Object.assign(scripts, { + wvc: { + tsc: `cd Packages/web-vcore && ${pathToNPMBin("tsc", 2)} --build --watch`, + tsc_noWatch: `cd Packages/web-vcore && ${pathToNPMBin("tsc", 2)} --build`, + }, +}); + const appNamespace = "default"; //"app"; const KubeCTLCmd = context=>`kubectl${context ? ` --context ${context}` : ""}`; const GetPodInfos = (context = "", namespace = "", requiredLabels = [], filterOutNonRunning = true)=>{