From ccf0584db8c3464d6cc3ff552788e4f4873aa5f6 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 9 Dec 2025 17:31:23 +0000 Subject: [PATCH] build: use tsgo for type checking I don't use and fancy typescript features, and apparently this version is very usable at this point. Removes the typescript dependency, which should have been in dev-deps anyway. --- .gitignore | 3 ++ Makefile | 4 +- package-lock.json | 133 ++++++++++++++++++++++++++++++++++++++++------ package.json | 2 +- 4 files changed, 125 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 0f305d9..fe10259 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ scripts/langmover/out tinyproxy.conf static/banner.svg start.sh +ts/*.tsbuildinfo +ts/**/*.tsbuildinfo +js/ diff --git a/Makefile b/Makefile index 2a3b550..23dd85d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ .PHONY: configuration email typescript swagger copy compile compress inline-css variants-html install clean npm config-description config-default precompile test .DEFAULT_GOAL := all +TS ?= npx tsgo + GOESBUILD ?= off ifeq ($(GOESBUILD), on) ESBUILD := esbuild @@ -60,7 +62,7 @@ DEBUG ?= off ifeq ($(DEBUG), on) SOURCEMAP := --sourcemap MINIFY := - TYPECHECK := npx tsc -noEmit --project ts/tsconfig.json + TYPECHECK := $(TS) -noEmit --incremental --project ts/tsconfig.json # jank COPYTS := rm -r $(DATA)/web/js/ts; cp -r tempts $(DATA)/web/js/ts UNCSS := cp $(CSS_BUNDLE) $(DATA)/bundle.css diff --git a/package-lock.json b/package-lock.json index fdf619d..2a56985 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "any-date-parser": "^1.5.4", "browserslist": "^4.21.7", "cheerio": "^1.0.0-rc.12", - "esbuild": "^0.25.12", "fs-cheerio": "^3.0.0", "highlight.js": "^11.11.1", "inline-source": "^8.0.2", @@ -32,10 +31,10 @@ "remove-markdown": "^0.5.0", "tailwindcss": "^3.3.2", "temporal-polyfill": "^0.3.0", - "typescript": "^5.1.3", "uncss": "^0.17.3" }, "devDependencies": { + "@typescript/native-preview": "^7.0.0-dev.20251209.1", "live-server": "^1.2.2" }, "optionalDependencies": { @@ -640,6 +639,123 @@ "undici-types": "~6.21.0" } }, + "node_modules/@typescript/native-preview": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-xnx3A1S1TTx+mx8FfP1UwkNTwPBmhGCbOh4PDNRUV5gDZkVuDDN3y1F7NPGSMg6MXE1KKPSLNM+PQMN33ZAL2Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsgo": "bin/tsgo.js" + }, + "optionalDependencies": { + "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20251209.1", + "@typescript/native-preview-darwin-x64": "7.0.0-dev.20251209.1", + "@typescript/native-preview-linux-arm": "7.0.0-dev.20251209.1", + "@typescript/native-preview-linux-arm64": "7.0.0-dev.20251209.1", + "@typescript/native-preview-linux-x64": "7.0.0-dev.20251209.1", + "@typescript/native-preview-win32-arm64": "7.0.0-dev.20251209.1", + "@typescript/native-preview-win32-x64": "7.0.0-dev.20251209.1" + } + }, + "node_modules/@typescript/native-preview-darwin-arm64": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-F1cnYi+ZeinYQnaTQKKIsbuoq8vip5iepBkSZXlB8PjbG62LW1edUdktd/nVEc+Q+SEysSQ3jRdk9eU766s5iw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@typescript/native-preview-darwin-x64": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-Ta6XKdAxEMBzd1xS4eQKXmlUkml+kMf23A9qFoegOxmyCdHJPak2gLH9ON5/C6js0ibZm1kdqwbcA0/INrcThg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@typescript/native-preview-linux-arm": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-4e7WSBLLdmfJUGzm9Id4WA2fDZ2sY3Q6iudyZPNSb5AFsCmqQksM/JGAlNROHpi/tIqo95e3ckbjmrZTmH60EA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@typescript/native-preview-linux-arm64": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-kdiPMvs1hwi76hgvZjz4XQVNYTV+MAbJKnHXz6eL6aVXoTYzNtan5vWywKOHv9rV4jBMyVlZqtKbeG/XVV9WdQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@typescript/native-preview-linux-x64": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-dH/Z50Xb52N4Csd0BXptmjuMN+87AhUAjM9Y5rNU8VwcUJJDFpKM6aKUhd4Q+XEVJWPFPlKDLx3pVhnO31CBhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@typescript/native-preview-win32-arm64": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-vW7IGRNIUhhQ0vzFY3sRNxvYavNGum2OWgW1Bwc05yhg9AexBlRjdhsUSTLQ2dUeaDm2nx4i38LhXIVgLzMNeA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@typescript/native-preview-win32-x64": { + "version": "7.0.0-dev.20251209.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20251209.1.tgz", + "integrity": "sha512-jKT6npBrhRX/84LWSy9PbOWx2USTZhq9SOkvH2mcnU/+uqyNxZIMMVnW5exIyzcnWSPly3jK2qpfiHNjdrDaAA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@webcoder49/code-input": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/@webcoder49/code-input/-/code-input-2.7.2.tgz", @@ -6967,19 +7083,6 @@ "node": ">= 0.8.0" } }, - "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", diff --git a/package.json b/package.json index 14752fa..f54f97c 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "remove-markdown": "^0.5.0", "tailwindcss": "^3.3.2", "temporal-polyfill": "^0.3.0", - "typescript": "^5.1.3", "uncss": "^0.17.3" }, "devDependencies": { + "@typescript/native-preview": "^7.0.0-dev.20251209.1", "live-server": "^1.2.2" }, "optionalDependencies": {