Single Fresh 2 app on Deno (not a monorepo). Dashboard for ATM Milano transit info.
| Command | Action |
|---|---|
deno task dev |
Vite dev server (URL in terminal; often port 5173) |
deno task build |
Production client + server bundle (vite build) |
deno task start |
Serve _fresh/server.js via deno serve |
deno task check |
deno fmt --check, deno lint, deno check on entrypoints |
deno task test |
deno test -A (parser + utils tests) |
deno install |
Populate node_modules for npm-specified packages (Preact, Vite plugins, etc.) |
CI: deno install → deno task check → deno task test (no production build in CI).
- Fresh 2 (
jsr:@fresh/core) withmain.ts+app.fsRoutes(), Preact JSX,@fresh/plugin-vite+ Vite 7. - Vanilla CSS in
assets/styles.css(design tokens as:rootvariables, nesting; no Tailwind/DaisyUI). - Deno fmt/lint (tabs, line width in
deno.json). No Biome / npm scripts. nodeModulesDir: "manual"— rundeno installafter clone or dependency changes.
- Entry:
main.ts→ static files + file routes. - Layout:
routes/_app.tsx—<html lang="it-IT">, meta, favicon. - Home:
routes/index.tsx— server-loads dashboard data vialib/dashboard_data.ts, rendersHeader,Dashboard,Footer. - API:
routes/api/*.tsx— JSON handlers mirroring old Nuxtserver/api/paths. - Upstream HTTP:
lib/atm_fetch.tsusesDeno.createHttpClient({ tlsOptions: { insecure: true } })forwww.atm.itandgiromilano.atm.it(legacy TLS). Surface alerts use defaultfetchtoalert.atm.it. - HTML parsing:
happy-dominlib/parser.tsand data modules (same approach as Nuxt server). - Types:
types/line.ts(ScrapedLineStatus,MetroLineStatusV2),types/news.ts.
- No root
tsconfig.json(Vite +deno.jsonown TS settings). Do not reintroduce Nuxt’s.nuxt/tsconfigextends. - TSX files that render JSX start with
import "preact/jsx-runtime";sodeno checkresolves Fresh’sjsx: "precompile"emit cleanly.
.vscode/settings.json: tab size 2, format on save. Install the Deno extension and enable the
workspace if prompted.