Add dev workflow script and fix build.content.mjs#574
Add dev workflow script and fix build.content.mjs#574jamiefolsom wants to merge 2 commits intodevelopfrom
Conversation
Fix build.content.mjs: - Support GITHUB_BRANCH env var for cloning content repos - Remove content/ before copying to prevent merge artifacts Add scripts/dev.sh - single-command local dev workflow: - Checks out the exact commit deployed on the Netlify site - Unlinks/relinks Netlify site to ensure correct env vars - Clears process env vars that override site settings - Backs up .env to let Netlify site vars take priority - Cleans generated content, .tina/, and i18n files - Sets USE_CONTENT_CACHE=true to avoid loader timeouts - Kills stale processes on ports 4321/9000 - Starts netlify dev Usage: npm run dev -- <site> (sites defined in scripts/sites.json)
✅ Deploy Preview for gbof-c19nyc-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for juel-ancestry ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for juel-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for pss-scavenger-hunt ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for padp-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for juel-life ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for libertos ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for registro-project ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for universities-studying-slavery ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for gamepossible ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Queries Netlify API for all CDP sites the user has access to and writes scripts/sites.json. Developers can then edit the file to use shorter names.
Summary
build.content.mjs: supportGITHUB_BRANCHenv var and remove stalecontent/before copyingscripts/dev.sh: single-command local dev workflow that handles site switching, version matching, env var isolation, and content cleanupscripts/sites.example.json: template for local site registry (actualsites.jsonis gitignored)npm run devscript entryUsage
Test plan
--initgeneratesscripts/sites.jsonwith all CDP sites from Netlifynpm run dev -- <site>links to correct site and starts dev server--skip-cleanskips content cleanup for faster restarts.envis backed up during run and restored on exit