Files
supabase/apps/www/.gitignore
Alaister YoungandAlaister Young 27af9ca162 chore(www): run production builds through Turbo (#50713)
www builds currently bypass Turbo. This caches Next.js compilation and
sitemap generation while keeping content refreshes and asset uploads on
every build, including cache hits.

**Changed:**

- Refresh content before Turbo hashes its inputs, and upload assets
after Turbo saves or restores the build output.
- Include generated content, shared code, environment settings,
sitemaps, and the customer RSS feed in the cache configuration.
- Remove the redundant `vercel.json` build override and consolidate
public environment settings into `NEXT_PUBLIC_*`.

Cache reuse requires the same commit and build inputs because production
CDN URLs include the commit SHA.

**Added:**

- Build lifecycle tests covering cache restoration, input invalidation,
root/app commands, and upload ordering and failure handling.

## To test

- From `apps/www`, run `pnpm exec vitest run turbo-build.test.ts
generate-sitemap.test.ts scripts/lib/githubStars.test.ts`.
- Check the Vercel preview build runs content preparation before
`build:next`, and verify the homepage, `/sitemap.xml`, and
`/customers-rss.xml` load.
- Rebuild with identical prepared content and environment settings to
check compilation is cached. Asset uploads should still run when
enabled.

Validation: 63 tests passed, along with typecheck, ESLint for the new
test, formatting, and a full local build. The local build used public
example settings and placeholder survey configuration, with asset
uploads disabled; Vercel deployment validation is still pending.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Build & Deployment**
- Production builds now reuse cached outputs and restore generated
assets when a cache is available.
- Static assets upload after a successful build, and changes to content,
documentation, configuration, or shared components trigger a fresh
build.

- **Documentation**
- Added production build guidance covering caching, CDN uploads,
overrides, and direct-build limitations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-09-28 12:14:33 -07:00

46 lines
769 B
Plaintext

# Dependencies
/node_modules
# Production
/build
# Generated files
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.staging.local
.env.production.local
*.swp
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*/generated/**/*
!**/*/generated/.gitkeep
!**/*/generated/**/.gitkeep
.generated
# Sitemaps (generated by build:next and restored from the Turbo build cache)
public/sitemap.xml
public/sitemap_www.xml
# Generated .md content bundle (built by scripts/generateMdContent.mjs)
app/api-v2/md/content.generated.ts
# Generated feeds and markdown (built by content:build)
/public/rss.xml
/public/changelog-rss.xml
/public/changelog-rss
/public/changelog.md
/public/changelog
# contentlayer
.contentlayer
.vercel
.env*.local