Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(vite, kit, nuxt): generate safe variable names using knitwork #4906

Merged
merged 6 commits into from
Jun 10, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

❓ 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 like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Previously a file like 1.test.global.ts produced an import name of 1Test which isn't valid.

πŸ“ Checklist

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

@danielroe danielroe added bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels May 10, 2022
@danielroe danielroe requested a review from pi0 May 10, 2022 08:41
@danielroe danielroe self-assigned this May 10, 2022
@netlify
Copy link

netlify bot commented May 10, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit be5829c
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62a3405853f2e100083fba3c

@pi0 pi0 added the pending label May 13, 2022
@pi0
Copy link
Member

pi0 commented May 13, 2022

This a valid and nice fix but pending to finally refactor import name normalizer out as is a comment requirement in many places. (PR: unjs/knitwork#10)

@pi0 pi0 mentioned this pull request Jun 10, 2022
@pi0 pi0 removed the pending label Jun 10, 2022
@pi0
Copy link
Member

pi0 commented Jun 10, 2022

knitwork.genSafeVariableName is now landed. I think we can safely replace getImportName with it everywhere :)

@pi0 pi0 changed the title fix(nuxt): only allow alpha chars at beginning of import name fix(vite, kit, nuxt): generate safe variable names using knitwork Jun 10, 2022
@pi0 pi0 merged commit 93f6a1e into main Jun 10, 2022
@pi0 pi0 deleted the fix/number-name branch June 10, 2022 13:12
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants