Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use generated tsconfig and virtual file augmentations #3112

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

BobbieGoede
Copy link
Collaborator

@BobbieGoede BobbieGoede commented Sep 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 cleans up the virtual file augmentations as well as the tsconfig file to resemble the module started more.

I had to add a bunch of type assertions for both I18n and runtime config types, will need to look into these,

Thanks to @userquin for giving examples on how to deal with the virtual file types!

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@BobbieGoede BobbieGoede self-assigned this Sep 19, 2024
@BobbieGoede BobbieGoede marked this pull request as draft September 19, 2024 09:05
package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Great work!
This approach makes sense!

I have always found it strange that the src directory contains a mixture of .ts implementation files and .d.ts type definition files, and I have wanted to refactor them at some point.

Virtual modules solve this issue, but it depends on the bundler. Since the nuxt module is a framework module system and Nuxt provides a bundling framework system, I believe the bundler dependency is not an issue.

Let's keep it up!

@userquin
Thank you for supporting!

@BobbieGoede BobbieGoede marked this pull request as ready for review September 19, 2024 19:48
@BobbieGoede
Copy link
Collaborator Author

Seems to be working as expected now πŸ€” It's unfortunate that we now have two identical virtual file augmentations, and will have to look into the added type assertions in a future refactor. But overall this should make the module types more predictable and in line with established (but undocumented πŸ˜…) conventions among Nuxt modules.

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