# =============================================================================
# Taskfile.yml — the one entry point for this dmwd-io Astro project.
# task list everything (the default task)
# task setup first-time setup (pnpm install)
# task dev run the Astro dev server with HMR
# task check typecheck .astro/.ts (astro check)
# task format Biome format (writes)
# task build production SSR build → ./dist
# task preview serve the built standalone server
# task ci the gate CI runs: check + lint + build
# Conventions (see the go-task skill): two-space indent, kebab-case task names,
# UPPERCASE vars, {{.VAR}} templates with no inner spaces, a desc on every task.
# =============================================================================
# .env.local (gitignored) overrides the committed .env base. Both optional.
dotenv: ['.env.local', '.env']
# Astro reads HOST/PORT for `astro dev` and the standalone server.
HOST: '{{.HOST | default "0.0.0.0"}}'
PORT: '{{.PORT | default "4321"}}'
desc: List every available task
# --- Lifecycle --------------------------------------------------------------
desc: First-time setup — install dependencies (needs NPM_TOKEN for @dmwd-io)
- sh: test -n "$NPM_TOKEN"
msg: 'NPM_TOKEN is not set — the @dmwd-io design-system will 401. Export it first (see .npmrc).'
desc: Return to a clean baseline (remove build output and reinstall)
prompt: This deletes dist/ and node_modules/ and reinstalls. Continue?
- rm -rf dist node_modules
# --- Run --------------------------------------------------------------------
desc: Start the Astro dev server with HMR
- '{{.PKG}} astro dev --host {{.HOST}} --port {{.PORT}}'
desc: Run the built standalone SSR server (after task build)
- node ./dist/server/entry.mjs
# --- Quality ----------------------------------------------------------------
desc: Typecheck .astro and .ts files (astro check)
desc: Lint with Biome (extra args pass through after --)
- '{{.PKG}} biome lint . {{.CLI_ARGS}}'
desc: Format with Biome and write changes
- '{{.PKG}} biome format --write .'
# --- Build ------------------------------------------------------------------
desc: Production SSR build (incremental — skipped when sources are unchanged)
- 'dist/server/entry.mjs'
# --- CI ---------------------------------------------------------------------
desc: The CI gate — typecheck, lint, then build