From fccf2e4d6e2fdfdf04a742fa334dde2aca702ec5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 5 Dec 2023 05:15:21 +0100 Subject: [PATCH] feat: upgrade deps (#3614) --- CODE_OF_CONDUCT.md | 26 +- CONTRIBUTING.md | 6 +- README.md | 5 +- eslint.config.js | 8 +- netlify.toml | 23 +- package.json | 73 +- .../.vitepress/plugins/markdownTransform.ts | 3 + .../theme/components/CourseLink.vue | 5 +- .../theme/components/FunctionBadge.vue | 7 +- .../theme/components/FunctionInfo.vue | 3 +- .../theme/components/FunctionsList.vue | 2 +- packages/.vitepress/theme/styles/demo.css | 12 +- packages/.vitepress/theme/styles/main.css | 11 +- packages/.vitepress/theme/styles/vars.css | 28 +- packages/add-ons.md | 69 +- packages/core/computedInject/demoReceiver.vue | 2 +- packages/core/computedInject/index.md | 2 + packages/core/createReusableTemplate/index.md | 26 +- packages/core/createTemplatePromise/index.md | 44 +- packages/core/onClickOutside/index.md | 54 +- packages/core/onKeyStroke/index.md | 6 +- packages/core/onLongPress/index.md | 42 +- packages/core/onStartTyping/index.md | 2 +- packages/core/onStartTyping/index.ts | 4 +- packages/core/unrefElement/index.md | 14 +- packages/core/useActiveElement/index.md | 10 +- packages/core/useAnimate/index.md | 10 +- packages/core/useBattery/index.md | 12 +- packages/core/useBroadcastChannel/index.md | 12 +- packages/core/useBrowserLocation/index.md | 2 +- packages/core/useClipboard/index.md | 36 +- packages/core/useClipboardItems/index.md | 28 +- packages/core/useColorMode/index.md | 14 +- packages/core/useConfirmDialog/index.md | 44 +- packages/core/useDark/index.md | 30 +- packages/core/useDeviceMotion/index.md | 11 +- packages/core/useDeviceOrientation/index.md | 24 +- packages/core/useDevicePixelRatio/index.md | 12 +- packages/core/useDevicesList/index.md | 15 +- packages/core/useDocumentVisibility/index.md | 11 +- packages/core/useDraggable/index.md | 24 +- packages/core/useDropZone/demo.vue | 4 +- packages/core/useDropZone/index.md | 2 +- packages/core/useElementBounding/index.md | 26 +- packages/core/useElementHover/index.md | 2 +- packages/core/useElementSize/index.md | 34 +- packages/core/useElementVisibility/index.md | 41 +- .../core/useElementVisibility/index.test.ts | 10 +- packages/core/useEventListener/index.md | 10 +- packages/core/useEventSource/index.md | 16 +- packages/core/useEyeDropper/index.md | 14 +- packages/core/useFetch/index.md | 3 +- packages/core/useFetch/index.ts | 2 +- packages/core/useFileDialog/index.md | 6 +- packages/core/useFileSystemAccess/index.ts | 6 +- packages/core/useFocus/index.md | 18 +- packages/core/useFocusWithin/index.md | 27 +- packages/core/useFullscreen/index.md | 18 +- packages/core/useGamepad/index.md | 6 +- packages/core/useGeolocation/index.md | 17 +- packages/core/useIdle/index.md | 11 +- packages/core/useImage/index.md | 4 +- packages/core/useInfiniteScroll/index.md | 6 +- .../core/useIntersectionObserver/index.md | 43 +- packages/core/useLocalStorage/index.md | 2 +- packages/core/useMagicKeys/index.md | 2 +- packages/core/useMagicKeys/index.ts | 8 +- packages/core/useMediaControls/index.md | 45 +- packages/core/useMemoize/index.md | 2 + packages/core/useMouse/index.md | 12 +- packages/core/useMouseInElement/index.md | 41 +- packages/core/useMouseInElement/index.ts | 4 +- packages/core/useMousePressed/index.md | 37 +- packages/core/useNetwork/index.md | 12 +- packages/core/useNow/index.md | 18 +- packages/core/useObjectUrl/index.md | 8 +- packages/core/useOffsetPagination/demo.vue | 2 +- packages/core/useOffsetPagination/index.md | 177 +- packages/core/useOnline/index.md | 11 +- packages/core/usePageLeave/index.md | 11 +- packages/core/useParallax/index.md | 23 +- packages/core/usePointer/index.md | 23 +- packages/core/usePointerLock/index.md | 16 +- packages/core/usePointerSwipe/index.md | 2 +- .../core/usePreferredColorScheme/index.md | 10 +- packages/core/usePreferredContrast/index.md | 10 +- packages/core/usePreferredDark/index.md | 10 +- packages/core/usePreferredLanguages/index.md | 10 +- .../core/usePreferredReducedMotion/index.md | 10 +- packages/core/useResizeObserver/index.md | 41 +- packages/core/useScreenSafeArea/index.md | 12 +- packages/core/useScroll/index.md | 12 +- packages/core/useScrollLock/index.md | 8 +- packages/core/useSessionStorage/index.md | 2 +- packages/core/useShare/index.md | 1 - packages/core/useSorted/index.md | 2 + packages/core/useSpeechRecognition/index.md | 1 + packages/core/useStyleTag/index.md | 13 +- packages/core/useSwipe/index.md | 16 +- packages/core/useSwipe/index.ts | 2 +- packages/core/useTemplateRefsList/index.md | 10 +- packages/core/useTextDirection/index.md | 8 +- packages/core/useTextSelection/index.md | 14 +- packages/core/useThrottledRefHistory/index.ts | 2 +- packages/core/useTimeAgo/index.md | 10 +- packages/core/useTimeAgo/index.test.ts | 4 +- packages/core/useTimestamp/index.md | 18 +- .../core/useUrlSearchParams/index.test.ts | 2 +- packages/core/useVibrate/index.md | 14 +- packages/core/useVirtualList/index.md | 34 +- packages/core/useVirtualList/index.ts | 4 +- packages/core/useWebWorker/index.md | 8 +- packages/core/useWebWorkerFn/index.ts | 2 +- packages/core/useWindowFocus/index.md | 11 +- packages/core/useWindowSize/index.md | 12 +- packages/electron/README.md | 10 +- packages/electron/useZoomFactor/index.ts | 4 +- packages/electron/useZoomLevel/index.ts | 4 +- packages/export-size.md | 1 - packages/firebase/README.md | 6 +- packages/firebase/useAuth/index.md | 6 +- packages/guide/components.md | 36 +- packages/guide/config.md | 1 + packages/guide/index.md | 9 +- packages/guidelines.md | 5 +- packages/integrations/README.md | 24 +- packages/integrations/package.json | 6 +- .../integrations/useAsyncValidator/index.md | 2 +- packages/integrations/useAxios/index.md | 8 +- packages/integrations/useCookies/index.md | 40 +- packages/integrations/useDrauu/index.md | 4 +- packages/integrations/useFocusTrap/index.md | 45 +- packages/integrations/useFuse/index.md | 2 +- packages/integrations/useIDBKeyval/index.md | 1 - packages/integrations/useNProgress/index.md | 2 +- packages/integrations/useNProgress/style.css | 26 +- packages/integrations/useQRCode/index.md | 4 +- packages/integrations/useSortable/index.md | 2 +- packages/math/usePrecision/index.ts | 2 +- packages/nuxt/package.json | 8 +- packages/router/README.md | 6 +- packages/rxjs/README.md | 14 +- packages/shared/createEventHook/index.md | 5 +- packages/shared/createGlobalState/index.md | 3 +- packages/shared/createInjectionState/index.md | 2 - packages/shared/reactify/index.md | 2 +- packages/shared/reactiveOmit/index.md | 2 +- packages/shared/reactivePick/index.md | 2 +- packages/shared/refDebounced/index.md | 1 + packages/shared/set/index.test.ts | 2 +- packages/shared/syncRef/index.ts | 2 +- packages/shared/toRefs/index.md | 16 +- packages/shared/toRefs/index.test.ts | 2 +- packages/shared/useDateFormat/index.md | 19 +- packages/shared/useDebounceFn/index.md | 3 +- packages/shared/useLastChanged/index.md | 1 - packages/shared/useThrottleFn/index.md | 2 +- packages/shared/watchTriggerable/index.md | 2 + playgrounds/nuxt/package.json | 4 +- playgrounds/vite-vue2.7/package.json | 6 +- playgrounds/vite/package.json | 4 +- pnpm-lock.yaml | 4877 +++++++++-------- scripts/changelog.ts | 6 +- scripts/export-size.ts | 3 +- scripts/utils.ts | 10 +- 165 files changed, 3737 insertions(+), 3384 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 22bef3c098c..61cfd4f789e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation. Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Our Responsibilities diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9734579af1..37d368fab89 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Thanks for being interested in contributing to this project! > > As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. **Please note that new features for VueUse may not be accepted at this time.** If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding. -## Development +## Development ### Setup @@ -45,7 +45,7 @@ There are some notes for adding new functions New add-ons are greatly welcome! -- Create a new folder under `packages/`, name it as your add-on name. +- Create a new folder under `packages/`, name it as your add-on name. - Add add-on details in `scripts/packages.ts` - Create `README.md` under that folder. - Add functions as you would do to the core package. @@ -90,7 +90,7 @@ export default useMyFunction for `index.md` the first sentence will be displayed as the short intro in the function list, so try to keep it brief and clear. -```md +```markdown # useMyFunction This will be the intro. The detail descriptions... diff --git a/README.md b/README.md index 82615d9239b..342e2e26e37 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,9 @@ npm i @vueuse/core ### CDN -```html +```vue + ``` @@ -95,7 +96,7 @@ It will be exposed to global as `window.VueUse` ## ðŸŠī Project Activity -![Alt](https://repobeats.axiom.co/api/embed/a406ba7461a6a087dbdb14d4395046c948d44c51.svg "Repobeats analytics image") +![Alt](https://repobeats.axiom.co/api/embed/a406ba7461a6a087dbdb14d4395046c948d44c51.svg 'Repobeats analytics image') ## ðŸ§ą Contribute diff --git a/eslint.config.js b/eslint.config.js index 087a1d24cca..58a48299a60 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -21,6 +21,7 @@ const restricted = [ export default antfu( { + formatters: true, ignores: [ 'patches', 'playgrounds', @@ -84,8 +85,8 @@ export default antfu( { files: [ '**/*.md', - '**/*.md/**/*.[jt]s', - '**/*.md/**/*.vue', + '**/*.md/*.[jt]s', + '**/*.md/*.vue', '**/demo.vue', '**/demo.client.vue', '**/*.test.ts', @@ -97,6 +98,9 @@ export default antfu( 'no-undef': 'off', 'no-unused-vars': 'off', 'no-restricted-imports': 'off', + 'vue/no-unused-vars': 'off', + 'vue/no-unused-refs': 'off', + 'vue/require-v-for-key': 'off', 'ts/no-unused-vars': 'off', 'ts/no-redeclare': 'off', 'unused-imports/no-unused-vars': 'off', diff --git a/netlify.toml b/netlify.toml index 0f3d25e2f8c..a7f5918d6f0 100755 --- a/netlify.toml +++ b/netlify.toml @@ -1,19 +1,18 @@ [build.environment] - NODE_OPTIONS = "--max_old_space_size=4096" - NODE_VERSION = "18" +NODE_OPTIONS = "--max_old_space_size=4096" +NODE_VERSION = "18" [build] - publish = "packages/.vitepress/dist" - command = "pnpm run install-fonts && pnpm run docs:build" +publish = "packages/.vitepress/dist" +command = "pnpm run install-fonts && pnpm run docs:build" [[redirects]] - from = "https://vueuse.js.org/*" - to = "https://vueuse.org/:splat" - status = 301 - force = true +from = "https://vueuse.js.org/*" +to = "https://vueuse.org/:splat" +status = 301 +force = true [[redirects]] - from = "/*" - to = "/index.html" - status = 200 - +from = "/*" +to = "/index.html" +status = 200 diff --git a/package.json b/package.json index f11578f64d6..4c26b437961 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "version": "10.6.1", "private": true, - "packageManager": "pnpm@8.10.2", + "packageManager": "pnpm@8.11.0", "description": "Collection of essential Vue Composition Utilities", "author": "Anthony Fu", "license": "MIT", @@ -36,75 +36,75 @@ "watch": "esno scripts/build-run.ts --watch" }, "devDependencies": { - "@antfu/eslint-config": "^1.1.0", - "@antfu/ni": "^0.21.8", - "@iconify/json": "^2.2.139", + "@antfu/eslint-config": "^2.3.3", + "@antfu/ni": "^0.21.12", + "@iconify/json": "^2.2.152", "@rollup/plugin-json": "^6.0.1", "@rollup/plugin-replace": "^5.0.5", "@type-challenges/utils": "^0.1.1", "@types/fs-extra": "^11.0.4", "@types/js-yaml": "^4.0.9", "@types/md5": "^2.3.5", - "@types/node": "^20.9.0", + "@types/node": "^20.10.3", "@types/remove-markdown": "^0.3.4", - "@types/semver": "^7.5.5", - "@vitest/coverage-v8": "^0.34.6", - "@vitest/ui": "^0.34.6", - "@vue/compiler-sfc": "^3.3.8", - "@vue/test-utils": "^2.4.1", + "@types/semver": "^7.5.6", + "@vitest/coverage-v8": "^1.0.1", + "@vitest/ui": "^1.0.1", + "@vue/compiler-sfc": "^3.3.10", + "@vue/test-utils": "^2.4.3", "@vueuse/core": "workspace:*", "@vueuse/integrations": "workspace:*", "@vueuse/math": "workspace:*", "@vueuse/rxjs": "workspace:*", "@vueuse/shared": "workspace:*", - "axios": "^1.6.1", + "axios": "^1.6.2", "bumpp": "^9.2.0", "consola": "^3.2.3", "esbuild-register": "^3.5.0", - "eslint": "8.51.0", - "eslint-plugin-antfu": "1.0.0-beta.10", - "esno": "^0.17.0", + "eslint": "^8.55.0", + "eslint-plugin-format": "^0.1.0", + "esno": "^4.0.0", "export-size": "^0.7.0", "fake-indexeddb": "^5.0.1", "fast-glob": "^3.3.2", - "firebase": "^10.6.0", - "fs-extra": "^11.1.1", + "firebase": "^10.7.0", + "fs-extra": "^11.2.0", "fuse.js": "^7.0.0", "google-font-installer": "^1.2.0", "gray-matter": "^4.0.3", "js-yaml": "^4.1.0", - "jsdom": "^22.1.0", - "lint-staged": "^15.0.2", + "jsdom": "^23.0.1", + "lint-staged": "^15.2.0", "markdown-table": "^3.0.3", "md5": "^2.3.0", "msw": "1.0.1", "node-fetch": "^3.3.2", "node-fetch-native": "^1.4.1", "ofetch": "^1.3.3", - "pnpm": "^8.10.2", - "postcss": "^8.4.31", + "pnpm": "^8.11.0", + "postcss": "^8.4.32", "postcss-nested": "^6.0.1", - "prettier": "^3.0.3", + "prettier": "^3.1.0", "prism-theme-vars": "^0.2.4", "remove-markdown": "^0.5.0", "rimraf": "^5.0.5", - "rollup": "^4.3.0", + "rollup": "^4.6.1", "rollup-plugin-dts": "^6.1.0", "rollup-plugin-esbuild": "^6.1.0", "rollup-plugin-pure": "^0.2.1", "sharp": "0.32.6", - "simple-git": "^3.20.0", + "simple-git": "^3.21.0", "simple-git-hooks": "^2.9.0", - "taze": "^0.12.0", - "typescript": "5.2.2", - "unocss": "^0.57.3", - "unplugin-icons": "^0.17.3", - "unplugin-vue-components": "^0.25.2", - "vite": "^4.5.0", - "vite-plugin-inspect": "^0.7.42", - "vite-plugin-pwa": "^0.16.7", - "vitepress": "1.0.0-rc.4", - "vitest": "^0.34.6", + "taze": "^0.13.0", + "typescript": "^5.3.2", + "unocss": "^0.58.0", + "unplugin-icons": "^0.18.1", + "unplugin-vue-components": "^0.26.0", + "vite": "^5.0.5", + "vite-plugin-inspect": "^0.8.1", + "vite-plugin-pwa": "^0.17.3", + "vitepress": "^1.0.0-rc.31", + "vitest": "^1.0.1", "vue": "^3.3.8", "vue2": "npm:vue@^2.7.14" }, @@ -113,9 +113,10 @@ "electron" ], "overrides": { - "magic-string": "^0.30.3", - "sourcemap-codec": "npm:@jridgewell/sourcemap-codec@^1.4.15", - "vue-demi": "0.14.6" + "magic-string": "^0.30.5", + "rollup": "^4.6.1", + "vite": "^5.0.5", + "vue-demi": "^0.14.6" } }, "simple-git-hooks": { diff --git a/packages/.vitepress/plugins/markdownTransform.ts b/packages/.vitepress/plugins/markdownTransform.ts index 704cf84a041..454d30e8453 100644 --- a/packages/.vitepress/plugins/markdownTransform.ts +++ b/packages/.vitepress/plugins/markdownTransform.ts @@ -100,6 +100,9 @@ export async function getFunctionMarkdown(pkg: string, name: string) { const demoPath = ['demo.vue', 'demo.client.vue'].find(i => fs.existsSync(join(dirname, i))) const types = await getTypeDefinition(pkg, name) + if (!types) + console.warn(`No types found for ${pkg}/${name}`) + let typingSection = '' if (types) { diff --git a/packages/.vitepress/theme/components/CourseLink.vue b/packages/.vitepress/theme/components/CourseLink.vue index f87daee711c..c10b0b57f9a 100644 --- a/packages/.vitepress/theme/components/CourseLink.vue +++ b/packages/.vitepress/theme/components/CourseLink.vue @@ -5,7 +5,10 @@ defineProps<{