-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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: add unplugin-vue-components
and unimport
integration
#20536
base: dev
Are you sure you want to change the base?
Conversation
unplugin-vue-components
and unimport
integrationunplugin-vue-components
and unimport
integration
unplugin-vue-components
and unimport
integrationunplugin-vue-components
and unimport
integration
packages/vuetify/build.config.mts
Outdated
@@ -0,0 +1,94 @@ | |||
import { defineBuildConfig } from 'unbuild' |
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.
Why are you using a separate build process for this?
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.
We must split client and node builds, I can move it to rollup but I like unbuild.
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.
done:
- added some jsdocs to rollup config files to have auto complettion and suggestions in the ide
- removed
unbuild
and movedunplugin/*.ts
build to Rollup - fixed also the lint script: added rootDir and custom exclude in
tsconfig.check.json
I didn't check Vitest using Vuetify Vite playground configuration: reverted changes and CI green. |
return JSON.parse(await readFile(path.resolve(vuetifyBase, 'dist/json/importMap.json'), 'utf-8')) | ||
} | ||
async function importMapLabs (vuetifyBase: string): Promise<ImportLabsComponents> { | ||
return JSON.parse(await readFile(path.resolve(vuetifyBase, 'dist/json/importMap-labs.json'), 'utf-8')) |
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.
It will be better to add importMap.json
and importMap-labs.json
to package exports, this change will allow use dynamic import instead resolving vuetify base and reading the file (or just use dynamic import via vuetify/dist/json/importMap.json
or vuetify/dist/json/importMap-labs.json
).
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.
We're using readFile here because node 20 logs a warning for import attributes
Description
This PR includes:
unimport
presets for Vuetify composables and directivesand Vuetify One composablesunplugin-vue-components
resolvers for Vuetify components and directivesunimport
andunplugin-auto-import
to latest versions (3.13.1 and 0.18.3 respectively)and Vuetify One composablesaddunbuild
to build the new new subpackages exports (node stuff): I have no idea how to configure/callunbuild
with custombuild.config.mts
configuration file, right now usingbuild.config.mts
in vuetify package root, should be moved tobuild
folder: should be fixed with this PR feat: add--config
to the CLI unjs/unbuild#440 (it should be ported to v2 or update here to use v3-rc version)vuetify/unimport
andvuetify/unplugin-vue-components
to package exports andtypesVersions
unplugin-vue-components
to auto import components, lab components and directives: reverted since the CI test process hangs (I need to review Vite playground configuration)We need to add these 2 new integrations somewhere in the docs.
Note
We need to review the lint script, right now I excluded
packages/vuetify/src/unplugin
from thetsconfig.dist.json
file to allow build vuetify.Note
Maybe we should add a new package or move this PR to another repository.
Tip
vuetify/unplugin-vue-components
: will resolve components and directives: the directives will be missing from the Vue module augmentation and so Volar will not suggest Vuetify directives in the Vue templates.vuetify/unplugin-vue-components
won't be able to auto import Vuetify composables.vuetify/unimport
viaunplugin-auto-import
: will auto import Vuetify composables and directives and won't be able to auto import Vuetify components.vuetify/unimport
will add Vuetify directives in the Vue module augmentation to allow Volar suggest them in the Vue templates (when feat(vue): add auto-import directives unplugin/unplugin-auto-import#534 merged and released).vite-plugin-vuetify
: same behaviorvuetify/unplugin-vue-components
.vite-plugin-vuetify
adds Vuetify SASS variables support.vuetify-nuxt-module
: will usevuetify/unimport
to auto-import Vuetify composables and directives (requires this PR feat(nuxt,schema): add directives folder nuxt/nuxt#29203 merged and released) and will use Nuxt internal components loader to load Vuetify components (requires this PR feat!: use Nuxt components loader instead custom Vite plugin nuxt-module#276 merged and released). Since it will usevuetify/unimport
, Vuetify directives will be suggested by Volar in Vue templates.vuetify-nuxt-module
adds Vuetify SASS variables support via custom styles Vite plugin.