diff --git a/package.json b/package.json index 3dc322462..3aa28b4cd 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,8 @@ "@types/minimist": "^1.2.5", "@types/node": "^20.11.1", "@types/semver": "^7.5.6", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", + "@typescript-eslint/eslint-plugin": "^6.18.1", + "@typescript-eslint/parser": "^6.18.1", "@vitest/coverage-istanbul": "^1.1.3", "@vue/consolidate": "0.17.3", "conventional-changelog-cli": "^4.1.0", @@ -83,7 +83,7 @@ "eslint": "^8.56.0", "eslint-define-config": "^1.24.1", "eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1", - "eslint-plugin-jest": "^27.6.1", + "eslint-plugin-jest": "^27.6.3", "estree-walker": "^2.0.2", "execa": "^8.0.1", "jsdom": "^23.2.0", @@ -95,7 +95,7 @@ "minimist": "^1.2.8", "npm-run-all": "^4.1.5", "picocolors": "^1.0.0", - "prettier": "^3.1.1", + "prettier": "^3.2.2", "pretty-bytes": "^6.1.1", "pug": "^3.0.2", "puppeteer": "~21.7.0", diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 6ec3dacc9..a3fdde483 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -501,11 +501,12 @@ export type ShallowUnwrapRef = { type DistrubuteRef = T extends Ref ? V : T -export type UnwrapRef = T extends ShallowRef - ? V - : T extends Ref - ? UnwrapRefSimple - : UnwrapRefSimple +export type UnwrapRef = + T extends ShallowRef + ? V + : T extends Ref + ? UnwrapRefSimple + : UnwrapRefSimple export type UnwrapRefSimple = T extends | Function diff --git a/packages/runtime-core/src/componentEmits.ts b/packages/runtime-core/src/componentEmits.ts index 3c0a111aa..4551235bc 100644 --- a/packages/runtime-core/src/componentEmits.ts +++ b/packages/runtime-core/src/componentEmits.ts @@ -54,28 +54,30 @@ export type EmitsToProps = T extends string[] } : {} -export type ShortEmitsToObject = E extends Record - ? { - [K in keyof E]: (...args: E[K]) => any - } - : E +export type ShortEmitsToObject = + E extends Record + ? { + [K in keyof E]: (...args: E[K]) => any + } + : E export type EmitFn< Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options, -> = Options extends Array - ? (event: V, ...args: any[]) => void - : {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function - ? (event: string, ...args: any[]) => void - : UnionToIntersection< - { - [key in Event]: Options[key] extends (...args: infer Args) => any - ? (event: key, ...args: Args) => void - : Options[key] extends any[] - ? (event: key, ...args: Options[key]) => void - : (event: key, ...args: any[]) => void - }[Event] - > +> = + Options extends Array + ? (event: V, ...args: any[]) => void + : {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function + ? (event: string, ...args: any[]) => void + : UnionToIntersection< + { + [key in Event]: Options[key] extends (...args: infer Args) => any + ? (event: key, ...args: Args) => void + : Options[key] extends any[] + ? (event: key, ...args: Options[key]) => void + : (event: key, ...args: any[]) => void + }[Event] + > export function emit( instance: ComponentInternalInstance, diff --git a/packages/runtime-core/src/componentPublicInstance.ts b/packages/runtime-core/src/componentPublicInstance.ts index 8cefecc7a..5b2b4f230 100644 --- a/packages/runtime-core/src/componentPublicInstance.ts +++ b/packages/runtime-core/src/componentPublicInstance.ts @@ -84,34 +84,36 @@ type IsDefaultMixinComponent = T extends ComponentOptionsMixin : false : false -type MixinToOptionTypes = T extends ComponentOptionsBase< - infer P, - infer B, - infer D, - infer C, - infer M, - infer Mixin, - infer Extends, - any, - any, - infer Defaults, - any, - any, - any -> - ? OptionTypesType

& - IntersectionMixin & - IntersectionMixin - : never +type MixinToOptionTypes = + T extends ComponentOptionsBase< + infer P, + infer B, + infer D, + infer C, + infer M, + infer Mixin, + infer Extends, + any, + any, + infer Defaults, + any, + any, + any + > + ? OptionTypesType

& + IntersectionMixin & + IntersectionMixin + : never // ExtractMixin(map type) is used to resolve circularly references type ExtractMixin = { Mixin: MixinToOptionTypes }[T extends ComponentOptionsMixin ? 'Mixin' : never] -export type IntersectionMixin = IsDefaultMixinComponent extends true - ? OptionTypesType - : UnionToIntersection> +export type IntersectionMixin = + IsDefaultMixinComponent extends true + ? OptionTypesType + : UnionToIntersection> export type UnwrapMixinsType< T, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9df4a08a6..01f6b261b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,11 +48,11 @@ importers: specifier: ^7.5.6 version: 7.5.6 '@typescript-eslint/eslint-plugin': - specifier: ^6.17.0 - version: 6.17.0(@typescript-eslint/parser@6.17.0)(eslint@8.56.0)(typescript@5.2.2) + specifier: ^6.18.1 + version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^6.17.0 - version: 6.17.0(eslint@8.56.0)(typescript@5.2.2) + specifier: ^6.18.1 + version: 6.18.1(eslint@8.56.0)(typescript@5.2.2) '@vitest/coverage-istanbul': specifier: ^1.1.3 version: 1.1.3(vitest@1.1.3) @@ -79,10 +79,10 @@ importers: version: 1.24.1 eslint-plugin-import: specifier: npm:eslint-plugin-i@^2.29.1 - version: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.17.0)(eslint@8.56.0) + version: /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0) eslint-plugin-jest: - specifier: ^27.6.1 - version: 27.6.1(@typescript-eslint/eslint-plugin@6.17.0)(eslint@8.56.0)(typescript@5.2.2) + specifier: ^27.6.3 + version: 27.6.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.2.2) estree-walker: specifier: ^2.0.2 version: 2.0.2 @@ -117,8 +117,8 @@ importers: specifier: ^1.0.0 version: 1.0.0 prettier: - specifier: ^3.1.1 - version: 3.1.1 + specifier: ^3.2.2 + version: 3.2.2 pretty-bytes: specifier: ^6.1.1 version: 6.1.1 @@ -1287,8 +1287,8 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin@6.17.0(@typescript-eslint/parser@6.17.0)(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-Vih/4xLXmY7V490dGwBQJTpIZxH4ZFH6eCVmQ4RFkB+wmaCTDAx4dtgoWwMNGKLkqRY1L6rPqzEbjorRnDo4rQ==} + /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.2.2): + resolution: {integrity: sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1299,11 +1299,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.9.1 - '@typescript-eslint/parser': 6.17.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 6.17.0 - '@typescript-eslint/type-utils': 6.17.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.17.0(eslint@8.56.0)(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.18.1 + '@typescript-eslint/type-utils': 6.18.1(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -1316,8 +1316,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.17.0(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} + /@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.2.2): + resolution: {integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1326,10 +1326,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.17.0 - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/scope-manager': 6.18.1 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 eslint: 8.56.0 typescript: 5.2.2 @@ -1345,16 +1345,16 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/scope-manager@6.17.0: - resolution: {integrity: sha512-RX7a8lwgOi7am0k17NUO0+ZmMOX4PpjLtLRgLmT1d3lBYdWH4ssBUbwdmc5pdRX8rXon8v9x8vaoOSpkHfcXGA==} + /@typescript-eslint/scope-manager@6.18.1: + resolution: {integrity: sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/visitor-keys': 6.18.1 dev: true - /@typescript-eslint/type-utils@6.17.0(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-hDXcWmnbtn4P2B37ka3nil3yi3VCQO2QEB9gBiHJmQp5wmyQWqnjA85+ZcE8c4FqnaB6lBwMrPkgd4aBYz3iNg==} + /@typescript-eslint/type-utils@6.18.1(eslint@8.56.0)(typescript@5.2.2): + resolution: {integrity: sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1363,8 +1363,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.17.0(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.2.2) + '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.2.2) @@ -1378,8 +1378,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@6.17.0: - resolution: {integrity: sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A==} + /@typescript-eslint/types@6.18.1: + resolution: {integrity: sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -1404,8 +1404,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.17.0(typescript@5.2.2): - resolution: {integrity: sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==} + /@typescript-eslint/typescript-estree@6.18.1(typescript@5.2.2): + resolution: {integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1413,8 +1413,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1446,8 +1446,8 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.17.0(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-LofsSPjN/ITNkzV47hxas2JCsNCEnGhVvocfyOcLzT9c/tSZE7SfhS/iWtzP1lKNOEfLhRTZz6xqI8N2RzweSQ==} + /@typescript-eslint/utils@6.18.1(eslint@8.56.0)(typescript@5.2.2): + resolution: {integrity: sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1455,9 +1455,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.14 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.17.0 - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.18.1 + '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.2.2) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -1473,11 +1473,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.17.0: - resolution: {integrity: sha512-H6VwB/k3IuIeQOyYczyyKN8wH6ed8EwliaYHLxOIhyF0dYEIsN8+Bk3GE19qafeMKyZJJHP8+O1HiFhFLUNKSg==} + /@typescript-eslint/visitor-keys@6.18.1: + resolution: {integrity: sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.17.0 + '@typescript-eslint/types': 6.18.1 eslint-visitor-keys: 3.4.3 dev: true @@ -2655,7 +2655,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -2676,7 +2676,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.17.0(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.2.2) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 @@ -2684,7 +2684,7 @@ packages: - supports-color dev: true - /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.17.0)(eslint@8.56.0): + /eslint-plugin-i@2.29.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0): resolution: {integrity: sha512-ORizX37MelIWLbMyqI7hi8VJMf7A0CskMmYkB+lkCX3aF4pkGV7kwx5bSEb4qx7Yce2rAf9s34HqDRPjGRZPNQ==} engines: {node: '>=12'} peerDependencies: @@ -2694,7 +2694,7 @@ packages: doctrine: 3.0.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) get-tsconfig: 4.7.2 is-glob: 4.0.3 minimatch: 3.1.2 @@ -2706,8 +2706,8 @@ packages: - supports-color dev: true - /eslint-plugin-jest@27.6.1(@typescript-eslint/eslint-plugin@6.17.0)(eslint@8.56.0)(typescript@5.2.2): - resolution: {integrity: sha512-WEYkyVXD9NlmFBKvrkmzrC+C9yZoz5pAml2hO19PlS3spJtoiwj4p2u8spd/7zx5IvRsZsCmsoImaAvBB9X93Q==} + /eslint-plugin-jest@27.6.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.2.2): + resolution: {integrity: sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 @@ -2719,7 +2719,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.17.0(@typescript-eslint/parser@6.17.0)(eslint@8.56.0)(typescript@5.2.2) + '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.2.2) '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.2.2) eslint: 8.56.0 transitivePeerDependencies: @@ -4620,8 +4620,8 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@3.1.1: - resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} + /prettier@3.2.2: + resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==} engines: {node: '>=14'} hasBin: true dev: true