Skip to content

feat: detect nitro preset#404

Open
atinux wants to merge 5 commits intomainfrom
feat/nitro-preset
Open

feat: detect nitro preset#404
atinux wants to merge 5 commits intomainfrom
feat/nitro-preset

Conversation

@atinux
Copy link
Member

@atinux atinux commented Mar 4, 2026

I was surprised to see that we were not tracking Nitro preset 😄

nitro:init is run after modules:done hook so was better to directly use the hook so we also make sure the preset is resolved.

@atinux atinux requested a review from danielroe as a code owner March 4, 2026 15:56
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 41e0aa7a-44fe-4189-bc80-507e6140d92f

📥 Commits

Reviewing files that changed from the base of the PR and between 42df201 and f919dcc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

The PR integrates Nitro into telemetry: createContext and Telemetry constructor now accept a Nitro parameter and expose nitroPreset (derived from nitro.options.preset or null) in the returned Context. Telemetry initialization has been moved into the nitro:init lifecycle hook. The Context type is updated to include nitroPreset: string | null. Tests were updated to expect nitroPreset (e.g., "node-server"). The build config marks nitropack as external and nitropack was added to devDependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main feature: detecting and tracking the Nitro preset in telemetry.
Description check ✅ Passed The description clearly explains the change: adds Nitro preset detection and justifies using the nitro:init hook to ensure preset resolution.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/nitro-preset

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

@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: 1

🤖 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/context.ts`:
- Line 34: The code uses a non-null assertion on nuxt.options.nitro!.preset but
Context expects nitroPreset: string | null; replace the assertion with a
normalization that safely reads nuxt.options.nitro?.preset and converts it to a
string or null (e.g., use optional chaining and a conditional or nullish
coalescing to produce either a string or null), updating the symbol nitroPreset
accordingly and removing the `!` assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 13a9f587-f18b-4c42-9313-134d0c8ef917

📥 Commits

Reviewing files that changed from the base of the PR and between de550ab and b708dee.

📒 Files selected for processing (5)
  • src/context.ts
  • src/module.ts
  • src/telemetry.ts
  • src/types.ts
  • test/e2e.spec.ts

@atinux atinux requested a review from danielroe March 5, 2026 10:01
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