Skip to content

Commit

Permalink
chore(dev): check component types in playground.vue (#16843)
Browse files Browse the repository at this point in the history
Co-authored-by: Kael <kaelwd@gmail.com>
  • Loading branch information
yuwu9145 and KaelWD authored Mar 21, 2023
1 parent 9034340 commit 9ceaf65
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/vuetify/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/build/

# playground components type definitions generated by unplugin-vue-components
/dev/components.d.ts

# Built files
/es5/
/lib/
/lib-temp/
/dist/
/cypress/
/cypress/
1 change: 1 addition & 0 deletions packages/vuetify/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/dev/Playground.vue
/dev/components.d.ts
/cypress/screenshots

# Built files
Expand Down
1 change: 1 addition & 0 deletions packages/vuetify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"dev": "cross-env NODE_ENV=development vite",
"dev:ssr": "cross-env NODE_ENV=development VITE_SSR=true vite-ssr",
"dev:prod": "concurrently \"cross-env NODE_ENV=production vite build -w\" \"vite preview\"",
"dev:typecheck": "vue-tsc --noEmit --skipLibCheck --project ./tsconfig.dev.json",
"build": "rimraf lib dist && concurrently \"yarn build:dist\" \"yarn build:lib\" -n \"dist,lib\" --kill-others-on-fail -r && yarn build:types",
"build:dist": "rollup --config build/rollup.config.js",
"build:lib": "cross-env NODE_ENV=lib babel src --out-dir lib --source-maps --extensions \".ts\",\".tsx\",\".snap\" --copy-files --no-copy-ignored --out-file-extension .mjs",
Expand Down
8 changes: 7 additions & 1 deletion packages/vuetify/tsconfig.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
"src",
"dev",
"cypress"
]
],
"compilerOptions": {
"allowJs": true
},
"vueCompilerOptions": {
"strictTemplates": true
}
}
4 changes: 2 additions & 2 deletions packages/vuetify/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')])
}))

export default defineConfig(({ mode }) => {
Expand All @@ -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)) {
Expand Down

0 comments on commit 9ceaf65

Please sign in to comment.