From 79e85933f4cc303e5cff34d39e7224dfeef70936 Mon Sep 17 00:00:00 2001 From: Paul Amoah <51966806+paglobal@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:52:55 +0000 Subject: [PATCH] Add support for typescript 5.2 in lit-analyzer tests (#324) --- packages/lit-analyzer/package-lock.json | 21 +++++++++++++++++++ packages/lit-analyzer/package.json | 3 ++- .../lit-analyzer/src/test/helpers/ts-test.ts | 5 +++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/packages/lit-analyzer/package-lock.json b/packages/lit-analyzer/package-lock.json index abc3eb2a..40713b6d 100644 --- a/packages/lit-analyzer/package-lock.json +++ b/packages/lit-analyzer/package-lock.json @@ -32,6 +32,7 @@ "typescript-4.8": "npm:typescript@~4.8.2", "typescript-5.0": "npm:typescript@~5.0.4", "typescript-5.1": "npm:typescript@~5.1.0", + "typescript-5.2": "npm:typescript@~5.2.0", "wireit": "^0.9.5" } }, @@ -3681,6 +3682,20 @@ "node": ">=14.17" } }, + "node_modules/typescript-5.2": { + "name": "typescript", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", @@ -6863,6 +6878,12 @@ "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", "dev": true }, + "typescript-5.2": { + "version": "npm:typescript@5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true + }, "unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", diff --git a/packages/lit-analyzer/package.json b/packages/lit-analyzer/package.json index ac82b34a..3cb04673 100644 --- a/packages/lit-analyzer/package.json +++ b/packages/lit-analyzer/package.json @@ -86,6 +86,7 @@ "cli.js" ], "dependencies": { + "@vscode/web-custom-data": "^0.4.2", "chalk": "^2.4.2", "didyoumean2": "4.1.0", "fast-glob": "^3.2.11", @@ -93,7 +94,6 @@ "ts-simple-type": "~2.0.0-next.0", "vscode-css-languageservice": "4.3.0", "vscode-html-languageservice": "3.1.0", - "@vscode/web-custom-data": "^0.4.2", "web-component-analyzer": "^2.0.0-next.5" }, "devDependencies": { @@ -106,6 +106,7 @@ "typescript-4.8": "npm:typescript@~4.8.2", "typescript-5.0": "npm:typescript@~5.0.4", "typescript-5.1": "npm:typescript@~5.1.0", + "typescript-5.2": "npm:typescript@~5.2.0", "wireit": "^0.9.5" }, "ava": { diff --git a/packages/lit-analyzer/src/test/helpers/ts-test.ts b/packages/lit-analyzer/src/test/helpers/ts-test.ts index 5b6f6faf..bb4978e9 100644 --- a/packages/lit-analyzer/src/test/helpers/ts-test.ts +++ b/packages/lit-analyzer/src/test/helpers/ts-test.ts @@ -5,11 +5,11 @@ import { setTypescriptModule } from "../../lib/analyze/ts-module.js"; type TestFunction = (title: string, implementation: Implementation) => void; -const TS_MODULES_ALL = ["current", "4.8", "5.0", "5.1"] as const; +const TS_MODULES_ALL = ["current", "4.8", "5.0", "5.1", "5.2"] as const; type TsModuleKind = typeof TS_MODULES_ALL[number]; -const TS_MODULES_DEFAULT: TsModuleKind[] = ["current", "4.8", "5.0", "5.1"]; +const TS_MODULES_DEFAULT: TsModuleKind[] = ["current", "4.8", "5.0", "5.1", "5.2"]; /** * Returns the name of the module to require for a specific ts module kind @@ -21,6 +21,7 @@ function getTsModuleNameWithKind(kind: TsModuleKind | undefined): string { case "4.8": case "5.0": case "5.1": + case "5.2": return `typescript-${kind}`; case "current": case undefined: