From 61c2b07827d431153f037dce9efa7c02d24de311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Sun, 25 May 2025 21:56:21 -0700 Subject: [PATCH 1/3] feat(types): use `GlobalDirectives` instead of `ComponentCustomProperties` (#839) --- src/core/declaration.ts | 4 ++-- test/__snapshots__/dts.test.ts.snap | 8 ++++---- test/dts.test.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/declaration.ts b/src/core/declaration.ts index 4fd2c168..7259be71 100644 --- a/src/core/declaration.ts +++ b/src/core/declaration.ts @@ -31,7 +31,7 @@ export function parseDeclaration(code: string): DeclarationImports | undefined { if (componentDeclaration) imports.component = extractImports(componentDeclaration) - const directiveDeclaration = /export\s+interface\s+ComponentCustomProperties\s*\{.*?\}/s.exec(code)?.[0] + const directiveDeclaration = /export\s+interface\s+GlobalDirectives\s*\{.*?\}/s.exec(code)?.[0] if (directiveDeclaration) imports.directive = extractImports(directiveDeclaration) @@ -132,7 +132,7 @@ declare module 'vue' {` } if (Object.keys(declarations.directive).length > 0) { code += ` - export interface ComponentCustomProperties { + export interface GlobalDirectives { ${declarations.directive.join('\n ')} }` } diff --git a/test/__snapshots__/dts.test.ts.snap b/test/__snapshots__/dts.test.ts.snap index 75752379..c1d09dda 100644 --- a/test/__snapshots__/dts.test.ts.snap +++ b/test/__snapshots__/dts.test.ts.snap @@ -29,7 +29,7 @@ export {} /* prettier-ignore */ declare module 'vue' { - export interface ComponentCustomProperties { + export interface GlobalDirectives { vLoading: typeof import('test/directive/Loading')['default'] } } @@ -51,7 +51,7 @@ declare module 'vue' { RouterView: typeof import('vue-router')['RouterView'] TestComp: typeof import('test/component/TestComp')['default'] } - export interface ComponentCustomProperties { + export interface GlobalDirectives { vLoading: typeof import('test/directive/Loading')['default'] } } @@ -130,7 +130,7 @@ declare module 'vue' { SomeComp: typeof import('test/component/SomeComp')['default'] TestComp: typeof import('test/component/TestComp')['default'] } - export interface ComponentCustomProperties { + export interface GlobalDirectives { vDirective: typeof import('foo') vLoading: typeof import('test/directive/Loading')['default'] vSome: typeof import('test/directive/Some')['default'] @@ -154,7 +154,7 @@ declare module 'vue' { RouterView: typeof import('vue-router')['RouterView'] TestComp: typeof import('test/component/TestComp')['default'] } - export interface ComponentCustomProperties { + export interface GlobalDirectives { vLoading: typeof import('test/directive/Loading')['default'] } } diff --git a/test/dts.test.ts b/test/dts.test.ts index b26ccba4..9ddf0f5d 100644 --- a/test/dts.test.ts +++ b/test/dts.test.ts @@ -57,7 +57,7 @@ declare module 'vue' { SomeComp: typeof import('test/component/SomeComp')['default'] TestComp: typeof import('test/component/OldComp')['default'] } - export interface ComponentCustomProperties{ + export interface GlobalDirectives{ // with comment: b // a: vSome: typeof import('test/directive/Some')['default'];vDirective:typeof import('foo') @@ -179,7 +179,7 @@ declare module 'vue' { IMdiLightAlarm: typeof import('~icons/mdi-light/alarm')['default'] } - export interface ComponentCustomProperties { + export interface GlobalDirectives { vDirective: typeof import('foo') vLoading: typeof import('test/directive/Loading')['default'] vSome: typeof import('test/directive/Some')['default'] From 5fa020135127e02a20cf62ce0a78cedc29fa00b6 Mon Sep 17 00:00:00 2001 From: reslear <12596485+reslear@users.noreply.github.com> Date: Mon, 26 May 2025 07:00:18 +0200 Subject: [PATCH 2/3] feat: update ionic.ts resolvers (#816) Co-authored-by: Anthony Fu --- src/core/resolvers/ionic.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/resolvers/ionic.ts b/src/core/resolvers/ionic.ts index 5aa01d50..b3a504ad 100644 --- a/src/core/resolvers/ionic.ts +++ b/src/core/resolvers/ionic.ts @@ -82,10 +82,12 @@ export const IonicBuiltInComponents = [ 'IonSegmentContent', 'IonSegmentView', 'IonSelect', + 'IonSelectModal', 'IonSelectOption', 'IonSkeletonText', 'IonSpinner', 'IonSplitPane', + 'IonTab', 'IonTabBar', 'IonTabButton', 'IonTabs', From d542b307888b242566a5b00e1ee1c5b8dc8a916f Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 26 May 2025 14:00:28 +0900 Subject: [PATCH 3/3] chore: release v28.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 19a5ba01..5c62700d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "unplugin-vue-components", "type": "module", - "version": "28.6.0", + "version": "28.7.0", "packageManager": "pnpm@10.11.0", "description": "Components auto importing for Vue", "author": "antfu ",