-
-
Notifications
You must be signed in to change notification settings - Fork 773
refactor(zeabur): update preset #3882
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
base: main
Are you sure you want to change the base?
Conversation
|
@pan93412 is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
π WalkthroughWalkthroughRenamed the Zeabur server preset to Changes
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes
Pre-merge checks and finishing touchesβ Passed checks (3 passed)
β¨ 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 |
aef0929 to
f74e332
Compare
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.
Pull request overview
This PR refactors the Zeabur preset to align with Zeabur's current zbpack implementation by simplifying the configuration to extend from the standard "node-server" and "static" presets instead of using custom implementations.
Key changes:
- Simplified the
zeaburpreset to extendnode-serverinstead of using custom entry point and output configuration - Simplified the
zeabur-staticpreset to extendstaticwithout custom output directories or commands - Added comprehensive test coverage for both presets
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
test/presets/zeabur.test.ts |
Added new test file with test cases for both zeabur and zeabur-static presets, verifying correct output directory structure |
src/presets/zeabur/preset.ts |
Refactored both presets to extend base presets (node-server and static) instead of custom implementations, removing complex hooks and configuration |
src/presets/_types.gen.ts |
Updated generated type definitions to reflect preset name changes |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f74e332 to
2b4c449
Compare
Zeabur now uses the general "node-server" to build the Dockerfile. Therefore, we simply extend "node-server" and "static".
2b4c449 to
f74bafb
Compare
|
Since both of your review comments point to the same underlying issue, I'd like to provide some additional context here to address them together. Last year, after evaluating stability and necessity, Zeabur decided to deprecate serverless runtime support, as containerization effectively covers those use cases. Currently, all projects on Zeabur are wrapped in a Dockerfile and executed as containers. As a result, the current role of
You might also notice that we currently hardcode the FROM node:25-slim AS builder
WORKDIR /src
COPY . .
RUN npm install -g pnpm && pnpm install --prod --frozen-lockfile
RUN pnpm run generate
FROM zeabur/caddy-static AS server
EXPOSE 8080
COPY --from=builder /src/.output/public /usr/share/caddy
Because Zeabur automatically injects This has caused confusion for many users who wonder, "Why does my Dockerfile build fine locally (using If you have any better suggestions or thoughts on how to handle this, I'd love to hear them! |
|
@pi0 sorry for pinging β what's your opinion? |
|
Thanks for the explanations, @pan93412 β€οΈ. It makes sense if the platform is simplified by switching to a My concern is that framework detection can easily fail. In With the current preset implementation, when a Nitro build runs in Zeabur CI, it produces a predictable output that the deployment platform can consume. I am fine if the output directory becomes |
Currently, we can only list all frameworks based on Nitro and apply the same logic to them. Most zero-config application builders use this approach, including Vercel and Railway's Railpack. I think it is fine at the moment. Nitro v3 will be implemented after I have cleaned up the logic in zbpack.
Yes. Once we declare that a framework (e.g., Nuxt, Undocs, TanStack Start) is based on Nitro, they will all follow the same bundle logic in |
|
Some providers also detect "some" Nitro based frameworks however zero config detection build output and docs are based on assumption that platform's framework detection is not a hard requirement. Maintaining a list of known pkg names per each provider is not desired nor practical honestly. The fact that official "nitro" package itself(!) is missing today (and our e2e deploys failed without notice) is a proof of this. Anyone should be able to make a Nitro based tool that just works everywhere without waiting. Regardless, i will properly review platform support as soon as could and likely defaulting to something guaranteed to work on zeabur even if detection fails. Feel free to reach me out in discord ( |
π Linked issue
A better implementation of #3122.
Fix ZEA-7651
β Type of change
π Description
Zeabur now uses the general "node-server" to build the Dockerfile. Therefore, we simply extend "node-server" and "static".
π Checklist
Checks:
zeaburandzeabur-static.$ ZEABUR=1 pnpm build β Nitro preset: zeabur [success] [nitro] You can preview this build using `node .output/server/index.mjs`"zeabur-static""zeabur" provider and generates the same output as "static" (?)$ ZEABUR=1 pnpm generate β Nitro preset: zeabur [success] [nitro] Generated public .output/public [success] [nitro] You can preview this build using `node .output/server/index.mjs`