Skip to content

chore: add proper types to OgImage Package.d.vue.ts workaround#1217

Merged
43081j merged 1 commit intomainfrom
chore/improve-package-type-decl
Feb 8, 2026
Merged

chore: add proper types to OgImage Package.d.vue.ts workaround#1217
43081j merged 1 commit intomainfrom
chore/improve-package-type-decl

Conversation

@serhalp
Copy link
Member

@serhalp serhalp commented Feb 8, 2026

It appears this file was here to break a circular type resolution. nuxt-og-image generates a type declaration that imports Package.vue type, which needs auto-import globals from nuxt.d.ts, which needs the nuxt-og-image type declaration, creating a cycle.

The old file used any which was a band-aid. I couldn't come up with a way to remove this file entirely, but this at least types the component props so consumers still get real type-checking.

It appears this file was here to break a circular type resolution. `nuxt-og-image` generates a type
declaration that imports `Package.vue type`, which needs auto-import globals from `nuxt.d.ts`, which
needs the `nuxt-og-image` type declaration, creating a cycle.

The old file used `any` which was a band-aid. I couldn't come up with a way
to remove this file entirely, but this at least types the component props
so consumers still get real type-checking.
@vercel
Copy link

vercel bot commented Feb 8, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 8, 2026 3:27pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Feb 8, 2026 3:27pm
npmx-lunaria Ignored Ignored Feb 8, 2026 3:27pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

The default export type in a Vue component type declaration file has been replaced with an explicit DefineComponent type. The component now specifies three properties: name (string), version (string), and an optional primaryColor (string). The change includes an import of the DefineComponent type and a comment block explaining the reasoning behind the explicit type declaration. This modification affects the type signature of the exported Vue component.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly explains the circular type resolution issue and describes how the changes improve typing by replacing any with proper component prop types.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/improve-package-type-decl

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@43081j 43081j left a comment

Choose a reason for hiding this comment

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

too bad we have to do this, would be good to somehow solve it one day such that we can drop the workaround

however, looks good to me

@43081j 43081j added this pull request to the merge queue Feb 8, 2026
Merged via the queue into main with commit eeeb6b6 Feb 8, 2026
20 checks passed
@43081j 43081j deleted the chore/improve-package-type-decl branch February 8, 2026 16:03
@danielroe
Copy link
Member

this will be resolved in the next version of nuxt-og-image

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.

3 participants