Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

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

Merged
pi0 merged 6 commits into
mainfrom
fix/number-name
Jun 10, 2022
Merged

fix(vite, kit, nuxt): generate safe variable names using knitwork#4906
pi0 merged 6 commits into
mainfrom
fix/number-name

Conversation

@danielroe

Copy link
Copy Markdown
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.

@danielroedanielroe 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 pi0May 10, 2022 08:41
@danielroedanielroe self-assigned this May 10, 2022
@netlify

netlifyBot commented May 10, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commitbe5829c
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62a3405853f2e100083fba3c

Comment threadpackages/nuxt/src/pages/utils.ts Outdated
pi0
pi0 approved these changes May 10, 2022
@pi0pi0 added the pending label May 13, 2022
@pi0

pi0 commented May 13, 2022

Copy link
Copy Markdown
Member

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)

@pi0pi0 mentioned this pull request Jun 10, 2022
@pi0pi0 removed the pending label Jun 10, 2022
@pi0

pi0 commented Jun 10, 2022

Copy link
Copy Markdown
Member

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

@pi0pi0 changed the title fix(nuxt): only allow alpha chars at beginning of import namefix(vite, kit, nuxt): generate safe variable names using knitworkJun 10, 2022
@pi0
pi0 merged commit 93f6a1e into mainJun 10, 2022
@pi0
pi0 deleted the fix/number-name branch June 10, 2022 13:12
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't working🔨 p3-minor-bugPriority 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

@danielroe@pi0