-
Notifications
You must be signed in to change notification settings - Fork 91
feat: add unplugin-vuetify
package
#347
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- package.json: Language not supported
- packages/unplugin-vuetify/package.json: Language not supported
- packages/unplugin-vuetify/tsconfig.json: Language not supported
Comments suppressed due to low confidence (1)
packages/unplugin-vuetify/src/utils.ts:46
- Pushing new kebab-case attributes directly into the 'attrs' array while iterating over it may cause duplicate entries or an infinite loop; consider iterating over a shallow copy of the array or collecting new values before merging.
attrs.push(toKebabCase(attr))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.
Files not reviewed (3)
- package.json: Language not supported
- packages/unplugin-vuetify/package.json: Language not supported
- packages/unplugin-vuetify/tsconfig.json: Language not supported
.replace(/[^a-z]/gi, '-') | ||
.replace(/\B([A-Z])/g, '-$1') | ||
.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The toKebabCase function directly replaces all non-alphabetic characters with '-', which may result in multiple consecutive dashes. Consider adding an additional replacement to collapse repeated dashes (e.g., using .replace(/-+/g, '-')).
.replace(/[^a-z]/gi, '-') | |
.replace(/\B([A-Z])/g, '-$1') | |
.toLowerCase() | |
.replace(/[^a-z]/gi, '-') // Replace non-alphabetic characters with dashes | |
.replace(/-+/g, '-') // Collapse consecutive dashes into a single dash | |
.replace(/\B([A-Z])/g, '-$1') // Add dashes before uppercase letters | |
.toLowerCase() // Convert the string to lowercase |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
This PR on draft, we need to add readme.md files, add another playground and prepare docs at Vuetify:
unimport
presets andunplugin-vue-components
resolvers vuetify#21129unimport
presets andunplugin-vue-component
resolvers can still be used registering the Vite/Webpack plugin disablingauto-import
, I've only tested this using Vite)This package is a modern refactor for existing codebase, doesn't replace/deprecate existing ones.
As summary (to prepare Vuetify docs later and the readme file here):
unimport
presets or theunplugin-vue-components
resolversunimport
presets to allow (unimport-presets
subpackage export):VuetifyXXX
insteadVXXX
), directives (v-vuetify-xxx
insteadv-xxxx
) and composables (useVXXX
or customprefix
) to avoid collisions (disabled by default)transformAssetUrls
when enabling custom Vuetify components prefix (check details below)webtypes
(I'm talking with Jan-Niklas at JetBrains (WebStorm) to drop support and use Volar instead, now directives names can usevuetify
prefix => maybe we can also add the entries with the prefix)unplugin-vue-component
resolvers to allow (unplugin-vue-component-resolvers
subpackage export, we need to change the name, missings
in thecomponent
) for:unimport
presetsunimport
presets: won't work sinceunplugin-vue-components
doesn't augment the vue module properly (iirc there is a PR to fix it)Here some GH repos using Vuetify (dev) PR:
unplugin-vuetify
userquin/vuetify-nuxt-unimport-component-prefix#1 PRWe need to replace keys in the existing transformAssetUrls entries
current transformAssetUrls map, won't work when using Vuetify component prefix