-
Notifications
You must be signed in to change notification settings - Fork 6.5k
refactor: split platform-specific code into platform-vercel and platform-cloudflare packages #8838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ovflowd
wants to merge
17
commits into
main
Choose a base branch
from
refactor/split-apps-by-deployment-target
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d7b6e7e
refactor: consolidate platform detection into NEXT_PUBLIC_DEPLOY_TARGET
ovflowd 641d0b9
refactor: split platform-specific code into platform-vercel and platf…
ovflowd c88bfc5
Merge branch 'main' into refactor/split-apps-by-deployment-target
ovflowd 1a61747
fix: use project-relative alias strings in default platform config
ovflowd 78a6852
fix(vercel): restore mdx defaults for shiki
cursoragent 517dfcb
chore(deps): catalog next versions across workspace
cursoragent 6664f19
refactor(config): restrict platform nextConfig overrides
cursoragent 0ac46dc
refactor(types): enforce platform nextConfig via type-only constraints
cursoragent 4641a0c
refactor: move platform workspaces from packages/ to apps/ and decoup…
ovflowd 23bfde7
docs: update Repository Structure to list apps/vercel and apps/cloudf…
ovflowd 87f739f
refactor(platform): resolve via #platform import map and unify type c…
ovflowd 35a58e3
fix(ci): build open-next in a dedicated step and skip turbo for wrangler
ovflowd ed3b670
fix(ci): invoke cloudflare:preview via pnpm filter so wrangler resolves
ovflowd 93751a4
fix(platform): defer Node-only config behind async thunks
ovflowd ecf659d
chore(cloudflare): drop cd-prefixed scripts and ignore wrangler state…
ovflowd 62528e8
refactor(platform): relocate deploy-target apps under platforms/
ovflowd 68b5524
fix(platform): restore platform-vercel next config test under platforms/
ovflowd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from '@platform/analytics'; |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1 @@ | ||
| export async function register() { | ||
| if (!('Cloudflare' in globalThis)) { | ||
| // Note: we don't need to set up the Vercel OTEL if the application is running on Cloudflare | ||
| const { registerOTel } = await import('@vercel/otel'); | ||
| registerOTel({ serviceName: 'nodejs-org' }); | ||
| } | ||
| } | ||
| export { register } from '@platform/instrumentation'; |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import type { HighlighterOptions } from '@node-core/rehype-shiki'; | ||
| import type { NextConfig } from 'next'; | ||
|
|
||
| type PlatformMdxConfig = Pick<HighlighterOptions, 'wasm' | 'twoslash'>; | ||
| type PlatformNextConfig = Pick<NextConfig, 'deploymentId' | 'env'>; | ||
|
|
||
| /** | ||
| * Shared platform-config contract consumed by `apps/site/next.config.mjs` | ||
| * and implemented by each `@node-core/platform-<target>` package. | ||
| * | ||
| * `nextConfig` and `images` are async thunks so that platform modules | ||
| * that depend on Node-only tooling (e.g. `@opennextjs/cloudflare`, | ||
| * `require.resolve`) can keep those imports out of the module's | ||
| * top-level. Webpack bundles the top level of this module into the | ||
| * server output; deferring heavy work into function bodies keeps the | ||
| * worker runtime free of build-only code. | ||
| */ | ||
| export type PlatformConfig = { | ||
| aliases?: Record<string, string>; | ||
| images?: () => Promise<NextConfig['images']>; | ||
| mdx?: PlatformMdxConfig; | ||
| nextConfig?: () => Promise<PlatformNextConfig>; | ||
| }; | ||
|
|
||
| declare const config: PlatformConfig; | ||
|
|
||
| export default config; | ||
|
cursor[bot] marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting by platform also opens the door to more nuanced CODEOWNERS - if we have experts or partners in one platform or the other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any example?