From 2a091c555fee54aa3206589ee5392cbee5072f61 Mon Sep 17 00:00:00 2001 From: tristar Date: Sat, 6 May 2023 20:21:56 +0900 Subject: [PATCH 1/2] feat: bump typescript to 4.9.5, to support "satisfies" keyword in test files. also update related packages(babel/parser, babel/types, types/node) --- package.json | 8 ++++---- test/parse.test.ts | 19 +++++++++++++++++++ yarn.lock | 47 ++++++++++++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index f0251749..c7426b42 100644 --- a/package.json +++ b/package.json @@ -164,12 +164,12 @@ "dependencies": {}, "devDependencies": { "@antfu/eslint-config": "^0.23.1", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "@babel/parser": "^7.20.15", + "@babel/types": "^7.20.7", "@rauschma/stringio": "^1.4.0", "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", - "@types/node": "14.x", + "@types/node": "^18.11.18", "@types/semver": "^7.3.9", "@types/vscode": "^1.63.0", "@types/ws": "^8.5.3", @@ -191,7 +191,7 @@ "semver": "^7.3.5", "tree-kill": "^1.2.2", "tsup": "^5.12.7", - "typescript": "^4.5.5", + "typescript": "^4.9.5", "vite": "^2.8.6", "vitest": "latest", "ws": "^8.6.0" diff --git a/test/parse.test.ts b/test/parse.test.ts index a6951b27..2d3432a3 100644 --- a/test/parse.test.ts +++ b/test/parse.test.ts @@ -43,4 +43,23 @@ describe('parse', () => { expect(out.describeBlocks.length).toBe(1) }) + + it('parse satisfies keyword', () => { + const out = parse( + 'x.ts', + '' + + 'type Person = {\n' + + ' name: string\n' + + ' age: number\n' + + '};\n' + + 'describe("satisfies keyword", () => {\n' + + ' const person = {\n' + + ' name: "test",\n' + + ' age: 20\n' + + ' } satisfies Person\n' + + '});\n', + ) + + expect(out.describeBlocks.length).toBe(1) + }) }) diff --git a/yarn.lock b/yarn.lock index e4340caa..08899eac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -73,11 +73,21 @@ dependencies: "@babel/highlight" "^7.16.7" +"@babel/helper-string-parser@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" + integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== + "@babel/helper-validator-identifier@^7.15.7", "@babel/helper-validator-identifier@^7.16.7": version "7.16.7" resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== +"@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + "@babel/highlight@^7.16.7": version "7.17.12" resolved "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.17.12.tgz#257de56ee5afbd20451ac0a75686b6b404257351" @@ -87,17 +97,18 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.17.3": - version "7.17.12" - resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.17.12.tgz#36c2ed06944e3691ba82735fc4cf62d12d491a23" - integrity sha512-FLzHmN9V3AJIrWfOpvRlZCeVg/WLdicSnTMsLur6uDj9TT8ymUlG9XxURdW/XvuygK+2CW0poOJABdA4m/YKxA== +"@babel/parser@^7.20.15": + version "7.21.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" + integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== -"@babel/types@^7.17.0": - version "7.17.12" - resolved "https://registry.npmmirror.com/@babel/types/-/types-7.17.12.tgz#1210690a516489c0200f355d87619157fbbd69a0" - integrity sha512-rH8i29wcZ6x9xjzI5ILHL/yZkbQnCERdHlogKuIb4PUr7do4iT8DPekrTbBLWTnRQm6U0GYABbTMSzijmEqlAg== +"@babel/types@^7.20.7": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.5.tgz#18dfbd47c39d3904d5db3d3dc2cc80bedb60e5b6" + integrity sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q== dependencies: - "@babel/helper-validator-identifier" "^7.16.7" + "@babel/helper-string-parser" "^7.21.5" + "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" "@eslint/eslintrc@^1.2.3": @@ -216,16 +227,16 @@ resolved "https://registry.npmmirror.com/@types/node/-/node-17.0.34.tgz#3b0b6a50ff797280b8d000c6281d229f9c538cef" integrity sha512-XImEz7XwTvDBtzlTnm8YvMqGW/ErMWBsKZ+hMTvnDIjGCKxwK5Xpc+c/oQjOauwq8M4OS11hEkpjX8rrI/eEgA== -"@types/node@14.x": - version "14.18.18" - resolved "https://registry.npmmirror.com/@types/node/-/node-14.18.18.tgz#5c9503030df484ccffcbb935ea9a9e1d6fad1a20" - integrity sha512-B9EoJFjhqcQ9OmQrNorItO+OwEOORNn3S31WuiHvZY/dm9ajkB7AKD/8toessEtHHNL+58jofbq7hMMY9v4yig== - "@types/node@^10.0.3": version "10.17.60" resolved "https://registry.npmmirror.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== +"@types/node@^18.11.18": + version "18.16.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.5.tgz#bf64e42719dc2e74da24709a2e1c0b50a966120a" + integrity sha512-seOA34WMo9KB+UA78qaJoCO20RJzZGVXQ5Sh6FWu0g/hfT44nKXnej3/tCQl7FL97idFpBhisLYCTB50S0EirA== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.npmmirror.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -3067,10 +3078,10 @@ type-fest@^0.8.1: resolved "https://registry.npmmirror.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -typescript@^4.5.5: - version "4.6.4" - resolved "https://registry.npmmirror.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" - integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== +typescript@^4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== unbox-primitive@^1.0.2: version "1.0.2" From 7500fdac0e08762fa632c8351258bdf388183340 Mon Sep 17 00:00:00 2001 From: tristar Date: Sat, 6 May 2023 20:24:19 +0900 Subject: [PATCH 2/2] fix: tsc type error. --- src/pure/ApiProcess.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pure/ApiProcess.ts b/src/pure/ApiProcess.ts index 2e849596..ca9d6761 100644 --- a/src/pure/ApiProcess.ts +++ b/src/pure/ApiProcess.ts @@ -138,8 +138,8 @@ export class ApiProcess { kill() { // Kill using tree-kill to ensure all child processes are killed. // Especially necessary on Windows, due to shell: true being passed to spawn. - if (this.process) - kill(this.process?.pid) + if (this.process && this.process.pid) + kill(this.process.pid) this.handlers.onFinished?.() } @@ -182,8 +182,8 @@ export class ApiProcess { dispose() { this.disposed = true this.vitestState?.client.dispose() - if (this.process) - kill(this.process?.pid) + if (this.process && this.process.pid) + kill(this.process.pid) this.vitestState = undefined this.process = undefined }