From ca4b7e3f9a2557d1edc42f668857f280fcbb50cc Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sun, 4 Jan 2026 21:42:27 +0000 Subject: [PATCH 1/4] Separated TS settings and TS tools per projects --- .gitignore | 1 + api/tsconfig.json | 6 +++-- core/tsconfig.json | 6 +++-- eslint.config.ts | 15 +++++++++-- extension/tsconfig.json | 7 ++++- loader-tests/tsconfig.json | 6 +++-- nano-staged.json | 13 ++++++---- package.json | 3 +-- pnpm-lock.yaml | 6 ++--- proxy/tsconfig.json | 7 +++-- scripts/check-types.sh | 52 ++++++++++++++++++++++++++++++++++++++ scripts/tsconfig.json | 6 ++++- server/tsconfig.json | 5 +++- tsconfig.json | 19 ++++++++++---- web/package.json | 3 ++- web/tsconfig.json | 4 +++ 16 files changed, 130 insertions(+), 29 deletions(-) create mode 100755 scripts/check-types.sh diff --git a/.gitignore b/.gitignore index a0089d635..7112c33b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ .eslintcache .env +tsconfig.tsbuildinfo diff --git a/api/tsconfig.json b/api/tsconfig.json index f2cdad622..d538e7982 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "../tsconfig.json", - "include": ["**/*.ts", "**/*.cts"], - "exclude": ["dist"] + "compilerOptions": { + "composite": true + }, + "include": ["**/*.ts"] } diff --git a/core/tsconfig.json b/core/tsconfig.json index f2cdad622..d538e7982 100644 --- a/core/tsconfig.json +++ b/core/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "../tsconfig.json", - "include": ["**/*.ts", "**/*.cts"], - "exclude": ["dist"] + "compilerOptions": { + "composite": true + }, + "include": ["**/*.ts"] } diff --git a/eslint.config.ts b/eslint.config.ts index be9ff8b25..b767d7070 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,7 +1,7 @@ import loguxSvelteConfig from '@logux/eslint-config/svelte' import type { Linter } from 'eslint' -export default [ +const config: Linter.Config[] = [ { ignores: [ '*/dist/', @@ -10,7 +10,16 @@ export default [ 'server/web/' ] }, - ...loguxSvelteConfig, + ...loguxSvelteConfig.map(item => { + let parserOptions = item.languageOptions?.parserOptions as + | { project?: unknown; projectService?: boolean } + | undefined + if (parserOptions?.project) { + delete parserOptions.project + parserOptions.projectService = true + } + return item + }), { rules: { '@typescript-eslint/no-base-to-string': 'off', @@ -80,3 +89,5 @@ export default [ } } ] satisfies Linter.Config[] + +export default config diff --git a/extension/tsconfig.json b/extension/tsconfig.json index f2cdad622..4c29fd0f0 100644 --- a/extension/tsconfig.json +++ b/extension/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "../tsconfig.json", - "include": ["**/*.ts", "**/*.cts"], + "compilerOptions": { + "composite": true, + "types": ["chrome", "node"], + "lib": ["ES2024", "DOM"] + }, + "include": ["**/*.ts"], "exclude": ["dist"] } diff --git a/loader-tests/tsconfig.json b/loader-tests/tsconfig.json index f2cdad622..d538e7982 100644 --- a/loader-tests/tsconfig.json +++ b/loader-tests/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "../tsconfig.json", - "include": ["**/*.ts", "**/*.cts"], - "exclude": ["dist"] + "compilerOptions": { + "composite": true + }, + "include": ["**/*.ts"] } diff --git a/nano-staged.json b/nano-staged.json index c0f1d1821..9725af363 100644 --- a/nano-staged.json +++ b/nano-staged.json @@ -1,10 +1,13 @@ { - "*.{html,md,json}": "oxfmt", - "*.{svelte,ts}": "svelte-check", - "*.{js,ts,cjs}": ["oxfmt", "eslint --fix --concurrency auto"], - "*.css": ["oxfmt", "stylelint --fix"], - "*.svelte": [ + "*.{html,md,json,css,js,ts}": "oxfmt", + "*.{svelte,ts}": "sh ./scripts/check-types.sh", + "*.{js,ts}": "eslint --fix --concurrency auto", + "*.css": "stylelint --fix", + "web/*.svelte": [ "node ./web/scripts/check-names.ts", + "svelte-check --tsconfig web/tsconfig.json" + ], + "*.svelte": [ "prettier --experimental-cli --write", "stylelint --fix", "eslint --fix --concurrency auto" diff --git a/package.json b/package.json index d0d458d0c..44e02aaaf 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "format:oxfmt": "oxfmt .", "format:prettier": "prettier --experimental-cli --write **/*.svelte", "test:js": "eslint --concurrency=auto --cache .", - "test:types": "svelte-check", + "test:types": "./scripts/check-types.sh", "test:online:audit": "pnpm audit --prod", "test:focused": "node ./scripts/check-focused-tests.ts", "test:messages": "node ./scripts/check-messages.ts", @@ -58,7 +58,6 @@ "remark-validate-links": "13.1.0", "stylelint": "16.26.1", "svelte": "5.46.1", - "svelte-check": "4.3.5", "svelte-eslint-parser": "1.4.1", "svgo": "4.0.0", "typescript": "5.9.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0be6f945c..bd60d2568 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,9 +98,6 @@ importers: svelte: specifier: 5.46.1 version: 5.46.1 - svelte-check: - specifier: 4.3.5 - version: 4.3.5(picomatch@4.0.3)(svelte@5.46.1)(typescript@5.9.3) svelte-eslint-parser: specifier: 1.4.1 version: 1.4.1(svelte@5.46.1) @@ -415,6 +412,9 @@ importers: stylelint-use-logical: specifier: 2.1.2 version: 2.1.2(stylelint@16.26.1(typescript@5.9.3)) + svelte-check: + specifier: 4.3.5 + version: 4.3.5(picomatch@4.0.3)(svelte@5.46.1)(typescript@5.9.3) packages: diff --git a/proxy/tsconfig.json b/proxy/tsconfig.json index f2cdad622..505999bbb 100644 --- a/proxy/tsconfig.json +++ b/proxy/tsconfig.json @@ -1,5 +1,8 @@ { "extends": "../tsconfig.json", - "include": ["**/*.ts", "**/*.cts"], - "exclude": ["dist"] + "compilerOptions": { + "composite": true + }, + "include": ["**/*.ts"], + "exclude": ["dist/"] } diff --git a/scripts/check-types.sh b/scripts/check-types.sh new file mode 100755 index 000000000..b8e97c18d --- /dev/null +++ b/scripts/check-types.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# Check types separated for each project. If files was passed here +# (e.g. from nano-staged), only related projects will be checked. + +set -e + +# Load projects from pnpm-workspace.yaml and add scripts +ALL_PROJECTS=$(pnpm config get packages --json | grep -o '"[^"]*"' | tr -d '"' | tr '\n' ' ') +ALL_PROJECTS="$ALL_PROJECTS scripts" + +# Function to determine which projects to check based on file paths +get_projects_from_files() { + projects="" + for file in "$@"; do + # Remove leading ./ and extract the first directory component + project=$(echo "$file" | sed 's|^\./||' | cut -d'/' -f1) + + # If file is in root (no directory), use scripts project + if [ "$project" = "$file" ] || [ -z "$project" ]; then + project="scripts" + fi + + if echo "$ALL_PROJECTS" | grep -q "\<$project\>"; then + if ! echo "$projects" | grep -q "\<$project\>"; then + projects="$projects $project" + fi + fi + done + echo "$projects" | sed 's/^ //' +} + +if [ $# -eq 0 ]; then + PROJECTS_TO_CHECK="$ALL_PROJECTS" +else + PROJECTS_TO_CHECK=$(get_projects_from_files "$@") + if [ -z "$PROJECTS_TO_CHECK" ]; then + echo "No valid projects found in provided files" + exit 0 + fi +fi + +for project in $PROJECTS_TO_CHECK; do + if [ "$project" = "web" ]; then + echo "Checking web" + cd web/ + ./node_modules/.bin/svelte-check --workspace web + cd .. + else + echo "Checking $project" + ./node_modules/.bin/tsc --noEmit -p "$project" + fi +done diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index e6f83d5e3..d10d5f26f 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -1,4 +1,8 @@ { "extends": "../tsconfig.json", - "include": ["*.ts"] + "compilerOptions": { + "composite": true + }, + "include": ["*.ts", "../*.ts"], + "references": [] } diff --git a/server/tsconfig.json b/server/tsconfig.json index f2cdad622..1b323272a 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -1,5 +1,8 @@ { "extends": "../tsconfig.json", - "include": ["**/*.ts", "**/*.cts"], + "compilerOptions": { + "composite": true + }, + "include": ["**/*.ts"], "exclude": ["dist"] } diff --git a/tsconfig.json b/tsconfig.json index a55b14d47..6fffc316b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,13 +10,22 @@ "esModuleInterop": true, "skipLibCheck": true, "allowJs": true, + "noEmit": true, "target": "ES2024", "module": "NodeNext", "strict": true, - "noEmit": true, - "types": ["chrome", "node"], - "lib": ["ES2024", "DOM", "DOM.Iterable"] + "types": ["node"], + "lib": ["ES2024"] }, - "include": ["**/*.ts", "**/*.cts", "web/**/*.svelte", "web/.storybook/*.ts"], - "exclude": ["*/dist"] + "include": [], + "references": [ + { "path": "./api" }, + { "path": "./core" }, + { "path": "./extension" }, + { "path": "./loader-tests" }, + { "path": "./proxy" }, + { "path": "./scripts" }, + { "path": "./server" }, + { "path": "./web" } + ] } diff --git a/web/package.json b/web/package.json index d89327096..ea8fa2e8a 100644 --- a/web/package.json +++ b/web/package.json @@ -66,7 +66,8 @@ "size-limit": "12.0.0", "storybook": "10.1.11", "stylelint": "16.26.1", - "stylelint-use-logical": "2.1.2" + "stylelint-use-logical": "2.1.2", + "svelte-check": "4.3.5" }, "engines": { "node": "^24.12.0", diff --git a/web/tsconfig.json b/web/tsconfig.json index 7cb19dc4f..c9b295d45 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "../tsconfig.json", + "compilerOptions": { + "composite": true, + "lib": ["ES2024", "DOM", "DOM.Iterable"] + }, "include": ["**/*.ts", "**/*.cts", "**/*.svelte", ".storybook/*.ts"], "exclude": ["dist", "storybook-static"] } From 97c125095f213adbe89293e0b8c031ef886203cd Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sun, 4 Jan 2026 21:44:43 +0000 Subject: [PATCH 2/4] Add tsgo --- package.json | 1 + pnpm-lock.yaml | 73 ++++++++++++++++++++++++++++++++++++++++++ scripts/check-types.sh | 2 +- 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 44e02aaaf..3f3f0ff4e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@types/chrome": "0.1.32", "@types/node": "25.0.3", "@types/ws": "8.18.1", + "@typescript/native-preview": "7.0.0-dev.20260103.1", "actions-up": "1.8.0", "better-node-test": "0.8.3", "eslint": "9.39.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd60d2568..7ffa8a474 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@types/ws': specifier: 8.18.1 version: 8.18.1 + '@typescript/native-preview': + specifier: 7.0.0-dev.20260103.1 + version: 7.0.0-dev.20260103.1 actions-up: specifier: 1.8.0 version: 1.8.0 @@ -1714,6 +1717,45 @@ packages: resolution: {integrity: sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-uQba8AUGOJhYLBFhlHb6CCdswijEQNg9pNxriv3bRC6qyxRZKusDZk9+aLRIMKEOmza1t2ZT6rIR7yZV1SS/yg==} + cpu: [arm64] + os: [darwin] + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-N/KRr6+Rs1On9gKMOQgg/cryLzDXdkUdy5TQz+kOzoZ5gtW7yx5to6hW2IS8RS3z8zcicn1awDnFcqBl5xL2hw==} + cpu: [x64] + os: [darwin] + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-ukDB/N8TkC3hvZyixdrDua7xfmtAbQbjicbK51toqaQCdgZtPWaq1+ttjTa9AN+TT36a4GFmXu/uEzMgHuUWug==} + cpu: [arm64] + os: [linux] + + '@typescript/native-preview-linux-arm@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-vznk92yXxmRZQa6vM5cntI0DLg2dwRIVX/Ok7Mga+RCNspgC8RpstFxhSHJUp7wxqNTfhLnd0bEReJXbMLW1TQ==} + cpu: [arm] + os: [linux] + + '@typescript/native-preview-linux-x64@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-YRNUYt/G8q7E0UPEqOhUFg+5e5Kh0pBQ+0VbaEbHZHGo0XxzR5z1BcesXUa8yphCzF3JX/GiWPb+umHjYRARoA==} + cpu: [x64] + os: [linux] + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-h5J4eVIXew7t6PStU9M3uueCoZ0+hDbNF8AvZtl1oKO2+fOiiA/k4krgz9Mfi2hb+yhemS3ZrLvrbW6FOlHmYA==} + cpu: [arm64] + os: [win32] + + '@typescript/native-preview-win32-x64@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-EvT+ll/jP08iYhjaCgzJHta/ObGv7vBuPU24gHKPbBLBVvFJuzXWK6jnYqcGnQcGrVFh3o37dcBhLR7LdTKatw==} + cpu: [x64] + os: [win32] + + '@typescript/native-preview@7.0.0-dev.20260103.1': + resolution: {integrity: sha512-gx+q8yi8GgvbKpQYJB2EBI0jHk8OJOySJ4xnVn019R6t5UhNkj6xcuArp+y1BJ3Mx8PigpURb+6WVGbSwuLWXQ==} + hasBin: true + '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} @@ -5744,6 +5786,37 @@ snapshots: '@typescript-eslint/types': 8.51.0 eslint-visitor-keys: 4.2.1 + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview-linux-arm@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview-linux-x64@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview-win32-x64@7.0.0-dev.20260103.1': + optional: true + + '@typescript/native-preview@7.0.0-dev.20260103.1': + optionalDependencies: + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260103.1 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260103.1 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20260103.1 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260103.1 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20260103.1 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260103.1 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20260103.1 + '@ungap/structured-clone@1.3.0': {} '@unrs/resolver-binding-android-arm-eabi@1.11.1': diff --git a/scripts/check-types.sh b/scripts/check-types.sh index b8e97c18d..c229e1f53 100755 --- a/scripts/check-types.sh +++ b/scripts/check-types.sh @@ -47,6 +47,6 @@ for project in $PROJECTS_TO_CHECK; do cd .. else echo "Checking $project" - ./node_modules/.bin/tsc --noEmit -p "$project" + ./node_modules/.bin/tsgo --noEmit -p "$project" fi done From 7e68eba44fb28931b59c790c14c0e511416c1cce Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sun, 4 Jan 2026 22:06:25 +0000 Subject: [PATCH 3/4] Move to tsgo for Svelte --- .github/workflows/main.yml | 2 ++ eslint.config.ts | 3 +- pnpm-lock.yaml | 69 ++++++++++++++++++++++++++++++++++++++ pnpm-workspace.yaml | 1 + scripts/check-types.sh | 2 +- web/.gitignore | 1 + web/package.json | 3 +- web/tsconfig.json | 1 - 8 files changed, 78 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17227cd94..1c8374392 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,6 +42,8 @@ jobs: env: FORCE_COLOR: 1 STAGING: 1 + - name: Double-check Svelte types with old tool + run: cd web && pnpm svelte-check - name: Build nginx config run: cd web && ./scripts/build-nginx-config.sh - name: Upload web assets diff --git a/eslint.config.ts b/eslint.config.ts index b767d7070..0797a24c2 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -7,7 +7,8 @@ const config: Linter.Config[] = [ '*/dist/', 'web/storybook-static/', 'web/vite.config.ts.*', - 'server/web/' + 'server/web/', + 'web/.fast-check' ] }, ...loguxSvelteConfig.map(item => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ffa8a474..a721e4a76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -418,6 +418,9 @@ importers: svelte-check: specifier: 4.3.5 version: 4.3.5(picomatch@4.0.3)(svelte@5.46.1)(typescript@5.9.3) + svelte-fast-check: + specifier: 0.2.2 + version: 0.2.2(svelte@5.46.1)(typescript@5.9.3) packages: @@ -2156,6 +2159,9 @@ packages: resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==} engines: {node: '>=12'} + cleye@2.2.1: + resolution: {integrity: sha512-eZzJGlG3N6+IsKV+297HIRS2fyRsLMOrx62hGUmmcyOtP/I+L7JVeSKZH49WZUdVB8NoaZOUvq01363I/PHJiA==} + clone-regexp@3.0.0: resolution: {integrity: sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==} engines: {node: '>=12'} @@ -2836,6 +2842,11 @@ packages: resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} hasBin: true + glob@11.1.0: + resolution: {integrity: sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==} + engines: {node: 20 || >=22} + hasBin: true + global-modules@2.0.0: resolution: {integrity: sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==} engines: {node: '>=6'} @@ -3115,6 +3126,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@4.1.1: + resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==} + engines: {node: 20 || >=22} + jiti@2.6.1: resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true @@ -3633,6 +3648,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.1: + resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} + engines: {node: 20 || >=22} + path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -4215,6 +4234,13 @@ packages: svelte: optional: true + svelte-fast-check@0.2.2: + resolution: {integrity: sha512-1fo9rhA0yqyRNx+aV6XMbdPzgzUdmOnP7HNjea3JbP+dy2g85PeAYo4oEtbOLTcoP8VDye0jIgbikecP24Y5Iw==} + hasBin: true + peerDependencies: + svelte: '>=5.0.0' + typescript: '>=5.0.0' + svelte2tsx@0.7.46: resolution: {integrity: sha512-S++Vw3w47a8rBuhbz4JK0fcGea8tOoX1boT53Aib8+oUO2EKeOG+geXprJVTDfBlvR+IJdf3jIpR2RGwT6paQA==} peerDependencies: @@ -4244,6 +4270,9 @@ packages: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} + terminal-columns@2.0.0: + resolution: {integrity: sha512-6IByuUjyNZJXUtwDNm+OIe62zgwwaRbH+WMNTcx05O2G5V9WhvluAAHJY8OvUdwmzMPpqAD/7EUpGdI6ae1aiQ==} + text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -4344,6 +4373,9 @@ packages: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} + type-flag@4.0.3: + resolution: {integrity: sha512-YA09cL07U7hSV+/doSfKl+RkIZ2olCnevZsVgAuyBUG3h2ROf9Oh2vmbq5Rf26aA9/qu9RtStuc7ap5PC6k/vw==} + typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} @@ -6167,6 +6199,11 @@ snapshots: dependencies: escape-string-regexp: 5.0.0 + cleye@2.2.1: + dependencies: + terminal-columns: 2.0.0 + type-flag: 4.0.3 + clone-regexp@3.0.0: dependencies: is-regexp: 3.1.0 @@ -6853,6 +6890,15 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@11.1.0: + dependencies: + foreground-child: 3.3.1 + jackspeak: 4.1.1 + minimatch: 10.1.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.1 + global-modules@2.0.0: dependencies: global-prefix: 3.0.0 @@ -7157,6 +7203,10 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@4.1.1: + dependencies: + '@isaacs/cliui': 8.0.2 + jiti@2.6.1: {} js-base64@3.7.8: @@ -7796,6 +7846,11 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@2.0.1: + dependencies: + lru-cache: 11.2.4 + minipass: 7.1.2 + path-type@4.0.0: {} pathe@2.0.3: {} @@ -8484,6 +8539,16 @@ snapshots: optionalDependencies: svelte: 5.46.1 + svelte-fast-check@0.2.2(svelte@5.46.1)(typescript@5.9.3): + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@typescript/native-preview': 7.0.0-dev.20260103.1 + cleye: 2.2.1 + glob: 11.1.0 + svelte: 5.46.1 + svelte2tsx: 0.7.46(svelte@5.46.1)(typescript@5.9.3) + typescript: 5.9.3 + svelte2tsx@0.7.46(svelte@5.46.1)(typescript@5.9.3): dependencies: dedent-js: 1.0.1 @@ -8533,6 +8598,8 @@ snapshots: tapable@2.3.0: {} + terminal-columns@2.0.0: {} + text-table@0.2.0: {} time-span@5.1.0: @@ -8621,6 +8688,8 @@ snapshots: type-fest@3.13.1: {} + type-flag@4.0.3: {} + typedarray@0.0.6: {} typescript-eslint@8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 65130e95b..ba9293626 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -30,6 +30,7 @@ minimumReleaseAgeExclude: - 'multiocular' - 'oxfmt' - '@oxfmt/*' + - svelte-fast-check allowBuilds: husky: true diff --git a/scripts/check-types.sh b/scripts/check-types.sh index c229e1f53..560e6ab13 100755 --- a/scripts/check-types.sh +++ b/scripts/check-types.sh @@ -43,7 +43,7 @@ for project in $PROJECTS_TO_CHECK; do if [ "$project" = "web" ]; then echo "Checking web" cd web/ - ./node_modules/.bin/svelte-check --workspace web + ./node_modules/.bin/svelte-fast-check --incremental cd .. else echo "Checking $project" diff --git a/web/.gitignore b/web/.gitignore index e41bb13c2..d4728ca19 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -4,3 +4,4 @@ vite.config.ts.timestamp* routes.regexp nginx.conf.compiled build-storybook.log +.fast-check diff --git a/web/package.json b/web/package.json index ea8fa2e8a..0fa24a9a7 100644 --- a/web/package.json +++ b/web/package.json @@ -67,7 +67,8 @@ "storybook": "10.1.11", "stylelint": "16.26.1", "stylelint-use-logical": "2.1.2", - "svelte-check": "4.3.5" + "svelte-check": "4.3.5", + "svelte-fast-check": "0.2.2" }, "engines": { "node": "^24.12.0", diff --git a/web/tsconfig.json b/web/tsconfig.json index c9b295d45..579b828ab 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "composite": true, "lib": ["ES2024", "DOM", "DOM.Iterable"] }, "include": ["**/*.ts", "**/*.cts", "**/*.svelte", ".storybook/*.ts"], From d050b8149e77f7c3928bd80084d6c16b86bf8952 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sun, 4 Jan 2026 22:16:10 +0000 Subject: [PATCH 4/4] Fix ts-file check in web project --- scripts/check-types.sh | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/scripts/check-types.sh b/scripts/check-types.sh index 560e6ab13..6684fc8e3 100755 --- a/scripts/check-types.sh +++ b/scripts/check-types.sh @@ -29,22 +29,48 @@ get_projects_from_files() { echo "$projects" | sed 's/^ //' } +has_files_with_ext() { + project="$1" + ext="$2" + shift 2 + for file in "$@"; do + file_project=$(echo "$file" | sed 's|^\./||' | cut -d'/' -f1) + if [ "$file_project" = "$project" ]; then + case "$file" in + *.$ext) return 0 ;; + esac + fi + done + return 1 +} + if [ $# -eq 0 ]; then PROJECTS_TO_CHECK="$ALL_PROJECTS" + FILES_PROVIDED=false else PROJECTS_TO_CHECK=$(get_projects_from_files "$@") - if [ -z "$PROJECTS_TO_CHECK" ]; then - echo "No valid projects found in provided files" - exit 0 - fi + FILES_PROVIDED=true fi for project in $PROJECTS_TO_CHECK; do if [ "$project" = "web" ]; then echo "Checking web" - cd web/ - ./node_modules/.bin/svelte-fast-check --incremental - cd .. + + if [ "$FILES_PROVIDED" = false ]; then + ./node_modules/.bin/tsgo --noEmit -p web + cd web/ + ./node_modules/.bin/svelte-fast-check --incremental + cd .. + else + if has_files_with_ext web ts "$@"; then + ./node_modules/.bin/tsgo --noEmit -p web + fi + if has_files_with_ext web svelte "$@"; then + cd web/ + ./node_modules/.bin/svelte-fast-check --incremental + cd .. + fi + fi else echo "Checking $project" ./node_modules/.bin/tsgo --noEmit -p "$project"