From aeb9ad9a82d090e2568c6db564d33c69246f7723 Mon Sep 17 00:00:00 2001 From: agileago Date: Wed, 23 Mar 2022 14:22:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0vue=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/api.md | 4 + .../module/basic/hello-world/count.comp.tsx | 3 +- .../basic/hello-world/hello-world.view.tsx | 7 +- package.json | 32 +- pnpm-lock.yaml | 485 ++++++++++-------- src/extends/component.ts | 58 ++- src/extends/service.ts | 14 +- src/index.ts | 1 - src/type.ts | 43 +- test/decorator.test.tsx | 70 ++- 10 files changed, 397 insertions(+), 320 deletions(-) diff --git a/docs/guide/api.md b/docs/guide/api.md index ebc0193..17a1b55 100644 --- a/docs/guide/api.md +++ b/docs/guide/api.md @@ -107,6 +107,10 @@ class Foo extends VueComponent { 在外部服务中获取当前的最近一级的注射器 +## useForwardRef + +在HOC组件中使用这个方法可以转发真正的ref + # 类型 diff --git a/example/module/basic/hello-world/count.comp.tsx b/example/module/basic/hello-world/count.comp.tsx index 139451a..ca2c457 100644 --- a/example/module/basic/hello-world/count.comp.tsx +++ b/example/module/basic/hello-world/count.comp.tsx @@ -6,8 +6,7 @@ interface CountCompProps { export class CountComp extends VueComponent { static defaultProps: ComponentProps = ['size'] - render() { - return
{this.props.size}
+ return
111
} } diff --git a/example/module/basic/hello-world/hello-world.view.tsx b/example/module/basic/hello-world/hello-world.view.tsx index e0b885a..bf041ed 100644 --- a/example/module/basic/hello-world/hello-world.view.tsx +++ b/example/module/basic/hello-world/hello-world.view.tsx @@ -1,6 +1,5 @@ -import { Hook, Link, useForwardRef, VueComponent } from 'vue3-oop' +import { Hook, Link, Mut, useForwardRef, VueComponent } from 'vue3-oop' import { Input, type InputProps } from 'ant-design-vue' -import { ref } from 'vue' function createBigSizeInput(size: 'small' | 'middle' | 'large') { class BigInput extends VueComponent> { @@ -22,10 +21,10 @@ function createBigSizeInput(size: 'small' | 'middle' | 'large') { const BigInput = createBigSizeInput('large') class Abc extends VueComponent { - a = ref(0) + @Mut() a = 0 render() { - return
{this.a.value}
+ return
this.a++}>{this.a}
} } diff --git a/package.json b/package.json index b0564bf..af196b5 100644 --- a/package.json +++ b/package.json @@ -51,18 +51,18 @@ "homepage": "https://agileago.github.io/vue3-oop", "license": "MIT", "devDependencies": { - "@abraham/reflection": "^0.9.1", - "@commitlint/cli": "^16.2.1", + "@abraham/reflection": "^0.10.0", + "@commitlint/cli": "^16.2.3", "@nexhome/yorkie": "^2.0.8", - "@release-it/conventional-changelog": "^4.2.0", + "@release-it/conventional-changelog": "^4.2.2", "@types/lodash-es": "^4.17.6", "@types/markdown-it": "^12.2.3", - "@types/node": "^17.0.21", + "@types/node": "^17.0.22", "@types/prettier": "^2.4.4", - "@typescript-eslint/eslint-plugin": "^5.13.0", - "@typescript-eslint/parser": "^5.13.0", + "@typescript-eslint/eslint-plugin": "^5.16.0", + "@typescript-eslint/parser": "^5.16.0", "@vitejs/plugin-vue": "^2.2.4", - "@vitest/ui": "^0.5.9", + "@vitest/ui": "^0.7.7", "@vue/test-utils": "^2.0.0-rc.18", "@vue3-oop/plugin-vue-jsx": "^1.4.0", "ant-design-vue": "^3.0.0-beta.8", @@ -71,24 +71,24 @@ "commitizen": "^4.2.4", "commitlint-config-cz": "^0.13.3", "cz-customizable": "^6.3.0", - "eslint": "^8.10.0", + "eslint": "^8.11.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.0.0", - "happy-dom": "^2.45.0", + "happy-dom": "^2.50.0", "injection-js": "^2.4.0", - "lint-staged": "^12.3.4", + "lint-staged": "^12.3.7", "lodash-es": "^4.17.21", - "prettier": "^2.5.1", - "release-it": "^14.12.5", + "prettier": "^2.6.0", + "release-it": "^14.13.1", "rimraf": "^3.0.2", "sass": "^1.49.9", "tslib": "^2.3.1", "typescript": "^4.6.2", "vite": "^2.8.6", "vitepress": "^0.22.3", - "vitest": "^0.5.9", + "vitest": "^0.7.7", "vue": "^3.2.31", - "vue-router": "^4.0.13" + "vue-router": "^4.0.14" }, "gitHooks": { "pre-commit": "lint-staged", @@ -123,6 +123,10 @@ "infile": "CHANGELOG.md", "ignoreRecommendedBump": true } + }, + "github": { + "release": true, + "web": true } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa5a416..a6acd60 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,18 +1,18 @@ lockfileVersion: 5.3 specifiers: - '@abraham/reflection': ^0.9.1 - '@commitlint/cli': ^16.2.1 + '@abraham/reflection': ^0.10.0 + '@commitlint/cli': ^16.2.3 '@nexhome/yorkie': ^2.0.8 - '@release-it/conventional-changelog': ^4.2.0 + '@release-it/conventional-changelog': ^4.2.2 '@types/lodash-es': ^4.17.6 '@types/markdown-it': ^12.2.3 - '@types/node': ^17.0.21 + '@types/node': ^17.0.22 '@types/prettier': ^2.4.4 - '@typescript-eslint/eslint-plugin': ^5.13.0 - '@typescript-eslint/parser': ^5.13.0 + '@typescript-eslint/eslint-plugin': ^5.16.0 + '@typescript-eslint/parser': ^5.16.0 '@vitejs/plugin-vue': ^2.2.4 - '@vitest/ui': ^0.5.9 + '@vitest/ui': ^0.7.7 '@vue/test-utils': ^2.0.0-rc.18 '@vue3-oop/plugin-vue-jsx': ^1.4.0 ant-design-vue: ^3.0.0-beta.8 @@ -21,38 +21,38 @@ specifiers: commitizen: ^4.2.4 commitlint-config-cz: ^0.13.3 cz-customizable: ^6.3.0 - eslint: ^8.10.0 + eslint: ^8.11.0 eslint-config-prettier: ^8.5.0 eslint-plugin-prettier: ^4.0.0 - happy-dom: ^2.45.0 + happy-dom: ^2.50.0 injection-js: ^2.4.0 - lint-staged: ^12.3.4 + lint-staged: ^12.3.7 lodash-es: ^4.17.21 - prettier: ^2.5.1 - release-it: ^14.12.5 + prettier: ^2.6.0 + release-it: ^14.13.1 rimraf: ^3.0.2 sass: ^1.49.9 tslib: ^2.3.1 typescript: ^4.6.2 vite: ^2.8.6 vitepress: ^0.22.3 - vitest: ^0.5.9 + vitest: ^0.7.7 vue: ^3.2.31 - vue-router: ^4.0.13 + vue-router: ^4.0.14 devDependencies: - '@abraham/reflection': 0.9.1 - '@commitlint/cli': 16.2.1 + '@abraham/reflection': 0.10.0 + '@commitlint/cli': 16.2.3 '@nexhome/yorkie': 2.0.8 - '@release-it/conventional-changelog': 4.2.0_release-it@14.12.5 + '@release-it/conventional-changelog': 4.2.2_release-it@14.13.1 '@types/lodash-es': 4.17.6 '@types/markdown-it': 12.2.3 - '@types/node': 17.0.21 + '@types/node': 17.0.22 '@types/prettier': 2.4.4 - '@typescript-eslint/eslint-plugin': 5.13.0_33fffc354ccfa91fbe7d1677b9395a0a - '@typescript-eslint/parser': 5.13.0_eslint@8.10.0+typescript@4.6.2 + '@typescript-eslint/eslint-plugin': 5.16.0_3fed250b11519414a4c7d52468dd6bf5 + '@typescript-eslint/parser': 5.16.0_eslint@8.11.0+typescript@4.6.2 '@vitejs/plugin-vue': 2.2.4_vite@2.8.6+vue@3.2.31 - '@vitest/ui': 0.5.9 + '@vitest/ui': 0.7.7 '@vue/test-utils': 2.0.0-rc.18_vue@3.2.31 '@vue3-oop/plugin-vue-jsx': 1.4.0_typescript@4.6.2 ant-design-vue: 3.0.0-beta.8_vue@3.2.31 @@ -61,29 +61,29 @@ devDependencies: commitizen: 4.2.4 commitlint-config-cz: 0.13.3 cz-customizable: 6.3.0 - eslint: 8.10.0 - eslint-config-prettier: 8.5.0_eslint@8.10.0 - eslint-plugin-prettier: 4.0.0_f3d13a703a9c1079e3d1af6044603beb - happy-dom: 2.45.0 + eslint: 8.11.0 + eslint-config-prettier: 8.5.0_eslint@8.11.0 + eslint-plugin-prettier: 4.0.0_68edcf5670f37721baf5d2cac6124e4d + happy-dom: 2.50.0 injection-js: 2.4.0 - lint-staged: 12.3.4 + lint-staged: 12.3.7 lodash-es: 4.17.21 - prettier: 2.5.1 - release-it: 14.12.5 + prettier: 2.6.0 + release-it: 14.13.1 rimraf: 3.0.2 sass: 1.49.9 tslib: 2.3.1 typescript: 4.6.2 vite: 2.8.6_sass@1.49.9 vitepress: 0.22.3_sass@1.49.9 - vitest: 0.5.9_4842f411806b8f5a09f3102fb519ba63 + vitest: 0.7.7_8dc1d8c1871c0820de48b5315c1f1a9e vue: 3.2.31 - vue-router: 4.0.13_vue@3.2.31 + vue-router: 4.0.14_vue@3.2.31 packages: - /@abraham/reflection/0.9.1: - resolution: {integrity: sha512-uUfxTjKTkPs9IDJkKvpUBunZPIwaCCBZ/x8VS6eVpzCLQyyu9gk5cYW+2jpRptjaHd0ZRiKXO9FpA9rKguE4nw==} + /@abraham/reflection/0.10.0: + resolution: {integrity: sha512-ltEjxbZn3B5CzPhUND30YJiondgOTH3m52edgshMxcuHTEjO2lRyL+EoO7H11yYzt1FIS5CfnMcACSP52WKrLA==} dev: true /@algolia/autocomplete-core/1.5.2: @@ -228,7 +228,7 @@ packages: resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.16.7 + '@babel/highlight': 7.16.10 dev: true /@babel/compat-data/7.16.8: @@ -250,7 +250,7 @@ packages: '@babel/traverse': 7.16.8 '@babel/types': 7.16.8 convert-source-map: 1.8.0 - debug: 4.3.3 + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.0 semver: 6.3.0 @@ -426,8 +426,8 @@ packages: - supports-color dev: true - /@babel/highlight/7.16.7: - resolution: {integrity: sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==} + /@babel/highlight/7.16.10: + resolution: {integrity: sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.16.7 @@ -518,7 +518,7 @@ packages: '@babel/helper-split-export-declaration': 7.16.7 '@babel/parser': 7.16.8 '@babel/types': 7.16.8 - debug: 4.3.3 + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -536,20 +536,20 @@ packages: resolution: {integrity: sha1-daLotRy3WKdVPWgEpZMteqznXDk=, tarball: '@bcoe/v8-coverage/download/@bcoe/v8-coverage-0.2.3.tgz'} dev: true - /@commitlint/cli/16.2.1: - resolution: {integrity: sha512-zfKf+B9osuiDbxGMJ7bWFv7XFCW8wlQYPtCffNp7Ukdb7mdrep5R9e03vPUZysnwp8NX6hg05kPEvnD/wRIGWw==} + /@commitlint/cli/16.2.3: + resolution: {integrity: sha512-VsJBQLvhhlOgEfxs/Z5liYuK0dXqLE5hz1VJzLBxiOxG31kL/X5Q4OvK292BmO7IGZcm1yJE3XQPWSiFaEHbWA==} engines: {node: '>=v12'} hasBin: true dependencies: '@commitlint/format': 16.2.1 '@commitlint/lint': 16.2.1 - '@commitlint/load': 16.2.1 + '@commitlint/load': 16.2.3 '@commitlint/read': 16.2.1 '@commitlint/types': 16.2.1 lodash: 4.17.21 resolve-from: 5.0.0 resolve-global: 1.0.0 - yargs: 17.3.1 + yargs: 17.4.0 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -602,19 +602,18 @@ packages: '@commitlint/types': 16.2.1 dev: true - /@commitlint/load/16.2.1: - resolution: {integrity: sha512-oSpz0jTyVI/A1AIImxJINTLDOMB8YF7lWGm+Jg5wVWM0r7ucpuhyViVvpSRTgvL0z09oIxlctyFGWUQQpI42uw==} + /@commitlint/load/16.2.3: + resolution: {integrity: sha512-Hb4OUlMnBUK6UxJEZ/VJ5k0LocIS7PtEMbRXEAA7eSpOgORIFexC4K/RaRpVd5UTtu3M0ST3ddPPijF9rdW6nw==} engines: {node: '>=v12'} - requiresBuild: true dependencies: '@commitlint/config-validator': 16.2.1 '@commitlint/execute-rule': 16.2.1 '@commitlint/resolve-extends': 16.2.1 '@commitlint/types': 16.2.1 - '@types/node': 17.0.21 + '@types/node': 17.0.22 chalk: 4.1.2 cosmiconfig: 7.0.1 - cosmiconfig-typescript-loader: 1.0.6_e79e62fe450383fd2d418267dc75e645 + cosmiconfig-typescript-loader: 1.0.6_5338de7ff0b33ef224ee85855d74b9f4 lodash: 4.17.21 resolve-from: 5.0.0 typescript: 4.6.2 @@ -737,15 +736,15 @@ packages: - '@algolia/client-search' dev: true - /@eslint/eslintrc/1.2.0: - resolution: {integrity: sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w==} + /@eslint/eslintrc/1.2.1: + resolution: {integrity: sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.3 + debug: 4.3.4 espree: 9.3.1 - globals: 13.12.1 - ignore: 4.0.6 + globals: 13.13.0 + ignore: 5.2.0 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -759,7 +758,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.3 + debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -821,8 +820,8 @@ packages: '@octokit/types': 6.34.0 dev: true - /@octokit/core/3.5.1: - resolution: {integrity: sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==} + /@octokit/core/3.6.0: + resolution: {integrity: sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==} dependencies: '@octokit/auth-token': 2.5.0 '@octokit/graphql': 4.8.0 @@ -857,29 +856,29 @@ packages: resolution: {integrity: sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==} dev: true - /@octokit/plugin-paginate-rest/2.17.0_@octokit+core@3.5.1: + /@octokit/plugin-paginate-rest/2.17.0_@octokit+core@3.6.0: resolution: {integrity: sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw==} peerDependencies: '@octokit/core': '>=2' dependencies: - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 '@octokit/types': 6.34.0 dev: true - /@octokit/plugin-request-log/1.0.4_@octokit+core@3.5.1: + /@octokit/plugin-request-log/1.0.4_@octokit+core@3.6.0: resolution: {integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==} peerDependencies: '@octokit/core': '>=3' dependencies: - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 dev: true - /@octokit/plugin-rest-endpoint-methods/5.13.0_@octokit+core@3.5.1: + /@octokit/plugin-rest-endpoint-methods/5.13.0_@octokit+core@3.6.0: resolution: {integrity: sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==} peerDependencies: '@octokit/core': '>=3' dependencies: - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 '@octokit/types': 6.34.0 deprecation: 2.3.1 dev: true @@ -908,10 +907,10 @@ packages: /@octokit/rest/18.12.0: resolution: {integrity: sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==} dependencies: - '@octokit/core': 3.5.1 - '@octokit/plugin-paginate-rest': 2.17.0_@octokit+core@3.5.1 - '@octokit/plugin-request-log': 1.0.4_@octokit+core@3.5.1 - '@octokit/plugin-rest-endpoint-methods': 5.13.0_@octokit+core@3.5.1 + '@octokit/core': 3.6.0 + '@octokit/plugin-paginate-rest': 2.17.0_@octokit+core@3.6.0 + '@octokit/plugin-request-log': 1.0.4_@octokit+core@3.6.0 + '@octokit/plugin-rest-endpoint-methods': 5.13.0_@octokit+core@3.6.0 transitivePeerDependencies: - encoding dev: true @@ -926,8 +925,8 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@release-it/conventional-changelog/4.2.0_release-it@14.12.5: - resolution: {integrity: sha512-o0XF8HyrUJ7u0bqXbGfq0M87pzK9cZ1ybBwDywZvV37EB1JRUJjpw1yQRcOe1gpaeOOplucb0BXj9SKuNQGBcw==} + /@release-it/conventional-changelog/4.2.2_release-it@14.13.1: + resolution: {integrity: sha512-cbpfMSKTt8VtyltNls6Kt0WXIRmgILNpF1nqGE2oe3acs286Brrb5WFGyPhYR8XUy0nVsnjG1zmUPP6n0Xd6XA==} engines: {node: '>=10'} peerDependencies: release-it: ^14.12.1 @@ -936,7 +935,7 @@ packages: conventional-changelog: 3.1.25 conventional-recommended-bump: 6.1.0 prepend-file: 2.0.1 - release-it: 14.12.5 + release-it: 14.13.1 dev: true /@rollup/pluginutils/4.1.2: @@ -998,8 +997,8 @@ packages: resolution: {integrity: sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==} dependencies: '@types/http-cache-semantics': 4.0.1 - '@types/keyv': 3.1.3 - '@types/node': 17.0.21 + '@types/keyv': 3.1.4 + '@types/node': 17.0.22 '@types/responselike': 1.0.0 dev: true @@ -1016,13 +1015,13 @@ packages: /@types/concat-stream/1.6.1: resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} dependencies: - '@types/node': 17.0.21 + '@types/node': 17.0.22 dev: true /@types/form-data/0.0.33: - resolution: {integrity: sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=, tarball: '@types/form-data/download/@types/form-data-0.0.33.tgz'} + resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} dependencies: - '@types/node': 17.0.21 + '@types/node': 17.0.22 dev: true /@types/http-cache-semantics/4.0.1: @@ -1033,14 +1032,14 @@ packages: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==, tarball: '@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.4.tgz'} dev: true - /@types/json-schema/7.0.9: - resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==} + /@types/json-schema/7.0.10: + resolution: {integrity: sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==} dev: true - /@types/keyv/3.1.3: - resolution: {integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==} + /@types/keyv/3.1.4: + resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 17.0.21 + '@types/node': 17.0.22 dev: true /@types/linkify-it/3.0.2: @@ -1076,8 +1075,8 @@ packages: resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} dev: true - /@types/node/17.0.21: - resolution: {integrity: sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==} + /@types/node/17.0.22: + resolution: {integrity: sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw==} dev: true /@types/node/8.10.66: @@ -1103,11 +1102,11 @@ packages: /@types/responselike/1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 17.0.21 + '@types/node': 17.0.22 dev: true - /@typescript-eslint/eslint-plugin/5.13.0_33fffc354ccfa91fbe7d1677b9395a0a: - resolution: {integrity: sha512-vLktb2Uec81fxm/cfz2Hd6QaWOs8qdmVAZXLdOBX6JFJDhf6oDZpMzZ4/LZ6SFM/5DgDcxIMIvy3F+O9yZBuiQ==} + /@typescript-eslint/eslint-plugin/5.16.0_3fed250b11519414a4c7d52468dd6bf5: + resolution: {integrity: sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -1117,12 +1116,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.13.0_eslint@8.10.0+typescript@4.6.2 - '@typescript-eslint/scope-manager': 5.13.0 - '@typescript-eslint/type-utils': 5.13.0_eslint@8.10.0+typescript@4.6.2 - '@typescript-eslint/utils': 5.13.0_eslint@8.10.0+typescript@4.6.2 - debug: 4.3.3 - eslint: 8.10.0 + '@typescript-eslint/parser': 5.16.0_eslint@8.11.0+typescript@4.6.2 + '@typescript-eslint/scope-manager': 5.16.0 + '@typescript-eslint/type-utils': 5.16.0_eslint@8.11.0+typescript@4.6.2 + '@typescript-eslint/utils': 5.16.0_eslint@8.11.0+typescript@4.6.2 + debug: 4.3.4 + eslint: 8.11.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -1133,8 +1132,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.13.0_eslint@8.10.0+typescript@4.6.2: - resolution: {integrity: sha512-GdrU4GvBE29tm2RqWOM0P5QfCtgCyN4hXICj/X9ibKED16136l9ZpoJvCL5pSKtmJzA+NRDzQ312wWMejCVVfg==} + /@typescript-eslint/parser/5.16.0_eslint@8.11.0+typescript@4.6.2: + resolution: {integrity: sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1143,26 +1142,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.13.0 - '@typescript-eslint/types': 5.13.0 - '@typescript-eslint/typescript-estree': 5.13.0_typescript@4.6.2 - debug: 4.3.3 - eslint: 8.10.0 + '@typescript-eslint/scope-manager': 5.16.0 + '@typescript-eslint/types': 5.16.0 + '@typescript-eslint/typescript-estree': 5.16.0_typescript@4.6.2 + debug: 4.3.4 + eslint: 8.11.0 typescript: 4.6.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.13.0: - resolution: {integrity: sha512-T4N8UvKYDSfVYdmJq7g2IPJYCRzwtp74KyDZytkR4OL3NRupvswvmJQJ4CX5tDSurW2cvCc1Ia1qM7d0jpa7IA==} + /@typescript-eslint/scope-manager/5.16.0: + resolution: {integrity: sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.13.0 - '@typescript-eslint/visitor-keys': 5.13.0 + '@typescript-eslint/types': 5.16.0 + '@typescript-eslint/visitor-keys': 5.16.0 dev: true - /@typescript-eslint/type-utils/5.13.0_eslint@8.10.0+typescript@4.6.2: - resolution: {integrity: sha512-/nz7qFizaBM1SuqAKb7GLkcNn2buRdDgZraXlkhz+vUGiN1NZ9LzkA595tHHeduAiS2MsHqMNhE2zNzGdw43Yg==} + /@typescript-eslint/type-utils/5.16.0_eslint@8.11.0+typescript@4.6.2: + resolution: {integrity: sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -1171,22 +1170,22 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.13.0_eslint@8.10.0+typescript@4.6.2 - debug: 4.3.3 - eslint: 8.10.0 + '@typescript-eslint/utils': 5.16.0_eslint@8.11.0+typescript@4.6.2 + debug: 4.3.4 + eslint: 8.11.0 tsutils: 3.21.0_typescript@4.6.2 typescript: 4.6.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.13.0: - resolution: {integrity: sha512-LmE/KO6DUy0nFY/OoQU0XelnmDt+V8lPQhh8MOVa7Y5k2gGRd6U9Kp3wAjhB4OHg57tUO0nOnwYQhRRyEAyOyg==} + /@typescript-eslint/types/5.16.0: + resolution: {integrity: sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.13.0_typescript@4.6.2: - resolution: {integrity: sha512-Q9cQow0DeLjnp5DuEDjLZ6JIkwGx3oYZe+BfcNuw/POhtpcxMTy18Icl6BJqTSd+3ftsrfuVb7mNHRZf7xiaNA==} + /@typescript-eslint/typescript-estree/5.16.0_typescript@4.6.2: + resolution: {integrity: sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -1194,9 +1193,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.13.0 - '@typescript-eslint/visitor-keys': 5.13.0 - debug: 4.3.3 + '@typescript-eslint/types': 5.16.0 + '@typescript-eslint/visitor-keys': 5.16.0 + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.5 @@ -1206,29 +1205,29 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.13.0_eslint@8.10.0+typescript@4.6.2: - resolution: {integrity: sha512-+9oHlPWYNl6AwwoEt5TQryEHwiKRVjz7Vk6kaBeD3/kwHE5YqTGHtm/JZY8Bo9ITOeKutFaXnBlMgSATMJALUQ==} + /@typescript-eslint/utils/5.16.0_eslint@8.11.0+typescript@4.6.2: + resolution: {integrity: sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@types/json-schema': 7.0.9 - '@typescript-eslint/scope-manager': 5.13.0 - '@typescript-eslint/types': 5.13.0 - '@typescript-eslint/typescript-estree': 5.13.0_typescript@4.6.2 - eslint: 8.10.0 + '@types/json-schema': 7.0.10 + '@typescript-eslint/scope-manager': 5.16.0 + '@typescript-eslint/types': 5.16.0 + '@typescript-eslint/typescript-estree': 5.16.0_typescript@4.6.2 + eslint: 8.11.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.10.0 + eslint-utils: 3.0.0_eslint@8.11.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.13.0: - resolution: {integrity: sha512-HLKEAS/qA1V7d9EzcpLFykTePmOQqOFim8oCvhY3pZgQ8Hi38hYpHd9e5GN6nQBFQNecNhws5wkS9Y5XIO0s/g==} + /@typescript-eslint/visitor-keys/5.16.0: + resolution: {integrity: sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.13.0 + '@typescript-eslint/types': 5.16.0 eslint-visitor-keys: 3.3.0 dev: true @@ -1243,8 +1242,8 @@ packages: vue: 3.2.31 dev: true - /@vitest/ui/0.5.9: - resolution: {integrity: sha512-+Y51EhIuT4tonINzzBSjfEsaU4deGgUilTGaE2MP+9Co3WyPHr11byzSA1VEj7mYWJ204xxPY22ZYUCdX01Aag==} + /@vitest/ui/0.7.7: + resolution: {integrity: sha512-r+8w1AlUUWcHmAbNbm2wuhhtLqAL5EPtgE2MYCF3/7fjLJUkxRdox8fn/bwqAQGoPTRDOyhLdOZWlJUpk5VKcw==} dependencies: sirv: 2.0.2 dev: true @@ -1291,8 +1290,8 @@ packages: '@vue/shared': 3.2.31 dev: true - /@vue/devtools-api/6.0.12: - resolution: {integrity: sha512-iO/4FIezHKXhiDBdKySCvJVh8/mZPxHpiQrTy+PXVqJZgpTPTdHy4q8GXulaY+UKEagdkBb0onxNQZ0LNiqVhw==} + /@vue/devtools-api/6.1.3: + resolution: {integrity: sha512-79InfO2xHv+WHIrH1bHXQUiQD/wMls9qBk6WVwGCbdwP7/3zINtvqPNMtmSHXsIKjvUAHc8L0ouOj6ZQQRmcXg==} dev: true /@vue/reactivity-transform/3.2.31: @@ -1341,7 +1340,7 @@ packages: dev: true /@vue/test-utils/2.0.0-rc.18_vue@3.2.31: - resolution: {integrity: sha512-aifolXjVdsogjaLmDoZ0FU8vN+R67aWmg9OuVeED4w5Ij5GFQLrlhM19uhWe/r5xXUL4fXMk3pX5wW6FJP1NcQ==, tarball: '@vue/test-utils/download/@vue/test-utils-2.0.0-rc.18.tgz'} + resolution: {integrity: sha512-aifolXjVdsogjaLmDoZ0FU8vN+R67aWmg9OuVeED4w5Ij5GFQLrlhM19uhWe/r5xXUL4fXMk3pX5wW6FJP1NcQ==} peerDependencies: vue: ^3.0.1 dependencies: @@ -1472,8 +1471,8 @@ packages: engines: {node: '>=4'} dev: true - /ansi-regex/4.1.0: - resolution: {integrity: sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==} + /ansi-regex/4.1.1: + resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} engines: {node: '>=6'} dev: true @@ -1488,7 +1487,7 @@ packages: dev: true /ansi-styles/3.2.1: - resolution: {integrity: sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=, tarball: ansi-styles/download/ansi-styles-3.2.1.tgz} + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} dependencies: color-convert: 1.9.3 @@ -1826,7 +1825,7 @@ packages: dev: true /ci-info/1.6.0: - resolution: {integrity: sha1-LKINu5zrMtRSSmgzAzE/AwSx5Jc=, tarball: ci-info/download/ci-info-1.6.0.tgz} + resolution: {integrity: sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==} dev: true /ci-info/2.0.0: @@ -2205,16 +2204,16 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /cosmiconfig-typescript-loader/1.0.6_e79e62fe450383fd2d418267dc75e645: + /cosmiconfig-typescript-loader/1.0.6_5338de7ff0b33ef224ee85855d74b9f4: resolution: {integrity: sha512-2nEotziYJWtNtoTjKbchj9QrdTT6DBxCvqjNKoDKARw+e2yZmTQCa07uRrykLIZuvSgp69YXLH89UHc0WhdMfQ==} engines: {node: '>=12', npm: '>=6'} peerDependencies: '@types/node': '*' typescript: '>=3' dependencies: - '@types/node': 17.0.21 + '@types/node': 17.0.22 cosmiconfig: 7.0.1 - ts-node: 10.6.0_e79e62fe450383fd2d418267dc75e645 + ts-node: 10.7.0_5338de7ff0b33ef224ee85855d74b9f4 typescript: 4.6.2 transitivePeerDependencies: - '@swc/core' @@ -2237,7 +2236,7 @@ packages: dev: true /cross-spawn/5.1.0: - resolution: {integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=, tarball: cross-spawn/download/cross-spawn-5.1.0.tgz} + resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: lru-cache: 4.1.5 shebang-command: 1.2.0 @@ -2277,7 +2276,7 @@ packages: longest: 2.0.1 word-wrap: 1.2.3 optionalDependencies: - '@commitlint/load': 16.2.1 + '@commitlint/load': 16.2.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -2320,8 +2319,20 @@ packages: ms: 2.1.2 dev: true - /debug/4.3.3_supports-color@9.2.1: - resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /debug/4.3.4_supports-color@9.2.1: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -2717,16 +2728,16 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier/8.5.0_eslint@8.10.0: + /eslint-config-prettier/8.5.0_eslint@8.11.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.10.0 + eslint: 8.11.0 dev: true - /eslint-plugin-prettier/4.0.0_f3d13a703a9c1079e3d1af6044603beb: + /eslint-plugin-prettier/4.0.0_68edcf5670f37721baf5d2cac6124e4d: resolution: {integrity: sha1-i5nR5LiySnYkcrRWeZICNhnLmOA=, tarball: eslint-plugin-prettier/download/eslint-plugin-prettier-4.0.0.tgz} engines: {node: '>=6.0.0'} peerDependencies: @@ -2737,9 +2748,9 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.10.0 - eslint-config-prettier: 8.5.0_eslint@8.10.0 - prettier: 2.5.1 + eslint: 8.11.0 + eslint-config-prettier: 8.5.0_eslint@8.11.0 + prettier: 2.6.0 prettier-linter-helpers: 1.0.0 dev: true @@ -2759,13 +2770,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.10.0: + /eslint-utils/3.0.0_eslint@8.11.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.10.0 + eslint: 8.11.0 eslint-visitor-keys: 2.1.0 dev: true @@ -2779,21 +2790,21 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.10.0: - resolution: {integrity: sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw==} + /eslint/8.11.0: + resolution: {integrity: sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.2.0 + '@eslint/eslintrc': 1.2.1 '@humanwhocodes/config-array': 0.9.5 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.3 + debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.10.0 + eslint-utils: 3.0.0_eslint@8.11.0 eslint-visitor-keys: 3.3.0 espree: 9.3.1 esquery: 1.4.0 @@ -2802,7 +2813,7 @@ packages: file-entry-cache: 6.0.1 functional-red-black-tree: 1.0.1 glob-parent: 6.0.2 - globals: 13.12.1 + globals: 13.13.0 ignore: 5.2.0 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -2874,7 +2885,7 @@ packages: is-stream: 1.1.0 npm-run-path: 2.0.2 p-finally: 1.0.0 - signal-exit: 3.0.6 + signal-exit: 3.0.7 strip-eof: 1.0.0 dev: true @@ -3058,7 +3069,7 @@ packages: engines: {node: '>=8.0.0'} dependencies: cross-spawn: 7.0.3 - signal-exit: 3.0.6 + signal-exit: 3.0.7 dev: true /form-data/2.5.1: @@ -3067,7 +3078,7 @@ packages: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 - mime-types: 2.1.34 + mime-types: 2.1.35 dev: true /form-data/4.0.0: @@ -3247,7 +3258,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: true @@ -3258,7 +3269,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: true @@ -3302,8 +3313,8 @@ packages: engines: {node: '>=4'} dev: true - /globals/13.12.1: - resolution: {integrity: sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==} + /globals/13.13.0: + resolution: {integrity: sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -3376,24 +3387,24 @@ packages: engines: {node: '>=0.4.7'} hasBin: true dependencies: - minimist: 1.2.5 + minimist: 1.2.6 neo-async: 2.6.2 source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.15.2 + uglify-js: 3.15.3 dev: true - /happy-dom/2.45.0: - resolution: {integrity: sha512-5f2CQ0m+YLw84UioQjJ9WR4Rj9j9/Y8tIMHhZ0QUXUyDaMVA8yd6le8Q0zbu/eupGhG9SW6z+217gQ5PfKN1OQ==} + /happy-dom/2.50.0: + resolution: {integrity: sha512-3boJ9i4AbSMUvI4f6N4UEuDDOdKMTCXlnsjoB7KCyhkN1VD+vR9kQEmHLLDHrIPdLn65zA/XhhaFZhCkoWoLQQ==} dependencies: css.escape: 1.5.1 he: 1.2.0 node-fetch: 2.6.7 sync-request: 6.1.0 webidl-conversions: 7.0.0 - whatwg-encoding: 1.0.5 - whatwg-mimetype: 2.3.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 transitivePeerDependencies: - encoding dev: true @@ -3511,13 +3522,15 @@ packages: safer-buffer: 2.1.2 dev: true - /ieee754/1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + /iconv-lite/0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 dev: true - /ignore/4.0.6: - resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} - engines: {node: '>= 4'} + /ieee754/1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: true /ignore/5.2.0: @@ -3625,7 +3638,7 @@ packages: mute-stream: 0.0.8 ora: 5.4.1 run-async: 2.4.1 - rxjs: 7.5.4 + rxjs: 7.5.5 string-width: 4.2.3 strip-ansi: 6.0.1 through: 2.3.8 @@ -3762,7 +3775,7 @@ packages: dev: true /is-stream/1.1.0: - resolution: {integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ=, tarball: is-stream/download/is-stream-1.1.0.tgz} + resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} engines: {node: '>=0.10.0'} dev: true @@ -3887,11 +3900,11 @@ packages: engines: {node: '>=6'} hasBin: true dependencies: - minimist: 1.2.5 + minimist: 1.2.6 dev: true /jsonfile/4.0.0: - resolution: {integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=, tarball: jsonfile/download/jsonfile-4.0.0.tgz} + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.9 dev: true @@ -3950,21 +3963,22 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /lint-staged/12.3.4: - resolution: {integrity: sha512-yv/iK4WwZ7/v0GtVkNb3R82pdL9M+ScpIbJLJNyCXkJ1FGaXvRCOg/SeL59SZtPpqZhE7BD6kPKFLIDUhDx2/w==} + /lint-staged/12.3.7: + resolution: {integrity: sha512-/S4D726e2GIsDVWIk1XGvheCaDm1SJRQp8efamZFWJxQMVEbOwSysp7xb49Oo73KYCdy97mIWinhlxcoNqIfIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} hasBin: true dependencies: cli-truncate: 3.1.0 colorette: 2.0.16 commander: 8.3.0 - debug: 4.3.3_supports-color@9.2.1 + debug: 4.3.4_supports-color@9.2.1 execa: 5.1.1 lilconfig: 2.0.4 - listr2: 4.0.4 + listr2: 4.0.5 micromatch: 4.0.4 normalize-path: 3.0.0 object-inspect: 1.12.0 + pidtree: 0.5.0 string-argv: 0.3.1 supports-color: 9.2.1 yaml: 1.10.2 @@ -3972,8 +3986,8 @@ packages: - enquirer dev: true - /listr2/4.0.4: - resolution: {integrity: sha512-vJOm5KD6uZXjSsrwajr+mNacIjf87gWvlBEltPWLbTkslUscWAzquyK4xfe9Zd4RDgO5nnwFyV06FC+uVR+5mg==} + /listr2/4.0.5: + resolution: {integrity: sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA==} engines: {node: '>=12'} peerDependencies: enquirer: '>= 2.3.0 < 3' @@ -3986,7 +4000,7 @@ packages: log-update: 4.0.0 p-map: 4.0.0 rfdc: 1.3.0 - rxjs: 7.5.4 + rxjs: 7.5.5 through: 2.3.8 wrap-ansi: 7.0.0 dev: true @@ -4022,7 +4036,7 @@ packages: dev: true /locate-path/6.0.0: - resolution: {integrity: sha1-VTIeswn+u8WcSAHZMackUqaB0oY=, tarball: locate-path/download/locate-path-6.0.0.tgz} + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} dependencies: p-locate: 5.0.0 @@ -4187,6 +4201,11 @@ packages: engines: {node: '>= 0.6'} dev: true + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + /mime-types/2.1.34: resolution: {integrity: sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==} engines: {node: '>= 0.6'} @@ -4194,6 +4213,13 @@ packages: mime-db: 1.51.0 dev: true + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + /mimic-fn/1.2.0: resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} engines: {node: '>=4'} @@ -4219,12 +4245,6 @@ packages: engines: {node: '>=4'} dev: true - /minimatch/3.0.4: - resolution: {integrity: sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=, tarball: minimatch/download/minimatch-3.0.4.tgz} - dependencies: - brace-expansion: 1.1.11 - dev: true - /minimatch/3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -4244,11 +4264,15 @@ packages: resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==} dev: true + /minimist/1.2.6: + resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==} + dev: true + /mkdirp/0.5.5: resolution: {integrity: sha1-2Rzv1i0UNsoPQWIOJRKI1CAJne8=, tarball: mkdirp/download/mkdirp-0.5.5.tgz} hasBin: true dependencies: - minimist: 1.2.5 + minimist: 1.2.6 dev: true /modify-values/1.0.1: @@ -4354,7 +4378,7 @@ packages: dev: true /npm-run-path/2.0.2: - resolution: {integrity: sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=, tarball: npm-run-path/download/npm-run-path-2.0.2.tgz} + resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} engines: {node: '>=4'} dependencies: path-key: 2.0.1 @@ -4432,7 +4456,7 @@ packages: dev: true /os-name/4.0.1: - resolution: {integrity: sha1-Ms7ngj3oWoiXZHuk1220a/hF5VU=, tarball: os-name/download/os-name-4.0.1.tgz} + resolution: {integrity: sha512-xl9MAoU97MH1Xt5K9ERft2YfCAoaO6msy1OBA0ozxEC0x0TmIoE6K3QvgJMMZA9yKGLmHXNY/YZoDbiGDj4zYw==} engines: {node: '>=10'} dependencies: macos-release: 2.5.0 @@ -4634,6 +4658,12 @@ packages: engines: {node: '>=8.6'} dev: true + /pidtree/0.5.0: + resolution: {integrity: sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /pify/2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} @@ -4681,8 +4711,8 @@ packages: fast-diff: 1.2.0 dev: true - /prettier/2.5.1: - resolution: {integrity: sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==, tarball: prettier/download/prettier-2.5.1.tgz} + /prettier/2.6.0: + resolution: {integrity: sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==} engines: {node: '>=10.13.0'} hasBin: true dev: true @@ -4771,7 +4801,7 @@ packages: dependencies: deep-extend: 0.6.0 ini: 1.3.8 - minimist: 1.2.5 + minimist: 1.2.6 strip-json-comments: 2.0.1 dev: true @@ -4877,8 +4907,8 @@ packages: rc: 1.2.8 dev: true - /release-it/14.12.5: - resolution: {integrity: sha512-mGFbbX8eEKMOhfjq5mZAgGppT8CME1T+vj6xA5tAPYSCuPpcNEDjqiG1tJfPy/XImZI4uS3U6pNP5KyDpy9etg==} + /release-it/14.13.1: + resolution: {integrity: sha512-mrng5bqZDFMr/7oCH3kuflwjKpKki4dUp6yYGxs20scYCvvd8rHAI5pdQOJHwI5BKHAC/pad0UjAEycMWQnEIw==} engines: {node: '>=10'} hasBin: true dependencies: @@ -4908,6 +4938,7 @@ packages: update-notifier: 5.1.0 url-join: 4.0.1 uuid: 8.3.2 + wildcard-match: 5.1.2 yaml: 1.10.2 yargs-parser: 20.2.9 transitivePeerDependencies: @@ -5044,8 +5075,8 @@ packages: tslib: 1.14.1 dev: true - /rxjs/7.5.4: - resolution: {integrity: sha512-h5M3Hk78r6wAheJF0a5YahB1yRQKCsZ4MsGdZ5O9ETbVtjPcScGfrMmoOq7EBsCRzd4BDkvDJ7ogP8Sz5tTFiQ==} + /rxjs/7.5.5: + resolution: {integrity: sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==} dependencies: tslib: 2.3.1 dev: true @@ -5149,10 +5180,6 @@ packages: object-inspect: 1.12.0 dev: true - /signal-exit/3.0.6: - resolution: {integrity: sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==} - dev: true - /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true @@ -5213,7 +5240,7 @@ packages: dev: true /source-map/0.7.3: - resolution: {integrity: sha1-UwL4FpAxc1ImVECS5kmB91F1A4M=, tarball: source-map/download/source-map-0.7.3.tgz} + resolution: {integrity: sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==} engines: {node: '>= 8'} dev: true @@ -5319,7 +5346,7 @@ packages: resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} engines: {node: '>=6'} dependencies: - ansi-regex: 4.1.0 + ansi-regex: 4.1.1 dev: true /strip-ansi/6.0.1: @@ -5456,7 +5483,7 @@ packages: dependencies: '@istanbuljs/schema': 0.1.3 glob: 7.2.0 - minimatch: 3.0.4 + minimatch: 3.1.2 dev: true /text-extensions/1.9.0: @@ -5550,8 +5577,8 @@ packages: engines: {node: '>=8'} dev: true - /ts-node/10.6.0_e79e62fe450383fd2d418267dc75e645: - resolution: {integrity: sha512-CJen6+dfOXolxudBQXnVjRVvYTmTWbyz7cn+xq2XTsvnaXbHqr4gXSCNbS2Jj8yTZMuGwUoBESLaOkLascVVvg==} + /ts-node/10.7.0_5338de7ff0b33ef224ee85855d74b9f4: + resolution: {integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==} hasBin: true peerDependencies: '@swc/core': '>=1.2.50' @@ -5569,7 +5596,7 @@ packages: '@tsconfig/node12': 1.0.9 '@tsconfig/node14': 1.0.1 '@tsconfig/node16': 1.0.2 - '@types/node': 17.0.21 + '@types/node': 17.0.22 acorn: 8.7.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -5657,8 +5684,8 @@ packages: hasBin: true dev: true - /uglify-js/3.15.2: - resolution: {integrity: sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==} + /uglify-js/3.15.3: + resolution: {integrity: sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==} engines: {node: '>=0.8.0'} hasBin: true requiresBuild: true @@ -5677,7 +5704,7 @@ packages: dev: true /universalify/0.1.2: - resolution: {integrity: sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=, tarball: universalify/download/universalify-0.1.2.tgz} + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} dev: true @@ -5815,9 +5842,9 @@ packages: - stylus dev: true - /vitest/0.5.9_4842f411806b8f5a09f3102fb519ba63: - resolution: {integrity: sha512-R8lRP9Q1yIbwr8pDf2gvw4PFe8H5YMyHhBcdyfnUh6toLfCR10jrdI/WkNxdo5I4H/9XrMX9t+SAavdJExNdKg==} - engines: {node: '>=14.14.0'} + /vitest/0.7.7_8dc1d8c1871c0820de48b5315c1f1a9e: + resolution: {integrity: sha512-xU7BTB7T7GbcjFBdbZAAp/dIQUwn8bygI+cbw6Yq1oXj60oGRJ+nJ7AXvSOJyaHMTmglEoaqazyDGnCHJBXftw==} + engines: {node: '>=v14.19.1'} hasBin: true peerDependencies: '@vitest/ui': '*' @@ -5836,10 +5863,10 @@ packages: dependencies: '@types/chai': 4.3.0 '@types/chai-subset': 1.3.3 - '@vitest/ui': 0.5.9 + '@vitest/ui': 0.7.7 c8: 7.11.0 chai: 4.3.6 - happy-dom: 2.45.0 + happy-dom: 2.50.0 local-pkg: 0.4.1 tinypool: 0.1.2 tinyspy: 0.3.0 @@ -5850,12 +5877,12 @@ packages: - stylus dev: true - /vue-router/4.0.13_vue@3.2.31: - resolution: {integrity: sha512-LmXrC+BkDRLak+d5xTMgUYraT3Nj0H/vCbP+7usGvIl9Viqd1UP6AsP0i69pSbn9O0dXK/xCdp4yPw21HqV9Jw==} + /vue-router/4.0.14_vue@3.2.31: + resolution: {integrity: sha512-wAO6zF9zxA3u+7AkMPqw9LjoUCjSxfFvINQj3E/DceTt6uEz1XZLraDhdg2EYmvVwTBSGlLYsUw8bDmx0754Mw==} peerDependencies: vue: ^3.2.0 dependencies: - '@vue/devtools-api': 6.0.12 + '@vue/devtools-api': 6.1.3 vue: 3.2.31 dev: true @@ -5900,14 +5927,16 @@ packages: engines: {node: '>=12'} dev: true - /whatwg-encoding/1.0.5: - resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} + /whatwg-encoding/2.0.0: + resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} + engines: {node: '>=12'} dependencies: - iconv-lite: 0.4.24 + iconv-lite: 0.6.3 dev: true - /whatwg-mimetype/2.3.0: - resolution: {integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==} + /whatwg-mimetype/3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} dev: true /whatwg-url/5.0.0: @@ -5939,6 +5968,10 @@ packages: string-width: 4.2.3 dev: true + /wildcard-match/5.1.2: + resolution: {integrity: sha512-qNXwI591Z88c8bWxp+yjV60Ch4F8Riawe3iGxbzquhy8Xs9m+0+SLFBGb/0yCTIDElawtaImC37fYZ+dr32KqQ==} + dev: true + /windows-release/4.0.0: resolution: {integrity: sha512-OxmV4wzDKB1x7AZaZgXMVsdJ1qER1ed83ZrTYd5Bwq2HfJVg3DJS8nqlAG4sMoJ7mu8cuRmLEYyU13BKwctRAg==} engines: {node: '>=10'} @@ -6037,8 +6070,8 @@ packages: yargs-parser: 20.2.9 dev: true - /yargs/17.3.1: - resolution: {integrity: sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==} + /yargs/17.4.0: + resolution: {integrity: sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==} engines: {node: '>=12'} dependencies: cliui: 7.0.4 diff --git a/src/extends/component.ts b/src/extends/component.ts index ac770d9..566fa73 100644 --- a/src/extends/component.ts +++ b/src/extends/component.ts @@ -8,13 +8,7 @@ import type { } from 'vue' import { getCurrentInstance, markRaw, provide } from 'vue' import { getEmitsFromProps, useCtx, useProps } from '../helper' -import type { - Hanlder, - VueComponentStaticContructor, - WithSlotTypes, - WithVModel, - WithVSlots, -} from '../type' +import type { Hanlder, WithSlotTypes, WithVModel, WithVSlots } from '../type' import { MutHandler } from '../decorators/mut' import { ComputedHandler } from '../decorators/computed' import { HookHandler } from '../decorators/hook' @@ -30,10 +24,7 @@ type VueComponentProps = Omit & AllowedComponentProps & Record -// @ts-ignore -export abstract class VueComponent { - /** 热更新使用 */ - static __hmrId?: string +export class VueComponent { /** 装饰器处理 */ static handler: Hanlder[] = [ MutHandler, @@ -43,6 +34,15 @@ export abstract class VueComponent { ] /** 是否自定义解析组件 */ static resolveComponent = resolveComponent + + /** 热更新使用 */ + static __hmrId?: string + /** 组件显示名字 */ + static displayName?: string + /** 组件的属性定义 */ + static defaultProps?: any + /** vue options emits */ + static emits?: string[] static __vccOpts__value?: ComponentOptions /** 组件option定义,vue3遇到类组件会从此属性获取组件的option */ static __vccOpts: ComponentOptions @@ -54,6 +54,8 @@ export abstract class VueComponent { public props = useProps>() /** 组件上下文 */ public context = useCtx() as WithSlotTypes + + // 公开的一些属性 publicPropertiesMap /** 组件内部实例,如果使用组件实例请 this.$.proxy */ public $ = getCurrentInstance()! /** 主要给jsx提示用 */ @@ -61,28 +63,40 @@ export abstract class VueComponent { return this.props } get $el() { - return this.$.proxy?.$el + return this.$.proxy!.$el + } + get $data() { + return this.$.proxy!.$data + } + get $attrs() { + return this.$.proxy!.$attrs + } + get $slots() { + return this.$.proxy!.$slots + } + get $options() { + return this.$.proxy!.$options } get $refs() { - return this.$.proxy?.$refs + return this.$.proxy!.$refs } get $parent() { - return this.$.proxy?.$parent + return this.$.proxy!.$parent } get $root() { - return this.$.proxy?.$root + return this.$.proxy!.$root } get $emit() { - return this.$.proxy?.$emit + return this.$.proxy!.$emit } get $forceUpdate() { - return this.$.proxy?.$forceUpdate + return this.$.proxy!.$forceUpdate } get $nextTick() { - return this.$.proxy?.$nextTick + return this.$.proxy!.$nextTick } get $watch() { - return this.$.proxy?.$watch + return this.$.proxy!.$watch } constructor() { @@ -94,7 +108,7 @@ export abstract class VueComponent { current.exposeProxy = this // 处理依赖注入 - const ThisConstructor = this.constructor as VueComponentStaticContructor + const ThisConstructor = this.constructor as typeof VueComponent if (ThisConstructor.ProviderKey) provide(ThisConstructor.ProviderKey, this) if (ThisConstructor.globalStore) { // 如果作为全局的服务,则注入到根上面 @@ -125,7 +139,7 @@ Object.defineProperty(VueComponent, '__vccOpts', { configurable: true, get() { if (this.__vccOpts__value) return this.__vccOpts__value - const CompConstructor = this as unknown as VueComponentStaticContructor + const CompConstructor = this as typeof VueComponent // eslint-disable-next-line @typescript-eslint/no-unused-vars const { displayName, @@ -148,7 +162,7 @@ Object.defineProperty(VueComponent, '__vccOpts', { setup: (props: any, ctx: any) => { const instance = VueComponent.resolveComponent(CompConstructor) // 支持模板 - if (CompConstructor.__vccOpts__value.render) return markRaw(instance) + if (CompConstructor.__vccOpts__value!.render) return instance return instance.render.bind(instance) }, }) diff --git a/src/extends/service.ts b/src/extends/service.ts index 48df7cc..bff5b8c 100644 --- a/src/extends/service.ts +++ b/src/extends/service.ts @@ -1,21 +1,25 @@ import { MutHandler } from '../decorators/mut' import { ComputedHandler } from '../decorators/computed' import { HookHandler } from '../decorators/hook' -import { provide } from 'vue' -import type { Hanlder, VueComponentStaticContructor } from '../type' +import type { InjectionKey } from 'vue' +import { markRaw, provide } from 'vue' +import type { Hanlder } from '../type' import { LinkHandler } from '../decorators/link' export const ProviderKey = 'ProviderKey' as const -export abstract class VueService { +export class VueService { + /** 注入的key */ + static ProviderKey?: string | symbol | number | InjectionKey static handler: Hanlder[] = [ MutHandler, ComputedHandler, LinkHandler, HookHandler, ] - public constructor() { - const ThisConstructor = this.constructor as VueComponentStaticContructor + constructor() { + markRaw(this) + const ThisConstructor = this.constructor as typeof VueService if (ThisConstructor.ProviderKey) provide(ThisConstructor.ProviderKey, this) VueService.handler.forEach((handler) => handler.handler(this)) } diff --git a/src/index.ts b/src/index.ts index 11a365c..9d3b4d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,6 @@ export type { ComponentSlots, ClassType, WithVModel, - ComponentPropsArray, ComponentPropsObject, Hanlder, } from './type' diff --git a/src/type.ts b/src/type.ts index 816e277..bec7506 100644 --- a/src/type.ts +++ b/src/type.ts @@ -1,31 +1,4 @@ -import type { - ComponentOptions, - ComponentPublicInstance, - InjectionKey, - Prop, - SetupContext, - VNodeChild, -} from 'vue' - -export interface VueComponentStaticContructor { - new (...args: any[]): ComponentPublicInstance - __vccOpts: ComponentOptions - /** 组件显示名称 */ - displayName?: string - /** 组件属性vue描述 */ - defaultProps?: any - /** 组件是否回退attrs */ - inheritAttrs?: boolean - /** 组件使用的指令 */ - directives?: any - /** 组件作为服务的key */ - ProviderKey?: symbol | string | number | InjectionKey - /** 组件是否作为全局服务 */ - globalStore?: boolean - /** 自定义解析组件 */ - resolveComponent?: any - [prop: string]: any -} +import type { Prop, SetupContext, VNodeChild } from 'vue' /** * 装饰器处理 @@ -85,22 +58,8 @@ export type ComponentProps = export type ComponentPropsObject = { [U in keyof Omit]-?: Prop } -export type ComponentPropsArray = UnionToTuple< - keyof Omit -> export type ComponentSlots = T['props']['v-slots'] /** 为了阻止ts把不相关的类也解析到metadata数据中,用这个工具类型包装一下类 */ export type ClassType = T - -// 联合类型转换成数组 'aaa' | 'bbb' -> ['aaa', 'bbb'] -export type UnionToTuple = ( - (T extends any ? (t: T) => T : never) extends infer U - ? (U extends any ? (u: U) => any : never) extends (v: infer V) => any - ? V - : never - : never -) extends (_: any) => infer W - ? [...UnionToTuple>, W] - : [] diff --git a/test/decorator.test.tsx b/test/decorator.test.tsx index ecc017c..e25adb7 100644 --- a/test/decorator.test.tsx +++ b/test/decorator.test.tsx @@ -2,17 +2,79 @@ import '@abraham/reflection' import { expect, test } from 'vitest' import { Mut, VueComponent } from 'vue3-oop' import { mount } from '@vue/test-utils' +import type { CustomRefFactory } from 'vue' + +const debounceRef: CustomRefFactory = (track, trigger) => { + let value: any + let timeout: number + return { + get() { + track() + return value + }, + set(v) { + if (value === undefined) { + value = v + return + } + clearTimeout(timeout) + timeout = window.setTimeout(() => { + value = v + trigger() + }, 1000) + }, + } +} +const delay = (timeout: number) => + new Promise((resolve) => setTimeout(resolve, timeout)) test('Mut decorator', async () => { class CountComponent extends VueComponent { @Mut() count = 1 + // shallow ref + @Mut(true) obj = { count: 1 } + // custom ref + @Mut(debounceRef) count1 = 1 + render() { - return

this.count++}>{this.count}

+ return ( +
+

this.count++}>{this.count}

+
this.obj.count++}> + {this.obj.count} +
+
this.count1++}> + {this.count1} +
+
+ ) } } // @ts-ignore const wrapper = mount(CountComponent) - expect(wrapper.text()).toContain('1') - await wrapper.get('p').trigger('click') - expect(wrapper.text()).toContain('2') + const vm = wrapper.vm as unknown as CountComponent + + const p = wrapper.get('p') + expect(p.text()).toContain('1') + await p.trigger('click') + expect(p.text()).toContain('2') + + // shallow ref + const shallow = wrapper.get('#shallow') + expect(shallow.text()).toContain('1') + await shallow.trigger('click') + expect(shallow.text()).toContain('1') + + vm.obj = { count: 2 } + await vm.$nextTick() + console.log(shallow.text()) + expect(shallow.text()).toContain('2') + + // custom ref + const custom = wrapper.get('#custom') + expect(custom.text()).toContain('1') + await custom.trigger('click') + expect(custom.text()).toContain('1') + await delay(1000) + expect(custom.text()).toContain('2') })