-
-
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
chore(dev): check component types in playground.vue #16843
Changes from 3 commits
a94b11b
aad2044
26d33bb
c121171
f07ca60
60374bb
565cc69
1a8d927
a83e8e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// generated by unplugin-vue-components | ||
// We suggest you to commit this file into source control | ||
// Read more: https://github.com/vuejs/core/pull/3399 | ||
import '@vue/runtime-core' | ||
|
||
declare module '@vue/runtime-core' { | ||
export interface GlobalComponents { | ||
RouterLink: typeof import('vue-router')['RouterLink'] | ||
RouterView: typeof import('vue-router')['RouterView'] | ||
VApp: typeof import('@/components/VApp/index')['VApp'] | ||
VAutocomplete: typeof import('@/components/VAutocomplete/index')['VAutocomplete'] | ||
VBtn: typeof import('@/components/VBtn/index')['VBtn'] | ||
VMain: typeof import('@/components/VMain/index')['VMain'] | ||
} | ||
} | ||
|
||
export {} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ const components = files.filter(file => file.startsWith('src/labs') || !block.so | |
const map = new Map(components.flatMap(file => { | ||
const src = readFileSync(file, { encoding: 'utf8' }) | ||
const matches = src.matchAll(/export const (V\w+)|export { (V\w+) }/gm) | ||
return Array.from(matches, m => [m[1] || m[2], file.replace('src/', '@/')]) | ||
return Array.from(matches, m => [m[1] || m[2], file.replace('src/', '@/').replace('.ts', '')]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To assist
TS 4.x does not support .ts suffix in import path, and it looks like to be one of tasks in TS 5.x roadmap Issue: microsoft/TypeScript#37582 More importantly, this change does not break |
||
})) | ||
|
||
export default defineConfig(({ mode }) => { | ||
|
@@ -45,7 +45,7 @@ export default defineConfig(({ mode }) => { | |
vueJsx({ optimize: false, enableObjectSlots: true }), | ||
viteSSR(), | ||
Components({ | ||
dts: false, | ||
dts: true, | ||
resolvers: [ | ||
name => { | ||
if (map.has(name)) { | ||
|
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.
Just add this to gitignore, otherwise it'll change every time you modify the playground
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.
also eslintignore
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.
this file will be ignored by git so it doesn't bother lint command in CI. Assuming this is for IDE experience, then a
.eslintignore
file should be placed in root directory