Skip to content

fix: use npx wrangler for Cloudflare Pages deploy#138

Merged
tomymaritano merged 129 commits into
mainfrom
fix/cloudflare-npx
Mar 12, 2026
Merged

fix: use npx wrangler for Cloudflare Pages deploy#138
tomymaritano merged 129 commits into
mainfrom
fix/cloudflare-npx

Conversation

@tomymaritano

@tomymaritano tomymaritano commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace cloudflare/wrangler-action@v3 with direct npx wrangler@3 calls
  • Fixes ERR_PNPM_ADDING_TO_ROOT that prevented all deploys in pnpm workspaces
  • Creates Cloudflare Pages project if it doesn't exist

Context

wrangler-action tries pnpm add wrangler which fails in pnpm monorepos. Using npx bypasses this entirely.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized internal deployment workflow by consolidating setup and deployment steps for improved efficiency.

tomymaritano and others added 30 commits March 11, 2026 01:41
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Notebooks now sync before notes in syncNow() to ensure note-notebook
dependencies are satisfied. Adds pullNotebooks/pushNotebooks methods
and applyRemoteNotebookChange for bidirectional notebook sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move validateNotebookTree from inline test definition to a shared module
so it can be reused by the API route and other consumers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add conflict state to SyncStatusIndicator with amber warning icon
and count. Conflicts now take priority over idle state so users
discover them without navigating to Settings.

Also export ConflictResolver from sync components barrel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DatabaseConnection.transaction() already calls the inner fn — no need
for extra () at call site.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix pullNotebooks() to only advance cursor to last successfully
  applied change (prevents skipping failed changes on retry)
- Fix tree validation snapshot to properly exclude deleted notebooks
  (prevents ghost parent references in validation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add bidirectional notebook sync
test: add sync-core unit tests (62 tests)
feat: surface sync conflicts in status indicator
# Conflicts:
#	apps/desktop/src/main/services/apiClient.ts
#	apps/desktop/src/main/services/syncService.ts
#	packages/api/src/db/schema.ts
#	packages/api/src/routes/sync.ts
#	packages/storage-sqlite/src/migrations/index.ts
Configure automated code review with path-specific instructions
for core, storage, desktop, and API packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ration

Add optional metadata (name, version, priority) to registerRemarkPlugin
and registerRehypePlugin signatures for debugging and execution ordering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tomymaritano and others added 20 commits March 11, 2026 21:33
# Conflicts:
#	packages/storage-sqlite/src/repositories/SQLiteNoteRepository.ts
feat: add DataAPI — rich read-only data access for plugins
# Conflicts:
#	apps/desktop/src/renderer/pages/settings/sections/Section.module.css
#	packages/storage-sqlite/src/repositories/SQLiteNoteRepository.ts
# Conflicts:
#	packages/storage-sqlite/src/repositories/SQLiteNoteRepository.ts
test(api): add comprehensive sync API and encryption tests
…ning

# Conflicts:
#	apps/desktop/src/renderer/App.tsx
#	apps/desktop/src/renderer/pages/settings/sections/Section.module.css
feat: sync hardening — auto-resume, history logging, bandwidth metrics
- Fix useThemeOverrides getSnapshot causing unnecessary re-renders
- Fix theme restoration race condition with plugin loading
- Add range.step validation in config validation
- Record timing for failed plugin loads and init.js
- Emit onNotesChanged events for note update/rename paths
- Fix concurrent modification safety in DataAPI event dispatch
- Fix DataAccessError import (value vs type-only)
- Add range step validation tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Install Husky + lint-staged for pre-commit formatting
- Add auto-merge workflow for owner PRs that pass CI
- Auto-merge dependabot PRs after CI passes
- External contributors' PRs still require owner review (CODEOWNERS)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace peter-evans action with gh CLI which doesn't need
pull-request-number input and works directly with PR events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Husky hooks:
- commit-msg: validate conventional commits with commitlint
- pre-push: run tests + typecheck before pushing

CI improvements (Tier 1 - Speed):
- Shared setup job with cached node_modules
- Cancel in-progress runs on new pushes
- Turborepo-ready with env vars

CI improvements (Tier 2 - Quality):
- Test coverage collection and artifact upload
- Bundle size tracking reported in PR summary
- PR size labels (XS/S/M/L/XL)
- Auto-label PRs by changed packages

CI improvements (Tier 3 - Security):
- npm audit check for high severity vulnerabilities
- License compatibility check (blocks GPL-3.0/AGPL/SSPL)
- CodeQL static analysis (weekly + on PR)
- Commitlint on PR titles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
plugin-api is browser code without @types/node, so process.env causes
typecheck failures. The debug log is low-cost and harmless in production.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: resolve CodeRabbit review issues across merged PRs
chore: add Husky pre-commit hooks and auto-merge workflow
## Summary
- **Replaces** `apps/docs-site/` (VitePress/Vue) and
`apps/marketing-site/` (Astro) with a single `apps/web/` Next.js 15 app
- **Docs** served via Fumadocs at `/docs/*` (21 pages migrated from
VitePress)
- **Marketing** pages at `/` with navbar, footer, landing page, and 13
converted pages (pricing, FAQ, changelog, download, etc.)
- **Stack unification**: entire frontend is now React + Next.js +
Tailwind CSS 4

## What changed
- `apps/web/` — New unified Next.js + Fumadocs app (37 static pages)
- `apps/docs-site/` — Deleted (replaced by `apps/web/content/docs/`)
- `apps/marketing-site/` — Deleted (replaced by
`apps/web/app/(marketing)/`)
- `.github/workflows/docs.yml` — Updated for Next.js build
- `.github/labeler.yml` — Updated labels for new structure
- `turbo.json` — Updated build outputs

## Test plan
- [x] `pnpm test` — all tests pass
- [x] `next build` — 37 pages generated successfully
- [ ] Manual review of docs pages at `/docs`
- [ ] Manual review of marketing pages at `/`
- [ ] Verify navbar, footer, mobile navigation work correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary
- **Auto-disable crashing plugins**: PluginRegistry now auto-disables
plugins after 3 consecutive crashes, with `resetErrors()` for manual
re-enable and `isAutoDisabled()` query
- **Plugin CLI commands**: Added `list`, `install`, `uninstall`, and
`link` commands to `readied-plugin` CLI for managing community plugins
from the terminal
- **Cross-platform utils**: Shared `getPluginsDir()` resolves
macOS/Win/Linux plugin directories

## Test Plan
- [x] All 235+ tests pass (`pnpm test`)
- [x] Auto-disable tests: threshold enforcement, reset behavior,
pre-threshold behavior
- [ ] Manual: `readied-plugin list` shows installed plugins
- [ ] Manual: `readied-plugin link .` creates symlink for dev plugins

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

## Summary by CodeRabbit

* **New Features**
* Added crash threshold protection that automatically disables plugins
after repeated failures
  * Introduced plugin error state reset capability for recovery
* Added CLI commands for plugin management: `list` (view installed
plugins), `install` (add from archive or directory), `uninstall` (remove
safely with confirmation), and `link` (for local development)

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary
- Fix `wrangler-action@v3` failing with `ERR_PNPM_ADDING_TO_ROOT` in
pnpm workspaces
- Add `packageManager: pnpm` and `workingDirectory: apps/web` to the
deploy step

## Context
The Deploy Web workflow has been failing on every push to main because
wrangler-action tries `pnpm add wrangler` at the workspace root without
`-w`.

## Test plan
- [ ] Merge to develop, then main, verify deploy workflow passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

## Summary by CodeRabbit

* **Chores**
* Updated deployment automation configuration to enhance build and
release processes with improved package manager specification and
working directory handling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary
- Add step to create `readied-web` project on Cloudflare Pages before
deploying
- Uses `continue-on-error: true` so it doesn't fail when project already
exists
- Add `--commit-dirty=true` to suppress wrangler git warning

## Context
The Deploy Web workflow has never succeeded — project `readied-web`
doesn't exist on Cloudflare Pages (error code 8000007).

## Test plan
- [ ] Merge to develop → main, verify deploy succeeds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
wrangler-action@v3 cannot install wrangler in pnpm workspaces
(ERR_PNPM_ADDING_TO_ROOT). Using npx wrangler@3 directly bypasses
this issue entirely. Also creates the Pages project if it doesn't exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tomymaritano tomymaritano enabled auto-merge (squash) March 12, 2026 03:45
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Removes the separate Cloudflare Pages project existence check step and consolidates deployment logic into a single step using inline wrangler CLI commands. Replaces wrangler-action with direct npx wrangler@3 calls for project creation and deployment, adding required API token and account ID environment variables.

Changes

Cohort / File(s) Summary
CI/CD Deployment Workflow
.github/workflows/docs.yml
Replaces wrangler-action with inline shell commands for Cloudflare Pages deployment. Removes separate project existence check step and merges project creation (pages project create) with deployment (pages deploy) into a single step. Adds environment variables for CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

ci, app:web, size/M

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: replacing the wrangler-action GitHub Action with direct npx wrangler commands for Cloudflare Pages deployment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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.

github-actions Bot pushed a commit that referenced this pull request Mar 12, 2026
Mirror of #138

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@tomymaritano tomymaritano merged commit c508e54 into main Mar 12, 2026
12 of 13 checks passed
@tomymaritano tomymaritano deleted the fix/cloudflare-npx branch March 12, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant