Skip to main content

Astro

Scaffold an Astro application with strict TypeScript checking and an explicit static or server-rendered deployment target.

Why Use This Command?

  1. Combines Astro's strict configuration with Nova's Astro TSConfig preset so framework types and project rules start aligned.
  2. Supports static output, a standalone Node.js server, or Cloudflare Workers without mixing incompatible adapter settings.
  3. Pins Astro's ESM cookie runtime directly so a mixed-framework monorepo cannot hoist an older CommonJS version into Astro's prerender build.
  4. Separates Astro source, Node-based configuration, and Vitest type-checking so one tool's declarations do not leak into another build.
  5. Can package static output or the Node.js server as a reviewed Docker image.
  6. Supports both a new monorepo and an additional app workspace through the same command.

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

FlagDescription
-d, --dry-runRun without writing any files.
--name <name>Project slug when creating a new monorepo; omit at an existing root.
--non-interactiveUse 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-imageAdd Docker packaging for static output or the Node.js server.

Output Files

FileDescription
astro.config.mjsAstro project configuration.
eslint.config.mtsOrdered Nova presets and the complete Nova custom-rule collection.
src/pages/index.astroStarter page using the generated workspace title.
tests/project.test.tsStarter Vitest workspace test.
tsconfig.astro.jsonAstro source contract with essentials, strict, browser, and Astro layers.
tsconfig.config.jsonNode.js contract for configuration files.
tsconfig.tests.jsonIsolated Vitest test contract.
vitest.config.mtsTest discovery scoped to this workspace.
package.jsonAstro dependencies and Nova-managed workspace scripts.

When --docker-image is enabled, Nova also writes .dockerignore, Dockerfile, and compose.yml. Static sites use an unprivileged NGINX image; Node.js server rendering uses Astro's standalone server output. Cloudflare server rendering cannot be combined with --docker-image because Cloudflare owns that runtime.

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.

Non-Interactive Mode

Agents and automation can provide every answer as flags:

bash
# 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}.