diff --git a/AGENTS.md b/AGENTS.md
index 51552666b4..ed26ec9cf0 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -182,11 +182,11 @@ review gate observes both the code and thread state.
## Task-specific guidance
-Use the matching repository skill in `.agents/skills/` for repeatable delivery,
-homelab, Delivery recovery, Scout, Temporal, TaskNotes, Minecraft harness and
-building, docs, Tracker, Experiments, PostHog, Discord, or report rendering
-work. Package-local runtime skills remain application assets and do not replace
-repository workflow guidance.
+Use the matching repository skill in `.agents/skills/` for delivery, homelab,
+Delivery recovery, Scout, Temporal, TaskNotes, Minecraft, docs, Tracker,
+Experiments, PostHog, Discord, or report rendering work. Package-local runtime
+skills remain application assets, not repository workflow guidance. First-party
+web consoles follow `packages/docs/wiki/src/content/docs/reference/console-stack.md`.
diff --git a/bun.lock b/bun.lock
index a754a7d140..82ea206d73 100644
--- a/bun.lock
+++ b/bun.lock
@@ -20,9 +20,9 @@
"name": "@shepherdjerred/alert-dashboard",
"version": "0.1.0",
"dependencies": {
- "@base-ui/react": "^1.6.0",
- "@hono/bun": "^1.0.1",
- "@js-temporal/polyfill": "^0.5.1",
+ "@base-ui/react": "catalog:",
+ "@hono/bun": "catalog:",
+ "@js-temporal/polyfill": "catalog:",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-async-hooks": "^2.12.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
@@ -31,7 +31,7 @@
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
"@prisma/adapter-libsql": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/experiments": "workspace:*",
@@ -41,37 +41,37 @@
"@shepherdjerred/loaded": "workspace:*",
"@shepherdjerred/ops-clients": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
- "@tanstack/react-form": "^1.33.6",
- "@tanstack/react-query": "^5.101.2",
- "@trpc/client": "^11.18.0",
- "@trpc/server": "^11.18.0",
- "@trpc/tanstack-react-query": "^11.18.0",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
- "prisma": "^7.10.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "@tanstack/react-form": "catalog:",
+ "@tanstack/react-query": "catalog:",
+ "@trpc/client": "catalog:",
+ "@trpc/server": "catalog:",
+ "@trpc/tanstack-react-query": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
+ "prisma": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.5.3",
- "uplot": "^1.6.32",
- "zod": "^4.4.3",
+ "uplot": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
- "@axe-core/playwright": "^4.14.1",
+ "@axe-core/playwright": "catalog:",
"@playwright/test": "1.64.0",
"@shepherdjerred/architecture": "workspace:*",
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/arcade": {
@@ -385,44 +385,44 @@
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
- "lucide-react": "^1.14.0",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
- "zod": "^4.4.3",
+ "lucide-react": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
+ "zod": "catalog:",
},
},
"packages/ci-cache": {
"name": "@shepherdjerred/ci-cache",
"version": "0.1.0",
"dependencies": {
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "zod": "^4.4.3",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
+ "@vitejs/plugin-react": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "lucide-react": "^1.14.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "lucide-react": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/code-review": {
@@ -527,15 +527,15 @@
"name": "@shepherdjerred/console-ui",
"version": "0.1.0",
"dependencies": {
- "@base-ui/react": "^1.6.0",
+ "@base-ui/react": "catalog:",
"@fontsource-variable/inter": "^5.3.0",
- "@js-temporal/polyfill": "^0.5.1",
- "@tanstack/react-form": "^1.33.6",
- "@tanstack/react-table": "^9.3.1",
- "@tanstack/react-virtual": "^3.14.26",
- "clsx": "^2.1.1",
- "lucide-react": "^1.14.0",
- "zod": "^4.4.3",
+ "@js-temporal/polyfill": "catalog:",
+ "@tanstack/react-form": "catalog:",
+ "@tanstack/react-table": "catalog:",
+ "@tanstack/react-virtual": "catalog:",
+ "clsx": "catalog:",
+ "lucide-react": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/eslint-config": "workspace:*",
@@ -543,20 +543,20 @@
"@tsconfig/recommended": "^1.0.13",
"@tsconfig/strictest": "^2.0.8",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
"jsdom": "^31.0.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "typescript": "^6.0.3",
- "vitest": "5.1.2",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "typescript": "catalog:",
+ "vitest": "catalog:",
},
"peerDependencies": {
- "react": "19.3.1",
+ "react": "catalog:",
},
},
"packages/cooklang-for-obsidian": {
@@ -622,45 +622,45 @@
"name": "@shepherdjerred/delivery",
"version": "0.1.0",
"dependencies": {
- "@hono/bun": "^1.0.1",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@hono/bun": "catalog:",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
"@shepherdjerred/ops-clients": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/version-catalog": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "@tanstack/react-router": "1.170.46",
+ "@tanstack/react-query": "catalog:",
+ "@tanstack/react-router": "catalog:",
"fflate": "^0.8.3",
- "hono": "^4.12.18",
+ "hono": "catalog:",
"pg": "8.23.1",
- "prisma": "^7.10.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "zod": "^4.4.3",
+ "prisma": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
- "@axe-core/playwright": "4.14.1",
- "@base-ui/react": "^1.6.0",
+ "@axe-core/playwright": "catalog:",
+ "@base-ui/react": "catalog:",
"@playwright/test": "1.64.0",
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/test-postgres": "workspace:*",
"@types/bun": "1.4.5",
"@types/pg": "8.23.1",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "lucide-react": "^1.14.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "lucide-react": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/discord-plays-core": {
@@ -1019,7 +1019,7 @@
"name": "@shepherdjerred/errors",
"version": "0.1.0",
"dependencies": {
- "@base-ui/react": "^1.6.0",
+ "@base-ui/react": "catalog:",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-async-hooks": "^2.12.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
@@ -1027,20 +1027,20 @@
"@opentelemetry/sdk-node": "^0.223.0",
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
- "prisma": "^7.10.1",
+ "@tanstack/react-query": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
+ "prisma": "catalog:",
"prom-client": "^15.1.3",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.5.3",
- "zod": "^4.4.3",
+ "zod": "catalog:",
},
"devDependencies": {
"@sentry/bun": "11.18.0",
@@ -1051,16 +1051,16 @@
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/test-postgres": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/eslint-config": {
@@ -1163,67 +1163,67 @@
"name": "@shepherdjerred/feeds",
"version": "0.1.0",
"dependencies": {
- "@hono/bun": "^1.0.1",
+ "@hono/bun": "catalog:",
"@shepherdjerred/feature-flags": "workspace:*",
"fast-xml-parser": "5.12.1",
- "hono": "^4.12.18",
+ "hono": "catalog:",
"htmlparser2": "^12.0.0",
"sanitize-html": "^2.18.0",
- "zod": "^4.4.3",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
+ "@tanstack/react-query": "catalog:",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@types/sanitize-html": "^2.16.1",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "lucide-react": "^1.14.0",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "lucide-react": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/flags": {
"name": "@shepherdjerred/flags",
"version": "0.1.0",
"dependencies": {
- "@hono/bun": "^1.0.1",
+ "@hono/bun": "catalog:",
"@shepherdjerred/feature-flags": "workspace:*",
- "hono": "^4.12.18",
- "zod": "^4.4.3",
+ "hono": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/llm-models": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
+ "@tanstack/react-query": "catalog:",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jsdom": "^31.0.1",
- "lucide-react": "^1.14.0",
- "monaco-editor": "^0.58.0",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "lucide-react": "catalog:",
+ "monaco-editor": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.4.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/glitter": {
@@ -1295,21 +1295,21 @@
"@opentelemetry/sdk-node": "^0.223.0",
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@sentry/bun": "11.18.0",
"@shepherdjerred/bugsink-config": "workspace:*",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/console-server": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
- "@trpc/server": "^11.18.0",
- "hono": "^4.12.18",
- "prisma": "^7.10.1",
+ "@trpc/server": "catalog:",
+ "hono": "catalog:",
+ "prisma": "catalog:",
"prom-client": "^15.1.3",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "zod": "^4.4.3",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/architecture": "workspace:*",
@@ -1318,23 +1318,23 @@
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/test-postgres": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "@tanstack/react-router": "1.170.46",
- "@trpc/client": "^11.18.0",
- "@trpc/tanstack-react-query": "^11.18.0",
+ "@tanstack/react-query": "catalog:",
+ "@tanstack/react-router": "catalog:",
+ "@trpc/client": "catalog:",
+ "@trpc/tanstack-react-query": "catalog:",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
"jsdom": "^31.0.1",
- "lucide-react": "^1.14.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "lucide-react": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/hkctl": {
@@ -1676,35 +1676,35 @@
"name": "@shepherdjerred/mail",
"version": "0.1.0",
"dependencies": {
- "@base-ui/react": "^1.6.0",
- "@hono/bun": "^1.0.1",
+ "@base-ui/react": "catalog:",
+ "@hono/bun": "catalog:",
"@shepherdjerred/feature-flags": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
+ "@tanstack/react-query": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
"nodemailer": "^10.6.1",
"postal-mime": "^4.2.1",
"prom-client": "^15.1.3",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.5.3",
- "zod": "^4.4.3",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@types/bun": "1.4.5",
"@types/nodemailer": "^8.0.2",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/mc-build": {
@@ -1866,7 +1866,7 @@
"name": "@shepherdjerred/ops-model",
"version": "0.1.0",
"dependencies": {
- "zod": "^4.4.3",
+ "zod": "catalog:",
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
@@ -1876,12 +1876,12 @@
"@tsconfig/strictest": "^2.0.8",
"@types/bun": "^1.4.5",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitest/coverage-istanbul": "catalog:",
"ajv": "^8.20.0",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vitest": "5.1.2",
+ "typescript": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/pr-fleet-controller": {
@@ -2958,10 +2958,10 @@
"name": "@shepherdjerred/tracker",
"version": "0.1.0",
"dependencies": {
- "@base-ui/react": "^1.6.0",
- "@dnd-kit/core": "^6.3.1",
- "@dnd-kit/sortable": "^10.0.0",
- "@hono/bun": "^1.0.1",
+ "@base-ui/react": "catalog:",
+ "@dnd-kit/core": "catalog:",
+ "@dnd-kit/sortable": "catalog:",
+ "@hono/bun": "catalog:",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-async-hooks": "^2.12.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
@@ -2969,30 +2969,30 @@
"@opentelemetry/sdk-node": "^0.223.0",
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@sentry/bun": "11.18.0",
"@shepherdjerred/bugsink-config": "workspace:*",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "@tanstack/react-virtual": "^3.14.26",
- "@trpc/client": "^11.18.0",
- "@trpc/server": "^11.18.0",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
+ "@tanstack/react-query": "catalog:",
+ "@tanstack/react-virtual": "catalog:",
+ "@trpc/client": "catalog:",
+ "@trpc/server": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
"pg": "8.23.1",
- "prisma": "^7.10.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "react-markdown": "^10.1.0",
+ "prisma": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "react-markdown": "catalog:",
"react-router": "8.4.0",
- "remark-gfm": "^4.0.1",
- "zod": "^4.4.3",
+ "remark-gfm": "catalog:",
+ "zod": "catalog:",
},
"devDependencies": {
- "@axe-core/playwright": "^4.14.1",
+ "@axe-core/playwright": "catalog:",
"@playwright/test": "1.64.0",
"@shepherdjerred/architecture": "workspace:*",
"@shepherdjerred/console-ui": "workspace:*",
@@ -3001,16 +3001,16 @@
"@shepherdjerred/test-postgres": "workspace:*",
"@types/bun": "1.4.5",
"@types/pg": "8.23.1",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
},
},
"packages/trmnl-dashboard": {
@@ -3275,6 +3275,42 @@
"svgo": "4.1.0",
"typescript-eslint": "8.74.0",
},
+ "catalog": {
+ "@axe-core/playwright": "^4.14.1",
+ "@base-ui/react": "^1.6.0",
+ "@dnd-kit/core": "^6.3.1",
+ "@dnd-kit/sortable": "^10.0.0",
+ "@hono/bun": "^1.0.1",
+ "@js-temporal/polyfill": "^0.5.1",
+ "@prisma/adapter-pg": "7.10.1",
+ "@prisma/client": "^7.10.1",
+ "@tanstack/react-form": "^1.33.6",
+ "@tanstack/react-query": "^5.101.2",
+ "@tanstack/react-router": "1.170.46",
+ "@tanstack/react-table": "^9.3.1",
+ "@tanstack/react-virtual": "^3.14.26",
+ "@trpc/client": "^11.18.0",
+ "@trpc/server": "^11.18.0",
+ "@trpc/tanstack-react-query": "^11.18.0",
+ "@types/react": "^19.3.0",
+ "@types/react-dom": "^19.3.0",
+ "@vitejs/plugin-react": "^6.0.1",
+ "@vitest/coverage-istanbul": "5.1.2",
+ "clsx": "^2.1.1",
+ "hono": "^4.12.18",
+ "lucide-react": "^1.14.0",
+ "monaco-editor": "^0.58.0",
+ "prisma": "^7.10.1",
+ "react": "19.3.1",
+ "react-dom": "19.3.1",
+ "react-markdown": "^10.1.0",
+ "remark-gfm": "^4.0.1",
+ "typescript": "^6.0.3",
+ "uplot": "^1.6.32",
+ "vite": "^8.0.11",
+ "vitest": "5.1.2",
+ "zod": "^4.4.3",
+ },
"packages": {
"@adobe/css-tools": ["@adobe/css-tools@4.5.0", "", {}, "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q=="],
diff --git a/package.json b/package.json
index bbe842dd6f..5f049275e6 100644
--- a/package.json
+++ b/package.json
@@ -73,6 +73,7 @@
"generate-flag-usage": "bun scripts/generate/flag-usage.ts",
"check-flag-usage": "bun scripts/checks/check-flag-usage.ts",
"check-ai-architecture": "bun scripts/checks/check-ai-architecture.ts",
+ "check-console-stack": "bun scripts/checks/check-console-stack.ts",
"check-floating-deps": "bun scripts/checks/deps/check-floating-deps.ts",
"check-patched-deps": "bun scripts/checks/deps/check-patched-deps.ts",
"check-ci-env": "bun scripts/checks/ci/check-ci-env.ts",
@@ -215,6 +216,42 @@
"packages/woodpecker-config-extension",
"scripts"
],
+ "catalog": {
+ "@axe-core/playwright": "^4.14.1",
+ "@base-ui/react": "^1.6.0",
+ "@dnd-kit/core": "^6.3.1",
+ "@dnd-kit/sortable": "^10.0.0",
+ "@hono/bun": "^1.0.1",
+ "@js-temporal/polyfill": "^0.5.1",
+ "@prisma/adapter-pg": "7.10.1",
+ "@prisma/client": "^7.10.1",
+ "@tanstack/react-form": "^1.33.6",
+ "@tanstack/react-query": "^5.101.2",
+ "@tanstack/react-router": "1.170.46",
+ "@tanstack/react-table": "^9.3.1",
+ "@tanstack/react-virtual": "^3.14.26",
+ "@trpc/client": "^11.18.0",
+ "@trpc/server": "^11.18.0",
+ "@trpc/tanstack-react-query": "^11.18.0",
+ "@types/react": "^19.3.0",
+ "@types/react-dom": "^19.3.0",
+ "@vitejs/plugin-react": "^6.0.1",
+ "@vitest/coverage-istanbul": "5.1.2",
+ "clsx": "^2.1.1",
+ "hono": "^4.12.18",
+ "lucide-react": "^1.14.0",
+ "monaco-editor": "^0.58.0",
+ "prisma": "^7.10.1",
+ "react": "19.3.1",
+ "react-dom": "19.3.1",
+ "react-markdown": "^10.1.0",
+ "remark-gfm": "^4.0.1",
+ "typescript": "^6.0.3",
+ "uplot": "^1.6.32",
+ "vite": "^8.0.11",
+ "vitest": "5.1.2",
+ "zod": "^4.4.3"
+ },
"overrides": {
"@ai-sdk/provider": "4.0.39",
"@ai-sdk/provider-utils": "5.0.85",
diff --git a/packages/alert-dashboard/package.json b/packages/alert-dashboard/package.json
index c851c48158..832ddd9495 100644
--- a/packages/alert-dashboard/package.json
+++ b/packages/alert-dashboard/package.json
@@ -34,9 +34,9 @@
"#test-fixtures/*": "./src/test-fixtures/*.ts"
},
"dependencies": {
- "@base-ui/react": "^1.6.0",
- "@hono/bun": "^1.0.1",
- "@js-temporal/polyfill": "^0.5.1",
+ "@base-ui/react": "catalog:",
+ "@hono/bun": "catalog:",
+ "@js-temporal/polyfill": "catalog:",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-async-hooks": "^2.12.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
@@ -45,26 +45,26 @@
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
"@prisma/adapter-libsql": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@shepherdjerred/loaded": "workspace:*",
"@shepherdjerred/experiments": "workspace:*",
- "@tanstack/react-form": "^1.33.6",
- "@tanstack/react-query": "^5.101.2",
- "@trpc/client": "^11.18.0",
- "@trpc/server": "^11.18.0",
- "@trpc/tanstack-react-query": "^11.18.0",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
- "prisma": "^7.10.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "@tanstack/react-form": "catalog:",
+ "@tanstack/react-query": "catalog:",
+ "@trpc/client": "catalog:",
+ "@trpc/server": "catalog:",
+ "@trpc/tanstack-react-query": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
+ "prisma": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.5.3",
- "zod": "^4.4.3",
+ "zod": "catalog:",
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/ops-clients": "workspace:*",
"@shepherdjerred/llm-observability": "workspace:*",
- "uplot": "^1.6.32",
+ "uplot": "catalog:",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
"@shepherdjerred/incidents": "workspace:*"
@@ -74,17 +74,17 @@
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
- "@axe-core/playwright": "^4.14.1",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
+ "@axe-core/playwright": "catalog:",
"@playwright/test": "1.64.0",
- "@vitejs/plugin-react": "^6.0.1",
+ "@vitejs/plugin-react": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
- "@vitest/coverage-istanbul": "5.1.2"
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:"
}
}
diff --git a/packages/charts/package.json b/packages/charts/package.json
index c5bae81237..63daa2ede2 100644
--- a/packages/charts/package.json
+++ b/packages/charts/package.json
@@ -21,18 +21,18 @@
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
- "lucide-react": "^1.14.0",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2",
- "zod": "^4.4.3"
+ "lucide-react": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:",
+ "zod": "catalog:"
}
}
diff --git a/packages/ci-cache/package.json b/packages/ci-cache/package.json
index 50151aebb7..684a8e6abc 100644
--- a/packages/ci-cache/package.json
+++ b/packages/ci-cache/package.json
@@ -12,24 +12,24 @@
"test:ci": "bun ../../scripts/ci/run-ci-test.ts"
},
"dependencies": {
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "zod": "^4.4.3"
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "zod": "catalog:"
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
+ "@vitejs/plugin-react": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "lucide-react": "^1.14.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "lucide-react": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/console-ui/package.json b/packages/console-ui/package.json
index 10351ab946..03da74de0a 100644
--- a/packages/console-ui/package.json
+++ b/packages/console-ui/package.json
@@ -19,18 +19,18 @@
"./*": "./src/*"
},
"dependencies": {
- "@base-ui/react": "^1.6.0",
+ "@base-ui/react": "catalog:",
"@fontsource-variable/inter": "^5.3.0",
- "@js-temporal/polyfill": "^0.5.1",
- "@tanstack/react-form": "^1.33.6",
- "@tanstack/react-table": "^9.3.1",
- "@tanstack/react-virtual": "^3.14.26",
- "clsx": "^2.1.1",
- "lucide-react": "^1.14.0",
- "zod": "^4.4.3"
+ "@js-temporal/polyfill": "catalog:",
+ "@tanstack/react-form": "catalog:",
+ "@tanstack/react-table": "catalog:",
+ "@tanstack/react-virtual": "catalog:",
+ "clsx": "catalog:",
+ "lucide-react": "catalog:",
+ "zod": "catalog:"
},
"peerDependencies": {
- "react": "19.3.1"
+ "react": "catalog:"
},
"devDependencies": {
"@shepherdjerred/eslint-config": "workspace:*",
@@ -38,16 +38,16 @@
"@tsconfig/recommended": "^1.0.13",
"@tsconfig/strictest": "^2.0.8",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
"jsdom": "^31.0.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "typescript": "^6.0.3",
- "vitest": "5.1.2"
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "typescript": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/delivery/package.json b/packages/delivery/package.json
index 4636ace0fd..c85837fd8d 100644
--- a/packages/delivery/package.json
+++ b/packages/delivery/package.json
@@ -33,44 +33,44 @@
"test:e2e": "bun --no-install --bun playwright test"
},
"dependencies": {
- "@hono/bun": "^1.0.1",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@hono/bun": "catalog:",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
"@shepherdjerred/ops-clients": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/version-catalog": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "@tanstack/react-router": "1.170.46",
+ "@tanstack/react-query": "catalog:",
+ "@tanstack/react-router": "catalog:",
"fflate": "^0.8.3",
- "hono": "^4.12.18",
+ "hono": "catalog:",
"pg": "8.23.1",
- "prisma": "^7.10.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "zod": "^4.4.3"
+ "prisma": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "zod": "catalog:"
},
"devDependencies": {
- "@axe-core/playwright": "4.14.1",
- "@base-ui/react": "^1.6.0",
+ "@axe-core/playwright": "catalog:",
+ "@base-ui/react": "catalog:",
"@playwright/test": "1.64.0",
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/test-postgres": "workspace:*",
"@types/bun": "1.4.5",
"@types/pg": "8.23.1",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "lucide-react": "^1.14.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "lucide-react": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/docs/wiki/src/content/docs/explanation/homelab/hosted-service-model.md b/packages/docs/wiki/src/content/docs/explanation/homelab/hosted-service-model.md
index a5ff150170..ae1d6bac3e 100644
--- a/packages/docs/wiki/src/content/docs/explanation/homelab/hosted-service-model.md
+++ b/packages/docs/wiki/src/content/docs/explanation/homelab/hosted-service-model.md
@@ -126,6 +126,31 @@ definition that merges should change nothing that runs. Activation adds the
environment, the Delivery delegation and the secrets, and those deserve their
own diff.
+## One stack for the consoles
+
+The ten ops consoles are first-party hosted services that people use every day:
+Hub, Delivery, Tracker, Errors, Mail, Flags, Feeds, Go link, Charts and CI
+cache. They already shared React, Vite, TypeScript, Vitest, Zod and the
+console-ui look at the same versions. Below that they diverged: React Router, TanStack Router
+and hand-rolled routing, REST beside tRPC, raw SQLite beside Prisma, native
+dialogs beside Base UI. Each choice was reasonable alone. Together they meant a
+fix for one console did not carry to another, and every new console started from
+a bare server.
+
+The consoles therefore share one stack, written down in the
+[console stack reference](/reference/console-stack/). The reasoning is the same
+as for the construct and the policy test: make the standard the easy path, then
+check what went around it. The scaffolder's `--console` flag writes the standard
+stack, a Bun workspace catalog holds one version of each library, and a stack
+check reads each console's `package.json`. The check starts with an allowlist of
+today's deviations, each with a reason. A deviation with no entry fails, and an
+entry whose deviation is gone fails, so the list only shrinks and a migration
+pull request removes its own entries.
+
+Two consoles are Rust, and fixed outside protocols such as SMTP and the Sentry
+envelope keep their wire format. Those are named exceptions, not allowlist
+entries, because the standard cannot apply to them.
+
## What stays manual, and why
A few inventory tests assert a literal count of images or charts. They guard
@@ -139,6 +164,8 @@ guessed them would be a default nobody chose.
## Related
- [Add a hosted service](/how-to/add-a-hosted-service/) is the procedure.
+- [Console stack reference](/reference/console-stack/) lists the standard and
+ its exceptions.
- [About the homelab](/explanation/homelab/overview/) covers the topology these
workloads run on.
- [Why releases are shaped this way](/explanation/homelab/release-safety/)
diff --git a/packages/docs/wiki/src/content/docs/how-to/add-a-hosted-service.md b/packages/docs/wiki/src/content/docs/how-to/add-a-hosted-service.md
index d41e85cb51..838ab8c639 100644
--- a/packages/docs/wiki/src/content/docs/how-to/add-a-hosted-service.md
+++ b/packages/docs/wiki/src/content/docs/how-to/add-a-hosted-service.md
@@ -28,19 +28,29 @@ and clears `pendingPrivateImages`.
bun scripts/misc/new-service.ts --name notes --kind web --port 7400 --host notes
```
- | Flag | Value |
- | --------- | ------------------------------------------------------------------- |
- | `--name` | Kebab-case. Names the package, image, chart, namespace, Application |
- | `--kind` | `web` for an HTTP service, `worker` for a workload with no ingress |
- | `--port` | The listening port, or a worker's health port. 1024 to 55535 |
- | `--host` | The tailnet hostname. Required for `web`, refused for `worker` |
- | `--title` | The catalog title. Defaults to the name in sentence case |
+ | Flag | Value |
+ | ----------- | --------------------------------------------------------------------- |
+ | `--name` | Kebab-case. Names the package, image, chart, namespace, Application |
+ | `--kind` | `web` for an HTTP service, `worker` for a workload with no ingress |
+ | `--port` | The listening port, or a worker's health port. 1024 to 55535 |
+ | `--host` | The tailnet hostname. Required for `web`, refused for `worker` |
+ | `--title` | The catalog title. Defaults to the name in sentence case |
+ | `--console` | Web only. Writes the console stack in place of the bare health server |
The command writes the package, the chart, the Argo Application and every
registration. It then installs, synthesizes `@homelab/cdktn` (updating
`packages/homelab/src/tofu/dockerhub/main.tf.json`), runs `generate:catalog`
and runs the completeness check. It prints each file it wrote.
+ For an ops console, add `--console`. The package then holds the
+ [console stack](/reference/console-stack/): a Hono server on Bun with
+ `/healthz` and `/trpc`, a tRPC router with one example procedure, a Prisma
+ schema for PostgreSQL, and a Vite and React client with TanStack Router, the
+ `@trpc/tanstack-react-query` provider and console-ui's shell. Its
+ dependencies use `catalog:`. Add the console to `CONSOLES` in
+ `scripts/checks/console-stack-rules.ts` so `bun run check-console-stack`
+ holds it to the standard.
+
2. Bump the three inventory counts that a new image and chart change. Run the
suite and edit the literal each failure names:
@@ -162,5 +172,6 @@ Application that the catalog does not name.
## Related
- [Why a hosted service is a construct, a policy test and a checklist](/explanation/homelab/hosted-service-model/)
+- [Console stack reference](/reference/console-stack/)
- [Cut a homelab release](/how-to/cut-a-homelab-release/)
- [Delivery model reference](/reference/delivery-model/)
diff --git a/packages/docs/wiki/src/content/docs/reference/console-stack.md b/packages/docs/wiki/src/content/docs/reference/console-stack.md
new file mode 100644
index 0000000000..5ba7339aaf
--- /dev/null
+++ b/packages/docs/wiki/src/content/docs/reference/console-stack.md
@@ -0,0 +1,136 @@
+---
+title: Console stack reference
+description: The one library stack of the ten first-party ops consoles, its Rust and fixed-protocol exceptions, the shared Bun catalog, and the check that holds each console to it.
+---
+
+The ten first-party ops consoles share one stack: Hub, Delivery, Tracker,
+Errors, Mail, Flags, Feeds, Go link, Charts and CI cache. The shared look is
+[`@shepherdjerred/console-ui`](/reference/console-ui/); this page lists the
+libraries underneath it. [Why the consoles share one stack](/explanation/homelab/hosted-service-model/#one-stack-for-the-consoles)
+gives the reasoning.
+
+## The standard
+
+| Layer | Standard |
+| --------------------- | ---------------------------------------------------------------------------------------- |
+| Router | TanStack Router with code-based routes; every URL parameter is validated with Zod |
+| Browser data | tRPC with TanStack Query through `@trpc/tanstack-react-query` |
+| First-party callers | Typed tRPC clients for the toolkit, Temporal, CI lanes and other services |
+| Server | Hono on Bun, started through the shared server kit |
+| Database | Prisma on PostgreSQL |
+| Headless UI | Base UI (`@base-ui/react`), through console-ui |
+| Tables | TanStack Table, inside console-ui's `DataTable` |
+| Forms | TanStack Form with Zod |
+| Long lists | TanStack Virtual |
+| Charts | uPlot |
+| Drag and drop | dnd-kit |
+| Markdown | react-markdown with remark-gfm |
+| Code editor | Monaco |
+| Dates | Temporal (`@js-temporal/polyfill`) for date math, `Intl` for display |
+| Icons | lucide-react |
+| Class names | clsx, in console-ui only |
+| Validation | Zod 4 |
+| Browser tests | Vitest browser mode with axe for new tests; Playwright with axe stays for full-app flows |
+| Framework and tooling | React 19.3.1, Vite 8, TypeScript 6, Vitest 5 |
+
+## Exceptions
+
+| Exception | Applies to | What changes |
+| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
+| Rust server | Charts, CI cache | The server cannot serve tRPC or use Prisma. The client uses TanStack Query over REST with Zod. `rusqlite` stays |
+| Fixed outside protocol | Sentry envelope ingest, SMTP, the Google Reader API, the Alertmanager webhook, the Helm repository, the Turborepo, Gradle and sccache caches, Go link redirects, health probes, `/metrics` | The endpoint keeps its REST or wire format; everything around it is tRPC |
+| File upload | Tracker attachments | Plain HTTP |
+
+## Banned alternatives
+
+The check fails when a console declares one of these, unless the console's
+allowlist entry names it.
+
+| Replaced by | Banned |
+| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
+| TanStack Router | `react-router`, `react-router-dom`, `@remix-run/router`, `wouter`, `@reach/router`, `navigo` |
+| tRPC with TanStack Query | `swr`, `axios`, `ky`, `ofetch`, `got`, `node-fetch`, `superagent` |
+| uPlot | `recharts`, `echarts`, `echarts-for-react`, `chart.js`, `react-chartjs-2`, `d3`, `victory`, `apexcharts`, `plotly.js`, `@visx/*`, `@nivo/*` |
+| Temporal and `Intl` | `date-fns`, `dayjs`, `luxon`, `moment`, `moment-timezone`, `@date-fns/*` |
+| TanStack Form | `react-hook-form`, `formik`, `final-form`, `react-final-form` |
+| Base UI | `@radix-ui/*`, `radix-ui`, `@headlessui/react`, `react-aria`, `react-aria-components`, `@react-aria/*`, `ariakit`, `@ariakit/*` |
+| TanStack Virtual | `react-window`, `react-virtualized`, `react-virtuoso` |
+| dnd-kit | `react-dnd`, `react-beautiful-dnd`, `@hello-pangea/dnd` |
+| react-markdown | `marked`, `markdown-it`, `showdown`, `snarkdown` |
+| Plain CSS on console-ui | `tailwindcss`, `@tailwindcss/*`, `styled-components`, `@emotion/*`, `goober` |
+| Hono on Bun | `express`, `fastify`, `koa`, `@hapi/hapi` |
+| Prisma on PostgreSQL | `better-sqlite3`, `sqlite3`, `@libsql/client`, `@prisma/adapter-libsql`, `@prisma/adapter-better-sqlite3` |
+
+A Rust console's client also may not declare `hono`, `@hono/bun`,
+`@trpc/server` or `prisma`.
+
+## Required libraries
+
+| Package kind | Required |
+| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| TypeScript console | The toolchain, `@tanstack/react-query`, `@tanstack/react-router`, `@trpc/client`, `@trpc/server`, `@trpc/tanstack-react-query`, `hono`, `@hono/bun`, `prisma`, `@prisma/client`, `@prisma/adapter-pg` |
+| Rust console client | The toolchain, `@tanstack/react-query`, `@tanstack/react-router` |
+| `console-ui` | `@base-ui/react`, `clsx`, `lucide-react`, `@tanstack/react-table`, `@tanstack/react-form` |
+
+A console that depends on `@shepherdjerred/console-server` counts as declaring
+`hono`, `@hono/bun`, `@trpc/server` and `@trpc/client`. One that depends on
+`@shepherdjerred/console-client` counts as declaring `@tanstack/react-query`,
+`@tanstack/react-router` and the tRPC client libraries.
+
+The toolchain is `react`, `react-dom`, `@types/react`, `@types/react-dom`,
+`@vitejs/plugin-react`, `typescript`, `vite`, `vitest`, `zod` and
+`lucide-react`.
+
+## The Bun catalog
+
+The root [`package.json`](https://github.com/shepherdjerred/monorepo/blob/main/package.json) declares a default `catalog` that holds one version of
+every library in the standard. A console, `console-ui` and `ops-model` declare
+those libraries as `"catalog:"`. Change a version in the catalog and run
+`bun install`, which rewrites `bun.lock`. A catalogued library declared with its
+own version fails the stack check.
+
+Two kinds of library are outside the catalog:
+
+| Library | Why |
+| ------------------ | ------------------------------------------------------------------------------------------ |
+| `@playwright/test` | The `ci-playwright` image promotion rewrites each exact pin together with the image digest |
+| `@types/bun` | Pinned with the Bun toolchain, which moves in one change |
+
+Renovate does not read `catalog` in a root `package.json` natively, so a
+JSONata custom manager in [`renovate.json`](https://github.com/shepherdjerred/monorepo/blob/main/renovate.json) extracts every entry. Mend-hosted
+Renovate cannot run `bun install`, so a catalog bump leaves `bun.lock` stale
+until someone refreshes it on the branch.
+
+## The stack check
+
+`bun run check-console-stack` runs
+[`scripts/checks/check-console-stack.ts`](https://github.com/shepherdjerred/monorepo/blob/main/scripts/checks/check-console-stack.ts)
+against each console's `package.json` and the root catalog, and prints one row
+per deviation. The rules and the allowlist live in
+[`scripts/checks/console-stack-rules.ts`](https://github.com/shepherdjerred/monorepo/blob/main/scripts/checks/console-stack-rules.ts).
+
+| Deviation | Meaning |
+| -------------- | -------------------------------------------------------------- |
+| `missing` | The standard requires a library the package does not declare |
+| `banned` | The package declares an alternative the standard replaces |
+| `uncatalogued` | The package declares a catalogued library with its own version |
+
+Every deviation that exists today has an allowlist entry with a reason. The
+allowlist only shrinks:
+
+- A deviation with no entry fails the check.
+- An entry whose deviation no longer exists fails the check, so the change that
+ removes a deviation removes its entry in the same pull request.
+- An entry names a package in the console list and carries a non-empty reason.
+
+The service scaffolder writes the standard stack for a new console:
+`bun scripts/misc/new-service.ts --kind web --console`, which
+[`scripts/misc/new-service-console.ts`](https://github.com/shepherdjerred/monorepo/blob/main/scripts/misc/new-service-console.ts)
+implements. See
+[Add a hosted service](/how-to/add-a-hosted-service/).
+
+## Related
+
+- [Console UI reference](/reference/console-ui/)
+- [Why the consoles share one stack](/explanation/homelab/hosted-service-model/#one-stack-for-the-consoles)
+- [Add a hosted service](/how-to/add-a-hosted-service/)
diff --git a/packages/errors/package.json b/packages/errors/package.json
index 40f0547c17..ec39b27ea7 100644
--- a/packages/errors/package.json
+++ b/packages/errors/package.json
@@ -25,7 +25,7 @@
"test:ci": "bun ../../scripts/ci/run-ci-test.ts"
},
"dependencies": {
- "@base-ui/react": "^1.6.0",
+ "@base-ui/react": "catalog:",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-async-hooks": "^2.12.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
@@ -33,20 +33,20 @@
"@opentelemetry/sdk-node": "^0.223.0",
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
- "prisma": "^7.10.1",
+ "@tanstack/react-query": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
+ "prisma": "catalog:",
"prom-client": "^15.1.3",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.5.3",
- "zod": "^4.4.3"
+ "zod": "catalog:"
},
"devDependencies": {
"@sentry/bun": "11.18.0",
@@ -57,15 +57,15 @@
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/test-postgres": "workspace:*",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/feeds/eslint.config.ts b/packages/feeds/eslint.config.ts
index 67c98d115d..5c714fdcbf 100644
--- a/packages/feeds/eslint.config.ts
+++ b/packages/feeds/eslint.config.ts
@@ -1,3 +1,6 @@
import { recommended } from "@shepherdjerred/eslint-config";
-export default recommended({ tsconfigRootDir: import.meta.dirname });
+export default recommended({
+ tsconfigRootDir: import.meta.dirname,
+ react: true,
+});
diff --git a/packages/feeds/package.json b/packages/feeds/package.json
index d2ade6ab2d..d3bc467354 100644
--- a/packages/feeds/package.json
+++ b/packages/feeds/package.json
@@ -16,33 +16,33 @@
"lint": "bunx eslint --cache . --max-warnings=0"
},
"dependencies": {
- "@hono/bun": "^1.0.1",
+ "@hono/bun": "catalog:",
"@shepherdjerred/feature-flags": "workspace:*",
"fast-xml-parser": "5.12.1",
- "hono": "^4.12.18",
+ "hono": "catalog:",
"htmlparser2": "^12.0.0",
"sanitize-html": "^2.18.0",
- "zod": "^4.4.3"
+ "zod": "catalog:"
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
+ "@tanstack/react-query": "catalog:",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@types/sanitize-html": "^2.16.1",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "lucide-react": "^1.14.0",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "lucide-react": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/feeds/src/client/app.tsx b/packages/feeds/src/client/app.tsx
index 65b6a4be90..f5df305453 100644
--- a/packages/feeds/src/client/app.tsx
+++ b/packages/feeds/src/client/app.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef, useState, type RefObject } from "react";
+import { useCallback, useRef, useState, type RefObject } from "react";
import { z } from "zod";
import {
FigureStrip,
@@ -31,122 +31,13 @@ import {
searchSuffix,
type Route,
} from "./model.ts";
+import { useWorkspaceShortcuts } from "./shortcuts.ts";
import { FeedsHeader, FeedsPicker, FeedsSidebar } from "./sidebar.tsx";
import {
UserFeedDialog,
type UserFeedDialogState,
} from "./user-feed-dialog.tsx";
-function isEditableTarget(target: EventTarget | null): boolean {
- return (
- target instanceof HTMLElement &&
- target.closest(
- "input, select, textarea, dialog, [contenteditable='true']",
- ) !== null
- );
-}
-
-function shouldIgnoreGlobalKey(event: KeyboardEvent): boolean {
- return (
- event.defaultPrevented ||
- event.isComposing ||
- event.metaKey ||
- event.ctrlKey ||
- event.altKey ||
- isEditableTarget(event.target) ||
- document.querySelector("dialog[open]") !== null
- );
-}
-
-type EntryShortcutContext = {
- readonly entries: readonly EntryListItem[];
- readonly activeIndex: number | undefined;
- readonly setActiveIndex: React.Dispatch<
- React.SetStateAction
- >;
- readonly onToggleRead: (entry: EntryListItem) => void;
- readonly onToggleStar: (entry: EntryListItem) => void;
- readonly onFocusSearch: () => void;
-};
-
-function handleEntryShortcut(
- key: string,
- context: EntryShortcutContext,
-): boolean {
- if (key === "/") {
- context.onFocusSearch();
- return true;
- }
- const { entries, activeIndex, setActiveIndex } = context;
- if (entries.length === 0) return false;
- if (key === "j") {
- setActiveIndex((prev) =>
- prev === undefined ? 0 : Math.min(entries.length - 1, prev + 1),
- );
- return true;
- }
- if (key === "k") {
- setActiveIndex((prev) => (prev === undefined ? 0 : Math.max(0, prev - 1)));
- return true;
- }
- const active = activeIndex === undefined ? undefined : entries[activeIndex];
- if (active === undefined) return false;
- if (key === "o") {
- globalThis.open(active.url, "_blank", "noopener,noreferrer");
- return true;
- }
- if (key === "m") {
- context.onToggleRead(active);
- return true;
- }
- if (key === "s") {
- context.onToggleStar(active);
- return true;
- }
- return false;
-}
-
-function useWorkspaceShortcuts(options: {
- readonly isEntriesRoute: boolean;
- readonly entries: readonly EntryListItem[];
- readonly activeIndex: number | undefined;
- readonly setActiveIndex: React.Dispatch<
- React.SetStateAction
- >;
- readonly searchInputRef: RefObject;
- readonly onToggleRead: (entry: EntryListItem) => void;
- readonly onToggleStar: (entry: EntryListItem) => void;
- readonly onRefresh: () => void;
-}): void {
- useEffect(() => {
- const onKeyDown = (event: KeyboardEvent): void => {
- if (shouldIgnoreGlobalKey(event)) return;
- if (event.key === "r") {
- event.preventDefault();
- options.onRefresh();
- return;
- }
- if (!options.isEntriesRoute) return;
- const handled = handleEntryShortcut(event.key, {
- entries: options.entries,
- activeIndex: options.activeIndex,
- setActiveIndex: options.setActiveIndex,
- onToggleRead: options.onToggleRead,
- onToggleStar: options.onToggleStar,
- onFocusSearch: () => {
- options.searchInputRef.current?.focus();
- options.searchInputRef.current?.select();
- },
- });
- if (handled) event.preventDefault();
- };
- globalThis.addEventListener("keydown", onKeyDown);
- return () => {
- globalThis.removeEventListener("keydown", onKeyDown);
- };
- });
-}
-
function activeFeedTitleFor(
route: Route | undefined,
feeds: readonly FeedHealthItem[] | undefined,
@@ -297,7 +188,10 @@ export function App({
setBannerError(error.message);
};
- useEffect(() => {
+ // Back and forward move the URL without a click, so the history entry the
+ // browser lands on is read back into state; attached to the workspace element.
+ const trackPopState = useCallback((element: HTMLElement | null) => {
+ if (element === null) return;
const onPopState = (): void => {
const nextSearch = globalThis.location.search;
setPathname(globalThis.location.pathname);
@@ -371,7 +265,7 @@ export function App({
);
}
- useWorkspaceShortcuts({
+ const bindShortcuts = useWorkspaceShortcuts({
isEntriesRoute,
entries,
activeIndex,
@@ -382,6 +276,18 @@ export function App({
onRefresh: triggerRefresh,
});
+ const bindWindowEvents = useCallback(
+ (element: HTMLElement | null) => {
+ const releaseShortcuts = bindShortcuts(element);
+ const releasePopState = trackPopState(element);
+ return () => {
+ releaseShortcuts?.();
+ releasePopState?.();
+ };
+ },
+ [bindShortcuts, trackPopState],
+ );
+
async function confirmDeleteFeed(): Promise {
if (confirmDelete === undefined || deleteFeedMutation.isPending) return;
try {
@@ -411,7 +317,7 @@ export function App({
/>
}
>
-
+
): boolean {
@@ -246,12 +246,12 @@ export function DeleteFeedDialog({
}): React.JSX.Element {
const dialogRef = useRef(null);
const titleId = useId();
- useDialogLightDismiss(dialogRef, target !== undefined);
+ const dialogRefCallback = useModalDialogRef(dialogRef, target !== undefined);
return (
-
+
{dirty.map((entry) => (
))}
diff --git a/packages/flags/src/client/views/views-api.ts b/packages/flags/src/client/views/views-api.ts
index 49be969125..5c92cadd57 100644
--- a/packages/flags/src/client/views/views-api.ts
+++ b/packages/flags/src/client/views/views-api.ts
@@ -1,6 +1,4 @@
-import { useEffect } from "react";
-import { useQueries, useQuery, useQueryClient } from "@tanstack/react-query";
-import { z } from "zod";
+import { useQueries, useQuery } from "@tanstack/react-query";
import { FlagsDiffResponseSchema } from "@shepherdjerred/feature-flags/flags-wire.ts";
import {
documentQuery,
@@ -29,42 +27,3 @@ export function useDocuments(ids: readonly string[], enabled = true) {
}),
});
}
-
-const ListedSchema = z.array(
- z.object({ id: z.string(), revision: z.number() }),
-);
-const RevisionSchema = z.object({ revision: z.number() });
-const DocumentKeySchema = z.tuple([
- z.literal("document"),
- z.string(),
- z.string(),
-]);
-
-/**
- * Keeps the summaries in step with edits. The deployment list and the drift
- * report never refetch on their own; when a document arrives at a revision the
- * list does not show (someone saved), both are refreshed.
- */
-export function useSummaryRefresh(): void {
- const queryClient = useQueryClient();
- useEffect(
- () =>
- queryClient.getQueryCache().subscribe((event) => {
- if (event.type !== "updated" || event.action.type !== "success") return;
- const key = DocumentKeySchema.safeParse(event.query.queryKey);
- const saved = RevisionSchema.safeParse(event.action.data);
- const listed = ListedSchema.safeParse(
- queryClient.getQueryData(["deployments"]),
- );
- if (!key.success || !saved.success || !listed.success) return;
- const [, catalog, stage] = key.data;
- const id = `${catalog}/${stage}`;
- const known = listed.data.find((entry) => entry.id === id);
- if (known === undefined || known.revision === saved.data.revision)
- return;
- void queryClient.invalidateQueries({ queryKey: ["deployments"] });
- void queryClient.invalidateQueries({ queryKey: ["diff"] });
- }),
- [queryClient],
- );
-}
diff --git a/packages/golink/package.json b/packages/golink/package.json
index 0fc17d40d4..665a01873f 100644
--- a/packages/golink/package.json
+++ b/packages/golink/package.json
@@ -32,21 +32,21 @@
"@opentelemetry/sdk-node": "^0.223.0",
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@sentry/bun": "11.18.0",
"@shepherdjerred/bugsink-config": "workspace:*",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/console-server": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
- "@trpc/server": "^11.18.0",
- "hono": "^4.12.18",
- "prisma": "^7.10.1",
+ "@trpc/server": "catalog:",
+ "hono": "catalog:",
+ "prisma": "catalog:",
"prom-client": "^15.1.3",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "zod": "^4.4.3"
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "zod": "catalog:"
},
"devDependencies": {
"@shepherdjerred/architecture": "workspace:*",
@@ -55,22 +55,22 @@
"@shepherdjerred/eslint-config": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
"@shepherdjerred/test-postgres": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "@tanstack/react-router": "1.170.46",
- "@trpc/client": "^11.18.0",
- "@trpc/tanstack-react-query": "^11.18.0",
+ "@tanstack/react-query": "catalog:",
+ "@tanstack/react-router": "catalog:",
+ "@trpc/client": "catalog:",
+ "@trpc/tanstack-react-query": "catalog:",
"@types/bun": "1.4.5",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
"jsdom": "^31.0.1",
- "lucide-react": "^1.14.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "lucide-react": "catalog:",
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/mail/eslint.config.ts b/packages/mail/eslint.config.ts
index 67c98d115d..5c714fdcbf 100644
--- a/packages/mail/eslint.config.ts
+++ b/packages/mail/eslint.config.ts
@@ -1,3 +1,6 @@
import { recommended } from "@shepherdjerred/eslint-config";
-export default recommended({ tsconfigRootDir: import.meta.dirname });
+export default recommended({
+ tsconfigRootDir: import.meta.dirname,
+ react: true,
+});
diff --git a/packages/mail/package.json b/packages/mail/package.json
index cf9b8968b7..b51be6c1ea 100644
--- a/packages/mail/package.json
+++ b/packages/mail/package.json
@@ -17,34 +17,34 @@
"lint": "bunx eslint --cache . --max-warnings=0"
},
"dependencies": {
- "@base-ui/react": "^1.6.0",
- "@hono/bun": "^1.0.1",
+ "@base-ui/react": "catalog:",
+ "@hono/bun": "catalog:",
"@shepherdjerred/feature-flags": "workspace:*",
"@shepherdjerred/ops-model": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
+ "@tanstack/react-query": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
"nodemailer": "^10.6.1",
"postal-mime": "^4.2.1",
"prom-client": "^15.1.3",
- "react": "19.3.1",
- "react-dom": "19.3.1",
+ "react": "catalog:",
+ "react-dom": "catalog:",
"react-router": "8.5.3",
- "zod": "^4.4.3"
+ "zod": "catalog:"
},
"devDependencies": {
"@shepherdjerred/console-ui": "workspace:*",
"@shepherdjerred/eslint-config": "workspace:*",
"@types/bun": "1.4.5",
"@types/nodemailer": "^8.0.2",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/packages/ops-model/package.json b/packages/ops-model/package.json
index 57749f56a7..04fe1a2756 100644
--- a/packages/ops-model/package.json
+++ b/packages/ops-model/package.json
@@ -22,12 +22,12 @@
"ajv": "^8.20.0",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vitest": "5.1.2",
- "@vitest/coverage-istanbul": "5.1.2"
+ "typescript": "catalog:",
+ "vitest": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:"
},
"dependencies": {
- "zod": "^4.4.3"
+ "zod": "catalog:"
},
"exports": {
"./services.json": "./services.json",
diff --git a/packages/tracker/package.json b/packages/tracker/package.json
index 66ba554edb..0f510cb38b 100644
--- a/packages/tracker/package.json
+++ b/packages/tracker/package.json
@@ -23,10 +23,10 @@
"test:e2e": "bun --no-install --bun playwright test"
},
"dependencies": {
- "@base-ui/react": "^1.6.0",
- "@dnd-kit/core": "^6.3.1",
- "@dnd-kit/sortable": "^10.0.0",
- "@hono/bun": "^1.0.1",
+ "@base-ui/react": "catalog:",
+ "@dnd-kit/core": "catalog:",
+ "@dnd-kit/sortable": "catalog:",
+ "@hono/bun": "catalog:",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-async-hooks": "^2.12.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
@@ -34,30 +34,30 @@
"@opentelemetry/sdk-node": "^0.223.0",
"@opentelemetry/sdk-trace-base": "^2.12.0",
"@opentelemetry/semantic-conventions": "^1.40.0",
- "@prisma/adapter-pg": "7.10.1",
- "@prisma/client": "^7.10.1",
+ "@prisma/adapter-pg": "catalog:",
+ "@prisma/client": "catalog:",
"@prisma/client-runtime-utils": "7.10.1",
"@sentry/bun": "11.18.0",
"@shepherdjerred/bugsink-config": "workspace:*",
"@shepherdjerred/config": "workspace:*",
"@shepherdjerred/feature-flags": "workspace:*",
- "@tanstack/react-query": "^5.101.2",
- "@tanstack/react-virtual": "^3.14.26",
- "@trpc/client": "^11.18.0",
- "@trpc/server": "^11.18.0",
- "hono": "^4.12.18",
- "lucide-react": "^1.14.0",
+ "@tanstack/react-query": "catalog:",
+ "@tanstack/react-virtual": "catalog:",
+ "@trpc/client": "catalog:",
+ "@trpc/server": "catalog:",
+ "hono": "catalog:",
+ "lucide-react": "catalog:",
"pg": "8.23.1",
- "prisma": "^7.10.1",
- "react": "19.3.1",
- "react-dom": "19.3.1",
- "react-markdown": "^10.1.0",
+ "prisma": "catalog:",
+ "react": "catalog:",
+ "react-dom": "catalog:",
+ "react-markdown": "catalog:",
"react-router": "8.4.0",
- "remark-gfm": "^4.0.1",
- "zod": "^4.4.3"
+ "remark-gfm": "catalog:",
+ "zod": "catalog:"
},
"devDependencies": {
- "@axe-core/playwright": "^4.14.1",
+ "@axe-core/playwright": "catalog:",
"@playwright/test": "1.64.0",
"@shepherdjerred/architecture": "workspace:*",
"@shepherdjerred/console-ui": "workspace:*",
@@ -66,15 +66,15 @@
"@shepherdjerred/test-postgres": "workspace:*",
"@types/bun": "1.4.5",
"@types/pg": "8.23.1",
- "@types/react": "^19.3.0",
- "@types/react-dom": "^19.3.0",
+ "@types/react": "catalog:",
+ "@types/react-dom": "catalog:",
"@typescript/native": "npm:typescript@7.0.2",
- "@vitejs/plugin-react": "^6.0.1",
- "@vitest/coverage-istanbul": "5.1.2",
+ "@vitejs/plugin-react": "catalog:",
+ "@vitest/coverage-istanbul": "catalog:",
"eslint": "^10.7.0",
"jiti": "^2.7.0",
- "typescript": "^6.0.3",
- "vite": "^8.0.11",
- "vitest": "5.1.2"
+ "typescript": "catalog:",
+ "vite": "catalog:",
+ "vitest": "catalog:"
}
}
diff --git a/renovate.json b/renovate.json
index 07d93c6df9..58e70f2834 100644
--- a/renovate.json
+++ b/renovate.json
@@ -24,6 +24,16 @@
"enabled": false
},
"customManagers": [
+ {
+ "customType": "jsonata",
+ "description": "Root Bun workspace catalog (package.json `catalog`). The ten first-party consoles, console-ui and ops-model reference these as `catalog:`, which Renovate's npm manager does not read, so this manager is the only thing that bumps them. Half upgrade: Mend-hosted Renovate cannot run `bun install`, so a human refreshes bun.lock on the branch; `bun install --frozen-lockfile` fails until then.",
+ "fileFormat": "json",
+ "managerFilePatterns": ["/^package\\.json$/"],
+ "matchStrings": [
+ "catalog.$each(function($value, $name) { { \"depName\": $name, \"currentValue\": $value } })"
+ ],
+ "datasourceTemplate": "npm"
+ },
{
"customType": "regex",
"description": "OpenTofu provider pins for the CDK Terrain stacks. A bump here is half of an upgrade: Mend-hosted Renovate cannot run post-upgrade commands, so someone runs bun run --cwd packages/homelab-cdktn providers:refresh on the branch to move the lock files, bindings and synthesized JSON. CI fails until that is done.",
@@ -293,7 +303,7 @@
{
"description": "Native TypeScript 7 owns typechecking; keep direct TypeScript on 6 for typescript-eslint project service, Astro Check, Twoslash, and TypeDoc.",
"groupName": "typescript",
- "matchManagers": ["bun", "npm"],
+ "matchManagers": ["bun", "npm", "custom.jsonata"],
"matchDepNames": ["typescript"],
"allowedVersions": "<7"
},
diff --git a/scripts/checks/check-console-stack.test.ts b/scripts/checks/check-console-stack.test.ts
new file mode 100644
index 0000000000..ba2bc461b8
--- /dev/null
+++ b/scripts/checks/check-console-stack.test.ts
@@ -0,0 +1,269 @@
+import { describe, expect, test } from "vitest";
+import {
+ collect,
+ compare,
+ deviationsFor,
+ renderTable,
+} from "./check-console-stack.ts";
+import {
+ ALLOWLIST,
+ CATALOG_PENDING,
+ CONSOLES,
+ REQUIRED,
+ type AllowlistEntry,
+ type ConsoleDefinition,
+ type Deviation,
+} from "./console-stack-rules.ts";
+
+const ROOT = new URL("../..", import.meta.url).pathname;
+
+const catalog = new Map([
+ ["react", "19.3.1"],
+ ["zod", "^4.4.3"],
+ ["hono", "^4.12.18"],
+]);
+
+const typescriptConsole: ConsoleDefinition = {
+ id: "demo",
+ label: "Demo",
+ directory: "packages/demo",
+ kind: "typescript",
+};
+
+function packageWith(
+ dependencies: Record
,
+): Parameters[1] {
+ return { name: "@demo/demo", dependencies };
+}
+
+/** A package that satisfies every requirement of its kind, all from the catalog. */
+function standardPackage(
+ kind: ConsoleDefinition["kind"],
+): Record {
+ return Object.fromEntries(
+ REQUIRED[kind].map((library) => [library, "catalog:"]),
+ );
+}
+
+describe("deviationsFor", () => {
+ test("a console on the standard has no deviations", () => {
+ expect(
+ deviationsFor(
+ typescriptConsole,
+ packageWith(standardPackage("typescript")),
+ catalog,
+ ),
+ ).toEqual([]);
+ });
+
+ test("reports each missing required library", () => {
+ const deps = standardPackage("typescript");
+ delete deps["@tanstack/react-router"];
+ delete deps["prisma"];
+ const keys = deviationsFor(typescriptConsole, packageWith(deps), catalog)
+ .filter((item) => item.kind === "missing")
+ .map((item) => item.library);
+ expect(keys.toSorted()).toEqual(["@tanstack/react-router", "prisma"]);
+ });
+
+ test("reports banned alternatives, including whole scopes", () => {
+ const deps = {
+ ...standardPackage("typescript"),
+ "react-router": "8.4.0",
+ axios: "^1.0.0",
+ "@radix-ui/react-dialog": "^1.0.0",
+ dayjs: "^1.0.0",
+ "@tailwindcss/vite": "^4.0.0",
+ };
+ const banned = deviationsFor(typescriptConsole, packageWith(deps), catalog)
+ .filter((item) => item.kind === "banned")
+ .map((item) => item.library);
+ expect(banned.toSorted()).toEqual([
+ "@radix-ui/react-dialog",
+ "@tailwindcss/vite",
+ "axios",
+ "dayjs",
+ "react-router",
+ ]);
+ });
+
+ test("reports a catalogued library declared with its own version", () => {
+ const deps = { ...standardPackage("typescript"), zod: "^4.4.3" };
+ const found = deviationsFor(typescriptConsole, packageWith(deps), catalog);
+ expect(found).toEqual([
+ expect.objectContaining({ kind: "uncatalogued", library: "zod" }),
+ ]);
+ });
+
+ test("a shared kit stands in for the libraries it provides", () => {
+ const provided = new Set([
+ "hono",
+ "@hono/bun",
+ "@trpc/server",
+ "@trpc/client",
+ "@trpc/tanstack-react-query",
+ "@tanstack/react-query",
+ "@tanstack/react-router",
+ ]);
+ const deps = Object.fromEntries(
+ Object.entries(standardPackage("typescript")).filter(
+ ([library]) => !provided.has(library),
+ ),
+ );
+ expect(
+ deviationsFor(
+ typescriptConsole,
+ packageWith({
+ ...deps,
+ "@shepherdjerred/console-server": "workspace:*",
+ "@shepherdjerred/console-client": "workspace:*",
+ }),
+ catalog,
+ ),
+ ).toEqual([]);
+ });
+
+ test("workspace packages are not catalogued", () => {
+ const deps = {
+ ...standardPackage("typescript"),
+ react: "workspace:*",
+ };
+ expect(
+ deviationsFor(typescriptConsole, packageWith(deps), catalog),
+ ).toEqual([]);
+ });
+
+ test("a Rust console needs no server stack but may not carry one", () => {
+ const rust: ConsoleDefinition = {
+ ...typescriptConsole,
+ kind: "rust-client",
+ };
+ expect(
+ deviationsFor(rust, packageWith(standardPackage("rust-client")), catalog),
+ ).toEqual([]);
+ const withHono = deviationsFor(
+ rust,
+ packageWith({ ...standardPackage("rust-client"), hono: "catalog:" }),
+ catalog,
+ );
+ expect(withHono).toEqual([
+ expect.objectContaining({ kind: "banned", library: "hono" }),
+ ]);
+ });
+});
+
+describe("compare", () => {
+ const deviation: Deviation = {
+ app: "demo",
+ kind: "banned",
+ library: "react-router",
+ rule: "use TanStack Router, not react-router",
+ };
+ const entry: AllowlistEntry = {
+ app: "demo",
+ kind: "banned",
+ library: "react-router",
+ reason: "until the router PR",
+ };
+
+ test("an allowlisted deviation passes", () => {
+ const report = compare([deviation], [entry], ["demo"]);
+ expect(report.unlisted).toEqual([]);
+ expect(report.stale).toEqual([]);
+ expect(report.malformed).toEqual([]);
+ });
+
+ test("a deviation without an entry fails", () => {
+ expect(compare([deviation], [], ["demo"]).unlisted).toEqual([deviation]);
+ });
+
+ // The list only shrinks: fixing a deviation without deleting its entry fails.
+ test("an entry whose deviation disappeared is stale", () => {
+ expect(compare([], [entry], ["demo"]).stale).toEqual([entry]);
+ });
+
+ test("rejects unknown apps, empty reasons and duplicates", () => {
+ const report = compare(
+ [],
+ [{ ...entry, app: "ghost" }, { ...entry, reason: " " }, entry, entry],
+ ["demo"],
+ );
+ expect(report.malformed).toEqual([
+ 'ghost:banned:react-router: unknown app "ghost"',
+ "demo:banned:react-router: missing reason",
+ "demo:banned:react-router: duplicate",
+ "demo:banned:react-router: duplicate",
+ ]);
+ });
+});
+
+describe("renderTable", () => {
+ test("lists each deviation with its reason and marks clean apps", () => {
+ const definitions = [
+ typescriptConsole,
+ { ...typescriptConsole, id: "clean", label: "Clean" },
+ ];
+ const table = renderTable(
+ [
+ {
+ app: "demo",
+ kind: "banned",
+ library: "react-router",
+ rule: "x",
+ },
+ ],
+ [
+ {
+ app: "demo",
+ kind: "banned",
+ library: "react-router",
+ reason: "until the router PR",
+ },
+ ],
+ definitions,
+ );
+ expect(table).toContain("Demo");
+ expect(table).toContain("react-router");
+ expect(table).toContain("until the router PR");
+ expect(table).toMatch(/Clean\s+-\s+-\s+on the standard/);
+ });
+});
+
+describe("the repository", () => {
+ test("matches the allowlist exactly", async () => {
+ const { deviations, problems } = await collect(ROOT);
+ const report = compare(
+ deviations,
+ ALLOWLIST,
+ CONSOLES.map((definition) => definition.id),
+ );
+ expect(problems).toEqual([]);
+ expect(report.malformed).toEqual([]);
+ expect(report.unlisted).toEqual([]);
+ expect(report.stale).toEqual([]);
+ });
+
+ test("every required library is catalogued or pending, never both", async () => {
+ const { problems } = await collect(ROOT);
+ expect(problems).toEqual([]);
+ for (const library of CATALOG_PENDING) {
+ expect(Object.values(REQUIRED).flat()).toContain(library);
+ }
+ });
+
+ test("covers the ten consoles and console-ui", () => {
+ expect(CONSOLES.map((definition) => definition.id)).toEqual([
+ "hub",
+ "delivery",
+ "tracker",
+ "errors",
+ "mail",
+ "flags",
+ "feeds",
+ "golink",
+ "charts",
+ "ci-cache",
+ "console-ui",
+ ]);
+ });
+});
diff --git a/scripts/checks/check-console-stack.ts b/scripts/checks/check-console-stack.ts
new file mode 100644
index 0000000000..a75b34681b
--- /dev/null
+++ b/scripts/checks/check-console-stack.ts
@@ -0,0 +1,274 @@
+#!/usr/bin/env bun
+/**
+ * Console stack check: the ten first-party ops consoles share one stack, and
+ * this check reads their `package.json` files to keep it that way.
+ *
+ * The standard is written down in
+ * `packages/docs/wiki/src/content/docs/reference/console-stack.md`. For each
+ * console (and `console-ui`, which owns the shared pieces) the check derives a
+ * list of deviations: a library the standard requires that is missing, a
+ * banned alternative that is present, or a catalogued library whose spec is not
+ * `catalog:`. Today's deviations live in `ALLOWLIST` below, each with a reason.
+ *
+ * The allowlist only shrinks. A deviation that is not listed fails the check,
+ * and so does a listed deviation that no longer exists: the migration PR that
+ * removes a deviation removes its entry in the same change.
+ */
+import { z } from "zod";
+import {
+ ALLOWLIST,
+ BANNED_GROUPS,
+ CATALOG_PENDING,
+ KIT_PROVIDES,
+ CONSOLES,
+ REQUIRED,
+ RUST_BANNED,
+ type AllowlistEntry,
+ type ConsoleDefinition,
+ type Deviation,
+} from "./console-stack-rules.ts";
+
+const PackageJsonSchema = z.object({
+ name: z.string(),
+ dependencies: z.record(z.string(), z.string()).optional(),
+ devDependencies: z.record(z.string(), z.string()).optional(),
+ peerDependencies: z.record(z.string(), z.string()).optional(),
+ catalog: z.record(z.string(), z.string()).optional(),
+});
+
+type PackageJson = z.infer;
+
+/** Every dependency a package declares, with its spec. */
+function declared(pkg: PackageJson): Map {
+ return new Map([
+ ...Object.entries(pkg.peerDependencies ?? {}),
+ ...Object.entries(pkg.devDependencies ?? {}),
+ ...Object.entries(pkg.dependencies ?? {}),
+ ]);
+}
+
+function isBanned(name: string): string | undefined {
+ for (const group of BANNED_GROUPS) {
+ for (const banned of group.names) {
+ const matches = banned.endsWith("/")
+ ? name.startsWith(banned)
+ : name === banned;
+ if (matches) return `use ${group.replaces}, not ${name}`;
+ }
+ }
+ return undefined;
+}
+
+export function deviationsFor(
+ definition: ConsoleDefinition,
+ pkg: PackageJson,
+ catalog: ReadonlyMap,
+): Deviation[] {
+ const deps = declared(pkg);
+ const provided = new Set(
+ [...deps.keys()].flatMap((name) => KIT_PROVIDES[name] ?? []),
+ );
+ const deviations: Deviation[] = [];
+ for (const library of REQUIRED[definition.kind]) {
+ if (!deps.has(library) && !provided.has(library)) {
+ deviations.push({
+ app: definition.id,
+ kind: "missing",
+ library,
+ rule: `the standard requires ${library}`,
+ });
+ }
+ }
+ const bannedHere =
+ definition.kind === "rust-client"
+ ? RUST_BANNED.map((name) => ({
+ name,
+ rule: `${name} cannot run against a Rust server`,
+ }))
+ : [];
+ for (const [name, spec] of deps) {
+ const rule = isBanned(name);
+ if (rule !== undefined) {
+ deviations.push({
+ app: definition.id,
+ kind: "banned",
+ library: name,
+ rule,
+ });
+ }
+ const rust = bannedHere.find((entry) => entry.name === name);
+ if (rust !== undefined) {
+ deviations.push({
+ app: definition.id,
+ kind: "banned",
+ library: name,
+ rule: rust.rule,
+ });
+ }
+ if (
+ spec !== "catalog:" &&
+ !spec.startsWith("workspace:") &&
+ catalog.has(name)
+ ) {
+ deviations.push({
+ app: definition.id,
+ kind: "uncatalogued",
+ library: name,
+ rule: `${name} is in the root catalog; declare it as "catalog:", not "${spec}"`,
+ });
+ }
+ }
+ return deviations;
+}
+
+const keyOf = (item: { app: string; kind: string; library: string }): string =>
+ `${item.app}:${item.kind}:${item.library}`;
+
+export type StackReport = {
+ readonly deviations: readonly Deviation[];
+ /** Deviations with no allowlist entry. */
+ readonly unlisted: readonly Deviation[];
+ /** Allowlist entries whose deviation no longer exists. */
+ readonly stale: readonly AllowlistEntry[];
+ /** Allowlist entries that name an app or repeat another entry. */
+ readonly malformed: readonly string[];
+};
+
+export function compare(
+ deviations: readonly Deviation[],
+ allowlist: readonly AllowlistEntry[],
+ apps: readonly string[],
+): StackReport {
+ const present = new Set(deviations.map((item) => keyOf(item)));
+ const listed = new Set(allowlist.map((item) => keyOf(item)));
+ const malformed: string[] = [];
+ const seen = new Set();
+ for (const entry of allowlist) {
+ if (!apps.includes(entry.app)) {
+ malformed.push(`${keyOf(entry)}: unknown app "${entry.app}"`);
+ }
+ if (entry.reason.trim() === "") {
+ malformed.push(`${keyOf(entry)}: missing reason`);
+ }
+ if (seen.has(keyOf(entry))) malformed.push(`${keyOf(entry)}: duplicate`);
+ seen.add(keyOf(entry));
+ }
+ return {
+ deviations,
+ unlisted: deviations.filter((item) => !listed.has(keyOf(item))),
+ stale: allowlist.filter((item) => !present.has(keyOf(item))),
+ malformed,
+ };
+}
+
+/** A fixed-width table of deviations per app, with each one's allowlist reason. */
+export function renderTable(
+ deviations: readonly Deviation[],
+ allowlist: readonly AllowlistEntry[],
+ definitions: readonly ConsoleDefinition[] = CONSOLES,
+): string {
+ const reasons = new Map(allowlist.map((item) => [keyOf(item), item.reason]));
+ const rows = definitions.flatMap((definition) => {
+ const own = deviations.filter((item) => item.app === definition.id);
+ if (own.length === 0)
+ return [[definition.label, "-", "-", "on the standard"]];
+ return own.map((item) => [
+ definition.label,
+ item.kind,
+ item.library,
+ reasons.get(keyOf(item)) ?? "NOT ALLOWLISTED",
+ ]);
+ });
+ const header = ["app", "deviation", "library", "reason"];
+ const widths = header.map((title, column) =>
+ Math.max(title.length, ...rows.map((row) => row[column]?.length ?? 0)),
+ );
+ const line = (cells: readonly string[]): string =>
+ cells
+ .map((cell, column) => cell.padEnd(widths[column] ?? cell.length))
+ .join(" ")
+ .trimEnd();
+ return [
+ line(header),
+ line(widths.map((width) => "-".repeat(width))),
+ ...rows.map((row) => line(row)),
+ ].join("\n");
+}
+
+async function readPackage(path: string): Promise {
+ return PackageJsonSchema.parse(await Bun.file(path).json());
+}
+
+export async function collect(root: string): Promise<{
+ deviations: Deviation[];
+ catalog: ReadonlyMap;
+ problems: string[];
+}> {
+ const rootPackage = await readPackage(`${root}/package.json`);
+ const catalog = new Map(Object.entries(rootPackage.catalog ?? {}));
+ const problems: string[] = [];
+ const deviations: Deviation[] = [];
+ for (const definition of CONSOLES) {
+ deviations.push(
+ ...deviationsFor(
+ definition,
+ await readPackage(`${root}/${definition.directory}/package.json`),
+ catalog,
+ ),
+ );
+ if (
+ definition.kind === "rust-client" &&
+ !(await Bun.file(`${root}/${definition.directory}/Cargo.toml`).exists())
+ ) {
+ problems.push(
+ `${definition.id} is declared a Rust console but ${definition.directory}/Cargo.toml does not exist`,
+ );
+ }
+ }
+ for (const library of Object.values(REQUIRED).flat()) {
+ if (!catalog.has(library) && !CATALOG_PENDING.includes(library)) {
+ problems.push(
+ `the standard requires ${library} but the root package.json catalog does not list it; add it, or list it in CATALOG_PENDING`,
+ );
+ }
+ }
+ for (const library of CATALOG_PENDING) {
+ if (catalog.has(library)) {
+ problems.push(
+ `${library} is in the root catalog; delete it from CATALOG_PENDING in scripts/checks/console-stack-rules.ts`,
+ );
+ }
+ }
+ return { deviations, catalog, problems };
+}
+
+if (import.meta.main) {
+ const root = new URL("../..", import.meta.url).pathname;
+ const { deviations, problems } = await collect(root);
+ const report = compare(
+ deviations,
+ ALLOWLIST,
+ CONSOLES.map((definition) => definition.id),
+ );
+ console.log(renderTable(deviations, ALLOWLIST));
+ const failures = [
+ ...problems,
+ ...report.malformed,
+ ...report.unlisted.map(
+ (item) => `${keyOf(item)}: ${item.rule}, and it is not allowlisted`,
+ ),
+ ...report.stale.map(
+ (item) =>
+ `${keyOf(item)}: allowlisted but no longer a deviation; delete the entry from ALLOWLIST in scripts/checks/check-console-stack.ts`,
+ ),
+ ];
+ console.log(
+ `\n${String(deviations.length)} allowlisted deviation(s) across ${String(CONSOLES.length)} packages.`,
+ );
+ if (failures.length > 0) {
+ console.error("\ncheck-console-stack: FAIL");
+ for (const failure of failures) console.error(` - ${failure}`);
+ process.exit(1);
+ }
+ console.log("check-console-stack: OK");
+}
diff --git a/scripts/checks/console-stack-rules.ts b/scripts/checks/console-stack-rules.ts
new file mode 100644
index 0000000000..4e4d1b6e22
--- /dev/null
+++ b/scripts/checks/console-stack-rules.ts
@@ -0,0 +1,395 @@
+/**
+ * The console stack standard as data: which packages are consoles, what each
+ * kind requires, what is banned, and today's allowlisted deviations. The rules
+ * are enforced by `check-console-stack.ts` and written up in
+ * `packages/docs/wiki/src/content/docs/reference/console-stack.md`.
+ */
+
+export type ConsoleKind = "typescript" | "rust-client" | "shared-ui";
+
+export type ConsoleDefinition = {
+ /** Short id used in the allowlist and the report. */
+ readonly id: string;
+ readonly label: string;
+ /** Directory holding the `package.json`, relative to the repository root. */
+ readonly directory: string;
+ readonly kind: ConsoleKind;
+};
+
+export const CONSOLES: readonly ConsoleDefinition[] = [
+ {
+ id: "hub",
+ label: "Hub",
+ directory: "packages/alert-dashboard",
+ kind: "typescript",
+ },
+ {
+ id: "delivery",
+ label: "Delivery",
+ directory: "packages/delivery",
+ kind: "typescript",
+ },
+ {
+ id: "tracker",
+ label: "Tracker",
+ directory: "packages/tracker",
+ kind: "typescript",
+ },
+ {
+ id: "errors",
+ label: "Errors",
+ directory: "packages/errors",
+ kind: "typescript",
+ },
+ { id: "mail", label: "Mail", directory: "packages/mail", kind: "typescript" },
+ {
+ id: "flags",
+ label: "Flags",
+ directory: "packages/flags",
+ kind: "typescript",
+ },
+ {
+ id: "feeds",
+ label: "Feeds",
+ directory: "packages/feeds",
+ kind: "typescript",
+ },
+ {
+ id: "golink",
+ label: "Go link",
+ directory: "packages/golink",
+ kind: "typescript",
+ },
+ {
+ id: "charts",
+ label: "Charts",
+ directory: "packages/charts",
+ kind: "rust-client",
+ },
+ {
+ id: "ci-cache",
+ label: "CI cache",
+ directory: "packages/ci-cache",
+ kind: "rust-client",
+ },
+ {
+ id: "console-ui",
+ label: "console-ui",
+ directory: "packages/console-ui",
+ kind: "shared-ui",
+ },
+];
+
+/** What every console builds and tests with. */
+const TOOLCHAIN = [
+ "react",
+ "react-dom",
+ "@types/react",
+ "@types/react-dom",
+ "@vitejs/plugin-react",
+ "typescript",
+ "vite",
+ "vitest",
+ "zod",
+ "lucide-react",
+] as const;
+
+/** Router and browser data: TanStack Router, tRPC with TanStack Query. */
+const BROWSER_STACK = ["@tanstack/react-query", "@tanstack/react-router"];
+
+/** tRPC, Hono on Bun and Prisma on PostgreSQL: the TypeScript server stack. */
+const SERVER_STACK = [
+ "@trpc/client",
+ "@trpc/server",
+ "@trpc/tanstack-react-query",
+ "hono",
+ "@hono/bun",
+ "prisma",
+ "@prisma/client",
+ "@prisma/adapter-pg",
+];
+
+/** The shared pieces console-ui owns for every console. */
+const SHARED_UI = [
+ "react",
+ "react-dom",
+ "@types/react",
+ "@types/react-dom",
+ "typescript",
+ "vitest",
+ "lucide-react",
+ "@base-ui/react",
+ "clsx",
+ "@tanstack/react-table",
+ "@tanstack/react-form",
+];
+
+export const REQUIRED: Readonly> = {
+ typescript: [...TOOLCHAIN, ...BROWSER_STACK, ...SERVER_STACK],
+ // Rust servers cannot serve tRPC or use Prisma: their clients use TanStack
+ // Query over REST with Zod, and the servers keep rusqlite.
+ "rust-client": [...TOOLCHAIN, ...BROWSER_STACK],
+ "shared-ui": SHARED_UI,
+};
+
+/**
+ * Shared kits that carry part of the stack for their consumers. A console that
+ * depends on a kit counts as declaring the libraries the kit provides.
+ */
+export const KIT_PROVIDES: Readonly> = {
+ "@shepherdjerred/console-server": [
+ "hono",
+ "@hono/bun",
+ "@trpc/server",
+ "@trpc/client",
+ ],
+ "@shepherdjerred/console-client": [
+ "@tanstack/react-query",
+ "@tanstack/react-router",
+ "@trpc/client",
+ "@trpc/server",
+ "@trpc/tanstack-react-query",
+ ],
+};
+
+/**
+ * Required libraries not in the root catalog yet. Knip rejects a catalog entry
+ * that no package uses, so the change that first declares one adds it to the
+ * catalog and deletes it here.
+ */
+export const CATALOG_PENDING: readonly string[] = [];
+
+/**
+ * Libraries a Rust console's client must not carry: the server stack cannot
+ * run against a Rust server.
+ */
+export const RUST_BANNED = ["hono", "@hono/bun", "@trpc/server", "prisma"];
+
+/**
+ * Alternatives the standard replaces. An entry ending in `/` bans the whole
+ * scope or prefix.
+ */
+export const BANNED_GROUPS: readonly {
+ replaces: string;
+ names: readonly string[];
+}[] = [
+ {
+ replaces: "TanStack Router",
+ names: [
+ "react-router",
+ "react-router-dom",
+ "@remix-run/router",
+ "wouter",
+ "@reach/router",
+ "navigo",
+ ],
+ },
+ {
+ replaces: "tRPC with TanStack Query",
+ names: ["swr", "axios", "ky", "ofetch", "got", "node-fetch", "superagent"],
+ },
+ {
+ replaces: "uPlot",
+ names: [
+ "recharts",
+ "echarts",
+ "echarts-for-react",
+ "chart.js",
+ "react-chartjs-2",
+ "d3",
+ "victory",
+ "apexcharts",
+ "plotly.js",
+ "@visx/",
+ "@nivo/",
+ ],
+ },
+ {
+ replaces: "Temporal (@js-temporal/polyfill) and Intl",
+ names: [
+ "date-fns",
+ "dayjs",
+ "luxon",
+ "moment",
+ "moment-timezone",
+ "@date-fns/",
+ ],
+ },
+ {
+ replaces: "TanStack Form",
+ names: ["react-hook-form", "formik", "final-form", "react-final-form"],
+ },
+ {
+ replaces: "Base UI",
+ names: [
+ "@radix-ui/",
+ "radix-ui",
+ "@headlessui/react",
+ "react-aria",
+ "react-aria-components",
+ "@react-aria/",
+ "ariakit",
+ "@ariakit/",
+ ],
+ },
+ {
+ replaces: "TanStack Virtual",
+ names: ["react-window", "react-virtualized", "react-virtuoso"],
+ },
+ {
+ replaces: "dnd-kit",
+ names: ["react-dnd", "react-beautiful-dnd", "@hello-pangea/dnd"],
+ },
+ {
+ replaces: "react-markdown with remark-gfm",
+ names: ["marked", "markdown-it", "showdown", "snarkdown"],
+ },
+ {
+ replaces: "plain CSS on console-ui",
+ names: [
+ "tailwindcss",
+ "@tailwindcss/",
+ "styled-components",
+ "@emotion/",
+ "goober",
+ ],
+ },
+ {
+ replaces: "Hono on Bun",
+ names: ["express", "fastify", "koa", "@hapi/hapi"],
+ },
+ {
+ replaces: "Prisma on PostgreSQL",
+ names: [
+ "better-sqlite3",
+ "sqlite3",
+ "@libsql/client",
+ "@prisma/adapter-libsql",
+ "@prisma/adapter-better-sqlite3",
+ ],
+ },
+];
+
+export type Deviation = {
+ readonly app: string;
+ /** `missing`, `banned` or `uncatalogued`. */
+ readonly kind: "missing" | "banned" | "uncatalogued";
+ readonly library: string;
+ /** The rule the deviation breaks, for the report. */
+ readonly rule: string;
+};
+
+export type AllowlistEntry = {
+ readonly app: string;
+ readonly kind: Deviation["kind"];
+ readonly library: string;
+ /** Why the deviation exists today and which change removes it. */
+ readonly reason: string;
+};
+
+const TRPC = ["@trpc/client", "@trpc/server", "@trpc/tanstack-react-query"];
+const PRISMA = ["prisma", "@prisma/client", "@prisma/adapter-pg"];
+
+const ROUTER = "TanStack Router lands with the app's router PR";
+const API = "browser and callers use REST until the app's tRPC API PR";
+const DATABASE = "raw SQLite until the app's PostgreSQL and Prisma PR";
+
+function entries(
+ app: string,
+ kind: AllowlistEntry["kind"],
+ libraries: readonly string[],
+ reason: string,
+): AllowlistEntry[] {
+ return libraries.map((library) => ({ app, kind, library, reason }));
+}
+
+/**
+ * Today's deviations, exactly. Migration PRs delete entries; nothing adds one
+ * without changing this file in review.
+ */
+export const ALLOWLIST: readonly AllowlistEntry[] = [
+ // Hub: React Router 8 and Prisma on SQLite; tRPC and Hono are already in.
+ ...entries("hub", "banned", ["react-router"], "react-router until Hub-R"),
+ ...entries("hub", "missing", ["@tanstack/react-router"], ROUTER),
+ ...entries(
+ "hub",
+ "banned",
+ ["@prisma/adapter-libsql"],
+ "Prisma on SQLite until Hub's PostgreSQL move",
+ ),
+ ...entries(
+ "hub",
+ "missing",
+ ["@prisma/adapter-pg"],
+ "Prisma on SQLite until Hub's PostgreSQL move",
+ ),
+ // Delivery: TanStack Router and Prisma on PostgreSQL are in; 125 REST routes remain.
+ ...entries(
+ "delivery",
+ "missing",
+ TRPC,
+ "125 REST routes until Delivery's tRPC API PR",
+ ),
+ // Tracker: React Router 8, and a plain tRPC client without TanStack Query's integration.
+ ...entries(
+ "tracker",
+ "banned",
+ ["react-router"],
+ "react-router until Tracker-R",
+ ),
+ ...entries("tracker", "missing", ["@tanstack/react-router"], ROUTER),
+ ...entries(
+ "tracker",
+ "missing",
+ ["@trpc/tanstack-react-query"],
+ "plain tRPC client until Tracker moves to the TanStack Query integration",
+ ),
+ // Errors: React Router 8, REST for the browser, static files served by hand.
+ ...entries(
+ "errors",
+ "banned",
+ ["react-router"],
+ "react-router until Errors-R",
+ ),
+ ...entries("errors", "missing", ["@tanstack/react-router"], ROUTER),
+ ...entries("errors", "missing", TRPC, API),
+ ...entries(
+ "errors",
+ "missing",
+ ["@hono/bun"],
+ "static files served by hand until the shared server kit",
+ ),
+ // Mail: React Router 8, REST, raw SQLite.
+ ...entries("mail", "banned", ["react-router"], "react-router until Mail-R"),
+ ...entries("mail", "missing", ["@tanstack/react-router"], ROUTER),
+ ...entries("mail", "missing", TRPC, API),
+ ...entries("mail", "missing", PRISMA, DATABASE),
+ // Flags: React Router 8, REST, raw SQLite.
+ ...entries("flags", "banned", ["react-router"], "react-router until Flags-R"),
+ ...entries("flags", "missing", ["@tanstack/react-router"], ROUTER),
+ ...entries("flags", "missing", TRPC, API),
+ ...entries("flags", "missing", PRISMA, DATABASE),
+ // Feeds: a hand-rolled router, REST, raw SQLite.
+ ...entries(
+ "feeds",
+ "missing",
+ ["@tanstack/react-router"],
+ "hand-rolled router until Feeds' router PR",
+ ),
+ ...entries("feeds", "missing", TRPC, API),
+ ...entries("feeds", "missing", PRISMA, DATABASE),
+ // Go link is on the shared server and client kits: nothing left to allowlist.
+ // Rust consoles: single pages reading the URL by hand, no TanStack Query yet.
+ ...entries(
+ "charts",
+ "missing",
+ ["@tanstack/react-router", "@tanstack/react-query"],
+ "single page reading the URL by hand until Charts' client PR",
+ ),
+ ...entries(
+ "ci-cache",
+ "missing",
+ ["@tanstack/react-router", "@tanstack/react-query"],
+ "single page reading the URL by hand until CI cache's client PR",
+ ),
+];
diff --git a/scripts/checks/deps/check-floating-deps.test.ts b/scripts/checks/deps/check-floating-deps.test.ts
index aa71b02a00..e2ae84096d 100644
--- a/scripts/checks/deps/check-floating-deps.test.ts
+++ b/scripts/checks/deps/check-floating-deps.test.ts
@@ -40,6 +40,8 @@ describe("classifySpec", () => {
"workspace:*",
"file:../eslint-config",
"link:../thing",
+ "catalog:",
+ "catalog:testing",
]) {
expect(classifySpec(spec)).toEqual({ ok: true });
}
@@ -97,6 +99,20 @@ describe("manifestErrors", () => {
});
});
+describe("catalog entries", () => {
+ test("are checked like dependency specs", () => {
+ const manifest = JSON.stringify({
+ catalog: { react: "19.3.1", zod: "latest", clsx: "catalog:" },
+ catalogs: { testing: { vitest: "*" } },
+ });
+ const errors = manifestErrors("package.json", manifest);
+ expect(errors).toHaveLength(3);
+ expect(errors.join("\n")).toContain("catalog.zod");
+ expect(errors.join("\n")).toContain("catalog.clsx");
+ expect(errors.join("\n")).toContain("catalogs.testing.vitest");
+ });
+});
+
describe("readWorkspacePatterns", () => {
test("requires an array of strings", () => {
expect(() => readWorkspacePatterns(JSON.stringify({}))).toThrow(
diff --git a/scripts/checks/deps/check-floating-deps.ts b/scripts/checks/deps/check-floating-deps.ts
index e047d2a78f..eec738274b 100644
--- a/scripts/checks/deps/check-floating-deps.ts
+++ b/scripts/checks/deps/check-floating-deps.ts
@@ -36,6 +36,13 @@ const dependencyFields = [
*/
const pinnedProtocols = ["workspace:", "file:", "link:"];
+/**
+ * `catalog:` and `catalog:` defer to the root manifest's `catalog` and
+ * `catalogs` entries, which are checked here like any other dependency field,
+ * so a catalogued spec is pinnable exactly when its catalog entry is.
+ */
+const catalogProtocol = "catalog:";
+
export type SpecVerdict = { ok: true } | { ok: false; reason: string };
/**
@@ -54,7 +61,7 @@ export function classifySpec(rawSpec: string): SpecVerdict {
};
}
- for (const protocol of pinnedProtocols) {
+ for (const protocol of [...pinnedProtocols, catalogProtocol]) {
if (spec.startsWith(protocol)) return { ok: true };
}
@@ -127,6 +134,36 @@ export function manifestErrors(
}
}
}
+ errors.push(...catalogErrors(relativePath, manifestRaw));
+ return errors;
+}
+
+/** Check the root manifest's `catalog` and `catalogs` entries as dependency specs. */
+function catalogErrors(relativePath: string, manifest: object): string[] {
+ const errors: string[] = [];
+ const check = (label: string, entries: unknown): void => {
+ if (typeof entries !== "object" || entries === null) return;
+ for (const [name, specRaw] of Object.entries(entries)) {
+ if (typeof specRaw !== "string") {
+ throw new TypeError(
+ `${relativePath} ${label}.${name} must be a string`,
+ );
+ }
+ const verdict = classifySpec(specRaw);
+ if (!verdict.ok || specRaw.startsWith(catalogProtocol)) {
+ errors.push(
+ `${relativePath} ${label}.${name}: ${verdict.ok ? "a catalog entry cannot reference another catalog" : verdict.reason}`,
+ );
+ }
+ }
+ };
+ check("catalog", Reflect.get(manifest, "catalog"));
+ const named: unknown = Reflect.get(manifest, "catalogs");
+ if (typeof named === "object" && named !== null) {
+ for (const [group, entries] of Object.entries(named)) {
+ check(`catalogs.${group}`, entries);
+ }
+ }
return errors;
}
diff --git a/scripts/checks/deps/check-renovate-hints.test.ts b/scripts/checks/deps/check-renovate-hints.test.ts
index e3000ccc86..c5460969d3 100644
--- a/scripts/checks/deps/check-renovate-hints.test.ts
+++ b/scripts/checks/deps/check-renovate-hints.test.ts
@@ -11,12 +11,15 @@ import {
const ConfigSchema = z.object({
customManagers: z.array(
- z.object({
- customType: z.literal("regex"),
- description: z.string(),
- managerFilePatterns: z.array(z.string()),
- matchStrings: z.array(z.string()),
- }),
+ z.union([
+ z.object({
+ customType: z.literal("regex"),
+ description: z.string(),
+ managerFilePatterns: z.array(z.string()),
+ matchStrings: z.array(z.string()),
+ }),
+ z.looseObject({ customType: z.literal("jsonata") }),
+ ]),
),
});
@@ -24,7 +27,9 @@ async function repositoryManagers(): Promise {
const config = ConfigSchema.parse(
await Bun.file(`${import.meta.dir}/../../../renovate.json`).json(),
);
- return config.customManagers;
+ return config.customManagers.flatMap((manager) =>
+ manager.customType === "regex" ? [manager] : [],
+ );
}
// Fixtures are assembled from parts so this file never contains a real hint
diff --git a/scripts/checks/deps/check-renovate-hints.ts b/scripts/checks/deps/check-renovate-hints.ts
index cc04a63a68..426a9b104f 100644
--- a/scripts/checks/deps/check-renovate-hints.ts
+++ b/scripts/checks/deps/check-renovate-hints.ts
@@ -27,8 +27,23 @@ const RegexManagerSchema = z.object({
matchStrings: z.array(z.string()),
});
+/**
+ * Hinted pins are read only by regex managers. Other manager types (the
+ * JSONata manager that reads the root Bun catalog) are not hint readers.
+ */
+const CustomManagerSchema = z.union([
+ RegexManagerSchema,
+ z.looseObject({ customType: z.literal("jsonata") }),
+]);
+
const RenovateConfigSchema = z.object({
- customManagers: z.array(RegexManagerSchema),
+ customManagers: z
+ .array(CustomManagerSchema)
+ .transform((managers) =>
+ managers.flatMap((manager) =>
+ manager.customType === "regex" ? [manager] : [],
+ ),
+ ),
customDatasources: z.record(z.string(), z.unknown()).optional(),
ignorePaths: z.array(z.string()).optional(),
});
diff --git a/scripts/misc/new-service-console.ts b/scripts/misc/new-service-console.ts
new file mode 100644
index 0000000000..fbd49dbec7
--- /dev/null
+++ b/scripts/misc/new-service-console.ts
@@ -0,0 +1,481 @@
+import type { ServiceOptions } from "./new-service-options.ts";
+
+/**
+ * The opt-in `--console` template of `new-service.ts`: a web service on the
+ * stack standard for first-party ops consoles, written up in the wiki
+ * reference "Console stack" and enforced by `scripts/checks/check-console-stack.ts`.
+ *
+ * A Hono server on Bun with `/healthz`, a tRPC router, a Prisma schema for
+ * PostgreSQL, and a Vite + React client with TanStack Router, the
+ * `@trpc/tanstack-react-query` provider and console-ui's shell. Every
+ * dependency a shared catalog entry covers is declared `catalog:`. Paths are
+ * relative to the repository root.
+ */
+
+const CATALOG = "catalog:";
+
+function sorted(
+ entries: Readonly>,
+): Record {
+ return Object.fromEntries(
+ Object.entries(entries).toSorted(([a], [b]) => (a < b ? -1 : 1)),
+ );
+}
+
+/** The console's `package.json`, replacing the base scaffold's. */
+function packageJson({ name }: ServiceOptions): string {
+ return `${JSON.stringify(
+ {
+ name: `@shepherdjerred/${name}`,
+ version: "0.1.0",
+ type: "module",
+ private: true,
+ exports: { "./*": "./src/*" },
+ scripts: {
+ generate: "prisma generate",
+ build: "vite build",
+ dev: "bun --watch src/index.ts",
+ "dev:client": "vite",
+ start: "bun src/index.ts",
+ test: "bun --no-install --bun vitest --config ../../vitest.config.ts run src",
+ "test:ci": "bun ../../scripts/ci/run-ci-test.ts",
+ typecheck:
+ "PATH=node_modules/@typescript/native/bin:$PATH tsc --noEmit",
+ lint: "eslint . --max-warnings=0",
+ },
+ dependencies: sorted({
+ "@hono/bun": CATALOG,
+ "@prisma/adapter-pg": CATALOG,
+ "@prisma/client": CATALOG,
+ "@tanstack/react-query": CATALOG,
+ "@tanstack/react-router": CATALOG,
+ "@trpc/client": CATALOG,
+ "@trpc/server": CATALOG,
+ "@trpc/tanstack-react-query": CATALOG,
+ hono: CATALOG,
+ "lucide-react": CATALOG,
+ prisma: CATALOG,
+ react: CATALOG,
+ "react-dom": CATALOG,
+ zod: CATALOG,
+ }),
+ devDependencies: sorted({
+ "@shepherdjerred/console-ui": "workspace:*",
+ "@shepherdjerred/eslint-config": "workspace:*",
+ "@types/bun": "1.4.5",
+ "@types/react": CATALOG,
+ "@types/react-dom": CATALOG,
+ "@typescript/native": "npm:typescript@7.0.2",
+ "@vitejs/plugin-react": CATALOG,
+ "@vitest/coverage-istanbul": CATALOG,
+ eslint: "^10.7.0",
+ typescript: CATALOG,
+ vite: CATALOG,
+ vitest: CATALOG,
+ }),
+ },
+ undefined,
+ 2,
+ )}\n`;
+}
+
+const ESLINT_CONFIG = `import { recommended } from "@shepherdjerred/eslint-config";
+
+export default [
+ ...recommended({
+ tsconfigRootDir: import.meta.dirname,
+ react: true,
+ ignores: ["generated/**", "dist/**"],
+ }),
+ {
+ // Prisma loads its config under Node, where \`Bun\` does not exist.
+ files: ["prisma.config.ts"],
+ rules: { "custom-rules/prefer-bun-apis": "off" },
+ },
+];
+`;
+
+const TSCONFIG = `${JSON.stringify(
+ {
+ extends: "../../tsconfig.base.json",
+ compilerOptions: {
+ lib: ["ESNext", "DOM", "DOM.Iterable"],
+ types: ["bun", "vite/client"],
+ jsx: "react-jsx",
+ noEmit: true,
+ },
+ include: ["src", "eslint.config.ts", "prisma.config.ts", "vite.config.ts"],
+ },
+ undefined,
+ 2,
+)}\n`;
+
+function viteConfig({ port }: ServiceOptions): string {
+ return `import react from "@vitejs/plugin-react";
+import { defineConfig } from "vite";
+
+export default defineConfig({
+ plugins: [react()],
+ build: { outDir: "dist/client", emptyOutDir: true, sourcemap: true },
+ server: {
+ host: "127.0.0.1",
+ port: ${String(port + 1)},
+ strictPort: true,
+ proxy: {
+ "/healthz": "http://127.0.0.1:${String(port)}",
+ "/trpc": "http://127.0.0.1:${String(port)}",
+ },
+ },
+});
+`;
+}
+
+function indexHtml({ title }: ServiceOptions): string {
+ return `
+
+
+
+
+
+ ${title}
+
+
+
+
+
+
+`;
+}
+
+const PRISMA_SCHEMA = `generator client {
+ provider = "prisma-client"
+ output = "../generated/prisma"
+ runtime = "bun"
+ moduleFormat = "esm"
+}
+
+datasource db {
+ provider = "postgresql"
+}
+
+// Placeholder. Replace it with the console's models and add a migration:
+// bunx prisma migrate dev --name init
+model Example {
+ id String @id @default(uuid())
+ name String
+ createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
+
+ @@map("examples")
+}
+`;
+
+function prismaConfig({ name, port }: ServiceOptions): string {
+ return `import { defineConfig } from "prisma/config";
+
+export default defineConfig({
+ schema: "prisma/schema.prisma",
+ datasource: {
+ url:
+ process.env["DATABASE_URL"] ??
+ "postgres://postgres@127.0.0.1:${String(port + 2)}/${name.replaceAll("-", "_")}",
+ },
+});
+`;
+}
+
+function serverSource({ name }: ServiceOptions): string {
+ return `import { serveStatic } from "@hono/bun";
+import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
+import { Hono } from "hono";
+import { appRouter } from "./router.ts";
+
+export type AppOptions = {
+ /** A built client directory to serve; the API answers alone when unset. */
+ readonly clientRoot?: string;
+};
+
+/**
+ * The console's HTTP surface: \`/healthz\` for the kubelet and the image smoke
+ * run, \`/trpc\` for every first-party caller, and the built client.
+ */
+export function createApp({ clientRoot }: AppOptions = {}): Hono {
+ const app = new Hono();
+ app.get("/healthz", (context) => context.text("ok"));
+ app.all("/trpc/*", (context) =>
+ fetchRequestHandler({
+ endpoint: "/trpc",
+ req: context.req.raw,
+ router: appRouter,
+ createContext: () => ({}),
+ }),
+ );
+ if (clientRoot !== undefined) {
+ app.use("/assets/*", serveStatic({ root: clientRoot }));
+ app.get("*", serveStatic({ root: clientRoot, path: "index.html" }));
+ }
+ return app;
+}
+
+export function startServer(port: number, hostname: string) {
+ const app = createApp({ clientRoot: "./dist/client" });
+ const server = Bun.serve({ port, hostname, fetch: app.fetch });
+ console.warn(\`${name} listening on :\${String(server.port)}\`);
+ return server;
+}
+`;
+}
+
+const ROUTER_SOURCE = `import { initTRPC } from "@trpc/server";
+import { z } from "zod";
+
+const t = initTRPC.create();
+
+/** The API every caller shares: the browser, the toolkit, Temporal and CI. */
+export const appRouter = t.router({
+ hello: t.procedure
+ .input(z.object({ name: z.string().min(1).optional() }))
+ .query(({ input }) => ({ greeting: \`Hello, \${input.name ?? "world"}\` })),
+});
+
+export type AppRouter = typeof appRouter;
+`;
+
+const DB_SOURCE = `import { PrismaPg } from "@prisma/adapter-pg";
+
+/** The driver adapter the generated Prisma client takes for PostgreSQL. */
+export function createDatabaseAdapter(connectionString: string): PrismaPg {
+ return new PrismaPg({ connectionString });
+}
+`;
+
+const DB_TEST = `import { expect, test } from "vitest";
+import { createDatabaseAdapter } from "./db.ts";
+
+test("builds a PostgreSQL driver adapter without connecting", () => {
+ const adapter = createDatabaseAdapter("postgres://postgres@127.0.0.1:1/x");
+ expect(adapter.provider).toBe("postgres");
+});
+`;
+
+function serverTest(): string {
+ return `import { expect, test } from "vitest";
+import { createApp } from "./server.ts";
+
+test("reports health", async () => {
+ const response = await createApp().request("/healthz");
+ expect(response.status).toBe(200);
+ expect(await response.text()).toBe("ok");
+});
+
+test("answers the example procedure over tRPC", async () => {
+ const input = encodeURIComponent(JSON.stringify({ name: "Ada" }));
+ const response = await createApp().request(\`/trpc/hello?input=\${input}\`);
+ expect(response.status).toBe(200);
+ expect(await response.json()).toEqual({
+ result: { data: { greeting: "Hello, Ada" } },
+ });
+});
+
+test("answers 404 for an unknown API path", async () => {
+ const response = await createApp().request("/nope");
+ expect(response.status).toBe(404);
+});
+`;
+}
+
+function trpcSource({ name }: ServiceOptions): string {
+ return `import { createTRPCContext } from "@trpc/tanstack-react-query";
+import type { AppRouter } from "@shepherdjerred/${name}/router.ts";
+
+export const { TRPCProvider, useTRPC } = createTRPCContext();
+`;
+}
+
+function mainSource({ name }: ServiceOptions): string {
+ return `import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { RouterProvider } from "@tanstack/react-router";
+import { createTRPCClient, httpBatchLink } from "@trpc/client";
+import { StrictMode } from "react";
+import { createRoot } from "react-dom/client";
+import type { AppRouter } from "@shepherdjerred/${name}/router.ts";
+import { createAppRouter } from "./routes.tsx";
+import { TRPCProvider } from "./trpc.ts";
+import "@shepherdjerred/console-ui/styles/index.css";
+
+const queryClient = new QueryClient();
+const trpcClient = createTRPCClient({
+ links: [httpBatchLink({ url: "/trpc" })],
+});
+const router = createAppRouter();
+
+const root = document.querySelector("#root");
+if (root === null) throw new Error("${name} page is missing #root");
+
+createRoot(root).render(
+
+
+
+
+
+
+ ,
+);
+`;
+}
+
+/**
+ * The directive the generated route file needs for one `interface`. It is
+ * assembled so this template is not itself read as a lint suppression.
+ */
+const SUPPRESSION = ["eslint", "disable", "next", "line"].join("-");
+
+function routesSource(options: ServiceOptions): string {
+ const { title } = options;
+ return `import { useQuery } from "@tanstack/react-query";
+import {
+ Link,
+ Outlet,
+ createRootRoute,
+ createRoute,
+ createRouter,
+ useSearch,
+ type RouterHistory,
+} from "@tanstack/react-router";
+import { HouseIcon } from "lucide-react";
+import { z } from "zod";
+import {
+ HeaderBar,
+ PageBody,
+ ShellFrame,
+ Sidebar,
+ SidebarGroup,
+ SidebarItem,
+} from "@shepherdjerred/console-ui";
+import { useTRPC } from "./trpc.ts";
+
+function Shell(): React.JSX.Element {
+ return (
+
+
+ (
+
+ {link.children}
+
+ )}
+ />
+
+
+ }
+ >
+
+
+ );
+}
+
+/** Every URL parameter is validated with Zod before a page reads it. */
+const homeSearch = z.object({ name: z.string().min(1).optional() });
+
+function Home(): React.JSX.Element {
+ const trpc = useTRPC();
+ const { name } = useSearch({ from: "/" });
+ const greeting = useQuery(trpc.hello.queryOptions({ name }));
+ return (
+ <>
+
+
+ {greeting.data?.greeting ?? "Loading…"}
+
+ >
+ );
+}
+
+const rootRoute = createRootRoute({ component: Shell });
+const homeRoute = createRoute({
+ getParentRoute: () => rootRoute,
+ path: "/",
+ validateSearch: homeSearch,
+ component: Home,
+});
+
+const routeTree = rootRoute.addChildren([homeRoute]);
+
+/** The browser uses its own history; tests pass a memory history. */
+export function createAppRouter(history?: RouterHistory) {
+ return createRouter({ routeTree, ...(history === undefined ? {} : { history }) });
+}
+
+declare module "@tanstack/react-router" {
+ // TanStack Router discovers the route tree through declaration merging,
+ // which only works with an interface: a type alias cannot merge.
+ // ${SUPPRESSION} @typescript-eslint/consistent-type-definitions -- declaration merging requires \`interface\`
+ interface Register {
+ router: ReturnType;
+ }
+}
+`;
+}
+
+function routesTest({ name, title }: ServiceOptions): string {
+ return `import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { createTRPCClient, httpBatchLink } from "@trpc/client";
+import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
+import { renderToString } from "react-dom/server";
+import { expect, test } from "vitest";
+import type { AppRouter } from "@shepherdjerred/${name}/router.ts";
+import { createAppRouter } from "./routes.tsx";
+import { TRPCProvider } from "./trpc.ts";
+
+test("renders the shell and the page header at the index route", async () => {
+ const queryClient = new QueryClient();
+ const trpcClient = createTRPCClient({
+ links: [httpBatchLink({ url: "http://localhost/trpc" })],
+ });
+ const router = createAppRouter(
+ createMemoryHistory({ initialEntries: ["/?name=Ada"] }),
+ );
+ await router.load();
+ const html = renderToString(
+
+
+
+
+ ,
+ );
+ expect(html).toContain("ui-shell");
+ expect(html).toContain("ui-header");
+ expect(html).toContain("${title}");
+});
+`;
+}
+
+/** Every file the console template creates or replaces, under the package. */
+export function consoleFiles(
+ options: ServiceOptions,
+): Readonly> {
+ const base = `packages/${options.name}`;
+ return {
+ [`${base}/package.json`]: packageJson(options),
+ [`${base}/eslint.config.ts`]: ESLINT_CONFIG,
+ [`${base}/tsconfig.json`]: TSCONFIG,
+ [`${base}/vite.config.ts`]: viteConfig(options),
+ [`${base}/index.html`]: indexHtml(options),
+ [`${base}/prisma.config.ts`]: prismaConfig(options),
+ [`${base}/prisma/schema.prisma`]: PRISMA_SCHEMA,
+ [`${base}/src/server.ts`]: serverSource(options),
+ [`${base}/src/server.test.ts`]: serverTest(),
+ [`${base}/src/router.ts`]: ROUTER_SOURCE,
+ [`${base}/src/db.ts`]: DB_SOURCE,
+ [`${base}/src/db.test.ts`]: DB_TEST,
+ [`${base}/src/client/main.tsx`]: mainSource(options),
+ [`${base}/src/client/routes.tsx`]: routesSource(options),
+ [`${base}/src/client/routes.test.tsx`]: routesTest(options),
+ [`${base}/src/client/trpc.ts`]: trpcSource(options),
+ };
+}
diff --git a/scripts/misc/new-service-files.ts b/scripts/misc/new-service-files.ts
index 2efe56067d..495894a292 100644
--- a/scripts/misc/new-service-files.ts
+++ b/scripts/misc/new-service-files.ts
@@ -1,3 +1,4 @@
+import { consoleFiles } from "./new-service-console.ts";
import type { ServiceOptions } from "./new-service-options.ts";
/**
@@ -80,7 +81,7 @@ test("answers 404 elsewhere", () => {
* the new image starts on the digests the fleet already runs.
*/
function dockerfile(
- { name, port }: ServiceOptions,
+ { name, port, console: isConsole }: ServiceOptions,
pins: { syntax: string; base: string },
): string {
const workspace = `@shepherdjerred/${name}`;
@@ -115,7 +116,7 @@ RUN bun install --frozen-lockfile --filter '${workspace}'
# Add each workspace dependency's directory to this COPY and to the runtime
# stage's as the service gains them.
FROM deps AS build
-COPY --parents tsconfig.base.json packages/${name} packages/eslint-config ./
+COPY --parents tsconfig.base.json packages/${name} packages/eslint-config${isConsole === true ? " packages/console-ui" : ""} ./
RUN cd packages/${name} && bun run build
FROM base AS prod-deps
@@ -410,5 +411,7 @@ export function serviceFiles(
[`${source}/resources/argo-applications/apps/${name}.ts`]:
applicationSource(options),
[`${CDK8S_ROOT}/helm/${name}/Chart.yaml`]: helmChart(options),
+ // The console template replaces the health-only server and its test.
+ ...(options.console === true ? consoleFiles(options) : {}),
};
}
diff --git a/scripts/misc/new-service-options.ts b/scripts/misc/new-service-options.ts
index 76d9676580..75f76e579e 100644
--- a/scripts/misc/new-service-options.ts
+++ b/scripts/misc/new-service-options.ts
@@ -13,10 +13,12 @@ export type ServiceOptions = {
host?: string;
/** The catalog title. */
title: string;
+ /** Scaffold the first-party console stack instead of a health-only server. */
+ console?: boolean;
};
export const USAGE =
- "Usage: bun scripts/misc/new-service.ts --name --kind web|worker --port [--host ] [--title ]";
+ "Usage: bun scripts/misc/new-service.ts --name --kind web|worker --port [--host ] [--title ] [--console]";
const HOST_PATTERN = /^[a-z][a-z0-9-]*$/u;
/** In-image smoke runs bind `port + 10000`, which must stay a valid port. */
@@ -40,6 +42,7 @@ export function parseServiceOptions(argv: readonly string[]): ServiceOptions {
port: { type: "string" },
host: { type: "string" },
title: { type: "string" },
+ console: { type: "boolean" },
},
strict: true,
});
@@ -55,6 +58,8 @@ export function parseServiceOptions(argv: readonly string[]): ServiceOptions {
throw usage("--host is required for a web service");
if (kind === "worker" && host !== undefined)
throw usage("--host applies to a web service; a worker has no ingress");
+ if (kind !== "web" && values.console === true)
+ throw usage("--console applies to a web service; a worker has no browser");
if (host !== undefined && !HOST_PATTERN.test(host))
throw usage("--host must be a lowercase tailnet hostname label");
return {
@@ -63,5 +68,6 @@ export function parseServiceOptions(argv: readonly string[]): ServiceOptions {
port,
...(host === undefined ? {} : { host }),
title: values.title ?? defaultTitle(name),
+ ...(values.console === true ? { console: true } : {}),
};
}
diff --git a/scripts/misc/new-service.test.ts b/scripts/misc/new-service.test.ts
index c70d5f8f39..f008817972 100644
--- a/scripts/misc/new-service.test.ts
+++ b/scripts/misc/new-service.test.ts
@@ -2,6 +2,7 @@ import { afterEach, describe, expect, test } from "vitest";
import { cp, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
+import prettier from "prettier";
import { z } from "zod";
import {
formatChecklist,
@@ -9,6 +10,7 @@ import {
parseBakeTargets,
registrationFindings,
} from "../checks/service-registration.ts";
+import { deviationsFor } from "../checks/check-console-stack.ts";
import {
cliWrittenFiles,
DOCKERHUB_SYNTH_OUTPUT,
@@ -46,6 +48,15 @@ const WORKER: ServiceOptions = {
title: "Fixture worker",
};
+const CONSOLE: ServiceOptions = {
+ name: "fixture-console",
+ kind: "web",
+ port: 7410,
+ host: "fixture-console",
+ title: "Fixture console",
+ console: true,
+};
+
const temporaryDirectories: string[] = [];
afterEach(async () => {
@@ -344,6 +355,118 @@ describe("scaffoldService collisions and pre-provisioned images", () => {
});
});
+describe("scaffoldService with --console", () => {
+ test("a --console service is registered and carries the console stack", async () => {
+ const root = await fixtureTree();
+ const files = await scaffoldService(root, CONSOLE);
+ const inputs = await loadRegistrationInputs(root);
+ expect(formatChecklist(registrationFindings(inputs))).toBe("");
+
+ const base = "packages/fixture-console";
+ expect(files).toEqual(
+ expect.arrayContaining([
+ `${base}/package.json`,
+ `${base}/prisma/schema.prisma`,
+ `${base}/prisma.config.ts`,
+ `${base}/index.html`,
+ `${base}/vite.config.ts`,
+ `${base}/src/router.ts`,
+ `${base}/src/db.ts`,
+ `${base}/src/server.ts`,
+ `${base}/src/server.test.ts`,
+ `${base}/src/client/main.tsx`,
+ `${base}/src/client/routes.tsx`,
+ `${base}/src/client/routes.test.tsx`,
+ `${base}/src/client/trpc.ts`,
+ ]),
+ );
+ const read = async (file: string) =>
+ Bun.file(path.join(root, base, file)).text();
+
+ const server = await read("src/server.ts");
+ expect(server).toContain("new Hono()");
+ expect(server).toContain('"/healthz"');
+ expect(server).toContain("fetchRequestHandler");
+ expect(await read("src/router.ts")).toContain("initTRPC.create()");
+ expect(await read("prisma/schema.prisma")).toContain(
+ 'provider = "postgresql"',
+ );
+ const routes = await read("src/client/routes.tsx");
+ expect(routes).toContain("createRootRoute");
+ expect(routes).toContain("validateSearch");
+ expect(routes).toContain("ShellFrame");
+ expect(routes).toContain("HeaderBar");
+ expect(routes).toContain("eslint-disable-next-line");
+ expect(routes).toContain("interface Register");
+ expect(await read("src/client/trpc.ts")).toContain(
+ "createTRPCContext()",
+ );
+ // The console's image builds the client, which imports console-ui.
+ expect(await read("Dockerfile")).toContain("packages/console-ui");
+ });
+
+ test("every generated source file is prettier-formatted", async () => {
+ const root = await fixtureTree();
+ const files = await scaffoldService(root, CONSOLE);
+ const sources = files.filter(
+ (file) =>
+ file.startsWith("packages/fixture-console/") &&
+ /\.(?:tsx?|json|html)$/u.test(file),
+ );
+ expect(sources.length).toBeGreaterThan(10);
+ for (const file of sources) {
+ const configured = path.join(REPOSITORY_ROOT, file);
+ const text = await Bun.file(path.join(root, file)).text();
+ expect(
+ await prettier.check(text, {
+ ...(await prettier.resolveConfig(configured)),
+ filepath: configured,
+ }),
+ file,
+ ).toBe(true);
+ }
+ });
+
+ test("a --console service's package.json meets the stack check", async () => {
+ const root = await fixtureTree();
+ await scaffoldService(root, CONSOLE);
+ const manifest = z
+ .object({
+ name: z.string(),
+ dependencies: z.record(z.string(), z.string()),
+ devDependencies: z.record(z.string(), z.string()),
+ })
+ .parse(
+ await Bun.file(
+ path.join(root, "packages/fixture-console/package.json"),
+ ).json(),
+ );
+ const rootManifest = z
+ .object({ catalog: z.record(z.string(), z.string()) })
+ .parse(await Bun.file(path.join(REPOSITORY_ROOT, "package.json")).json());
+ const deviations = deviationsFor(
+ { id: "fixture", label: "Fixture", directory: "x", kind: "typescript" },
+ manifest,
+ new Map(Object.entries(rootManifest.catalog)),
+ );
+ expect(deviations).toEqual([]);
+ });
+
+ test("a plain web service stays a health-only server", async () => {
+ const root = await fixtureTree();
+ await scaffoldService(root, WEB);
+ const server = await Bun.file(
+ path.join(root, "packages/fixture-notes/src/server.ts"),
+ ).text();
+ expect(server).toContain("Bun.serve({ port, hostname, fetch: handle })");
+ expect(
+ await Bun.file(
+ path.join(root, "packages/fixture-notes/src/router.ts"),
+ ).exists(),
+ ).toBe(false);
+ });
+});
+
describe("parseServiceOptions", () => {
test("reads a web service and a worker", () => {
expect(
@@ -358,7 +481,21 @@ describe("parseServiceOptions", () => {
).toEqual(WORKER);
});
+ test("reads --console for a web service", () => {
+ expect(
+ parseServiceOptions([
+ "--name=fixture-console",
+ "--kind=web",
+ "--port=7410",
+ "--host=fixture-console",
+ "--title=Fixture console",
+ "--console",
+ ]),
+ ).toEqual(CONSOLE);
+ });
+
test.each([
+ ["--name notes --kind worker --port 7400 --console", "--console applies"],
["--kind web --port 7400 --host notes", "--name is required"],
["--name Bad_Name --kind web --port 7400 --host notes", "kebab-name"],
["--name notes --kind job --port 7400", "--kind must be web or worker"],
diff --git a/scripts/misc/new-service.ts b/scripts/misc/new-service.ts
index 59966c4d82..b3d4a1cca7 100644
--- a/scripts/misc/new-service.ts
+++ b/scripts/misc/new-service.ts
@@ -3,6 +3,11 @@
* Scaffolds a hosted first-party service in its prepared state.
*
* bun scripts/misc/new-service.ts --name notes --kind web --port 7400 --host notes
+ * bun scripts/misc/new-service.ts --name notes --kind web --port 7400 --host notes --console
+ *
+ * `--console` writes the first-party console stack (Hono on Bun, tRPC, Prisma
+ * on PostgreSQL, a Vite + React client on TanStack Router and console-ui) in
+ * place of the bare health server; see `new-service-console.ts`.
*
* It creates the package (Bun entrypoint with a health endpoint, Dockerfile),
* a cdk8s chart on the matching first-party construct, the Argo Application
@@ -38,7 +43,7 @@ export const DOCKERHUB_SYNTH_OUTPUT =
"packages/homelab/src/tofu/dockerhub/main.tf.json";
/** The Dockerfile whose stages and base-image pins a new service starts from. */
const DOCKERFILE_MODEL = "packages/tracker/Dockerfile";
-const FORMATTED = /\.(?:ts|json)$/u;
+const FORMATTED = /\.(?:tsx?|json|html)$/u;
/**
* Formats with this checkout's prettier configuration, whichever root the
@@ -116,7 +121,16 @@ export async function scaffoldService(
}
/** What the scaffolder leaves to its author; the how-to has the detail. */
-function nextSteps({ name }: ServiceOptions): string[] {
+function nextSteps({ name, console: isConsole }: ServiceOptions): string[] {
+ const consoleSteps =
+ isConsole === true
+ ? [
+ ` 5. Replace the placeholder model in packages/${name}/prisma/schema.prisma, then`,
+ ` run bunx turbo run generate --filter=@shepherdjerred/${name} and add its migration.`,
+ " 6. Add the console to CONSOLES in scripts/checks/console-stack-rules.ts so",
+ " bun run check-console-stack holds it to the standard.",
+ ]
+ : [];
return [
`Nothing deploys while ${activationConstant(name)} is false. Left to you:`,
" 1. Bump the three inventory counts the new image and chart change:",
@@ -124,6 +138,7 @@ function nextSteps({ name }: ServiceOptions): string[] {
` 2. Add ${name} to the inventory table in packages/README.md.`,
` 3. Write packages/${name}/README.md and the service itself.`,
" 4. Activate it in a later change, once its image is published.",
+ ...consoleSteps,
'See the wiki how-to "Add a hosted service":',
" packages/docs/wiki/src/content/docs/how-to/add-a-hosted-service.md",
];
diff --git a/scripts/renovate-config.test.ts b/scripts/renovate-config.test.ts
index 2ac80b6af5..b5de4382cc 100644
--- a/scripts/renovate-config.test.ts
+++ b/scripts/renovate-config.test.ts
@@ -263,7 +263,7 @@ test("keeps direct TypeScript on 6 without constraining the native alias", async
description:
"Native TypeScript 7 owns typechecking; keep direct TypeScript on 6 for typescript-eslint project service, Astro Check, Twoslash, and TypeDoc.",
groupName: "typescript",
- matchManagers: ["bun", "npm"],
+ matchManagers: ["bun", "npm", "custom.jsonata"],
matchDepNames: ["typescript"],
allowedVersions: "<7",
});
diff --git a/scripts/verify.ts b/scripts/verify.ts
index a11469ffab..03136d3b13 100644
--- a/scripts/verify.ts
+++ b/scripts/verify.ts
@@ -15,6 +15,7 @@ const turboTasks = [
"check-directory-file-counts",
"check-flag-usage",
"check-ai-architecture",
+ "check-console-stack",
"check-floating-deps",
"check-patched-deps",
"check-ci-env",
diff --git a/turbo.json b/turbo.json
index 7000c23326..bd2998be58 100644
--- a/turbo.json
+++ b/turbo.json
@@ -282,6 +282,28 @@
"!packages/dotfiles/dot_agents/skills/**"
]
},
+ // The ten ops consoles share one stack. The check reads each console's
+ // package.json (and the root catalog), so those manifests are its inputs.
+ "//#check-console-stack": {
+ "inputs": [
+ "package.json",
+ "packages/alert-dashboard/package.json",
+ "packages/delivery/package.json",
+ "packages/tracker/package.json",
+ "packages/errors/package.json",
+ "packages/mail/package.json",
+ "packages/flags/package.json",
+ "packages/feeds/package.json",
+ "packages/golink/package.json",
+ "packages/charts/package.json",
+ "packages/charts/Cargo.toml",
+ "packages/ci-cache/package.json",
+ "packages/ci-cache/Cargo.toml",
+ "packages/console-ui/package.json",
+ "scripts/checks/check-console-stack.ts",
+ "scripts/checks/console-stack-rules.ts"
+ ]
+ },
// Dependency specs must be lockfile-pinnable: a dist-tag re-resolves on
// every install, so the registry moving `latest` breaks --frozen-lockfile
// on main with no commit to blame.