chore: retire Express layer — Hono Worker is the only server#43
chore: retire Express layer — Hono Worker is the only server#43chitcommit wants to merge 1 commit into
Conversation
Final phase of the Express → Hono Worker migration. All routes were ported in PRs #33–#42; this PR removes the Express layer entirely and rewires dev/build. Deleted (25 files): - Routes & bootstrap: server/index.ts, server/routes.ts - Clients: server/aiAnalysis.ts, server/openai.ts, server/chittyCloudMcp.ts, server/chittyEcosystem.ts, server/chittyCloudflareCore.ts, server/chittyCore.ts, server/chittyAuth.ts, server/githubWebhooks.ts - Infra: server/objectStorage.ts, server/objectAcl.ts, server/storage.ts, server/db.ts, server/seedData.ts, server/toolRegistry.ts, server/vite.ts - Middleware: server/middleware/{errorHandler,logging,validation}.ts - Tests: server/__tests__/** (superseded by worker/__tests__/* integration suite) - Utility scripts: scripts/notion-sync.js, scripts/update-sync-status.js (Notion sync is centralized via Ch1tty; not a per-repo concern) Deps removed: express, express-session, connect-pg-simple, memorystore, memoizee, @types/{express,express-session,connect-pg-simple,passport,passport-local,ws,memoizee}, @clerk/{backend,clerk-sdk-node,express,types}, @google-cloud/storage, google-auth-library, @notionhq/client, @anthropic-ai/claude-code, @chittyapps/chittycloude-mcp, openid-client, ws, tsx, esbuild Deps added: concurrently (dev workflow), wrangler (deploy), @cloudflare/workers-types Dev workflow (Option B — separate vite + wrangler dev): npm run dev — concurrently runs vite (5173) + wrangler dev (8788); vite proxies /api/* to the Worker for HMR. npm run dev:web — vite only npm run dev:api — wrangler dev only npm run build — vite build (Worker is bundled by wrangler deploy) npm run deploy — wrangler deploy --env production Validation: - npm run check: 85 errors → 41 errors (all remaining errors are pre-existing client/* type issues, surfaced once server/* noise is removed; client is untouched in this PR) - vite build: OK (496 KB JS / 70 KB CSS) - wrangler deploy --dry-run --env production: OK, all bindings resolve (Hyperdrive, R2 EVIDENCE/PROCESSED, ASSETS, tail consumer chittytrack) - Worker integration tests: 6 env-independent tests pass; DB-backed tests gated on TEST_DB_URL (per "no mocks" policy, run against a real Neon branch) Constraints honored: - client/** and shared/** untouched - No prod-mutating commands (R2 bucket create, secrets, registry register) executed — operator tasks called out in the checklist below. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bd9c2f0a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,286 +0,0 @@ | |||
| #!/usr/bin/env node | |||
There was a problem hiding this comment.
Keep Notion sync workflow runnable after script removal
Deleting this script breaks .github/workflows/notion-sync.yml, which still executes node scripts/notion-sync.js (and node scripts/update-sync-status.js) on push/PR/schedule when Notion secrets are configured. After this commit those steps will fail with a missing-file/module error before any sync logic runs, so the repository’s Notion automation is effectively dead until the workflow is updated or replacement scripts are provided.
Useful? React with 👍 / 👎.
| app.post('/api/github/webhooks', express.raw({ type: 'application/json' }), handler.handleWebhook); | ||
|
|
There was a problem hiding this comment.
Port GitHub App endpoints before removing webhook routes
This removal drops the only implementation of /api/github/webhooks, /api/github/callback, and /api/github/setup, but no equivalent routes exist in the Worker router (worker/src/index.ts only mounts non-GitHub route groups and falls back to app.all('/api/*', ...) with 501). Any existing GitHub App configuration (for example .github/app/app-manifest.json webhook URL) will stop working immediately after deployment.
Useful? React with 👍 / 👎.
Stack: Final cleanup. Stacks on #42 → #41 → #40 → #39 → #38 → #37 → #36 → #34 → #33.
Production traffic now flows entirely through the Hono Worker at
assets.chitty.cc/*. The Express server is gone. The SPA (Vite-builtdist/public) is served by the Worker'sASSETSbinding in production.Files deleted (27)
Routes & bootstrap
server/index.ts,server/routes.tsClients (ported to
worker/src/clients/*)server/aiAnalysis.ts,server/openai.tsserver/chittyCloudMcp.ts,server/chittyEcosystem.ts,server/chittyCloudflareCore.ts,server/chittyCore.tsserver/chittyAuth.ts,server/githubWebhooks.tsInfra (replaced by Drizzle + Worker bindings)
server/objectStorage.ts,server/objectAcl.ts(R2 +r2_object_acltable)server/storage.ts,server/db.ts(worker/src/db.ts)server/seedData.ts,server/toolRegistry.ts,server/vite.tsMiddleware
server/middleware/{errorHandler,logging,validation}.tsTests
server/__tests__/**(superseded byworker/__tests__/*real-Neon integration suite)Utility scripts
scripts/notion-sync.js,scripts/update-sync-status.js(Notion sync is centralized via Ch1tty; not a per-repo concern)Deps removed from package.json
express,express-session,connect-pg-simple,memorystore,memoizee,@types/{express,express-session,connect-pg-simple,passport,passport-local,ws,memoizee},@clerk/{backend,clerk-sdk-node,express,types},@google-cloud/storage,google-auth-library,@notionhq/client,@anthropic-ai/claude-code,@chittyapps/chittycloude-mcp,openid-client,ws,tsx,esbuild.Deps added
concurrently(dev workflow),wrangler(deploy),@cloudflare/workers-types(Worker types).Dev workflow chosen — Option B (separate vite + wrangler dev)
Standard Cloudflare + Vite SPA dev pattern with HMR.
Validation gates
npm run checkbeforenpm run checkafterclient/*issues, surfaced onceserver/*noise gone.client/untouched per constraints.vite buildwrangler deploy --dry-run --env productionchittytrack)TEST_DB_URLper "no mocks" policy — operator validates against a real Neon branchgrep -rE "from .*server/" client/ shared/git ls-files server/Migration complete checklist
worker/__tests__/*)wrangler r2 bucket create chittyassets-evidence && wrangler r2 bucket create chittyassets-processedwrangler secret put OPENAI_API_KEY --env production(and any others surfaced bywrangler deploy)npm run db:pushagainst prod connection string (route via ChittyConnect for cold creds)🤖 Generated with Claude Code