diff --git a/internal/build/package.json b/internal/build/package.json index 873c3f6067..954efe8547 100644 --- a/internal/build/package.json +++ b/internal/build/package.json @@ -33,7 +33,6 @@ "lodash": "^4.17.21", "rollup": "^2.75.7", "rollup-plugin-esbuild": "^4.9.1", - "ts-morph": "^14.0.0", "unplugin-vue-macros": "^0.11.2" }, "devDependencies": { diff --git a/internal/build/src/tasks/types-definitions.ts b/internal/build/src/tasks/types-definitions.ts index 078f406b92..4930d51399 100644 --- a/internal/build/src/tasks/types-definitions.ts +++ b/internal/build/src/tasks/types-definitions.ts @@ -1,158 +1,25 @@ -import process from 'process' import path from 'path' -import { mkdir, readFile, writeFile } from 'fs/promises' -import consola from 'consola' -import * as vueCompiler from 'vue/compiler-sfc' +import { readFile, writeFile } from 'fs/promises' import glob from 'fast-glob' -import chalk from 'chalk' -import { Project } from 'ts-morph' -import { - buildOutput, - epRoot, - excludeFiles, - pkgRoot, - projRoot, -} from '@element-plus/build-utils' -import { pathRewriter } from '../utils' -import type { CompilerOptions, SourceFile } from 'ts-morph' +import { copy, remove } from 'fs-extra' +import { buildOutput } from '@element-plus/build-utils' +import { pathRewriter, run } from '../utils' -const TSCONFIG_PATH = path.resolve(projRoot, 'tsconfig.web.json') -const outDir = path.resolve(buildOutput, 'types') - -/** - * fork = require( https://github.com/egoist/vue-dts-gen/blob/main/src/index.ts - */ export const generateTypesDefinitions = async () => { - const compilerOptions: CompilerOptions = { - emitDeclarationOnly: true, - outDir, - baseUrl: projRoot, - preserveSymlinks: true, - skipLibCheck: true, - noImplicitAny: false, - } - const project = new Project({ - compilerOptions, - tsConfigFilePath: TSCONFIG_PATH, - skipAddingFilesFromTsConfig: true, - }) - - const sourceFiles = await addSourceFiles(project) - consola.success('Added source files') - - typeCheck(project) - consola.success('Type check passed!') - - await project.emit({ - emitOnlyDtsFiles: true, - }) - - const tasks = sourceFiles.map(async (sourceFile) => { - const relativePath = path.relative(pkgRoot, sourceFile.getFilePath()) - consola.trace( - chalk.yellow( - `Generating definition for file: ${chalk.bold(relativePath)}` - ) - ) - - const emitOutput = sourceFile.getEmitOutput() - const emitFiles = emitOutput.getOutputFiles() - if (emitFiles.length === 0) { - throw new Error(`Emit no file: ${chalk.bold(relativePath)}`) - } - - const subTasks = emitFiles.map(async (outputFile) => { - const filepath = outputFile.getFilePath() - await mkdir(path.dirname(filepath), { - recursive: true, - }) - - await writeFile( - filepath, - pathRewriter('esm')(outputFile.getText()), - 'utf8' - ) - - consola.success( - chalk.green( - `Definition for file: ${chalk.bold(relativePath)} generated` - ) - ) - }) - - await Promise.all(subTasks) - }) - - await Promise.all(tasks) -} - -async function addSourceFiles(project: Project) { - project.addSourceFileAtPath(path.resolve(projRoot, 'typings/env.d.ts')) - - const globSourceFile = '**/*.{js?(x),ts?(x),vue}' - const filePaths = excludeFiles( - await glob([globSourceFile, '!element-plus/**/*'], { - cwd: pkgRoot, - absolute: true, - onlyFiles: true, - }) + await run( + 'npx vue-tsc -p tsconfig.web.json --declaration --emitDeclarationOnly --declarationDir dist/types' ) - const epPaths = excludeFiles( - await glob(globSourceFile, { - cwd: epRoot, - onlyFiles: true, - }) - ) - - const sourceFiles: SourceFile[] = [] - await Promise.all([ - ...filePaths.map(async (file) => { - if (file.endsWith('.vue')) { - const content = await readFile(file, 'utf-8') - const hasTsNoCheck = content.includes('@ts-nocheck') - - const sfc = vueCompiler.parse(content) - const { script, scriptSetup } = sfc.descriptor - if (script || scriptSetup) { - let content = - (hasTsNoCheck ? '// @ts-nocheck\n' : '') + (script?.content ?? '') - - if (scriptSetup) { - const compiled = vueCompiler.compileScript(sfc.descriptor, { - id: 'xxx', - }) - content += compiled.content - } - - const lang = scriptSetup?.lang || script?.lang || 'js' - const sourceFile = project.createSourceFile( - `${path.relative(process.cwd(), file)}.${lang}`, - content - ) - sourceFiles.push(sourceFile) - } - } else { - const sourceFile = project.addSourceFileAtPath(file) - sourceFiles.push(sourceFile) - } - }), - ...epPaths.map(async (file) => { - const content = await readFile(path.resolve(epRoot, file), 'utf-8') - sourceFiles.push( - project.createSourceFile(path.resolve(pkgRoot, file), content) - ) - }), - ]) - - return sourceFiles -} - -function typeCheck(project: Project) { - const diagnostics = project.getPreEmitDiagnostics() - if (diagnostics.length > 0) { - consola.error(project.formatDiagnosticsWithColorAndContext(diagnostics)) - const err = new Error('Failed to generate dts.') - consola.error(err) - throw err - } + const typesDir = path.join(buildOutput, 'types', 'packages') + const filePaths = await glob(`**/*.d.ts`, { + cwd: typesDir, + absolute: true, + }) + const rewriteTasks = filePaths.map(async (filePath) => { + const content = await readFile(filePath, 'utf8') + await writeFile(filePath, pathRewriter('esm')(content), 'utf8') + }) + await Promise.all(rewriteTasks) + const sourceDir = path.join(typesDir, 'element-plus') + await copy(sourceDir, typesDir) + await remove(sourceDir) } diff --git a/package.json b/package.json index a7d3d3f72b..c8378e567e 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,6 @@ "resize-observer-polyfill": "^1.5.1", "rimraf": "^3.0.2", "sass": "^1.53.0", - "ts-morph": "^14.0.0", "tsx": "^4.7.1", "type-fest": "^2.14.0", "typescript": "^4.7.4", @@ -118,7 +117,7 @@ "vitest": "1.6.0", "vue": "^3.2.37", "vue-router": "^4.0.16", - "vue-tsc": "^0.38.2" + "vue-tsc": "^1.8.27" }, "engines": { "node": ">= 18" diff --git a/packages/components/affix/index.ts b/packages/components/affix/index.ts index 817d61cb90..8f957a49b8 100644 --- a/packages/components/affix/index.ts +++ b/packages/components/affix/index.ts @@ -1,8 +1,7 @@ import { withInstall } from '@element-plus/utils' - import Affix from './src/affix.vue' - -export const ElAffix = withInstall(Affix) +import type { SFCWithInstall } from '@element-plus/utils' +export const ElAffix: SFCWithInstall = withInstall(Affix) export default ElAffix export * from './src/affix' diff --git a/packages/components/alert/index.ts b/packages/components/alert/index.ts index ccaf6c99e6..bfcd58ac67 100644 --- a/packages/components/alert/index.ts +++ b/packages/components/alert/index.ts @@ -1,8 +1,8 @@ import { withInstall } from '@element-plus/utils' - import Alert from './src/alert.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElAlert = withInstall(Alert) +export const ElAlert: SFCWithInstall = withInstall(Alert) export default ElAlert export * from './src/alert' diff --git a/packages/components/anchor/index.ts b/packages/components/anchor/index.ts index a8daaea885..22531f2d61 100644 --- a/packages/components/anchor/index.ts +++ b/packages/components/anchor/index.ts @@ -1,11 +1,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Anchor from './src/anchor.vue' import AnchorLink from './src/anchor-link.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElAnchor = withInstall(Anchor, { +export const ElAnchor: SFCWithInstall & { + AnchorLink: typeof AnchorLink +} = withInstall(Anchor, { AnchorLink, }) -export const ElAnchorLink = withNoopInstall(AnchorLink) +export const ElAnchorLink: SFCWithInstall = + withNoopInstall(AnchorLink) export default ElAnchor export * from './src/anchor' diff --git a/packages/components/autocomplete/index.ts b/packages/components/autocomplete/index.ts index c90ccd44eb..702d88584a 100644 --- a/packages/components/autocomplete/index.ts +++ b/packages/components/autocomplete/index.ts @@ -1,7 +1,9 @@ import { withInstall } from '@element-plus/utils' import Autocomplete from './src/autocomplete.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElAutocomplete = withInstall(Autocomplete) +export const ElAutocomplete: SFCWithInstall = + withInstall(Autocomplete) export default ElAutocomplete diff --git a/packages/components/avatar/index.ts b/packages/components/avatar/index.ts index 10fabb8968..c8cb10efa2 100644 --- a/packages/components/avatar/index.ts +++ b/packages/components/avatar/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Avatar from './src/avatar.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElAvatar = withInstall(Avatar) +export const ElAvatar: SFCWithInstall = withInstall(Avatar) export default ElAvatar export * from './src/avatar' diff --git a/packages/components/backtop/index.ts b/packages/components/backtop/index.ts index b1e53ae14a..a42eb2ae51 100644 --- a/packages/components/backtop/index.ts +++ b/packages/components/backtop/index.ts @@ -1,8 +1,8 @@ import { withInstall } from '@element-plus/utils' - import Backtop from './src/backtop.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElBacktop = withInstall(Backtop) +export const ElBacktop: SFCWithInstall = withInstall(Backtop) export default ElBacktop export * from './src/backtop' diff --git a/packages/components/badge/index.ts b/packages/components/badge/index.ts index 2db313a4bf..211900eae6 100644 --- a/packages/components/badge/index.ts +++ b/packages/components/badge/index.ts @@ -1,8 +1,8 @@ import { withInstall } from '@element-plus/utils' - import Badge from './src/badge.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElBadge = withInstall(Badge) +export const ElBadge: SFCWithInstall = withInstall(Badge) export default ElBadge export * from './src/badge' diff --git a/packages/components/breadcrumb/index.ts b/packages/components/breadcrumb/index.ts index 96e2de4ff8..cf91a4443f 100644 --- a/packages/components/breadcrumb/index.ts +++ b/packages/components/breadcrumb/index.ts @@ -2,11 +2,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Breadcrumb from './src/breadcrumb.vue' import BreadcrumbItem from './src/breadcrumb-item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElBreadcrumb = withInstall(Breadcrumb, { +export const ElBreadcrumb: SFCWithInstall & { + BreadcrumbItem: typeof BreadcrumbItem +} = withInstall(Breadcrumb, { BreadcrumbItem, }) -export const ElBreadcrumbItem = withNoopInstall(BreadcrumbItem) +export const ElBreadcrumbItem: SFCWithInstall = + withNoopInstall(BreadcrumbItem) export default ElBreadcrumb export * from './src/breadcrumb' diff --git a/packages/components/button/index.ts b/packages/components/button/index.ts index e12b69ebc9..b7112b1744 100644 --- a/packages/components/button/index.ts +++ b/packages/components/button/index.ts @@ -1,11 +1,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Button from './src/button.vue' import ButtonGroup from './src/button-group.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElButton = withInstall(Button, { +export const ElButton: SFCWithInstall & { + ButtonGroup: typeof ButtonGroup +} = withInstall(Button, { ButtonGroup, }) -export const ElButtonGroup = withNoopInstall(ButtonGroup) +export const ElButtonGroup: SFCWithInstall = + withNoopInstall(ButtonGroup) export default ElButton export * from './src/button' diff --git a/packages/components/calendar/index.ts b/packages/components/calendar/index.ts index 9fc9a73945..32f049f03c 100644 --- a/packages/components/calendar/index.ts +++ b/packages/components/calendar/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Calendar from './src/calendar.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCalendar = withInstall(Calendar) +export const ElCalendar: SFCWithInstall = withInstall(Calendar) export default ElCalendar export * from './src/calendar' diff --git a/packages/components/card/index.ts b/packages/components/card/index.ts index 210d0a6717..5b1fbc8da1 100644 --- a/packages/components/card/index.ts +++ b/packages/components/card/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Card from './src/card.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCard = withInstall(Card) +export const ElCard: SFCWithInstall = withInstall(Card) export default ElCard export * from './src/card' diff --git a/packages/components/carousel/index.ts b/packages/components/carousel/index.ts index 6e64ac86a6..880934f105 100644 --- a/packages/components/carousel/index.ts +++ b/packages/components/carousel/index.ts @@ -1,14 +1,18 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Carousel from './src/carousel.vue' import CarouselItem from './src/carousel-item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCarousel = withInstall(Carousel, { +export const ElCarousel: SFCWithInstall & { + CarouselItem: typeof CarouselItem +} = withInstall(Carousel, { CarouselItem, }) export default ElCarousel -export const ElCarouselItem = withNoopInstall(CarouselItem) +export const ElCarouselItem: SFCWithInstall = + withNoopInstall(CarouselItem) export * from './src/carousel' export * from './src/carousel-item' diff --git a/packages/components/cascader-panel/__tests__/cascader-panel.test.tsx b/packages/components/cascader-panel/__tests__/cascader-panel.test.tsx index 301d3bdfb8..bc96e9bc77 100644 --- a/packages/components/cascader-panel/__tests__/cascader-panel.test.tsx +++ b/packages/components/cascader-panel/__tests__/cascader-panel.test.tsx @@ -138,7 +138,7 @@ describe('CascaderPanel.vue', () => { v-model={value.value} options={NORMAL_OPTIONS} onChange={handleChange} - onExpandChange={handleExpandChange} + onExpand-change={handleExpandChange} /> )) @@ -223,7 +223,7 @@ describe('CascaderPanel.vue', () => { v-model={value.value} options={DISABLED_OPTIONS} onChange={handleChange} - onExpandChange={handleExpandChange} + onExpand-change={handleExpandChange} /> )) diff --git a/packages/components/cascader-panel/index.ts b/packages/components/cascader-panel/index.ts index 96c8985e75..5c7e5381bb 100644 --- a/packages/components/cascader-panel/index.ts +++ b/packages/components/cascader-panel/index.ts @@ -1,15 +1,11 @@ +import { withInstall } from '@element-plus/utils' import CascaderPanel from './src/index.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -CascaderPanel.install = (app: App): void => { - app.component(CascaderPanel.name!, CascaderPanel) -} +export const ElCascaderPanel: SFCWithInstall = + withInstall(CascaderPanel) -const _CascaderPanel = CascaderPanel as SFCWithInstall - -export default _CascaderPanel -export const ElCascaderPanel = _CascaderPanel +export default ElCascaderPanel export * from './src/types' export * from './src/config' export * from './src/instance' diff --git a/packages/components/cascader/index.ts b/packages/components/cascader/index.ts index cafaa67d20..c43b57a564 100644 --- a/packages/components/cascader/index.ts +++ b/packages/components/cascader/index.ts @@ -1,15 +1,10 @@ +import { withInstall } from '@element-plus/utils' import Cascader from './src/cascader.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -Cascader.install = (app: App): void => { - app.component(Cascader.name!, Cascader) -} +export const ElCascader: SFCWithInstall = withInstall(Cascader) -const _Cascader = Cascader as SFCWithInstall - -export default _Cascader -export const ElCascader = _Cascader +export default ElCascader export * from './src/cascader' export * from './src/instances' diff --git a/packages/components/check-tag/index.ts b/packages/components/check-tag/index.ts index 8776aea688..7f8e55bea2 100644 --- a/packages/components/check-tag/index.ts +++ b/packages/components/check-tag/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import CheckTag from './src/check-tag.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCheckTag = withInstall(CheckTag) +export const ElCheckTag: SFCWithInstall = withInstall(CheckTag) export default ElCheckTag export * from './src/check-tag' diff --git a/packages/components/checkbox/index.ts b/packages/components/checkbox/index.ts index 7d7fe55410..7687efa72f 100644 --- a/packages/components/checkbox/index.ts +++ b/packages/components/checkbox/index.ts @@ -3,15 +3,21 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Checkbox from './src/checkbox.vue' import CheckboxButton from './src/checkbox-button.vue' import CheckboxGroup from './src/checkbox-group.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCheckbox = withInstall(Checkbox, { +export const ElCheckbox: SFCWithInstall & { + CheckboxButton: typeof CheckboxButton + CheckboxGroup: typeof CheckboxGroup +} = withInstall(Checkbox, { CheckboxButton, CheckboxGroup, }) export default ElCheckbox -export const ElCheckboxButton = withNoopInstall(CheckboxButton) -export const ElCheckboxGroup = withNoopInstall(CheckboxGroup) +export const ElCheckboxButton: SFCWithInstall = + withNoopInstall(CheckboxButton) +export const ElCheckboxGroup: SFCWithInstall = + withNoopInstall(CheckboxGroup) export * from './src/checkbox-group' export * from './src/checkbox' diff --git a/packages/components/col/index.ts b/packages/components/col/index.ts index bcea85591e..c5a61aec4f 100644 --- a/packages/components/col/index.ts +++ b/packages/components/col/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Col from './src/col.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCol = withInstall(Col) +export const ElCol: SFCWithInstall = withInstall(Col) export default ElCol export * from './src/col' diff --git a/packages/components/collapse-transition/index.ts b/packages/components/collapse-transition/index.ts index e42cad46e6..9831a5cc9d 100644 --- a/packages/components/collapse-transition/index.ts +++ b/packages/components/collapse-transition/index.ts @@ -1,14 +1,8 @@ +import { withInstall } from '@element-plus/utils' import CollapseTransition from './src/collapse-transition.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -CollapseTransition.install = (app: App): void => { - app.component(CollapseTransition.name!, CollapseTransition) -} +export const ElCollapseTransition: SFCWithInstall = + withInstall(CollapseTransition) -const _CollapseTransition = CollapseTransition as SFCWithInstall< - typeof CollapseTransition -> - -export default _CollapseTransition -export const ElCollapseTransition = _CollapseTransition +export default ElCollapseTransition diff --git a/packages/components/collapse/index.ts b/packages/components/collapse/index.ts index 24524c26ed..acf1e54c40 100644 --- a/packages/components/collapse/index.ts +++ b/packages/components/collapse/index.ts @@ -2,12 +2,16 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Collapse from './src/collapse.vue' import CollapseItem from './src/collapse-item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCollapse = withInstall(Collapse, { +export const ElCollapse: SFCWithInstall & { + CollapseItem: typeof CollapseItem +} = withInstall(Collapse, { CollapseItem, }) export default ElCollapse -export const ElCollapseItem = withNoopInstall(CollapseItem) +export const ElCollapseItem: SFCWithInstall = + withNoopInstall(CollapseItem) export * from './src/collapse' export * from './src/collapse-item' diff --git a/packages/components/color-picker/index.ts b/packages/components/color-picker/index.ts index 4b6294cd5b..befbca98f6 100644 --- a/packages/components/color-picker/index.ts +++ b/packages/components/color-picker/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import ColorPicker from './src/color-picker.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElColorPicker = withInstall(ColorPicker) +export const ElColorPicker: SFCWithInstall = + withInstall(ColorPicker) export default ElColorPicker export * from './src/color-picker' diff --git a/packages/components/config-provider/index.ts b/packages/components/config-provider/index.ts index 0aab530929..1e9211850d 100644 --- a/packages/components/config-provider/index.ts +++ b/packages/components/config-provider/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import ConfigProvider from './src/config-provider' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElConfigProvider = withInstall(ConfigProvider) +export const ElConfigProvider: SFCWithInstall = + withInstall(ConfigProvider) export default ElConfigProvider export * from './src/config-provider' diff --git a/packages/components/container/index.ts b/packages/components/container/index.ts index 8ad8262127..d097ac66b6 100644 --- a/packages/components/container/index.ts +++ b/packages/components/container/index.ts @@ -5,8 +5,14 @@ import Aside from './src/aside.vue' import Footer from './src/footer.vue' import Header from './src/header.vue' import Main from './src/main.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElContainer = withInstall(Container, { +export const ElContainer: SFCWithInstall & { + Aside: typeof Aside + Footer: typeof Footer + Header: typeof Header + Main: typeof Main +} = withInstall(Container, { Aside, Footer, Header, @@ -14,10 +20,10 @@ export const ElContainer = withInstall(Container, { }) export default ElContainer -export const ElAside = withNoopInstall(Aside) -export const ElFooter = withNoopInstall(Footer) -export const ElHeader = withNoopInstall(Header) -export const ElMain = withNoopInstall(Main) +export const ElAside: SFCWithInstall = withNoopInstall(Aside) +export const ElFooter: SFCWithInstall = withNoopInstall(Footer) +export const ElHeader: SFCWithInstall = withNoopInstall(Header) +export const ElMain: SFCWithInstall = withNoopInstall(Main) export type ContainerInstance = InstanceType export type AsideInstance = InstanceType diff --git a/packages/components/countdown/index.ts b/packages/components/countdown/index.ts index a722c8247d..08c2407182 100644 --- a/packages/components/countdown/index.ts +++ b/packages/components/countdown/index.ts @@ -1,7 +1,9 @@ import { withInstall } from '@element-plus/utils' import Countdown from './src/countdown.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElCountdown = withInstall(Countdown) +export const ElCountdown: SFCWithInstall = + withInstall(Countdown) export default ElCountdown export * from './src/countdown' diff --git a/packages/components/date-picker/index.ts b/packages/components/date-picker/index.ts index 7c234874ff..2fb6b5b0a9 100644 --- a/packages/components/date-picker/index.ts +++ b/packages/components/date-picker/index.ts @@ -1,16 +1,12 @@ +import { withInstall } from '@element-plus/utils' import DatePicker from './src/date-picker' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -const _DatePicker = DatePicker as SFCWithInstall +export const ElDatePicker: SFCWithInstall = + withInstall(DatePicker) -_DatePicker.install = (app: App) => { - app.component(_DatePicker.name!, _DatePicker) -} - -export default _DatePicker -export const ElDatePicker = _DatePicker +export default ElDatePicker export * from './src/constants' export * from './src/props/date-picker' export type { DatePickerInstance } from './src/instance' diff --git a/packages/components/descriptions/index.ts b/packages/components/descriptions/index.ts index d95625024b..f02c90a25b 100644 --- a/packages/components/descriptions/index.ts +++ b/packages/components/descriptions/index.ts @@ -2,12 +2,16 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Descriptions from './src/description.vue' import DescriptionsItem from './src/description-item' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElDescriptions = withInstall(Descriptions, { +export const ElDescriptions: SFCWithInstall & { + DescriptionsItem: typeof DescriptionsItem +} = withInstall(Descriptions, { DescriptionsItem, }) -export const ElDescriptionsItem = withNoopInstall(DescriptionsItem) +export const ElDescriptionsItem: SFCWithInstall = + withNoopInstall(DescriptionsItem) export default ElDescriptions diff --git a/packages/components/dialog/index.ts b/packages/components/dialog/index.ts index 28e8232a95..2da7a7f5cb 100644 --- a/packages/components/dialog/index.ts +++ b/packages/components/dialog/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Dialog from './src/dialog.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElDialog = withInstall(Dialog) +export const ElDialog: SFCWithInstall = withInstall(Dialog) export default ElDialog export * from './src/use-dialog' diff --git a/packages/components/divider/index.ts b/packages/components/divider/index.ts index d66e2178ba..fcbd0d39b5 100644 --- a/packages/components/divider/index.ts +++ b/packages/components/divider/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Divider from './src/divider.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElDivider = withInstall(Divider) +export const ElDivider: SFCWithInstall = withInstall(Divider) export default ElDivider export * from './src/divider' diff --git a/packages/components/drawer/index.ts b/packages/components/drawer/index.ts index e1bbee3ba8..5c2fa86bfe 100644 --- a/packages/components/drawer/index.ts +++ b/packages/components/drawer/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Drawer from './src/drawer.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElDrawer = withInstall(Drawer) +export const ElDrawer: SFCWithInstall = withInstall(Drawer) export default ElDrawer export * from './src/drawer' diff --git a/packages/components/dropdown/index.ts b/packages/components/dropdown/index.ts index 4d1e831181..a71b9f29d3 100644 --- a/packages/components/dropdown/index.ts +++ b/packages/components/dropdown/index.ts @@ -3,14 +3,20 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Dropdown from './src/dropdown.vue' import DropdownItem from './src/dropdown-item.vue' import DropdownMenu from './src/dropdown-menu.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElDropdown = withInstall(Dropdown, { +export const ElDropdown: SFCWithInstall & { + DropdownItem: typeof DropdownItem + DropdownMenu: typeof DropdownMenu +} = withInstall(Dropdown, { DropdownItem, DropdownMenu, }) export default ElDropdown -export const ElDropdownItem = withNoopInstall(DropdownItem) -export const ElDropdownMenu = withNoopInstall(DropdownMenu) +export const ElDropdownItem: SFCWithInstall = + withNoopInstall(DropdownItem) +export const ElDropdownMenu: SFCWithInstall = + withNoopInstall(DropdownMenu) export * from './src/dropdown' export * from './src/instance' export * from './src/tokens' diff --git a/packages/components/empty/index.ts b/packages/components/empty/index.ts index 634bac7207..904f445b07 100644 --- a/packages/components/empty/index.ts +++ b/packages/components/empty/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Empty from './src/empty.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElEmpty = withInstall(Empty) +export const ElEmpty: SFCWithInstall = withInstall(Empty) export default ElEmpty export * from './src/empty' diff --git a/packages/components/form/index.ts b/packages/components/form/index.ts index 730dc6180c..e4342279ba 100644 --- a/packages/components/form/index.ts +++ b/packages/components/form/index.ts @@ -1,12 +1,16 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Form from './src/form.vue' import FormItem from './src/form-item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElForm = withInstall(Form, { +export const ElForm: SFCWithInstall & { + FormItem: typeof FormItem +} = withInstall(Form, { FormItem, }) export default ElForm -export const ElFormItem = withNoopInstall(FormItem) +export const ElFormItem: SFCWithInstall = + withNoopInstall(FormItem) export * from './src/form' export * from './src/form-item' diff --git a/packages/components/icon/index.ts b/packages/components/icon/index.ts index 56c810796a..c98213bcaf 100644 --- a/packages/components/icon/index.ts +++ b/packages/components/icon/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Icon from './src/icon.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElIcon = withInstall(Icon) +export const ElIcon: SFCWithInstall = withInstall(Icon) export default ElIcon export * from './src/icon' diff --git a/packages/components/image-viewer/index.ts b/packages/components/image-viewer/index.ts index 542c7a5df1..3a8512c7b6 100644 --- a/packages/components/image-viewer/index.ts +++ b/packages/components/image-viewer/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import ImageViewer from './src/image-viewer.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElImageViewer = withInstall(ImageViewer) +export const ElImageViewer: SFCWithInstall = + withInstall(ImageViewer) export default ElImageViewer export * from './src/image-viewer' diff --git a/packages/components/image/index.ts b/packages/components/image/index.ts index a3b16dc6b7..d28341572c 100644 --- a/packages/components/image/index.ts +++ b/packages/components/image/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Image from './src/image.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElImage = withInstall(Image) +export const ElImage: SFCWithInstall = withInstall(Image) export default ElImage export * from './src/image' diff --git a/packages/components/input-number/index.ts b/packages/components/input-number/index.ts index 66e282752b..fa67572947 100644 --- a/packages/components/input-number/index.ts +++ b/packages/components/input-number/index.ts @@ -1,7 +1,9 @@ import { withInstall } from '@element-plus/utils' import InputNumber from './src/input-number.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElInputNumber = withInstall(InputNumber) +export const ElInputNumber: SFCWithInstall = + withInstall(InputNumber) export default ElInputNumber export * from './src/input-number' diff --git a/packages/components/input/__tests__/input.test.tsx b/packages/components/input/__tests__/input.test.tsx index 1660e1710a..2e502435a5 100644 --- a/packages/components/input/__tests__/input.test.tsx +++ b/packages/components/input/__tests__/input.test.tsx @@ -146,7 +146,9 @@ describe('Input.vue', () => { }) test('rows', () => { - const wrapper = mount(() => ) + const wrapper = mount(() => { + return + }) expect(wrapper.find('textarea').element.rows).toEqual(3) }) diff --git a/packages/components/input/index.ts b/packages/components/input/index.ts index b3702e8424..f2511504e8 100644 --- a/packages/components/input/index.ts +++ b/packages/components/input/index.ts @@ -1,8 +1,8 @@ import { withInstall } from '@element-plus/utils' - import Input from './src/input.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElInput = withInstall(Input) +export const ElInput: SFCWithInstall = withInstall(Input) export default ElInput export * from './src/input' diff --git a/packages/components/link/index.ts b/packages/components/link/index.ts index 9092c59c1c..1bcbca1065 100644 --- a/packages/components/link/index.ts +++ b/packages/components/link/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Link from './src/link.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElLink = withInstall(Link) +export const ElLink: SFCWithInstall = withInstall(Link) export default ElLink export * from './src/link' diff --git a/packages/components/menu/index.ts b/packages/components/menu/index.ts index a164dfec0e..37b0a6788d 100644 --- a/packages/components/menu/index.ts +++ b/packages/components/menu/index.ts @@ -4,16 +4,24 @@ import Menu from './src/menu' import MenuItem from './src/menu-item.vue' import MenuItemGroup from './src/menu-item-group.vue' import SubMenu from './src/sub-menu' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElMenu = withInstall(Menu, { +export const ElMenu: SFCWithInstall & { + MenuItem: typeof MenuItem + MenuItemGroup: typeof MenuItemGroup + SubMenu: typeof SubMenu +} = withInstall(Menu, { MenuItem, MenuItemGroup, SubMenu, }) export default ElMenu -export const ElMenuItem = withNoopInstall(MenuItem) -export const ElMenuItemGroup = withNoopInstall(MenuItemGroup) -export const ElSubMenu = withNoopInstall(SubMenu) +export const ElMenuItem: SFCWithInstall = + withNoopInstall(MenuItem) +export const ElMenuItemGroup: SFCWithInstall = + withNoopInstall(MenuItemGroup) +export const ElSubMenu: SFCWithInstall = + withNoopInstall(SubMenu) export * from './src/menu' export * from './src/menu-item' diff --git a/packages/components/page-header/index.ts b/packages/components/page-header/index.ts index 7f339ca006..8093b3d77a 100644 --- a/packages/components/page-header/index.ts +++ b/packages/components/page-header/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import PageHeader from './src/page-header.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElPageHeader = withInstall(PageHeader) +export const ElPageHeader: SFCWithInstall = + withInstall(PageHeader) export default ElPageHeader export * from './src/page-header' diff --git a/packages/components/pagination/index.ts b/packages/components/pagination/index.ts index 89ec779e8d..6fc4ba3881 100644 --- a/packages/components/pagination/index.ts +++ b/packages/components/pagination/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import Pagination from './src/pagination' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElPagination = withInstall(Pagination) +export const ElPagination: SFCWithInstall = + withInstall(Pagination) export default ElPagination export * from './src/pagination' diff --git a/packages/components/popconfirm/__tests__/popconfirm.test.tsx b/packages/components/popconfirm/__tests__/popconfirm.test.tsx index 66c015ed28..fb47d5d6e9 100644 --- a/packages/components/popconfirm/__tests__/popconfirm.test.tsx +++ b/packages/components/popconfirm/__tests__/popconfirm.test.tsx @@ -17,7 +17,6 @@ describe('Popconfirm.vue', () => { const wrapper = mount(() => ( <>
{AXIOM}
, }} @@ -46,7 +45,6 @@ describe('Popconfirm.vue', () => { mount(() => ( <>
{AXIOM}
, }} @@ -66,7 +64,6 @@ describe('Popconfirm.vue', () => { mount(() => ( <>
{AXIOM}
, diff --git a/packages/components/popconfirm/index.ts b/packages/components/popconfirm/index.ts index 48046f28cd..df566e1122 100644 --- a/packages/components/popconfirm/index.ts +++ b/packages/components/popconfirm/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import Popconfirm from './src/popconfirm.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElPopconfirm = withInstall(Popconfirm) +export const ElPopconfirm: SFCWithInstall = + withInstall(Popconfirm) export default ElPopconfirm export * from './src/popconfirm' diff --git a/packages/components/popover/__tests__/popover.test.tsx b/packages/components/popover/__tests__/popover.test.tsx index ac88b381fc..7d2f717cc2 100644 --- a/packages/components/popover/__tests__/popover.test.tsx +++ b/packages/components/popover/__tests__/popover.test.tsx @@ -76,6 +76,8 @@ describe('Popover.vue', () => { diff --git a/packages/components/popover/index.ts b/packages/components/popover/index.ts index bd0ad3ecf4..effb436045 100644 --- a/packages/components/popover/index.ts +++ b/packages/components/popover/index.ts @@ -2,13 +2,14 @@ import { withInstall, withInstallDirective } from '@element-plus/utils' import Popover from './src/popover.vue' import PopoverDirective, { VPopover } from './src/directive' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElPopoverDirective = withInstallDirective( - PopoverDirective, - VPopover -) +export const ElPopoverDirective: SFCWithInstall = + withInstallDirective(PopoverDirective, VPopover) -export const ElPopover = withInstall(Popover, { +export const ElPopover: SFCWithInstall & { + directive: typeof ElPopoverDirective +} = withInstall(Popover, { directive: ElPopoverDirective, }) export default ElPopover diff --git a/packages/components/popper/index.ts b/packages/components/popper/index.ts index 81f07f4009..dbb1ce15f8 100644 --- a/packages/components/popper/index.ts +++ b/packages/components/popper/index.ts @@ -4,10 +4,11 @@ import Popper from './src/popper.vue' import ElPopperArrow from './src/arrow.vue' import ElPopperTrigger from './src/trigger.vue' import ElPopperContent from './src/content.vue' +import type { SFCWithInstall } from '@element-plus/utils' export { ElPopperArrow, ElPopperTrigger, ElPopperContent } -export const ElPopper = withInstall(Popper) +export const ElPopper: SFCWithInstall = withInstall(Popper) export default ElPopper export * from './src/popper' diff --git a/packages/components/progress/index.ts b/packages/components/progress/index.ts index e7c0bcabd1..edd02b8ee8 100644 --- a/packages/components/progress/index.ts +++ b/packages/components/progress/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Progress from './src/progress.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElProgress = withInstall(Progress) +export const ElProgress: SFCWithInstall = withInstall(Progress) export default ElProgress export * from './src/progress' diff --git a/packages/components/radio/index.ts b/packages/components/radio/index.ts index b7e444c256..af73df1ab7 100644 --- a/packages/components/radio/index.ts +++ b/packages/components/radio/index.ts @@ -3,14 +3,20 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Radio from './src/radio.vue' import RadioButton from './src/radio-button.vue' import RadioGroup from './src/radio-group.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElRadio = withInstall(Radio, { +export const ElRadio: SFCWithInstall & { + RadioButton: typeof RadioButton + RadioGroup: typeof RadioGroup +} = withInstall(Radio, { RadioButton, RadioGroup, }) export default ElRadio -export const ElRadioGroup = withNoopInstall(RadioGroup) -export const ElRadioButton = withNoopInstall(RadioButton) +export const ElRadioGroup: SFCWithInstall = + withNoopInstall(RadioGroup) +export const ElRadioButton: SFCWithInstall = + withNoopInstall(RadioButton) export * from './src/radio' export * from './src/radio-group' diff --git a/packages/components/rate/index.ts b/packages/components/rate/index.ts index 0128fbd6e7..c00c9da355 100644 --- a/packages/components/rate/index.ts +++ b/packages/components/rate/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Rate from './src/rate.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElRate = withInstall(Rate) +export const ElRate: SFCWithInstall = withInstall(Rate) export default ElRate export * from './src/rate' diff --git a/packages/components/result/index.ts b/packages/components/result/index.ts index 92213d36b0..107c8e6815 100644 --- a/packages/components/result/index.ts +++ b/packages/components/result/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Result from './src/result.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElResult = withInstall(Result) +export const ElResult: SFCWithInstall = withInstall(Result) export default ElResult diff --git a/packages/components/row/index.ts b/packages/components/row/index.ts index 5eced1c44a..acd5f7f5b3 100644 --- a/packages/components/row/index.ts +++ b/packages/components/row/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Row from './src/row.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElRow = withInstall(Row) +export const ElRow: SFCWithInstall = withInstall(Row) export default ElRow export * from './src/row' diff --git a/packages/components/scrollbar/index.ts b/packages/components/scrollbar/index.ts index 5ad87d9d9c..791f33eaa3 100644 --- a/packages/components/scrollbar/index.ts +++ b/packages/components/scrollbar/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' import Scrollbar from './src/scrollbar.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElScrollbar = withInstall(Scrollbar) +export const ElScrollbar: SFCWithInstall = + withInstall(Scrollbar) export default ElScrollbar export * from './src/util' diff --git a/packages/components/select-v2/index.ts b/packages/components/select-v2/index.ts index 9d31ff47c2..839b83a76d 100644 --- a/packages/components/select-v2/index.ts +++ b/packages/components/select-v2/index.ts @@ -1,15 +1,9 @@ +import { withInstall } from '@element-plus/utils' import Select from './src/select.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -Select.install = (app: App): void => { - app.component(Select.name!, Select) -} - -const _Select = Select as SFCWithInstall - -export default _Select -export const ElSelectV2 = _Select +export const ElSelectV2: SFCWithInstall = withInstall(Select) +export default ElSelectV2 export * from './src/token' diff --git a/packages/components/select/index.ts b/packages/components/select/index.ts index 8e0bfac1eb..7cab0e4485 100644 --- a/packages/components/select/index.ts +++ b/packages/components/select/index.ts @@ -3,13 +3,18 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Select from './src/select.vue' import Option from './src/option.vue' import OptionGroup from './src/option-group.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElSelect = withInstall(Select, { +export const ElSelect: SFCWithInstall & { + Option: typeof Option + OptionGroup: typeof OptionGroup +} = withInstall(Select, { Option, OptionGroup, }) export default ElSelect -export const ElOption = withNoopInstall(Option) -export const ElOptionGroup = withNoopInstall(OptionGroup) +export const ElOption: SFCWithInstall = withNoopInstall(Option) +export const ElOptionGroup: SFCWithInstall = + withNoopInstall(OptionGroup) export * from './src/token' diff --git a/packages/components/skeleton/index.ts b/packages/components/skeleton/index.ts index 7c561fa35a..f9348a7863 100644 --- a/packages/components/skeleton/index.ts +++ b/packages/components/skeleton/index.ts @@ -2,11 +2,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Skeleton from './src/skeleton.vue' import SkeletonItem from './src/skeleton-item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElSkeleton = withInstall(Skeleton, { +export const ElSkeleton: SFCWithInstall & { + SkeletonItem: typeof SkeletonItem +} = withInstall(Skeleton, { SkeletonItem, }) -export const ElSkeletonItem = withNoopInstall(SkeletonItem) +export const ElSkeletonItem: SFCWithInstall = + withNoopInstall(SkeletonItem) export default ElSkeleton export * from './src/skeleton' diff --git a/packages/components/slider/index.ts b/packages/components/slider/index.ts index ee131f4778..bc6539e6fb 100644 --- a/packages/components/slider/index.ts +++ b/packages/components/slider/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Slider from './src/slider.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElSlider = withInstall(Slider) +export const ElSlider: SFCWithInstall = withInstall(Slider) export default ElSlider export * from './src/slider' diff --git a/packages/components/space/index.ts b/packages/components/space/index.ts index 4aa1f76e15..92a7187a89 100644 --- a/packages/components/space/index.ts +++ b/packages/components/space/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Space from './src/space' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElSpace = withInstall(Space) +export const ElSpace: SFCWithInstall = withInstall(Space) export default ElSpace export * from './src/space' diff --git a/packages/components/statistic/index.ts b/packages/components/statistic/index.ts index 1c0c4995ed..eb765c4729 100644 --- a/packages/components/statistic/index.ts +++ b/packages/components/statistic/index.ts @@ -1,7 +1,9 @@ import { withInstall } from '@element-plus/utils' import Statistic from './src/statistic.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElStatistic = withInstall(Statistic) +export const ElStatistic: SFCWithInstall = + withInstall(Statistic) export default ElStatistic export * from './src/statistic' diff --git a/packages/components/steps/index.ts b/packages/components/steps/index.ts index 15a2d64918..3ed2cebd0f 100644 --- a/packages/components/steps/index.ts +++ b/packages/components/steps/index.ts @@ -2,12 +2,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Steps from './src/steps.vue' import Step from './src/item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElSteps = withInstall(Steps, { +export const ElSteps: SFCWithInstall & { + Step: typeof Step +} = withInstall(Steps, { Step, }) export default ElSteps -export const ElStep = withNoopInstall(Step) +export const ElStep: SFCWithInstall = withNoopInstall(Step) export * from './src/item' export * from './src/steps' diff --git a/packages/components/switch/index.ts b/packages/components/switch/index.ts index 47eb484c60..7eba9be4c4 100644 --- a/packages/components/switch/index.ts +++ b/packages/components/switch/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Switch from './src/switch.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElSwitch = withInstall(Switch) +export const ElSwitch: SFCWithInstall = withInstall(Switch) export default ElSwitch export * from './src/switch' diff --git a/packages/components/table-v2/index.ts b/packages/components/table-v2/index.ts index f4e946d9b7..1c283ec5b7 100644 --- a/packages/components/table-v2/index.ts +++ b/packages/components/table-v2/index.ts @@ -1,6 +1,7 @@ import { withInstall } from '@element-plus/utils' import TableV2 from './src/table-v2' import AutoResizer from './src/components/auto-resizer' +import type { SFCWithInstall } from '@element-plus/utils' export { Alignment as TableV2Alignment, @@ -11,8 +12,9 @@ export { default as TableV2 } from './src/table-v2' export * from './src/auto-resizer' export { placeholderSign as TableV2Placeholder } from './src/private' -export const ElTableV2 = withInstall(TableV2) -export const ElAutoResizer = withInstall(AutoResizer) +export const ElTableV2: SFCWithInstall = withInstall(TableV2) +export const ElAutoResizer: SFCWithInstall = + withInstall(AutoResizer) export type { Column, diff --git a/packages/components/table/index.ts b/packages/components/table/index.ts index dbbe194515..38b5c8ce0e 100644 --- a/packages/components/table/index.ts +++ b/packages/components/table/index.ts @@ -1,12 +1,16 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Table from './src/table.vue' import TableColumn from './src/tableColumn' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTable = withInstall(Table, { +export const ElTable: SFCWithInstall & { + TableColumn: typeof TableColumn +} = withInstall(Table, { TableColumn, }) export default ElTable -export const ElTableColumn = withNoopInstall(TableColumn) +export const ElTableColumn: SFCWithInstall = + withNoopInstall(TableColumn) export type TableInstance = InstanceType diff --git a/packages/components/tabs/index.ts b/packages/components/tabs/index.ts index f92b6f8c21..9be8ba3ec8 100644 --- a/packages/components/tabs/index.ts +++ b/packages/components/tabs/index.ts @@ -1,11 +1,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Tabs from './src/tabs' import TabPane from './src/tab-pane.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTabs = withInstall(Tabs, { +export const ElTabs: SFCWithInstall & { + TabPane: typeof TabPane +} = withInstall(Tabs, { TabPane, }) -export const ElTabPane = withNoopInstall(TabPane) +export const ElTabPane: SFCWithInstall = + withNoopInstall(TabPane) export default ElTabs export * from './src/tabs' diff --git a/packages/components/tag/__tests__/tag.test.tsx b/packages/components/tag/__tests__/tag.test.tsx index a774c87e11..e1eb6e2dc8 100644 --- a/packages/components/tag/__tests__/tag.test.tsx +++ b/packages/components/tag/__tests__/tag.test.tsx @@ -52,6 +52,7 @@ describe('Tag.vue', () => { test('disableTransitions', () => { const wrapper = mount(() => ) const vm = wrapper.vm + // FIXME: This check actually is useless as there is no the class `md-fade-center` in the code. expect(vm.$el.classList.contains('md-fade-center')).toEqual(false) }) diff --git a/packages/components/tag/index.ts b/packages/components/tag/index.ts index 18056df8e6..fd2be4ae20 100644 --- a/packages/components/tag/index.ts +++ b/packages/components/tag/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Tag from './src/tag.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTag = withInstall(Tag) +export const ElTag: SFCWithInstall = withInstall(Tag) export default ElTag export * from './src/tag' diff --git a/packages/components/teleport/index.ts b/packages/components/teleport/index.ts index 116cd1eff0..17efe7944f 100644 --- a/packages/components/teleport/index.ts +++ b/packages/components/teleport/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Teleport from './src/teleport.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTeleport = withInstall(Teleport) +export const ElTeleport: SFCWithInstall = withInstall(Teleport) export default ElTeleport diff --git a/packages/components/text/index.ts b/packages/components/text/index.ts index e155582eb2..c33f6ddf3b 100644 --- a/packages/components/text/index.ts +++ b/packages/components/text/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Text from './src/text.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElText = withInstall(Text) +export const ElText: SFCWithInstall = withInstall(Text) export default ElText export * from './src/text' diff --git a/packages/components/time-picker/index.ts b/packages/components/time-picker/index.ts index 75a0ecfa2b..92781a9ca0 100644 --- a/packages/components/time-picker/index.ts +++ b/packages/components/time-picker/index.ts @@ -1,20 +1,16 @@ +import { withInstall } from '@element-plus/utils' import TimePicker from './src/time-picker' import CommonPicker from './src/common/picker.vue' import TimePickPanel from './src/time-picker-com/panel-time-pick.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' export * from './src/utils' export * from './src/constants' export * from './src/common/props' -const _TimePicker = TimePicker as SFCWithInstall - -_TimePicker.install = (app: App) => { - app.component(_TimePicker.name!, _TimePicker) -} +export const ElTimePicker: SFCWithInstall = + withInstall(TimePicker) export { CommonPicker, TimePickPanel } -export default _TimePicker -export const ElTimePicker = _TimePicker +export default ElTimePicker diff --git a/packages/components/time-select/__tests__/time-select.test.tsx b/packages/components/time-select/__tests__/time-select.test.tsx index cd7d09f31d..09950f0e98 100644 --- a/packages/components/time-select/__tests__/time-select.test.tsx +++ b/packages/components/time-select/__tests__/time-select.test.tsx @@ -207,7 +207,11 @@ describe('TimeSelect', () => { it('specified id attachment', async () => { const wrapper = mount(() => ( - + )) diff --git a/packages/components/time-select/index.ts b/packages/components/time-select/index.ts index 9d4205c478..d700022277 100644 --- a/packages/components/time-select/index.ts +++ b/packages/components/time-select/index.ts @@ -1,8 +1,10 @@ import { withInstall } from '@element-plus/utils' - import TimeSelect from './src/time-select.vue' -export const ElTimeSelect = withInstall(TimeSelect) +import type { SFCWithInstall } from '@element-plus/utils' + +export const ElTimeSelect: SFCWithInstall = + withInstall(TimeSelect) export default ElTimeSelect export * from './src/time-select' diff --git a/packages/components/timeline/index.ts b/packages/components/timeline/index.ts index 1040a9276c..1869323a3a 100644 --- a/packages/components/timeline/index.ts +++ b/packages/components/timeline/index.ts @@ -1,12 +1,16 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Timeline from './src/timeline' import TimelineItem from './src/timeline-item.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTimeline = withInstall(Timeline, { +export const ElTimeline: SFCWithInstall & { + TimelineItem: typeof TimelineItem +} = withInstall(Timeline, { TimelineItem, }) export default ElTimeline -export const ElTimelineItem = withNoopInstall(TimelineItem) +export const ElTimelineItem: SFCWithInstall = + withNoopInstall(TimelineItem) export * from './src/timeline' export * from './src/timeline-item' diff --git a/packages/components/tooltip-v2/index.ts b/packages/components/tooltip-v2/index.ts index 3ec73e98e0..5e8048b37f 100644 --- a/packages/components/tooltip-v2/index.ts +++ b/packages/components/tooltip-v2/index.ts @@ -1,7 +1,9 @@ import { withInstall } from '@element-plus/utils' import TooltipV2 from './src/tooltip.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTooltipV2 = withInstall(TooltipV2) +export const ElTooltipV2: SFCWithInstall = + withInstall(TooltipV2) export * from './src/arrow' export * from './src/content' export * from './src/root' diff --git a/packages/components/tooltip/index.ts b/packages/components/tooltip/index.ts index 48a100a0ea..139403f97e 100644 --- a/packages/components/tooltip/index.ts +++ b/packages/components/tooltip/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Tooltip from './src/tooltip.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTooltip = withInstall(Tooltip) +export const ElTooltip: SFCWithInstall = withInstall(Tooltip) export * from './src/tooltip' export * from './src/trigger' export * from './src/content' diff --git a/packages/components/tour/index.ts b/packages/components/tour/index.ts index d2f32d95ce..0613db77a9 100644 --- a/packages/components/tour/index.ts +++ b/packages/components/tour/index.ts @@ -1,11 +1,15 @@ import { withInstall, withNoopInstall } from '@element-plus/utils' import Tour from './src/tour.vue' import TourStep from './src/step.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTour = withInstall(Tour, { +export const ElTour: SFCWithInstall & { + TourStep: typeof TourStep +} = withInstall(Tour, { TourStep, }) -export const ElTourStep = withNoopInstall(TourStep) +export const ElTourStep: SFCWithInstall = + withNoopInstall(TourStep) export default ElTour export * from './src/tour' diff --git a/packages/components/transfer/index.ts b/packages/components/transfer/index.ts index 6207d34d66..cdd033e923 100644 --- a/packages/components/transfer/index.ts +++ b/packages/components/transfer/index.ts @@ -1,8 +1,9 @@ import { withInstall } from '@element-plus/utils' import Transfer from './src/transfer.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTransfer = withInstall(Transfer) +export const ElTransfer: SFCWithInstall = withInstall(Transfer) export default ElTransfer export * from './src/transfer' diff --git a/packages/components/transfer/src/transfer-panel.vue b/packages/components/transfer/src/transfer-panel.vue index 1d2246e4c4..7d97a3db86 100644 --- a/packages/components/transfer/src/transfer-panel.vue +++ b/packages/components/transfer/src/transfer-panel.vue @@ -71,7 +71,7 @@ const props = defineProps(transferPanelProps) const emit = defineEmits(transferPanelEmits) const slots = useSlots() -const OptionContent = ({ option }: { option: VNode | VNode[] }) => option +const OptionContent = ({ option }: { option?: VNode | VNode[] }) => option const { t } = useLocale() const ns = useNamespace('transfer') diff --git a/packages/components/tree-select/index.ts b/packages/components/tree-select/index.ts index 2b5b7f0e00..40f13a5d04 100644 --- a/packages/components/tree-select/index.ts +++ b/packages/components/tree-select/index.ts @@ -1,13 +1,9 @@ +import { withInstall } from '@element-plus/utils' import TreeSelect from './src/tree-select.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -TreeSelect.install = (app: App): void => { - app.component(TreeSelect.name!, TreeSelect) -} +export const ElTreeSelect: SFCWithInstall = + withInstall(TreeSelect) -const _TreeSelect = TreeSelect as SFCWithInstall - -export default _TreeSelect -export const ElTreeSelect = _TreeSelect +export default ElTreeSelect diff --git a/packages/components/tree-v2/index.ts b/packages/components/tree-v2/index.ts index 6d1ac4e152..cbf1e2bc55 100644 --- a/packages/components/tree-v2/index.ts +++ b/packages/components/tree-v2/index.ts @@ -1,5 +1,6 @@ import { withInstall } from '@element-plus/utils' import TreeV2 from './src/tree.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElTreeV2 = withInstall(TreeV2) +export const ElTreeV2: SFCWithInstall = withInstall(TreeV2) export default ElTreeV2 diff --git a/packages/components/tree/index.ts b/packages/components/tree/index.ts index b16f76d908..0ef1498546 100644 --- a/packages/components/tree/index.ts +++ b/packages/components/tree/index.ts @@ -1,14 +1,8 @@ +import { withInstall } from '@element-plus/utils' import Tree from './src/tree.vue' -import type { App } from 'vue' import type { SFCWithInstall } from '@element-plus/utils' -Tree.install = (app: App): void => { - app.component(Tree.name!, Tree) -} +export const ElTree: SFCWithInstall = withInstall(Tree) -const _Tree = Tree as SFCWithInstall - -export default _Tree -export const ElTree = _Tree -export type { TreeInstance } from './src/instance' +export default ElTree diff --git a/packages/components/upload/index.ts b/packages/components/upload/index.ts index de033e9708..ee04037252 100644 --- a/packages/components/upload/index.ts +++ b/packages/components/upload/index.ts @@ -1,7 +1,8 @@ import { withInstall } from '@element-plus/utils' import Upload from './src/upload.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElUpload = withInstall(Upload) +export const ElUpload: SFCWithInstall = withInstall(Upload) export default ElUpload export * from './src/upload' diff --git a/packages/components/virtual-list/__tests__/dynamic-size-grid.test.ts b/packages/components/virtual-list/__tests__/dynamic-size-grid.test.ts index f1baf6d733..db197abd8f 100644 --- a/packages/components/virtual-list/__tests__/dynamic-size-grid.test.ts +++ b/packages/components/virtual-list/__tests__/dynamic-size-grid.test.ts @@ -2,7 +2,6 @@ import { nextTick, unref } from 'vue' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' import makeMount from '@element-plus/test-utils/make-mount' import makeScroll from '@element-plus/test-utils/make-scroll' -import setupMock from '../setup-mock' import { CENTERED_ALIGNMENT, END_ALIGNMENT, @@ -10,6 +9,7 @@ import { START_ALIGNMENT, } from '../src/defaults' import { DynamicSizeGrid } from '..' +import setupMock from './setup-mock' import type { GridExposes } from '../src/types' diff --git a/packages/components/virtual-list/__tests__/dynamic-size-list.test.ts b/packages/components/virtual-list/__tests__/dynamic-size-list.test.ts index 54f23991e0..f9b7af41fe 100644 --- a/packages/components/virtual-list/__tests__/dynamic-size-list.test.ts +++ b/packages/components/virtual-list/__tests__/dynamic-size-list.test.ts @@ -2,7 +2,6 @@ import { nextTick } from 'vue' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' import makeMount from '@element-plus/test-utils/make-mount' -import setupMock from '../setup-mock' import { END_ALIGNMENT, HORIZONTAL, @@ -10,6 +9,7 @@ import { START_ALIGNMENT, } from '../src/defaults' import { DynamicSizeList } from '..' +import setupMock from './setup-mock' import type { ListExposes } from '../src/types' type ListRef = ListExposes diff --git a/packages/components/virtual-list/__tests__/fixed-size-grid.test.ts b/packages/components/virtual-list/__tests__/fixed-size-grid.test.ts index 2959f1e332..e0e1dbfeff 100644 --- a/packages/components/virtual-list/__tests__/fixed-size-grid.test.ts +++ b/packages/components/virtual-list/__tests__/fixed-size-grid.test.ts @@ -2,7 +2,6 @@ import { nextTick, unref } from 'vue' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' import makeMount from '@element-plus/test-utils/make-mount' import makeScroll from '@element-plus/test-utils/make-scroll' -import setupMock from '../setup-mock' import { CENTERED_ALIGNMENT, END_ALIGNMENT, @@ -10,6 +9,7 @@ import { START_ALIGNMENT, } from '../src/defaults' import { FixedSizeGrid } from '..' +import setupMock from './setup-mock' import type { GridExposes } from '../src/types' diff --git a/packages/components/virtual-list/__tests__/fixed-size-list.test.ts b/packages/components/virtual-list/__tests__/fixed-size-list.test.ts index 72350688d7..0f77d6db22 100644 --- a/packages/components/virtual-list/__tests__/fixed-size-list.test.ts +++ b/packages/components/virtual-list/__tests__/fixed-size-list.test.ts @@ -3,7 +3,6 @@ import { nextTick } from 'vue' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' import makeMount from '@element-plus/test-utils/make-mount' import makeScroll from '@element-plus/test-utils/make-scroll' -import setupMock from '../setup-mock' import { CENTERED_ALIGNMENT, END_ALIGNMENT, @@ -13,6 +12,7 @@ import { START_ALIGNMENT, } from '../src/defaults' import { FixedSizeList } from '..' +import setupMock from './setup-mock' import type { SpyInstance } from 'vitest' import type { ListExposes } from '../src/types' diff --git a/packages/components/virtual-list/setup-mock.ts b/packages/components/virtual-list/__tests__/setup-mock.ts similarity index 100% rename from packages/components/virtual-list/setup-mock.ts rename to packages/components/virtual-list/__tests__/setup-mock.ts diff --git a/packages/components/watermark/index.ts b/packages/components/watermark/index.ts index 6b05e65ab0..c059bb72f2 100644 --- a/packages/components/watermark/index.ts +++ b/packages/components/watermark/index.ts @@ -1,7 +1,9 @@ import { withInstall } from '@element-plus/utils' import Watermark from './src/watermark.vue' +import type { SFCWithInstall } from '@element-plus/utils' -export const ElWatermark = withInstall(Watermark) +export const ElWatermark: SFCWithInstall = + withInstall(Watermark) export default ElWatermark export * from './src/watermark' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c93be474f6..7c556bc6ff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -124,7 +124,7 @@ importers: version: 1.43.1 '@vitejs/plugin-vue': specifier: ^2.3.3 - version: 2.3.3(vite@2.9.15)(vue@3.2.37) + version: 2.3.3(vue@3.2.37) '@vitejs/plugin-vue-jsx': specifier: ^1.3.10 version: 1.3.10 @@ -203,9 +203,6 @@ importers: sass: specifier: ^1.53.0 version: 1.53.0 - ts-morph: - specifier: ^14.0.0 - version: 14.0.0 tsx: specifier: ^4.7.1 version: 4.7.1 @@ -231,8 +228,8 @@ importers: specifier: ^4.0.16 version: 4.0.16(vue@3.2.37) vue-tsc: - specifier: ^0.38.2 - version: 0.38.2(typescript@4.7.4) + specifier: ^1.8.27 + version: 1.8.27(typescript@4.7.4) docs: dependencies: @@ -368,7 +365,7 @@ importers: version: 5.0.5(rollup@2.75.7) '@vitejs/plugin-vue': specifier: ^2.3.3 - version: 2.3.3(vite@2.9.15)(vue@3.2.37) + version: 2.3.3(vue@3.2.37) '@vitejs/plugin-vue-jsx': specifier: ^1.3.10 version: 1.3.10 @@ -402,9 +399,6 @@ importers: rollup-plugin-esbuild: specifier: ^4.9.1 version: 4.9.1(esbuild@0.14.47)(rollup@2.75.7) - ts-morph: - specifier: ^14.0.0 - version: 14.0.0 unplugin-vue-macros: specifier: ^0.11.2 version: 0.11.2(esbuild@0.14.47)(rollup@2.75.7)(vue@3.2.37) @@ -426,7 +420,7 @@ importers: devDependencies: unbuild: specifier: ^2.0.0 - version: 2.0.0(sass@1.53.0)(typescript@5.5.4)(vue-tsc@0.38.2) + version: 2.0.0(sass@1.53.0)(typescript@4.7.4)(vue-tsc@1.8.27) internal/build-utils: dependencies: @@ -442,7 +436,7 @@ importers: devDependencies: unbuild: specifier: ^2.0.0 - version: 2.0.0(sass@1.53.0)(typescript@5.5.4)(vue-tsc@0.38.2) + version: 2.0.0(sass@1.53.0)(typescript@4.7.4)(vue-tsc@1.8.27) internal/eslint-config: dependencies: @@ -4461,6 +4455,20 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 + /@rollup/pluginutils@5.1.0: + resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.5 + estree-walker: 2.0.2 + picomatch: 2.3.1 + dev: true + /@rollup/pluginutils@5.1.0(rollup@2.75.7): resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} @@ -4671,14 +4679,6 @@ packages: engines: {node: '>=10.13.0'} dev: true - /@ts-morph/common@0.13.0: - resolution: {integrity: sha512-fEJ6j7Cu8yiWjA4UmybOBH9Efgb/64ZTWuvCF4KysGu4xz8ettfyaqFt8WZ1btCxXsGZJjZ2/3svOF6rL+UFdQ==} - dependencies: - fast-glob: 3.2.11 - minimatch: 5.1.6 - mkdirp: 1.0.4 - path-browserify: 1.0.1 - /@tsconfig/node10@1.0.8: resolution: {integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==} dev: true @@ -4864,12 +4864,6 @@ packages: undici-types: 5.26.5 dev: true - /@types/node@20.14.12: - resolution: {integrity: sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==} - dependencies: - undici-types: 5.26.5 - dev: true - /@types/node@20.14.9: resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} dependencies: @@ -5246,6 +5240,19 @@ packages: dependencies: vite: 2.9.15(sass@1.53.0) vue: 3.2.37 + dev: true + + /@vitejs/plugin-vue@2.3.3(vue@3.2.37): + resolution: {integrity: sha512-SmQLDyhz+6lGJhPELsBdzXGc+AcaT8stgkbiTFGpXPe8Tl1tJaBw1A6pxDqDuRsVkD8uscrkx3hA7QDOoKYtyw==} + engines: {node: '>=12.0.0'} + peerDependencies: + vite: ^2.5.10 + vue: ^3.2.25 + peerDependenciesMeta: + vite: + optional: true + dependencies: + vue: 3.2.37 /@vitejs/plugin-vue@5.0.5(vite@5.3.3)(vue@3.4.31): resolution: {integrity: sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ==} @@ -5338,34 +5345,23 @@ packages: pretty-format: 29.7.0 dev: true - /@volar/code-gen@0.38.2: - resolution: {integrity: sha512-H81I6d7rZB7teqL+zhK/Xz1v0/kKkUwkB0Aq6b4+BTCqcJeiZkoWxd0gFhrhWTnUoqiM83lhoTGo2vkvx5YagQ==} + /@volar/language-core@1.11.1: + resolution: {integrity: sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==} dependencies: - '@volar/source-map': 0.38.2 + '@volar/source-map': 1.11.1 dev: true - /@volar/source-map@0.38.2: - resolution: {integrity: sha512-DWcYbYt9SPwk0r4VmXk1F0v4X5+hCqH1JRkAWSeJymQyXCQ2OQDEbY2PF12a7y2qn4FUBD2gOba2TynAqI8ZFQ==} + /@volar/source-map@1.11.1: + resolution: {integrity: sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==} + dependencies: + muggle-string: 0.3.1 dev: true - /@volar/vue-code-gen@0.38.2: - resolution: {integrity: sha512-whLunD6phSGWBUHZKdTxeglrpzQu26ii8CRVapFdjfyMaVhQ7ESNeIAhkTVyg2ovOPc0PiDYPQEPzfWAADIWog==} + /@volar/typescript@1.11.1: + resolution: {integrity: sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==} dependencies: - '@volar/code-gen': 0.38.2 - '@volar/source-map': 0.38.2 - '@vue/compiler-core': 3.4.31 - '@vue/compiler-dom': 3.4.31 - '@vue/shared': 3.4.31 - dev: true - - /@volar/vue-typescript@0.38.2: - resolution: {integrity: sha512-5IKvSK2m5yUmH6iu/tNScVlvJGuiHawTfSmjxaMs+/tod25WeK37LEdf+pdKtlJ30bYTQmmkAuEfG01QvvBRGQ==} - dependencies: - '@volar/code-gen': 0.38.2 - '@volar/source-map': 0.38.2 - '@volar/vue-code-gen': 0.38.2 - '@vue/compiler-sfc': 3.4.31 - '@vue/reactivity': 3.2.37 + '@volar/language-core': 1.11.1 + path-browserify: 1.0.1 dev: true /@vue-macros/api@0.9.3(vue@3.2.37): @@ -5432,7 +5428,7 @@ packages: optional: true dependencies: '@babel/types': 7.24.0 - '@rollup/pluginutils': 5.1.0(rollup@3.29.4) + '@rollup/pluginutils': 5.1.0 '@vue/compiler-sfc': 3.4.31 ast-kit: 0.11.3 local-pkg: 0.5.0 @@ -6011,6 +6007,26 @@ packages: rfdc: 1.4.1 dev: true + /@vue/language-core@1.8.27(typescript@4.7.4): + resolution: {integrity: sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@volar/language-core': 1.11.1 + '@volar/source-map': 1.11.1 + '@vue/compiler-dom': 3.4.31 + '@vue/shared': 3.4.31 + computeds: 0.0.1 + minimatch: 9.0.5 + muggle-string: 0.3.1 + path-browserify: 1.0.1 + typescript: 4.7.4 + vue-template-compiler: 2.7.16 + dev: true + /@vue/reactivity-transform@3.2.37: resolution: {integrity: sha512-IWopkKEb+8qpu/1eMKVeXrK0NLw9HicGviJzhJDEyfxTR9e1WtpnnbYkJWurX6WwoFP0sz10xQg8yL8lgskAZg==} dependencies: @@ -6964,6 +6980,7 @@ packages: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 + dev: true /braces@2.3.2: resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==} @@ -7395,11 +7412,6 @@ packages: readable-stream: 2.3.7 dev: false - /code-block-writer@11.0.0: - resolution: {integrity: sha512-GEqWvEWWsOvER+g9keO4ohFoD3ymwyCnqY3hoTr7GZipYFwEhMHJw+TtV0rfgRhNImM6QWZGO2XYjlJVyYT62w==} - dependencies: - tslib: 2.3.1 - /code-point-at@1.1.0: resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} engines: {node: '>=0.10.0'} @@ -7508,6 +7520,10 @@ packages: fast-glob: 3.2.11 dev: false + /computeds@0.0.1: + resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} + dev: true + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -7970,6 +7986,10 @@ packages: resolution: {integrity: sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==} dev: false + /de-indent@1.0.2: + resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} + dev: true + /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -10435,6 +10455,11 @@ packages: dependencies: function-bind: 1.1.2 + /he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + dev: true + /homedir-polyfill@1.0.3: resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} engines: {node: '>=0.10.0'} @@ -10545,6 +10570,7 @@ packages: /immutable@4.1.0: resolution: {integrity: sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==} + dev: true /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -11092,7 +11118,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 20.14.12 + '@types/node': 18.19.25 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -11250,7 +11276,7 @@ packages: dependencies: universalify: 2.0.1 optionalDependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 /jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} @@ -11943,6 +11969,7 @@ packages: engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 + dev: true /minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} @@ -12007,6 +12034,7 @@ packages: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true + dev: true /mkdist@0.3.10(typescript@4.7.3): resolution: {integrity: sha512-Aoc6hjILr2JPUJU2OUvBiD5sZ/CG1FeiXwk6KKPqE0iSTjBCrjrVK/fP5ig+TB3AKHvh2aA2QXXGeXVCJBdSwg==} @@ -12027,7 +12055,7 @@ packages: typescript: 4.7.3 dev: true - /mkdist@1.5.3(sass@1.53.0)(typescript@5.5.4)(vue-tsc@0.38.2): + /mkdist@1.5.3(sass@1.53.0)(typescript@4.7.4)(vue-tsc@1.8.27): resolution: {integrity: sha512-XXvaXyS3k/fCExY2/c9z0fmJ9kWq/UZeZZGQ0R693M004lowXNJKIENdH5Cf5Uu3LtSB9vhGu/1YM7IGjWbfxA==} hasBin: true peerDependencies: @@ -12058,8 +12086,8 @@ packages: postcss-nested: 6.0.1(postcss@8.4.39) sass: 1.53.0 semver: 7.6.2 - typescript: 5.5.4 - vue-tsc: 0.38.2(typescript@4.7.4) + typescript: 4.7.4 + vue-tsc: 1.8.27(typescript@4.7.4) dev: true /mlly@0.3.19: @@ -12107,6 +12135,10 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + /muggle-string@0.3.1: + resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} + dev: true + /mute-stdout@1.0.1: resolution: {integrity: sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==} engines: {node: '>= 0.10'} @@ -12612,6 +12644,7 @@ packages: /path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + dev: true /path-dirname@1.0.2: resolution: {integrity: sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==} @@ -14022,7 +14055,7 @@ packages: '@babel/code-frame': 7.24.7 dev: true - /rollup-plugin-dts@6.1.1(rollup@3.29.4)(typescript@5.5.4): + /rollup-plugin-dts@6.1.1(rollup@3.29.4)(typescript@4.7.4): resolution: {integrity: sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==} engines: {node: '>=16'} peerDependencies: @@ -14031,7 +14064,7 @@ packages: dependencies: magic-string: 0.30.10 rollup: 3.29.4 - typescript: 5.5.4 + typescript: 4.7.4 optionalDependencies: '@babel/code-frame': 7.24.7 dev: true @@ -14209,6 +14242,7 @@ packages: chokidar: 3.5.3 immutable: 4.1.0 source-map-js: 1.0.2 + dev: true /sax@1.2.1: resolution: {integrity: sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==} @@ -14462,6 +14496,7 @@ packages: /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + dev: true /source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} @@ -15097,12 +15132,6 @@ packages: engines: {node: '>=8'} dev: true - /ts-morph@14.0.0: - resolution: {integrity: sha512-tO8YQ1dP41fw8GVmeQAdNsD8roZi1JMqB7YwZrqU856DvmG5/710e41q2XauzTYrygH9XmMryaFeLo+kdCziyA==} - dependencies: - '@ts-morph/common': 0.13.0 - code-block-writer: 11.0.0 - /ts-node@10.8.1(@types/node@18.19.25)(typescript@4.7.4): resolution: {integrity: sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==} hasBin: true @@ -15147,9 +15176,6 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: false - /tslib@2.3.1: - resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} - /tslib@2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} @@ -15306,12 +15332,6 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - /typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - /uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} dev: true @@ -15371,7 +15391,7 @@ packages: - supports-color dev: true - /unbuild@2.0.0(sass@1.53.0)(typescript@5.5.4)(vue-tsc@0.38.2): + /unbuild@2.0.0(sass@1.53.0)(typescript@4.7.4)(vue-tsc@1.8.27): resolution: {integrity: sha512-JWCUYx3Oxdzvw2J9kTAp+DKE8df/BnH/JTSj6JyA4SH40ECdFu7FoJJcrm8G92B7TjofQ6GZGjJs50TRxoH6Wg==} hasBin: true peerDependencies: @@ -15395,15 +15415,15 @@ packages: hookable: 5.5.3 jiti: 1.21.6 magic-string: 0.30.10 - mkdist: 1.5.3(sass@1.53.0)(typescript@5.5.4)(vue-tsc@0.38.2) + mkdist: 1.5.3(sass@1.53.0)(typescript@4.7.4)(vue-tsc@1.8.27) mlly: 1.7.1 pathe: 1.1.2 pkg-types: 1.1.3 pretty-bytes: 6.1.1 rollup: 3.29.4 - rollup-plugin-dts: 6.1.1(rollup@3.29.4)(typescript@5.5.4) + rollup-plugin-dts: 6.1.1(rollup@3.29.4)(typescript@4.7.4) scule: 1.3.0 - typescript: 5.5.4 + typescript: 4.7.4 untyped: 1.4.2 transitivePeerDependencies: - sass @@ -16311,6 +16331,7 @@ packages: sass: 1.53.0 optionalDependencies: fsevents: 2.3.3 + dev: true /vite@5.1.6(@types/node@18.19.25)(sass@1.53.0): resolution: {integrity: sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==} @@ -16557,13 +16578,22 @@ packages: vue: 3.2.37 dev: true - /vue-tsc@0.38.2(typescript@4.7.4): - resolution: {integrity: sha512-+OMmpw9BZC9khul3I1HGtWchv7BCiaM7NvfdilVAiOFkjnivIoaW6jJm6YPQJaEPouePtpkDUWovyzgNxWdDsw==} + /vue-template-compiler@2.7.16: + resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} + dependencies: + de-indent: 1.0.2 + he: 1.2.0 + dev: true + + /vue-tsc@1.8.27(typescript@4.7.4): + resolution: {integrity: sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==} hasBin: true peerDependencies: typescript: '*' dependencies: - '@volar/vue-typescript': 0.38.2 + '@volar/typescript': 1.11.1 + '@vue/language-core': 1.8.27(typescript@4.7.4) + semver: 7.6.2 typescript: 4.7.4 dev: true diff --git a/tsconfig.base.json b/tsconfig.base.json index 9eb8fb2fc7..44aae94f4f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,6 +17,7 @@ "types": [], "paths": { "@element-plus/*": ["packages/*"] - } + }, + "preserveSymlinks": true } }