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

feat: configurable generated file and directory paths #3235

Merged

Conversation

BobbieGoede
Copy link
Collaborator

@BobbieGoede BobbieGoede commented Nov 16, 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

Related to #3022 but does not resolve it.

Resolves #3234
Resolves #3188

This only changes the paths in the generated options to be relative, this is still not desirable but better than exposing absolute paths as it could expose sensitive information.

Since this also influences the paths found in the locales array returned by useI18n I have made this a configurable option with experimental.generatedLocaleFilePathFormat to prevent this being a breaking change, in the future I want to look into removing the paths entirely or hashing the file paths.

I'm not sure if there are use cases for end users to have access to the files property on the generated locale options.

📝 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 Nov 16, 2024
@BobbieGoede BobbieGoede marked this pull request as draft November 16, 2024 10:38
@BobbieGoede BobbieGoede changed the title fix: use relative locale file paths in generated options feat: experimental configurable generated locale file paths Nov 16, 2024
@BobbieGoede BobbieGoede marked this pull request as ready for review November 17, 2024 11:59
@BobbieGoede BobbieGoede marked this pull request as draft November 17, 2024 19:03
@BobbieGoede
Copy link
Collaborator Author

Setting back to draft status - the normalizedLocales in the generated options files need their paths processed as well.

@BobbieGoede BobbieGoede marked this pull request as ready for review November 17, 2024 21:11
@BobbieGoede BobbieGoede requested review from userquin and kazupon and removed request for userquin and kazupon November 17, 2024 21:11
@BobbieGoede BobbieGoede marked this pull request as draft November 18, 2024 15:19
@BobbieGoede
Copy link
Collaborator Author

Converting to draft again, the i18nModules langDir paths should be processed as well.

@BobbieGoede BobbieGoede marked this pull request as ready for review November 18, 2024 15:42
@BobbieGoede BobbieGoede changed the title feat: experimental configurable generated locale file paths feat: configurable generated file and directory paths Nov 18, 2024
@BobbieGoede BobbieGoede merged commit abc3d7b into nuxt-modules:main Nov 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant