Skip to content

docs: improve jsdocs#4199

Open
RihanArfan wants to merge 4 commits intomainfrom
docs/jsdocs
Open

docs: improve jsdocs#4199
RihanArfan wants to merge 4 commits intomainfrom
docs/jsdocs

Conversation

@RihanArfan
Copy link
Copy Markdown
Member

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Adds additional jsdocs and links to docs pages.

Also corrects some old jsdocs @see links to point to new docs routes.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@RihanArfan RihanArfan requested a review from pi0 as a code owner April 10, 2026 16:27
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Apr 13, 2026 10:20am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 612648c3-a15b-44a2-b359-ce5c4b5a1358

📥 Commits

Reviewing files that changed from the base of the PR and between 4b93503 and 68d06e1.

📒 Files selected for processing (1)
  • src/types/runtime/cache.ts
✅ Files skipped from review due to trivial changes (1)
  • src/types/runtime/cache.ts

📝 Walkthrough

Walkthrough

Adds and expands JSDoc/type comments across Nitro's type definitions (config, handlers, modules, routes, OpenAPI, runtime), clarifying semantics, defaults, and links. One structural change: removal of the index signature from NitroMeta. No runtime logic or exported type signatures were changed.

Changes

Cohort / File(s) Summary
Configuration Types
src/types/config.ts
Large expansion of JSDoc for NitroOptions and related exported types (defaults, deprecations, semantics, cross-references). Documentation-only; no type-signature changes.
Route & OpenAPI Types
src/types/route-rules.ts, src/types/openapi.ts
Added detailed docs for route rule fields, normalization behavior, and OpenAPI config (NitroOpenAPIConfig) including defaults and disable flags. No structural/type changes.
Handler Types
src/types/handler.ts
Refined and expanded JSDoc for NitroRouteMeta, EventHandlerFormat, NitroEventHandler, NitroDevEventHandler, NitroErrorHandler with usage notes and examples. Documentation-only.
Module Types
src/types/module.ts
JSDoc added for NitroModuleInput and NitroModule describing accepted module shapes and setup lifecycle. No signature changes.
Nitro Core & Runtime Types
src/types/nitro.ts, src/types/runtime/cache.ts, src/types/runtime/nitro.ts
Removed NitroMeta index signature (now only version/majorVersion) and added JSDoc for Nitro, build info, cached handler options, and runtime hooks. No other type/signature changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'docs:' prefix and clearly describes the main change of improving JSDoc documentation.
Description check ✅ Passed The description is directly related to the changeset, explaining the addition of JSDoc comments and corrections to documentation links across multiple type files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/jsdocs
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch docs/jsdocs

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/types/config.ts`:
- Line 455: Update the cron expression in the scheduledTasks example to the
correct syntax by replacing the invalid string "**​/5 * * * *" with "*/5 * * *
*" in the scheduledTasks documentation or example (search for the scheduledTasks
constant/type or the doc block containing that cron example in
src/types/config.ts and update the example string).

In `@src/types/nitro.ts`:
- Around line 18-21: The removal of the index signature from the NitroMeta
interface breaks assignability for consumers that add arbitrary keys; restore
backward compatibility by reintroducing the index signature (e.g., add [key:
string]: any to NitroMeta) or, if you intend this as a breaking change,
explicitly mark it in the changelog/release notes and add migration guidance
explaining how callers should migrate off storing extra keys; locate NitroMeta
in the src/types/nitro.ts file to apply one of these two remedies.
🪄 Autofix (Beta)

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

Run ID: fc91ea1a-75db-4cc9-9f60-37ac3fa50912

📥 Commits

Reviewing files that changed from the base of the PR and between 896186a and d427adc.

📒 Files selected for processing (8)
  • src/types/config.ts
  • src/types/handler.ts
  • src/types/module.ts
  • src/types/nitro.ts
  • src/types/openapi.ts
  • src/types/route-rules.ts
  • src/types/runtime/cache.ts
  • src/types/runtime/nitro.ts

* These are the normalized options after preset defaults and user config
* have been merged. For the user-facing input type, see {@link NitroConfig}.
*
* @see https://nitro.build/config
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it is an internal

Suggested change
* @see https://nitro.build/config

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 10, 2026

Open in StackBlitz

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

commit: d427adc

preset: PresetName;

/**
* Enable static site generation mode.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It disables server build

/**
* Auto-import configuration.
*
* Set to `false` to disable auto-imports. Pass an object to customize.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Default should be false in v3

/**
* Nitro modules to extend behavior during initialization.
*
* Accepts module path strings, {@link NitroModule} objects, or bare setup functions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should check but iirc this option now is almost unused

Co-authored-by: Pooya Parsa <pyapar@gmail.com>
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.

2 participants