Skip to main content

Ignore Files

Regenerate every physical ignore file declared under ignoreFiles in nova.config.json from reviewed Nova bundles and project-owned patterns.

Why Use This Command?

  • Keeps the root .gitignore, root .dockerignore, and Cloudflare Astro .assetsignore files synchronized from one configuration.
  • Separates reusable Nova defaults from project-specific patterns.
  • Uses exact project-relative paths so each generated file stays at its canonical scope.

Requirements

  • Node.js runtime — Use any Node.js LTS release.
  • Project root — Run the command from the directory containing nova.config.json and the top-level package.json.

Usage

Options

FlagDescription
-d, --dry-runValidate and render every configured entry without writing files.
-r, --replace-fileOverwrite existing files instead of creating .nova-backup copies.

Config Fields

Each ignoreFiles key is an exact project-relative output path beginning with ./. Nova manages Docker build-context exclusions only at ./.dockerignore; workspace-local .dockerignore paths are unsupported because Docker builds use the repository root context.

FieldTypeDescription
bundlesstring[]Ordered Nova content bundles valid for that ignore-file basename.
patternsstring[]Optional project-owned patterns appended after the bundled content.
json
{
  "ignoreFiles": {
    "./.gitignore": {
      "bundles": ["nova"],
      "patterns": ["graphify-out/"]
    },
    "./.dockerignore": {
      "bundles": ["nova"],
      "patterns": []
    },
    "./apps/site/public/.assetsignore": {
      "bundles": ["cloudflare-astro"],
      "patterns": []
    }
  }
}

Supported Files and Bundles

File basenameBundleWhat It Excludes
.gitignorenovaDependencies, generated output, local secrets, editors, and OS files.
.dockerignorenovaHost-only dependencies, builds, secrets, and source-control metadata.
.assetsignorecloudflare-astroAstro's _worker.js and _routes.json deployment control files.

Nova validates that each path is project-relative and that every bundle belongs to the target file type before anything is written. .gitignore and .assetsignore may be nested, while .dockerignore must be exactly ./.dockerignore.

How It Works

The command loads every configured entry, joins the selected bundles in order, appends a Project Excludes section, and then appends the entry's custom patterns. The established .gitignore section layout and ordering remain unchanged. Generated files include the same Nova header as before, updated to point back to this command and documentation.

For the root .dockerignore, the nova bundle excludes environment files, .secrets, dependency trees, build output, and log files at both the repository root and within nested workspaces. It re-includes .env.sample and .env.example at both levels. Running nova generate must-haves ignore-files --replace-file regenerates those rules from the canonical bundle.

Nova scaffolds register the physical ignore files they create. A root scaffold registers ./.gitignore; a Docker-enabled repository registers ./.dockerignore; and a server-rendered Cloudflare Astro workspace registers public/.assetsignore.