Skip to content

fix: point root types to published declaration#4347

Open
Fernando-droidx wants to merge 1 commit into
nitrojs:mainfrom
Fernando-droidx:fix/root-types-entry
Open

fix: point root types to published declaration#4347
Fernando-droidx wants to merge 1 commit into
nitrojs:mainfrom
Fernando-droidx:fix/root-types-entry

Conversation

@Fernando-droidx

Copy link
Copy Markdown

Summary

  • point the root types field at the declaration generated beside the root runtime export
  • restore TypeScript resolution for consumers using legacy moduleResolution: "node"

Fixes #4346.

Validation

  • pnpm typecheck
  • git diff --check
  • confirmed dist/runtime/nitro.d.mts is generated and included by the package files list
  • reproduced the published-package failure before the change with nitro@3.0.260610-beta: TypeScript follows ./lib/index.d.mts, which is absent from the tarball

pnpm build generated the runtime declarations but did not complete on local Node.js 22.13.1 because node ./scripts/gen-presets.ts does not support direct .ts execution on that Node version.

@Fernando-droidx Fernando-droidx requested a review from pi0 as a code owner June 13, 2026 19:06
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@Fernando-droidx is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: a5569cbb-fce3-47e3-a061-5c57772acda0

📥 Commits

Reviewing files that changed from the base of the PR and between 7765bcb and f1d1be7.

📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

The package.json types field is updated to point to ./dist/runtime/nitro.d.mts, correcting a broken reference that previously pointed to the non-existent ./lib/index.d.mts. This ensures TypeScript can resolve the package's type declarations during development and compilation.

Changes

Types Declaration Fix

Layer / File(s) Summary
Package types entry point
package.json
The root types field is updated from ./lib/index.d.mts to ./dist/runtime/nitro.d.mts to reference the actual published TypeScript declaration file.

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix: point root types to published declaration' follows conventional commits format (fix prefix) and clearly describes the main change to the package.json types field.
Description check ✅ Passed The PR description is directly related to the changeset, explaining the root types field update, validation steps, and the issue it fixes (#4346).
Linked Issues check ✅ Passed The PR successfully addresses issue #4346 by updating the package.json types field from the missing ./lib/index.d.mts to the published ./dist/runtime/nitro.d.mts, restoring TypeScript resolution for legacy moduleResolution: node.
Out of Scope Changes check ✅ Passed The single change to package.json's types field is directly in scope and addresses the stated objective of fixing the broken TypeScript resolution documented in issue #4346.
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 unit tests (beta)
  • Create PR with unit tests

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.

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.

nitro 3 beta package types field points to missing lib/index.d.mts

1 participant