Skip to content

Commit

Permalink
chore: make api build faster
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Nov 10, 2022
1 parent 56ba931 commit 7f144b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/api-generator/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'fs/promises'
import path from 'path'
import { components } from 'vuetify/dist/vuetify.js'
import { components as componentsInfo } from 'vuetify/dist/json/importMap.json'
import { kebabCase } from './helpers/text'
import { generateComposableDataFromTypes, generateDirectiveDataFromTypes } from './types'
import Piscina from 'piscina'
Expand Down Expand Up @@ -39,7 +40,10 @@ const run = async () => {

await mkdirp('./src/tmp')
for (const component in components) {
await fs.writeFile(`./src/tmp/${component}.d.ts`, template.replaceAll('__component__', component))
await fs.writeFile(`./src/tmp/${component}.d.ts`,
template.replaceAll('__component__', component)
.replaceAll('__name__', componentsInfo[component].from.replace('.mjs', '.js'))
)
}

const outPath = path.resolve(__dirname, '../../docs/src/api/data/')
Expand Down
2 changes: 1 addition & 1 deletion packages/api-generator/src/template.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AllowedComponentProps, ComponentPublicInstance, FunctionalComponent, RenderFunction, VNodeChild, VNodeProps } from 'vue'
import type { __component__ } from '@/components'
import type { __component__ } from '@/__name__'

type StripProps = keyof VNodeProps | keyof AllowedComponentProps | 'v-slots' | '$children' | `v-slot:${string}`
type Event = `on${string}`
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/transitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const VSlideYReverseTransition = createCssTransition('slide-y-reverse-tra
export const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator())
export const VExpandXTransition = createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true))

export * from './dialog-transition'
export { VDialogTransition } from './dialog-transition'

export type VFabTransition = InstanceType<typeof VFabTransition>
export type VDialogBottomTransition = InstanceType<typeof VDialogBottomTransition>
Expand Down

0 comments on commit 7f144b6

Please sign in to comment.