Update 3d chart mode, add US heatmap, move kjol-web -> kjol-website

This commit is contained in:
2026-07-16 12:40:49 -04:00
parent 550e97aa9b
commit 2477c2d6a2
75 changed files with 701 additions and 416 deletions

40
.vscode/launch.json vendored
View File

@@ -1,77 +1,77 @@
{
// Debug configs for kjol-web (the website). cwd is the site dir because the dev server
// Debug configs for kjol-website (the website). cwd is the site dir because the dev server
// resolves ./wwwroot, ./app, ./wasm, ./frontend and the watched engine dirs relative
// to it.
//
// Every dev-server config preLaunchTasks "kjol-web: prebuild" (codegen -> Tailwind ->
// Every dev-server config preLaunchTasks "kjol-website: prebuild" (codegen -> Tailwind ->
// Solid bundle). Codegen must run before the server is COMPILED — it writes
// app/*.gen.go, which the server imports — and under the debugger the binary is built
// by Delve, not by the server's own Build hook, so nothing else would generate it.
//
// GOWORK=off on every config: kjol-web is its own module (module kjolweb, replace kjol
// GOWORK=off on every config: kjol-website is its own module (module kjolwebsite, replace kjol
// => ../..). Inside a parent project the parent's go.work — which lists kjol/go but not
// kjolweb — shadows it, and the build fails "main module (...) does not contain package
// .../kjol-web/server". Off, Go uses kjolweb's own go.mod; standalone it is a no-op.
// kjolwebsite — shadows it, and the build fails "main module (...) does not contain package
// .../kjol-website/server". Off, Go uses kjolwebsite's own go.mod; standalone it is a no-op.
"version": "0.2.0",
"configurations": [
{
"name": "kjol-web: dev server",
"name": "kjol-website: dev server",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/go/cmd/kjol-web/server",
"cwd": "${workspaceFolder}/go/cmd/kjol-web",
"program": "${workspaceFolder}/go/cmd/kjol-website/server",
"cwd": "${workspaceFolder}/go/cmd/kjol-website",
"env": { "GOWORK": "off" },
"args": ["-addr", ":8085"],
"preLaunchTask": "kjol-web: prebuild"
"preLaunchTask": "kjol-website: prebuild"
},
{
"name": "kjol-web: dev server (no watch)",
"name": "kjol-website: dev server (no watch)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/go/cmd/kjol-web/server",
"cwd": "${workspaceFolder}/go/cmd/kjol-web",
"program": "${workspaceFolder}/go/cmd/kjol-website/server",
"cwd": "${workspaceFolder}/go/cmd/kjol-website",
"env": { "GOWORK": "off" },
// -watch=false skips the server's own Build entirely, so wwwroot is served exactly
// as it sits on disk. The prebuild is what puts current generated code, CSS and JS
// bundles there; without it you would be debugging against stale artefacts — and
// with no bundle at all, every /js/* page would come up blank.
"args": ["-watch=false"],
"preLaunchTask": "kjol-web: prebuild"
"preLaunchTask": "kjol-website: prebuild"
},
{
"name": "kjol-web: cold build (-build)",
"name": "kjol-website: cold build (-build)",
"type": "go",
"request": "launch",
"mode": "auto",
// The same binary, with the flag that runs every build step once and exits. There is
// no separate ./build command: the steps are a library, because the server imports
// them and Go will not let you import a main.
"program": "${workspaceFolder}/go/cmd/kjol-web/server",
"cwd": "${workspaceFolder}/go/cmd/kjol-web",
"program": "${workspaceFolder}/go/cmd/kjol-website/server",
"cwd": "${workspaceFolder}/go/cmd/kjol-website",
"env": { "GOWORK": "off" },
"args": ["-build"]
},
{
"name": "kjol-web: codegen (wasmgen)",
"name": "kjol-website: codegen (wasmgen)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/go/cmd/wasmgen",
"cwd": "${workspaceFolder}/go/cmd/kjol-web",
"cwd": "${workspaceFolder}/go/cmd/kjol-website",
"env": { "GOWORK": "off" },
"args": ["./app"]
},
{
"name": "kjol-web: bundle (Solid)",
"name": "kjol-website: bundle (Solid)",
"type": "go",
"request": "launch",
"mode": "auto",
// Debug the JS build itself — the Solid compiler, the Tailwind engine, the SSR bake.
// All of it is Go, so all of it takes a breakpoint.
"program": "${workspaceFolder}/go/cmd/bundle",
"cwd": "${workspaceFolder}/go/cmd/kjol-web",
"cwd": "${workspaceFolder}/go/cmd/kjol-website",
"env": { "GOWORK": "off" },
"args": [
"-app", "frontend",

56
.vscode/tasks.json vendored
View File

@@ -1,66 +1,66 @@
{
// Tasks for the kjol repo.
//
// kjol-web — the website, and the runnable example of both web layers — is a nested
// module at go/cmd/kjol-web, so its tasks set cwd there; the module-wide Go tasks run
// kjol-website — the website, and the runnable example of both web layers — is a nested
// module at go/cmd/kjol-website, so its tasks set cwd there; the module-wide Go tasks run
// in go/.
//
// These used to be called "gowasm: ...", which stopped being true: the site is two
// front-ends now, and one build compiles Go to WebAssembly AND bundles a Solid app.
// They are "kjol-web: ..." to match the directory they act on.
// They are "kjol-website: ..." to match the directory they act on.
//
// The build pipeline is Go, not a shell script — see go/cmd/kjol-web/build. The dev
// The build pipeline is Go, not a shell script — see go/cmd/kjol-website/build. The dev
// server calls the same functions on every save, and a bash script would not run for
// anyone on Windows. Note there is no `./build` COMMAND any more: the steps are a
// library (the server imports them, and Go will not let you import a main), so a cold
// build is `go run ./server -build`.
//
// "kjol-web: prebuild" is what every run/debug config depends on. Codegen has to happen
// "kjol-website: prebuild" is what every run/debug config depends on. Codegen has to happen
// before the server is COMPILED — it writes app/*.gen.go, which the server imports — and
// under the debugger the binary is built by Delve, not by the server's own Build hook,
// so nothing else would generate it. Tailwind and the Solid bundle are in there too, so
// that a -watch=false session serves current artefacts instead of stale ones. Each step
// is also exposed on its own, so you can rerun just the one you need.
//
// The kjol-web tasks (cwd go/cmd/kjol-web) set GOWORK=off: kjol-web is its own module
// (module kjolweb, replace kjol => ../..), and inside a parent project the parent's
// go.work — which does not list kjolweb — would shadow it and the go command would fail
// "main module (...) does not contain package .../kjol-web/...". The kjol-module tasks
// The kjol-website tasks (cwd go/cmd/kjol-website) set GOWORK=off: kjol-website is its own module
// (module kjolwebsite, replace kjol => ../..), and inside a parent project the parent's
// go.work — which does not list kjolwebsite — would shadow it and the go command would fail
// "main module (...) does not contain package .../kjol-website/...". The kjol-module tasks
// (cwd go) keep the workspace, since kjol/go is what a parent's go.work does list.
"version": "2.0.0",
"tasks": [
{
"label": "kjol-web: prebuild",
"label": "kjol-website: prebuild",
"detail": "Codegen -> Tailwind -> Solid bundle. Dependency of the run + debug configs.",
"dependsOrder": "sequence",
"dependsOn": ["kjol-web: codegen", "kjol-web: tailwind", "kjol-web: bundle (Solid)"],
"dependsOn": ["kjol-website: codegen", "kjol-website: tailwind", "kjol-website: bundle (Solid)"],
"problemMatcher": [],
"group": "build"
},
{
"label": "kjol-web: codegen",
"label": "kjol-website: codegen",
"detail": "Regenerate app/*.gen.go from the //gowasm: directives (pages, layouts, server components)",
"type": "shell",
"command": "go",
"args": ["run", "kjol/cmd/wasmgen", "./app"],
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-web", "env": { "GOWORK": "off" } },
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" } },
"problemMatcher": ["$go"],
"presentation": { "reveal": "silent", "panel": "shared" },
"group": "build"
},
{
"label": "kjol-web: tailwind",
"label": "kjol-website: tailwind",
"detail": "Compile css/app.css -> wwwroot/app.css, scanning the webui kit + the site's Go markup",
"type": "shell",
"command": "go",
"args": [
"run", "./cmd/twcss",
"-entry", "cmd/kjol-web/css/app.css",
"-out", "cmd/kjol-web/wwwroot/app.css",
"-entry", "cmd/kjol-website/css/app.css",
"-out", "cmd/kjol-website/wwwroot/app.css",
"-base", ".",
"webui/**/*.go",
"cmd/kjol-web/app/**/*.go",
"cmd/kjol-web/server/**/*.go"
"cmd/kjol-website/app/**/*.go",
"cmd/kjol-website/server/**/*.go"
],
// Run from the kjol module root so the Tailwind engine's deps resolve in kjol's
// go.mod, not the site's.
@@ -70,7 +70,7 @@
"group": "build"
},
{
"label": "kjol-web: bundle (Solid)",
"label": "kjol-website: bundle (Solid)",
"detail": "TSX -> Solid -> esbuild, plus the SSR bake: wwwroot/bundle.min.{js,css} + public.bundle.min.*",
"type": "shell",
"command": "go",
@@ -83,19 +83,19 @@
"-out", "wwwroot",
"-gen-ts", "frontend/src/ui/generated"
],
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-web", "env": { "GOWORK": "off" } },
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" } },
"problemMatcher": ["$go"],
"presentation": { "reveal": "silent", "panel": "shared" },
"group": "build"
},
{
"label": "kjol-web: dev server (hot reload)",
"label": "kjol-website: dev server (hot reload)",
"detail": "SSR + /rsc + hot reload on :8085. Rebuilds on save; a .css save recompiles Tailwind only and swaps the stylesheet in place.",
"type": "shell",
"command": "go",
"args": ["run", "./server"],
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-web", "env": { "GOWORK": "off" } },
"dependsOn": ["kjol-web: prebuild"],
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" } },
"dependsOn": ["kjol-website: prebuild"],
"isBackground": true,
"problemMatcher": {
"owner": "go",
@@ -113,18 +113,18 @@
"group": { "kind": "build", "isDefault": true }
},
{
"label": "kjol-web: build (cold)",
"label": "kjol-website: build (cold)",
"detail": "Cold build, then exit: codegen + Tailwind + wasm + Solid bundle + wasm_exec.js.",
"type": "shell",
"command": "go",
"args": ["run", "./server", "-build"],
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-web", "env": { "GOWORK": "off" } },
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" } },
"problemMatcher": ["$go"],
"group": "build"
},
{
"label": "kjol: build ./...",
"detail": "Build the whole kjol module (does not descend into the nested kjol-web module)",
"detail": "Build the whole kjol module (does not descend into the nested kjol-website module)",
"type": "shell",
"command": "go build ./...",
"options": { "cwd": "${workspaceFolder}/go" },
@@ -161,11 +161,11 @@
"group": "test"
},
{
"label": "kjol-web: test",
"label": "kjol-website: test",
"detail": "The site's own tests (SSR, the icon registry, the AutoTable export bytes). Its own module, so `kjol: test ./...` does not reach it.",
"type": "shell",
"command": "go test ./...",
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-web", "env": { "GOWORK": "off" } },
"options": { "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" } },
"problemMatcher": ["$go"],
"group": "test"
}