Skip to content

chore(monorepo): break out platform-specific code - #9029

Merged
avivkeller merged 3 commits into
mainfrom
refactor/platform-packages
Jul 30, 2026
Merged

chore(monorepo): break out platform-specific code#9029
avivkeller merged 3 commits into
mainfrom
refactor/platform-packages

Conversation

@avivkeller

@avivkeller avivkeller commented Jul 28, 2026

Copy link
Copy Markdown
Member

Vercel is failing due to the vercel.json being moved. Refer to the OpenNext CI successes.

Copilot AI review requested due to automatic review settings July 28, 2026 19:34
@avivkeller
avivkeller requested review from a team as code owners July 28, 2026 19:34
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nodejs-org Skipped Skipped Jul 30, 2026 7:05pm

Request Review

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how Vercel and Cloudflare discover config and resolve platform code at build time; misconfiguration could break previews or Workers deploys without affecting local default builds much.

Overview
Moves Vercel, Cloudflare, and default hosting concerns out of apps/site into platforms/{vercel,cloudflare,default}, wired through Node import conditions on #platform/* (analytics, instrumentation, next.config, Shiki, Playwright).

The site app drops embedded OpenNext/Wrangler scripts, Cloudflare env branching (OPEN_NEXT_CLOUDFLARE), and direct @vercel/* usage; the root layout and MDX pipeline now delegate to #platform/analytics, #platform/instrumentation, and #platform/shiki.mjs. vercel.json relocates to platforms/vercel/ with filtered install/build and --conditions=vercel; Cloudflare build/preview/deploy and Twoslash VFS generation live on @node-core/platform-cloudflare.

CI and root scripts target @node-core/website for Next/static export builds and @node-core/platform-cloudflare for OpenNext e2e and deploy workflows.

Reviewed by Cursor Bugbot for commit 92fc729. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.10%. Comparing base (eab3644) to head (92fc729).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9029      +/-   ##
==========================================
- Coverage   75.15%   75.10%   -0.06%     
==========================================
  Files         102      102              
  Lines        9124     9105      -19     
  Branches      374      372       -2     
==========================================
- Hits         6857     6838      -19     
  Misses       2263     2263              
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment thread platforms/vercel/vercel.json
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 10.77 MB
New Total First Load JS 7.16 MB
Delta -3.61 MB (-33.50%)

Changes

🔄 Modified Routes (5)
Route Old First Load JS New First Load JS Delta
/[locale] 2.57 MB 1.68 MB 📉 -907.15 KB (-34.47%)
/[locale]/[...path] 2.57 MB 1.68 MB 📉 -907.15 KB (-34.47%)
/[locale]/blog/[...path] 2.57 MB 1.68 MB 📉 -907.15 KB (-34.47%)
/[locale]/download/archive/[version] 2.57 MB 1.68 MB 📉 -907.15 KB (-34.47%)
/_not-found 503.23 KB 437.38 KB 📉 -65.85 KB (-13.09%)

Copilot AI review requested due to automatic review settings July 28, 2026 20:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread apps/site/package.json
Copilot AI review requested due to automatic review settings July 28, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@avivkeller

Copy link
Copy Markdown
Member Author

(Vercel is failing since vercel.json moved to a different directory)

Copilot AI review requested due to automatic review settings July 28, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 20:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread platforms/vercel/next.config.mjs
Copilot AI review requested due to automatic review settings July 29, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread platforms/cloudflare/turbo.json
Comment thread apps/site/turbo.json

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SGTM, awesome stuff. Thanks for continuing this work 🙇

@bmuenzenmeyer bmuenzenmeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I approved #8838 as well, this is great. I like the default platform concept.

Comment thread platforms/cloudflare/tsconfig.json Outdated
Comment thread pnpm-workspace.yaml Outdated
Copilot AI review requested due to automatic review settings July 30, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread .github/workflows/tmp-cloudflare-open-next-deploy.yml Outdated
Move deployment-target-specific code out of `apps/site` and into
dedicated `platforms/*` workspace packages: `platform-cloudflare`,
`platform-vercel`, and a `platform-default` fallback.

The site now reaches platform code through `#platform/*` subpath
imports, resolved via package import conditions, so `apps/site` no
longer carries Cloudflare- or Vercel-only configuration, dependencies,
or build scripts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 30, 2026 18:47
@avivkeller
avivkeller force-pushed the refactor/platform-packages branch from 2e7f7a5 to 18d6d15 Compare July 30, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 30, 2026 19:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 30, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@avivkeller
avivkeller merged commit 5446e54 into main Jul 30, 2026
14 of 15 checks passed
@avivkeller
avivkeller deleted the refactor/platform-packages branch July 30, 2026 19:10

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 92fc729. Configure here.

Comment thread apps/site/package.json
"name": "@node-core/website",
"type": "module",
"scripts": {
"prebuild": "node --run build:blog-data && node --run build:twoslash-fsmap",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blog data skipped on Cloudflare builds

High Severity

Removing website prebuild drops generation of gitignored public/blog-data.json, which next.json.mjs imports. Cloudflare prebuild/predeploy only run the twoslash fsmap, and the documented pnpm --filter=@node-core/platform-cloudflare build path does not go through turbo dependsOn, so clean Cloudflare builds fail or omit blog data.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 92fc729. Configure here.

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.

4 participants