Skip to content

Commit

Permalink
feat: dev-lib tsc that runs tsc in all available folders
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Aug 3, 2024
1 parent fbfadd6 commit 551da4e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 50 deletions.
12 changes: 11 additions & 1 deletion src/bin/dev-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ const commands: (Command | Separator)[] = [
desc: 'Clean ./dist and ./dist-esm, then run "tsc" in CJS and ESM modes.',
cliOnly: true,
},
{
name: 'tsc',
fn: tscAll,
desc: 'Run tsc in folders (src, scripts, e2e, playwright) if there is tsconfig.json present',
},
{ name: 'bt', fn: bt, desc: 'Build & Test: run "build" and then "test".' },
{ name: 'lbt', fn: lbt, desc: 'Lint/Build/Test: run "lint", then "build", then "test".' },
new Separator(), // test
Expand Down Expand Up @@ -144,10 +149,15 @@ async function lbt(): Promise<void> {
}

async function bt(): Promise<void> {
await runTSCInFolders(['.', 'scripts'], ['--noEmit'])
await tscAll()
runJest()
}

async function tscAll(): Promise<void> {
// todo: remove playwright after it fully moves to e2e
await runTSCInFolders(['.', 'scripts', 'e2e', 'playwright'], ['--noEmit'])
}

function logEnvironment(): void {
const { CPU_LIMIT, NODE_OPTIONS = 'not defined' } = process.env
const { node } = process.versions
Expand Down
98 changes: 49 additions & 49 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -934,17 +934,17 @@
typescript "^5.0.2"

"@naturalcycles/js-lib@^14.0.0", "@naturalcycles/js-lib@^14.244.0":
version "14.247.1"
resolved "https://registry.yarnpkg.com/@naturalcycles/js-lib/-/js-lib-14.247.1.tgz#8fcde16485d676b06ec782c57fa7799bbbb5cc87"
integrity sha512-pyeFVxLktIF888PHeAHJoympEADQGCpN+5WKwsl9ERtr0N5UClCFLTvaWF1N5RLF0WXNuXSecDQ80pXlNgmYtA==
version "14.249.0"
resolved "https://registry.yarnpkg.com/@naturalcycles/js-lib/-/js-lib-14.249.0.tgz#0d98397aeb438caa71289df23319c5bbd681e616"
integrity sha512-0sTAaLPCnHFkXu1KCRgHmupJHA6brK2usSFp7OWQJEWZQkjhD66Fv8WJiKrLC/97z6K3xrX8S3B6pzOObWs/Ug==
dependencies:
tslib "^2.0.0"
zod "^3.20.2"

"@naturalcycles/nodejs-lib@^13.0.1":
version "13.31.1"
resolved "https://registry.yarnpkg.com/@naturalcycles/nodejs-lib/-/nodejs-lib-13.31.1.tgz#4db32e7bac621f6d2179e439bb3480315178f353"
integrity sha512-RMyACm18PJTJUTAcRtGUe7huVLfSWqvsA75IJ/3cXGOryVVAbAAtj9wn4ZYJwRdLP/bJWglCrYlthu8G+/kb3Q==
version "13.32.0"
resolved "https://registry.yarnpkg.com/@naturalcycles/nodejs-lib/-/nodejs-lib-13.32.0.tgz#5bde75eb20cd521b203bb6022e4f6171e2f0349d"
integrity sha512-NorY8F9PS2S7wpzyh7novBh1KhcH/43OPzCubmZfl7/kICtW2kJmkbWs60OmoHVloNcJibwsKEXBBuNLz0P2dg==
dependencies:
"@naturalcycles/js-lib" "^14.244.0"
"@types/js-yaml" "^4.0.9"
Expand Down Expand Up @@ -1146,11 +1146,11 @@
"@types/node" "*"

"@types/node@*", "@types/node@^22.0.0":
version "22.0.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.0.2.tgz#9fb1a2b31970871e8bf696f0e8a40d2e6d2bd04e"
integrity sha512-yPL6DyFwY5PiMVEwymNeqUTKsDczQBJ/5T7W/46RwLU/VH+AA8aT5TZkvBviLKLbbm0hlfftEkGrNzfRk/fofQ==
version "22.1.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.1.0.tgz#6d6adc648b5e03f0e83c78dc788c2b037d0ad94b"
integrity sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==
dependencies:
undici-types "~6.11.1"
undici-types "~6.13.0"

"@types/normalize-package-data@^2.4.0":
version "2.4.4"
Expand Down Expand Up @@ -1655,13 +1655,13 @@ braces@^3.0.3:
fill-range "^7.1.1"

browserslist@^4.23.0, browserslist@^4.23.1:
version "4.23.2"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed"
integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==
version "4.23.3"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.3.tgz#debb029d3c93ebc97ffbc8d9cbb03403e227c800"
integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==
dependencies:
caniuse-lite "^1.0.30001640"
electron-to-chromium "^1.4.820"
node-releases "^2.0.14"
caniuse-lite "^1.0.30001646"
electron-to-chromium "^1.5.4"
node-releases "^2.0.18"
update-browserslist-db "^1.1.0"

bs-logger@0.x:
Expand Down Expand Up @@ -1719,10 +1719,10 @@ camelcase@^6.2.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001640:
version "1.0.30001645"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001645.tgz#4c4b7427683dea1170a152cd1654be8d0da7bd71"
integrity sha512-GFtY2+qt91kzyMk6j48dJcwJVq5uTkk71XxE3RtScx7XWRLsO7bU44LOFkOZYR8w9YMS0UhPSYpN/6rAMImmLw==
caniuse-lite@^1.0.30001646:
version "1.0.30001647"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001647.tgz#56d58c5a4ef72913a4465f9766af895a4ead0165"
integrity sha512-n83xdNiyeNcHpzWY+1aFbqCK7LuLfBricc4+alSQL2Xb6OR3XpnQAmlDG+pQcdTfiHRuLcQ96VOfrPSGiNJYSg==

chalk@^2.4.2:
version "2.4.2"
Expand Down Expand Up @@ -2021,7 +2021,7 @@ debug@^3.2.7:
dependencies:
ms "^2.1.1"

debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.6, debug@~4.3.4:
debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.3.6, debug@~4.3.6:
version "4.3.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b"
integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==
Expand Down Expand Up @@ -2116,7 +2116,7 @@ ejs@^3.1.10:
dependencies:
jake "^10.8.5"

electron-to-chromium@^1.4.820:
electron-to-chromium@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz#cd477c830dd6fca41fbd5465c1ff6ce08ac22343"
integrity sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==
Expand Down Expand Up @@ -2326,9 +2326,9 @@ eslint-plugin-jest@^28.0.0:
"@typescript-eslint/utils" "^6.0.0 || ^7.0.0"

eslint-plugin-jsdoc@^48.0.1:
version "48.10.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.10.2.tgz#dd3fb8b8d4c6a0add3191b7f00b32a1e1ca7880d"
integrity sha512-xTkf/MmEeVrTbezc6kDqCJmK9RcseIKo8X4oyoDCMvV4LY8dqrQi8kmfRrv9n0gNBkCclevaOh2Lkmu6Fs8SLg==
version "48.11.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.11.0.tgz#7c8dae6ce0d814aff54b87fdb808f02635691ade"
integrity sha512-d12JHJDPNo7IFwTOAItCeJY1hcqoIxE0lHA8infQByLilQ9xkqrRa6laWCnsuCrf+8rUnvxXY1XuTbibRBNylA==
dependencies:
"@es-joy/jsdoccomment" "~0.46.0"
are-docs-informative "^0.0.2"
Expand Down Expand Up @@ -2860,9 +2860,9 @@ globals@^14.0.0:
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==

globals@^15.7.0, globals@^15.8.0:
version "15.8.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.8.0.tgz#e64bb47b619dd8cbf32b3c1a0a61714e33cbbb41"
integrity sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==
version "15.9.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.9.0.tgz#e9de01771091ffbc37db5714dab484f9f69ff399"
integrity sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==

globalthis@^1.0.3:
version "1.0.4"
Expand Down Expand Up @@ -3856,7 +3856,7 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"

lilconfig@~3.1.1:
lilconfig@~3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.2.tgz#e4a7c3cb549e3a606c8dcc32e5ae1005e62c05cb"
integrity sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==
Expand All @@ -3867,22 +3867,22 @@ lines-and-columns@^1.1.6:
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

lint-staged@^15.0.1:
version "15.2.7"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.7.tgz#97867e29ed632820c0fb90be06cd9ed384025649"
integrity sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==
version "15.2.8"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.8.tgz#5e19eb7b4dbb922f56fafb4635b44ee3c92f7322"
integrity sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==
dependencies:
chalk "~5.3.0"
commander "~12.1.0"
debug "~4.3.4"
debug "~4.3.6"
execa "~8.0.1"
lilconfig "~3.1.1"
listr2 "~8.2.1"
lilconfig "~3.1.2"
listr2 "~8.2.4"
micromatch "~4.0.7"
pidtree "~0.6.0"
string-argv "~0.3.2"
yaml "~2.4.2"
yaml "~2.5.0"

listr2@~8.2.1:
listr2@~8.2.4:
version "8.2.4"
resolved "https://registry.yarnpkg.com/listr2/-/listr2-8.2.4.tgz#486b51cbdb41889108cb7e2c90eeb44519f5a77f"
integrity sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==
Expand Down Expand Up @@ -4174,7 +4174,7 @@ node-int64@^0.4.0:
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==

node-releases@^2.0.14:
node-releases@^2.0.18:
version "2.0.18"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f"
integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==
Expand Down Expand Up @@ -5207,9 +5207,9 @@ ts-api-utils@^1.3.0:
integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==

ts-jest@^29.0.0:
version "29.2.3"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.3.tgz#3d226ac36b8b820151a38f164414f9f6b412131f"
integrity sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ==
version "29.2.4"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.4.tgz#38ccf487407d7a63054a72689f6f99b075e296e5"
integrity sha512-3d6tgDyhCI29HlpwIq87sNuI+3Q6GLTTCeYRHCs7vDz+/3GCMwEtV9jezLyl4ZtnBgx00I7hm8PCP8cTksMGrw==
dependencies:
bs-logger "0.x"
ejs "^3.1.10"
Expand Down Expand Up @@ -5360,10 +5360,10 @@ unbox-primitive@^1.0.2:
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10"
integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==

undici-types@~6.11.1:
version "6.11.1"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.11.1.tgz#432ea6e8efd54a48569705a699e62d8f4981b197"
integrity sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==
undici-types@~6.13.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.13.0.tgz#e3e79220ab8c81ed1496b5812471afd7cf075ea5"
integrity sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==

unicorn-magic@^0.1.0:
version "0.1.0"
Expand Down Expand Up @@ -5551,10 +5551,10 @@ yallist@^3.0.2:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

yaml@~2.4.2:
version "2.4.5"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.5.tgz#60630b206dd6d84df97003d33fc1ddf6296cca5e"
integrity sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==
yaml@~2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.0.tgz#c6165a721cf8000e91c36490a41d7be25176cf5d"
integrity sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==

yargs-parser@^21.0.1, yargs-parser@^21.1.1:
version "21.1.1"
Expand Down

0 comments on commit 551da4e

Please sign in to comment.