Astro
Scaffold an Astro application with strict TypeScript checking and an explicit static or server-rendered deployment target.
Why Use This Command?
- Combines Astro's strict configuration with Nova's Astro TSConfig preset so framework types and project rules start aligned.
- Supports static output, a standalone Node.js server, or Cloudflare Workers without mixing incompatible adapter settings.
- Pins Astro's ESM cookie runtime directly so a mixed-framework monorepo cannot hoist an older CommonJS version into Astro's prerender build.
- Separates Astro source, Node-based configuration, and Vitest type-checking so one tool's declarations do not leak into another build.
- Can contribute static output or the Node.js server to the repository-wide s6 Docker appliance.
- Supports both a new monorepo and an additional app workspace through the same command.
- Configures Astro's native i18n router for English and keeps homepage copy in an app-owned JSON catalog without adding a translation dependency.
Requirements
- Node.js runtime — Use any Node.js LTS release.
- Empty directory or monorepo root — Nova auto-detects whether to create a project or add a workspace.
Usage
Options
| Flag | Description |
|---|---|
-d, --dry-run | Run without writing any files. |
--install | Install dependencies after scaffolding; this is the default. |
--no-install | Skip dependency installation. |
--name <name> | Project slug when creating a new monorepo; omit at an existing root. |
--non-interactive | Use flags and defaults without opening prompts. |
--workspace-name <name> | Workspace directory name. |
--output <dir> | Output directory. |
--rendering <static|server> | Rendering mode; defaults to static. |
--adapter <node|cloudflare> | Server adapter when --rendering server is selected; defaults to node. |
--docker-image | Add the static or Node.js service to the repository-wide s6 image. |
Output Files
| File | Description |
|---|---|
astro.config.mjs | Astro project configuration with native English i18n routing. |
eslint.config.mts | Ordered Nova presets and the complete Nova custom-rule collection. |
src/i18n/en.json | English message catalog for the generated launchpad. |
src/pages/index.astro | Locale-aware starter page using the English catalog. |
tests/project.test.ts | Starter Vitest workspace test. |
tsconfig.astro.json | Astro source contract with essentials, strict, browser, and Astro layers. |
tsconfig.config.json | Node.js contract for configuration files. |
tsconfig.tests.json | Isolated Vitest test contract. |
vitest.config.mts | Test discovery scoped to this workspace. |
package.json | Astro dependencies and Nova-managed workspace scripts. |
When --docker-image is enabled, Nova writes .dockerignore, Dockerfile, and compose.yml at the project root and keeps private assembly files under packages/docker. Static output becomes a supervised static service, while Node.js server rendering contributes Astro's standalone server to the same repository image.
Cloudflare server rendering cannot be combined with --docker-image because Cloudflare owns that runtime. See Docker Images for the shared s6 contract.
A server-rendered Cloudflare workspace also receives public/.assetsignore, which keeps _worker.js and _routes.json out of the copied public asset set. Nova registers that exact path in ignoreFiles with the cloudflare-astro bundle so the generic ignore-files generator can reproduce it later.
Astro does not enable MDX by default, so this scaffold does not pretend .mdx files are buildable. If you add Astro's MDX integration, also add langMdx to the ESLint config; Nova's MDX language preset composes with the Astro framework layer.
Localization
Every static, Node.js, and Cloudflare variant enables Astro's native i18n router with English as the unprefixed default locale. Add another locale to astro.config.mjs, create its catalog beside src/i18n/en.json, and add the matching locale page route when the application is ready to translate.
Nova does not install a translation library. Astro owns locale routing, while the application owns its message catalogs and translated routes.
Non-Interactive Mode
Agents and automation can provide every answer as flags:
# Static site with defaults
nova scaffold app astro --non-interactive --name my-site --workspace-name web --output ./my-site
# Node.js server in Docker
nova scaffold app astro --non-interactive --workspace-name server --output ./apps/server --rendering server --adapter node --docker-image
# Cloudflare server-rendered site
nova scaffold app astro --non-interactive --workspace-name edge --output ./apps/edge --rendering server --adapter cloudflare
Registration
Nova registers the workspace with the app role and trackable policy. Its package name follows {projectSlug}-app-{workspaceName}.
Nova also registers a same-named file artifact. A full root build stages the completed Astro output under build/<package-name>/ without changing the workspace's own build/ directory.