Skip to content

Taskfile

FieldValue
TypeSkill Resource
Source~/.copilot/skills/frontend/templates/astro-starter/Taskfile.yml
DescriptionNot specified

Source Content

version: '3'
# =============================================================================
# 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 lint Biome lint
# 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']
vars:
PKG: pnpm
env:
# Astro reads HOST/PORT for `astro dev` and the standalone server.
HOST: '{{.HOST | default "0.0.0.0"}}'
PORT: '{{.PORT | default "4321"}}'
tasks:
default:
desc: List every available task
cmds:
- task --list
silent: true
# --- Lifecycle --------------------------------------------------------------
setup:
desc: First-time setup — install dependencies (needs NPM_TOKEN for @dmwd-io)
preconditions:
- sh: test -n "$NPM_TOKEN"
msg: 'NPM_TOKEN is not set — the @dmwd-io design-system will 401. Export it first (see .npmrc).'
cmds:
- '{{.PKG}} install'
reset:
desc: Return to a clean baseline (remove build output and reinstall)
prompt: This deletes dist/ and node_modules/ and reinstalls. Continue?
cmds:
- rm -rf dist node_modules
- task: setup
# --- Run --------------------------------------------------------------------
dev:
desc: Start the Astro dev server with HMR
cmds:
- '{{.PKG}} astro dev --host {{.HOST}} --port {{.PORT}}'
preview:
desc: Run the built standalone SSR server (after task build)
deps:
- build
cmds:
- node ./dist/server/entry.mjs
# --- Quality ----------------------------------------------------------------
check:
desc: Typecheck .astro and .ts files (astro check)
cmds:
- '{{.PKG}} astro check'
lint:
desc: Lint with Biome (extra args pass through after --)
cmds:
- '{{.PKG}} biome lint . {{.CLI_ARGS}}'
format:
desc: Format with Biome and write changes
cmds:
- '{{.PKG}} biome format --write .'
# --- Build ------------------------------------------------------------------
build:
desc: Production SSR build (incremental — skipped when sources are unchanged)
sources:
- 'src/**/*'
- 'astro.config.mjs'
- 'tsconfig.json'
- 'package.json'
generates:
- 'dist/server/entry.mjs'
cmds:
- '{{.PKG}} astro build'
# --- CI ---------------------------------------------------------------------
ci:
desc: The CI gate — typecheck, lint, then build
cmds:
- task: check
- task: lint
- task: build