Skip to content

fix(module): declare module nitropack/types - #212

Merged
harlan-zw merged 3 commits into
nuxt-modules:mainfrom
dargmuesli:patch-1
Jun 29, 2025
Merged

harlan-zw merged 3 commits into
nuxt-modules:mainfrom
dargmuesli:patch-1

Conversation

@dargmuesli

@dargmuesli dargmuesli commented Jun 28, 2025 •

Copy link
Copy Markdown
Contributor

🔗 Linked issue

n/a

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ 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

I think this is required for Nuxt 4 typechecks.
See https://github.com/maevsi/vibetype/actions/runs/15946054209/job/44980254542?pr=1997#step:7:1641.
cc @BobbieGoede

I think this is required for Nuxt 4 typechecks.
@BobbieGoede

Copy link
Copy Markdown
Member

cc @BobbieGoede

👀
In case you tagged me because of nuxt/nuxt#30665, I'll tag @danielroe as well (as he did the heavy lifting on that PR 😅)

@danielroe danielroe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure what extendTypes does but I would recommend using addTypeTemplate with the appropriate contexts passed as a second arg.

@dargmuesli

Copy link
Copy Markdown
Contributor Author

In case you tagged me because of nuxt/nuxt#30665

I did 😉

addTypeTemplate

I pushed a draft for that 🏃 cc @harlan-zw would you please check my changes? I moved a function to runtime/server so that the Nitro types apply.


Btw, should we continue to use the .nuxt/module directory for the seo types? I see that Nuxt scripts use .nuxt/modules and most other types are in .nuxt/types. And then of course some modules use their module name as folder name and others just output to .nuxt/... is there any best practice / guideline on where to place these files @danielroe?

image

@harlan-zw

Copy link
Copy Markdown
Contributor

not sure what extendTypes does but I would recommend using addTypeTemplate with the appropriate contexts passed as a second arg.

This was my bespoke solution to addTypeTemplate before it existed, the end user types were quite annoying to get right so was quite wary of modifying this without a good reason. That type PR looks like just the reason 🙌

Thanks @dargmuesli, as tests are passing, I'll merge this. I'll likely try get typechecking running in the CI before I release this. I'll see about where I'm saving the types as well.

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.

4 participants