Add TypeScript toolchain (tsc per-module, build-only)
This commit is contained in:
@@ -13,3 +13,7 @@ dist/
|
||||
.python-version
|
||||
.direnv
|
||||
.hermes/
|
||||
|
||||
# TypeScript: compiled output and codegen are build-only
|
||||
/games/static/js/dist/
|
||||
/ts/generated/
|
||||
|
||||
@@ -25,12 +25,22 @@ init:
|
||||
server:
|
||||
uv run python -Wa manage.py runserver
|
||||
|
||||
gen-element-types:
|
||||
uv run python manage.py gen_element_types
|
||||
|
||||
ts: gen-element-types
|
||||
pnpm exec tsc
|
||||
|
||||
ts-check: gen-element-types
|
||||
pnpm exec tsc --noEmit
|
||||
|
||||
dev:
|
||||
@pnpm concurrently \
|
||||
--names "Django,Tailwind" \
|
||||
--prefix-colors "blue,green" \
|
||||
--names "Django,Tailwind,TS" \
|
||||
--prefix-colors "blue,green,magenta" \
|
||||
"uv run python -Wa manage.py runserver" \
|
||||
"pnpm tailwindcss -i ./common/input.css -o ./games/static/base.css --watch"
|
||||
"pnpm tailwindcss -i ./common/input.css -o ./games/static/base.css --watch" \
|
||||
"pnpm exec tsc --watch"
|
||||
|
||||
|
||||
caddy:
|
||||
@@ -85,7 +95,7 @@ format:
|
||||
format-check:
|
||||
uv run ruff format --check
|
||||
|
||||
check: lint format-check test
|
||||
check: lint format-check ts-check test
|
||||
|
||||
date:
|
||||
uv run python -c 'import datetime; from zoneinfo import ZoneInfo; print(datetime.datetime.isoformat(datetime.datetime.now(ZoneInfo("Europe/Prague")), timespec="minutes", sep=" "))'
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
"concurrently": "^8.2.2",
|
||||
"npm-check-updates": "^16.14.20",
|
||||
"tailwindcss": "^4.1.18"
|
||||
"tailwindcss": "^4.1.18",
|
||||
"typescript": "^5.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/cli": "^4.1.18",
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
export {};
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
fetchWithHtmxTriggers(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"strict": true,
|
||||
"noEmitOnError": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"rootDir": "ts",
|
||||
"outDir": "games/static/js/dist"
|
||||
},
|
||||
"include": ["ts/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user