docs: list supported configuration file names - #4517
Conversation
Document the exact configuration files Nitro loads via c12: nitro.config.* (12 extensions), .config/nitro.* and .config/nitro.config.*, plus the extensionless .nitrorc file. Also remove two inaccurate claims: configuration via the package.json nitro key and a .nitrorc in the user home directory are not loaded (c12 packageJson/globalRc options are not enabled by Nitro). Closes nitrojs#4505
|
@tarikermis is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe configuration documentation now lists supported Nitro configuration filenames, lookup order, project-root resolution, ChangesConfiguration documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/1.docs/50.configuration.md`:
- Around line 41-45: Update the configuration file lists in the Nitro
configuration documentation to reflect c12’s actual extension precedence,
placing JavaScript extensions before TypeScript extensions. Apply the same
ordering consistently to all three locations: nitro.config, .config/nitro, and
.config/nitro.config.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e4397044-9b7b-49a4-bfdd-2009d3845724
📒 Files selected for processing (1)
docs/1.docs/50.configuration.md
c12 resolves .js before .ts for the same basename, so list the extensions in the order they are actually checked. Refs nitrojs#4505
🔗 Linked issue
Closes #4505
❓ Type of change
📚 Description
The configuration page never says which file names Nitro actually loads, so users cannot tell whether names such as
.nitrorc.js,nitro.config.yaml, or.config/nitro.tomlare supported.This adds a complete “Supported configuration files” section and removes two claims that do not match Nitro's loader:
packageJsonoption, so anitrokey inpackage.jsonis not loaded.globalRc, so a home-directory.nitrorcis not loaded.The page now lists the supported
nitro.config.*,.config/nitro.*,.config/nitro.config.*, and extensionless.nitrorcforms, including their precedence.I checked the list both against the c12 resolver used by Nitro and by running Nitro's real
loadOptions()against temporary directories. The schema covers all supported extensions, and the negative cases above stayed unloaded.Verification
pnpm lintpasses.Verified on Linux with Node 22. Windows path handling was not tested, and the extension preference within a single basename is intentionally left undocumented.
📝 Checklist
Best Regards, Tarik