diff --git a/.vscode/settings.json b/.vscode/settings.json index 8144fdea..6500d8fa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,7 +20,8 @@ }, "search.exclude": { "**/node_modules": true, - "**/lib": true + "**/lib": true, + "**/.yarn/releases": true }, "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/package.json b/package.json index df835d53..6bbe6aa8 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,7 @@ "prettier": "~3.8.0", "syncpack": "^9.0.0", "ts-jest": "~29.2.5", - "typescript": "~4.5.0", - "workspace-tools": "^0.35.2" + "typescript": "~4.5.0" }, "resolutions": { "es5-ext": "0.10.53", diff --git a/scripts/debugTests.js b/scripts/debugTests.js index 7f1a0eb3..05b34089 100644 --- a/scripts/debugTests.js +++ b/scripts/debugTests.js @@ -1,14 +1,23 @@ // @ts-check +const fs = require('fs'); const jest = require('jest'); -const { findPackageRoot } = require('workspace-tools'); +const path = require('path'); const args = process.argv.slice(2); +function findPackageRoot(/** @type {string} */ cwd) { + let dir = cwd; + while (dir !== path.dirname(dir)) { + if (fs.existsSync(path.join(dir, 'package.json'))) { + return dir; + } + dir = path.dirname(dir); + } + throw new Error("Couldn't find the package root from " + cwd); +} + function start() { const packagePath = findPackageRoot(process.cwd()); - if (!packagePath) { - throw new Error('Could not find package.json relative to ' + process.cwd()); - } process.chdir(packagePath);