$ pnpm i$ pnpm run devThis site deploys to Cloudflare Workers as a static-assets Worker, configured in wrangler.jsonc. It's a fully static Astro build (output: 'static') with no server-side rendering yet — wrangler.jsonc has no main entrypoint, just an assets block pointing at dist/. SSR can be added later for specific routes by installing the @astrojs/cloudflare adapter and giving wrangler.jsonc a main script, without needing to migrate off Workers.
- The Cloudflare Worker is connected to this GitHub repository via Workers Builds (Cloudflare's git-integration CI/CD for Workers, configured in the Cloudflare dashboard).
- On push to
main, Cloudflare clones the repo, installs dependencies withpnpm, runspnpm run buildto generate the static site indist/, then runswrangler deployto publish it. - Static assets are served from Cloudflare's global network.
# Build and deploy in one step
$ pnpm run deploy
# Or separately:
$ pnpm run build
$ npx wrangler deploy
# Validate the wrangler config without actually deploying:
$ npx wrangler deploy --dry-runDeploying manually requires being logged in via npx wrangler login, or a CLOUDFLARE_API_TOKEN environment variable.
If you need to reconnect this to a Cloudflare account from scratch:
- Go to the Cloudflare Dashboard → Workers & Pages → Create → Import a repository
- Connect this GitHub repo
- Build command:
pnpm run build - Cloudflare will detect
wrangler.jsoncand deploy accordingly - Attach the custom domain under the Worker's Settings → Domains & Routes
This project uses audit-ci for local dependency vulnerability scanning, enforced automatically via Husky pre-commit hooks.
Husky is configured to run security audits automatically before every commit:
- Security Audit: Runs
audit-cito check for moderate and high severity vulnerabilities - Code Quality: Runs
lint-stagedto format and lint code with Biome
If vulnerabilities are found, the commit will be blocked until they are resolved. This ensures no vulnerable dependencies are committed to the repository.
You can also check for vulnerabilities manually:
# Check for moderate and high severity vulnerabilities (default)
$ pnpm run audit
# Check only for high and critical severity vulnerabilities
$ pnpm run audit:highThe audit will fail (exit with non-zero code) if vulnerabilities are found.
audit-ci uses the same vulnerability database as npm audit / pnpm audit, but provides:
- Configurable severity thresholds
- Non-zero exit codes on failure (useful for CI and pre-commit hooks)
- JSON output support
- Ability to allowlist specific vulnerabilities if needed
The pre-commit hook (.husky/pre-commit) runs in this order:
- Security audit (
pnpm run audit) - Blocks commit if vulnerabilities found - Lint-staged (Biome formatting/linting) - Auto-fixes code style issues
This ensures security issues are caught before code formatting, providing fast feedback.
After cloning the repository, Husky will be automatically initialized when you run:
$ pnpm installThe prepare script in package.json ensures Husky is set up correctly.
If you need to temporarily allowlist a known vulnerability (not recommended for production), you can create an .audit-ci.json configuration file:
{
"allowlist": ["CVE-XXXX-XXXXX"]
}Note: Only use allowlists for vulnerabilities that are confirmed false positives or have acceptable risk for your use case.
If you absolutely need to bypass the pre-commit hook (e.g., for emergency hotfixes), you can use:
$ git commit --no-verifyWarning: Only use this when absolutely necessary, as it bypasses all security checks.