Skip to content

feat: add OpenNextjs preset #179

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

Merged
merged 2 commits into from
Jun 20, 2025
Merged

feat: add OpenNextjs preset #179

merged 2 commits into from
Jun 20, 2025

Conversation

jcbsfilho
Copy link
Collaborator

This pull request introduces a new preset, opennextjs, to the packages/presets module and adds support for skipping project builds in the build context. The changes include defining the configuration, metadata, and prebuild logic for the new preset, as well as updating the build context interface to accommodate the new feature.

New opennextjs Preset:

  • Added a new preset, opennextjs, with its configuration, metadata, and prebuild logic. This includes defining the build rules, origin settings, and edge function behaviors in opennextjs/config.ts (packages/presets/src/presets/opennextjs/config.ts).
  • Created opennextjs/metadata.ts to define metadata for the preset, including its name (packages/presets/src/presets/opennextjs/metadata.ts).
  • Implemented opennextjs/prebuild.ts to handle prebuild actions specific to the opennextjs preset, such as installing dependencies, running build commands, and populating assets and cache (packages/presets/src/presets/opennextjs/prebuild.ts).
  • Exported the opennextjs preset in opennextjs/index.ts to make it available for use (packages/presets/src/presets/opennextjs/index.ts).
  • Included the opennextjs preset in the main export file (packages/presets/src/index.ts).

Build Context Enhancement:

  • Added an optional skipProjectBuild property to the BuildContext interface, allowing builds to skip project-level build steps (packages/config/src/types.ts).

pablodiehl
pablodiehl previously approved these changes Jun 20, 2025
rules: {
request: [
{
name: 'Set Storage Origin for All Requests',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this All Requests or Static requests only? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Everything starting with '/_next/static/' is in the match field. Thanks, I'll improve the name of this rule.

jotanarciso
jotanarciso previously approved these changes Jun 20, 2025
@jcbsfilho jcbsfilho dismissed stale reviews from jotanarciso and pablodiehl via bfd9d93 June 20, 2025 17:56
@jcbsfilho jcbsfilho merged commit ca726ad into stage Jun 20, 2025
2 checks passed
@jcbsfilho jcbsfilho deleted the feat/preset-opennextjs branch June 20, 2025 17:59
jotanarciso pushed a commit that referenced this pull request Jun 20, 2025
[skip ci]
## [1.20.0-stage.14](v1.20.0-stage.13...v1.20.0-stage.14) (2025-06-20)

### Features

* add OpenNextjs preset (#179) ([ca726ad](ca726ad))
@jotanarciso
Copy link
Collaborator

🎉 This PR is included in version 1.20.0-stage.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants