Skip to content

fix(core): scan handlers when initialising nitro#2546

Merged
pi0 merged 2 commits intomainfrom
fix/export-scan-handlers
Jun 19, 2024
Merged

fix(core): scan handlers when initialising nitro#2546
pi0 merged 2 commits intomainfrom
fix/export-scan-handlers

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented Jun 19, 2024

🔗 Linked issue

❓ 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

This runs scanHandlers, which is required to run before writeTypes to ensure the return types for the handlers are present + correctly generated:

https://github.com/unjs/nitro/blob/7e0b49ef63f1404657d875543bcbbec6c2a4d6b9/src/core/build/types.ts#L25

I've placed it after running modules so that they could update the directories to be scanned, if required. If that's not necessary we could move it up to these lines - or even include within scanAndSyncOptions:

https://github.com/unjs/nitro/blob/86b48239d0a38d08854d4caa49cdc3febca8fe18/src/core/nitro.ts#L40-L42

Alternatively, we could export scanHandlers to allow frameworks to do this automatically.

📝 Checklist

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

@danielroe danielroe added the bug Something isn't working label Jun 19, 2024
@danielroe danielroe requested a review from pi0 June 19, 2024 08:15
@danielroe danielroe self-assigned this Jun 19, 2024
@danielroe danielroe changed the title fix(core): export scanHandlers fix(core): scan handlers when initialising nitro Jun 19, 2024
@pi0 pi0 merged commit e1c52af into main Jun 19, 2024
@pi0 pi0 deleted the fix/export-scan-handlers branch June 19, 2024 09:33
davidstackio pushed a commit to davidstackio/nitro that referenced this pull request Aug 7, 2024
* fix(core): export `scanHandlers`

* fix(core): scan handlers when initialising nitro
pi0 pushed a commit that referenced this pull request Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants