Skip to content

feat: add nitro preset#436

Open
jcbsfilho wants to merge 9 commits into
mainfrom
feat/preset-nitro
Open

feat: add nitro preset#436
jcbsfilho wants to merge 9 commits into
mainfrom
feat/preset-nitro

Conversation

@jcbsfilho
Copy link
Copy Markdown
Collaborator

This pull request introduces a new Nitro preset to the Azion platform, enabling streamlined deployment and configuration for Nitro-based applications. It adds the necessary configuration, runtime logic, and build steps for Nitro, while also improving polyfill handling for import.meta.url and updating relevant package exports and dependencies.

Nitro Preset Integration:

  • Added a new Nitro preset, including configuration (config.ts), metadata (metadata.ts), prebuild script (prebuild.ts), and export in the main index (index.ts). This preset defines build, storage, connector, function, application, and workload settings tailored for Nitro deployments. [1] [2] [3] [4] [5]
  • Introduced a custom Nitro build extension, including a runtime module that integrates with Nitro's server and asset handling. This includes hooks to generate necessary output files and a custom Rollup plugin for resolving Nitro imports. [1] [2]

Package and Export Updates:

  • Updated packages/presets/package.json to include the new Nitro preset in exports and files, ensuring it is discoverable and distributable. [1] [2]
  • Added a changeset entry documenting the new Nitro preset release and associated version bumps.

Polyfill and Node Environment Improvements:

  • Enhanced the @aziontech/unenv-preset to inject a polyfill for import.meta.url, including the polyfill implementation and global assignment for AsyncLocalStorage. [1] [2] [3]
  • Updated the esbuild node polyfills plugin to handle import.meta.url via the define option rather than injection, ensuring correct polyfilling behavior.

Other Build Config Changes:

  • Removed the keepNames: true option from the esbuild config, possibly to reduce bundle size or improve compatibility.

@jcbsfilho jcbsfilho requested a review from a team as a code owner June 1, 2026 14:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

SCC Complexity Analysis

  • Title: feat: add nitro preset
  • Author: jcbsfilho
Metric Source Branch (feat/preset-nitro) Target Branch (main) Difference
Complexity 2445 2438 7
Code 50386 50056 330

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/aziontech/lib/@aziontech/builder@436
npm i https://pkg.pr.new/aziontech/lib/@aziontech/presets@436
npm i https://pkg.pr.new/aziontech/lib/@aziontech/unenv-preset@436

commit: 20d742a

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

SCC Complexity Analysis

  • Title: feat: add nitro preset
  • Author: jcbsfilho
Metric Source Branch (feat/preset-nitro) Target Branch (main) Difference
Complexity 2445 2438 7
Code 50389 50056 333

PatrickMenoti
PatrickMenoti previously approved these changes Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

SCC Complexity Analysis

  • Title: feat: add nitro preset
  • Author: jcbsfilho
Metric Source Branch (feat/preset-nitro) Target Branch (main) Difference
Complexity 2445 2438 7
Code 50519 50056 463

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants