Skip to content

feat(config): expose resolved config layers as nitro.options.layers - #4813

Merged
pi0 merged 1 commit into
mainfrom
feat/expose-layers
Oct 17, 2026
Merged

pi0 merged 1 commit into
mainfrom
feat/expose-layers

Conversation

@pi0x

@pi0x pi0x commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Resolves #4771

Adds nitro.options.layers so modules no longer need to reach into nitro.options._c12.layers.

Instead of passing c12's layer objects through, this exposes a small Nitro-owned shape (NitroConfigLayer):

interface NitroConfigLayer {
  cwd: string;         // layer directory
  configFile?: string; // resolved config file path
  config: NitroConfig; // the layer's own config (before merging)
  meta?: { name?: string; [key: string]: unknown };
}
  • The first layer is always the project root, even when there is no config file. After it come the extends layers, from highest to lowest priority.
  • Preset layers, the inline overrides layer, and the rc/package.json layers are left out (they have no directory).
  • c12-only fields like source and sourceOptions are left out, so giget options and auth tokens are not exposed.
  • layers can't be set in NitroConfig.

_c12 is unchanged.

🤖 Generated with AI assistant

@pi0x
pi0x requested a review from pi0 as a code owner October 17, 2026 12:42
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
nitro.build Ready Ready Preview Oct 17, 2026 12:42pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0d67d110-c3d3-4528-ad62-ce7e681de569
📥 Commits

Reviewing files that changed from the base of the PR and between 5e61db0 and 2cea8b0.

📒 Files selected for processing: 4
  • docs/1.docs/50.configuration.md
  • src/config/loader.ts
  • src/types/config.ts
  • test/unit/config-layers.test.ts
+-----------------------------------------------------------------------------------------------------------------------------------+
| Don't use manual procedures. A shell script or batch file will execute the same instructions, in the same order, time after time. |
+-----------------------------------------------------------------------------------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4813

commit: 2cea8b0

@pi0
pi0 merged commit 9e84b43 into main Oct 17, 2026
13 of 14 checks passed
@pi0
pi0 deleted the feat/expose-layers branch October 17, 2026 12:44

This branch was successfully deployed

1 active deployment
Preview — 2cea8b01 Deployed Oct 17, 2026 by vercel[bot]
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.

Expose layers through options

2 participants