feat: Cloudflare monorepo + vinext migration#668
Draft
codercatdev wants to merge 8 commits intodevfrom
Draft
Conversation
V5b showed 2/4 infographic frames with gray/off-white backgrounds despite the color rule saying 'Use ONLY black'. Restructured as numbered rules with explicit rejection language. Background rule is now #1 priority.
- apps/web: Next.js site (all existing app code) - apps/studio: Sanity Studio (standalone deploy target) - packages/shared: Shared Sanity schemas + config No import changes yet — structural move only.
- Create apps/web/sanity/lib/api.ts re-export shim so existing @/sanity/lib/api imports continue to work (delegates to @codingcatdev/shared) - Fix all apps/studio/sanity.config.ts imports: - Schema imports → @codingcatdev/shared/sanity/schemas/... - Local plugins/components → relative paths (./sanity/...) - api.ts → @codingcatdev/shared/sanity/lib/api - Fix assist.ts relative import to use @codingcatdev/shared - Fix SharePreviewActionButton.tsx api import - Fix YouTubePreview.tsx utils import (create local studio utils) - Copy resolveHref.ts to studio (simple, no external deps) Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>
Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>
…Phase C) Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
B1: Remove @vercel/speed-insights import and <SpeedInsights /> JSX from analytics.tsx I1: Make studioUrl configurable via NEXT_PUBLIC_SANITY_STUDIO_URL env var I2: Use SANITY_STUDIO_PREVIEW_URL for cross-origin presentationTool previewUrl I3: Prefer SANITY_STUDIO_ env vars in sanity.cli.ts with NEXT_PUBLIC_ fallback I5: Remove apps/web/vercel.json (no longer deploying to Vercel) Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>
- Deleted the @codingcatdev/shared package, consolidating Sanity schemas and API configurations directly within the apps. - Updated imports in the studio and web apps to use local paths instead of the shared package. - Removed the GEMINI.md file as it is no longer needed. - Adjusted pnpm workspace configuration to reflect the removal of the shared package. Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cloudflare Monorepo + Vinext Migration
Migrates the CodingCat.dev site from a single Next.js app on Vercel to a pnpm workspace monorepo deployed to Cloudflare Workers via vinext.
Changes
Phase A: pnpm Workspace Restructure
git mvwith 100% rename detection (full history preserved)apps/web/(Next.js site),apps/studio/(Sanity Studio),packages/shared/(schemas + API config)@codingcatdev/web,@codingcatdev/studio,@codingcatdev/sharedpnpm-workspace.yamlwith workspace scriptsapps/web/sanity/lib/api.tskeeps 14 existing imports working@/imports rewritten to@codingcatdev/shared/...or relative pathsPhase B: Sanity Studio Extraction
apps/studio/is now a standalone Sanity Studio app with its ownpackage.jsonsanity deployapp/(sanity)/studio/[[...tool]]/) from web apppackages/sharedexports for.tsxfiles (settings.tsx)Phase C: Vinext Migration
nextcommands withvinextin scripts (dev,build,start,deploy)"type": "module"to package.json, renamedpostcss.config.js→.cjsvite.config.tswith vinext + @vitejs/plugin-rsc + @cloudflare/vite-pluginwrangler.jsoncfor Cloudflare Workers deploymentnext.config.tspreserved (vinext reads it for images, serverExternalPackages)next/*imports shimmed by vinext automatically@vercel/speed-insights(unused). Kept@vercel/analytics(client-side, compatible)Key Technical Decisions
@codingcatdev/sharedwith wildcard exportsnext.config.ts@remotion/lambdain depsreact-instantsearch-nextjsreact-instantsearchif build issuesValidated: next-sanity Compatibility ✅
Deep-dived
sanity-io/next-sanitysource code.defineLiveuses only:draftMode()fromnext/headers— vinext supportsfetchwithnext.tags/next.revalidate— vinext supports ISREventSourcefor real-time — pure browser APIpreconnect/prefetchDNSfromreact-dom— standard ReactThe Live Content API (homepage's core feature) should work on vinext.
Known Risks / Follow-ups
react-instantsearch-nextjs— may need swap to basereact-instantsearchif build failsnextjs-toploader— uses Next.js router events, may need removal@remotion/lambda— may needssr.externalin vite config if bundling issuesNEXT_PUBLIC_SANITY_*env vars in studio (no longer Next.js)presentationTool.previewUrlfor standalone studio deploymentpnpm approve-buildsfor workerd native binaryvinext build) to validate end-to-endTesting
vinext devstarts without errorsvinext buildcompletesvinext deployto Cloudflare Workers succeeds