diff --git a/backend/package.json b/backend/package.json index a47cf2102b57..a6d65ea692ed 100644 --- a/backend/package.json +++ b/backend/package.json @@ -81,13 +81,13 @@ "@vitest/coverage-v8": "4.1.5", "concurrently": "8.2.2", "openapi3-ts": "2.0.2", - "oxlint": "1.73.0", + "oxlint": "1.74.0", "oxlint-tsgolint": "0.24.0", "readline-sync": "1.4.10", "supertest": "7.1.4", "testcontainers": "11.11.0", "tsx": "4.21.0", - "typescript": "6.0.2", + "typescript": "7.0.2", "vitest": "4.1.0", "yaml": "2.8.2" }, diff --git a/frontend/package.json b/frontend/package.json index bd52eaa7aa61..37b36a60d5e3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -110,7 +110,7 @@ "madge": "8.0.0", "magic-string": "0.30.17", "normalize.css": "8.0.1", - "oxlint": "1.73.0", + "oxlint": "1.74.0", "oxlint-tsgolint": "0.24.0", "postcss": "8.5.15", "sass": "1.70.0", @@ -119,7 +119,7 @@ "subset-font": "2.3.0", "tailwindcss": "4.3.2", "tsx": "4.21.0", - "typescript": "6.0.2", + "typescript": "7.0.2", "unplugin-inject-preload": "3.0.0", "vite": "8.0.5", "vite-bundle-visualizer": "1.2.1", diff --git a/frontend/scripts/import-tree.ts b/frontend/scripts/import-tree.ts index 9ef29535aa72..20c8212b40cf 100644 --- a/frontend/scripts/import-tree.ts +++ b/frontend/scripts/import-tree.ts @@ -1,6 +1,5 @@ import fs from "node:fs"; import path from "node:path"; -import ts from "typescript"; const ROOT = path.resolve(import.meta.dirname, ".."); @@ -50,35 +49,19 @@ if (entryPoints.length === 0) { process.exit(1); } -// --- Import extraction (type-aware) --- - -const tsConfig: ts.CompilerOptions = { - module: ts.ModuleKind.ESNext, - target: ts.ScriptTarget.ESNext, - jsx: ts.JsxEmit.Preserve, - sourceMap: false, - declaration: false, - isolatedModules: true, -}; +// --- Import extraction --- +// Matches value `import`/`export ... from` statements and side-effect imports. +// `import type ...` / `export type ...` don't match (the `type` keyword sits +// where the specifier list or quote is expected), so type-only imports are +// excluded — which is what we want for a runtime dependency graph. const JS_IMPORT_RE = /(?:import|export)\s+(?:(?:\{[^}]*\}|[\w*]+(?:\s*,\s*\{[^}]*\})?)\s+from\s+)?["']([^"']+)["']/g; function extractImports(filePath: string): string[] { const content = fs.readFileSync(filePath, "utf-8"); - let outputText: string; - try { - ({ outputText } = ts.transpileModule(content, { - compilerOptions: tsConfig, - fileName: filePath, - })); - } catch { - // Some files (e.g. declaration files) can't be transpiled — fall back to - // regex on the original source, which still strips type-only imports. - outputText = content; - } const specifiers: string[] = []; - for (const match of outputText.matchAll(JS_IMPORT_RE)) { + for (const match of content.matchAll(JS_IMPORT_RE)) { const spec = match[1]; if (spec !== undefined) specifiers.push(spec); } diff --git a/frontend/src/html/pages/test.html b/frontend/src/html/pages/test.html index a4e0c0482850..040345d69fc3 100644 --- a/frontend/src/html/pages/test.html +++ b/frontend/src/html/pages/test.html @@ -15,10 +15,7 @@
- +
Time left to memorise all words: 0s
Time left to memorise all words: 0s
diff --git a/frontend/src/html/popups.html b/frontend/src/html/popups.html index c09badc2912d..f3eb659002a5 100644 --- a/frontend/src/html/popups.html +++ b/frontend/src/html/popups.html @@ -7,35 +7,6 @@
- -