Skip to content

chore: sync from webzHQ monorepo (Cloudflare migration)#3

Merged
heyoub merged 1 commit intomainfrom
sync/monorepo-cloudflare-migration
Mar 5, 2026
Merged

chore: sync from webzHQ monorepo (Cloudflare migration)#3
heyoub merged 1 commit intomainfrom
sync/monorepo-cloudflare-migration

Conversation

@heyoub
Copy link
Copy Markdown
Owner

@heyoub heyoub commented Mar 5, 2026

Summary

  • Syncs all changes made in the webzHQ monorepo back to this standalone repo
  • Migrates from Vercel to Cloudflare Pages (removes landing/vercel.json)
  • Adds landing/_headers for Cloudflare routing
  • Adds GitHub Actions deploy workflow for Cloudflare Pages
  • Updates configs, docs, and source from monorepo iterations

Context

This repo was copied into the TheFreeBatteryFactory/webzHQ monorepo where further development happened. These changes are being synced back as part of extracting apps from the monorepo into standalone repos. Monorepo is source-of-truth for conflicts.

Test plan

  • Static landing/ directory contains index.html, script.js, style.css
  • Deploy workflow triggers on merge to main
  • sunsetter-aqm.batterypack.dev serves correctly

Summary by CodeRabbit

  • Chores
    • Configured deployment pipeline to Cloudflare Pages via GitHub Actions
    • Removed Vercel configuration files
    • Enhanced build process to handle environments without git initialization
    • Added X-Content-Type-Options security header

- Remove landing/vercel.json (now using Cloudflare Pages)
- Add landing/_headers for Cloudflare routing
- Add Cloudflare Pages deploy workflow
- Update configs, docs, and source from monorepo iterations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sunsetter-aqm Error Error Mar 5, 2026 1:17am

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Migrate from Vercel to Cloudflare Pages deployment

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Migrate deployment from Vercel to Cloudflare Pages
• Add GitHub Actions workflow for automated Cloudflare deployment
• Add Cloudflare routing headers configuration
• Update husky prepare script for non-git environments
Diagram
flowchart LR
  A["Vercel Config<br/>vercel.json"] -->|Remove| B["Cloudflare Pages"]
  C["GitHub Actions"] -->|Add Deploy Workflow| B
  D["Routing Headers<br/>_headers"] -->|Add| B
  E["Package Scripts<br/>husky prepare"] -->|Update| F["Non-git Safe"]
Loading

Grey Divider

File Changes

1. .github/workflows/deploy.yml ⚙️ Configuration changes +16/-0

Add Cloudflare Pages deployment workflow

• New GitHub Actions workflow for Cloudflare Pages deployment
• Triggers on push to main branch and manual workflow dispatch
• Uses wrangler CLI to deploy landing directory to sunsetter-aqm project
• Requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets

.github/workflows/deploy.yml


2. landing/_headers ⚙️ Configuration changes +2/-0

Add Cloudflare routing headers configuration

• New Cloudflare routing headers configuration file
• Sets X-Content-Type-Options header to nosniff for security
• Applies to all routes in landing directory

landing/_headers


3. landing/vercel.json ⚙️ Configuration changes +0/-4

Remove Vercel configuration file

• Removed Vercel-specific configuration file
• No longer needed after migration to Cloudflare Pages

landing/vercel.json


View more (2)
4. vercel.json ⚙️ Configuration changes +0/-6

Remove root Vercel configuration

• Removed root Vercel configuration file
• Contained build command and output directory settings for Vercel
• Replaced by Cloudflare Pages deployment approach

vercel.json


5. package.json 🐞 Bug fix +1/-1

Make husky prepare script environment-safe

• Updated husky prepare script to handle non-git environments
• Changed from direct husky install to conditional check for .git directory
• Prevents errors when installing dependencies outside git repositories

package.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 5, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Prepare script breaks Windows 🐞 Bug ⛯ Reliability
Description
The updated prepare script uses POSIX shell syntax ([ -d .git ] and true) which will fail in
Windows’ default npm shell (cmd/powershell), potentially breaking npm install for Windows
contributors.
Code

package.json[56]

+    "prepare": "[ -d .git ] && husky install || true"
Evidence
prepare now contains POSIX shell commands. On Windows, npm scripts typically execute under
cmd/powershell, where [/-d and true are not standard commands; the intended short-circuiting
will not behave as expected and can cause the install step to fail. The repo includes husky hooks,
so prepare is expected to run for contributors.

package.json[43-57]
.husky/pre-commit[1-2]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`package.json` uses a POSIX-shell `prepare` script. This can fail on Windows’ default npm shell, breaking `npm install` for contributors.

### Issue Context
The repo uses husky hooks, and `prepare` is used to install them. The new script relies on `[ -d .git ]` and `true`, which are not portable across npm shells.

### Fix Focus Areas
- package.json[43-57]
- .husky/pre-commit[1-2]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Unpinned wrangler in deploy 🐞 Bug ⛯ Reliability
Description
The deploy workflow runs npx wrangler ... without pinning a wrangler version or setting up a known
Node/npm version, making deployments vulnerable to breaking changes from runner defaults or new
wrangler releases.
Code

.github/workflows/deploy.yml[13]

+      - run: npx wrangler pages deploy landing --project-name=sunsetter-aqm --commit-hash=${{ github.sha }}
Evidence
deploy.yml executes wrangler via npx, but the repo does not vend a wrangler version (not present
in dependencies/devDependencies). Separately, the CI workflow explicitly pins Node via
actions/setup-node, indicating the repo already treats Node version drift as a concern; deploy.yml
does not follow this pattern.

.github/workflows/deploy.yml[8-16]
package.json[99-160]
.github/workflows/ci.yml[34-41]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Cloudflare Pages deploy workflow runs `npx wrangler ...` without pinning a Node version or the wrangler version, which can cause deployment instability due to version drift.

### Issue Context
- The repo does **not** include wrangler in dependencies/devDependencies, so the workflow relies on whatever wrangler version `npx` resolves at runtime.
- Other workflows (CI) explicitly pin Node via `actions/setup-node`, but deploy.yml does not.

### Fix Focus Areas
- .github/workflows/deploy.yml[10-16]
- .github/workflows/ci.yml[34-41]
- package.json[99-160]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3b505f5-627f-4697-9cce-4280479efe6c

📥 Commits

Reviewing files that changed from the base of the PR and between 08c0d7a and 95a2ee4.

📒 Files selected for processing (5)
  • .github/workflows/deploy.yml
  • landing/_headers
  • landing/vercel.json
  • package.json
  • vercel.json

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting


Walkthrough

This change migrates deployment from Vercel to Cloudflare Pages by adding a GitHub Actions workflow, removing Vercel configuration files, adding a security header, and updating the prepare script to gracefully handle environments without a Git repository.

Changes

Cohort / File(s) Summary
Deployment Platform Migration
.github/workflows/deploy.yml, landing/vercel.json, vercel.json
Introduces Cloudflare Pages deployment workflow triggered on pushes to main and manual dispatch; removes Vercel configuration files from both root and landing directories.
Security Headers
landing/_headers
Adds X-Content-Type-Options: nosniff header directive for MIME type protection.
Build Script Resilience
package.json
Updates prepare script with conditional guard [ -d .git ] && husky install || true to handle environments lacking a .git directory.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 From Vercel's nest to Cloudflare skies so blue,
With wrangler's wings we deploy anew,
Security headers guard the way,
A safer, faster landing day! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync/monorepo-cloudflare-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@heyoub heyoub merged commit 0f4e8e0 into main Mar 5, 2026
4 of 6 checks passed
"format": "prettier --write \"src/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\"",
"prepare": "husky install"
"prepare": "[ -d .git ] && husky install || true"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Prepare script breaks windows 🐞 Bug ⛯ Reliability

The updated prepare script uses POSIX shell syntax ([ -d .git ] and true) which will fail in
Windows’ default npm shell (cmd/powershell), potentially breaking npm install for Windows
contributors.
Agent Prompt
### Issue description
`package.json` uses a POSIX-shell `prepare` script. This can fail on Windows’ default npm shell, breaking `npm install` for contributors.

### Issue Context
The repo uses husky hooks, and `prepare` is used to install them. The new script relies on `[ -d .git ]` and `true`, which are not portable across npm shells.

### Fix Focus Areas
- package.json[43-57]
- .husky/pre-commit[1-2]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant