From 1a4e0ad8d42dee1adf519b536ae9148a791537b2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 8 Jul 2022 14:24:26 +0800 Subject: [PATCH] feat(math)!: move `logicAnd`, `logicOr`, `logicNot` to `@vueuse/math` (#1794) --- packages/add-ons.md | 2 +- packages/integrations/README.md | 2 +- packages/math/index.ts | 3 +++ packages/{shared => math}/logicAnd/index.md | 5 +++-- packages/{shared => math}/logicAnd/index.ts | 4 ++-- packages/{shared => math}/logicNot/index.md | 5 +++-- packages/{shared => math}/logicNot/index.ts | 4 ++-- packages/{shared => math}/logicOr/index.md | 5 +++-- packages/{shared => math}/logicOr/index.ts | 4 ++-- packages/shared/index.ts | 3 --- 10 files changed, 20 insertions(+), 17 deletions(-) rename packages/{shared => math}/logicAnd/index.md (70%) rename packages/{shared => math}/logicAnd/index.ts (76%) rename packages/{shared => math}/logicNot/index.md (62%) rename packages/{shared => math}/logicNot/index.ts (75%) rename packages/{shared => math}/logicOr/index.md (69%) rename packages/{shared => math}/logicOr/index.ts (76%) diff --git a/packages/add-ons.md b/packages/add-ons.md index e041014dfdb..0aaca85296d 100644 --- a/packages/add-ons.md +++ b/packages/add-ons.md @@ -71,7 +71,7 @@ Utilities for vue-router Integration wrappers for utility libraries - [`useAsyncValidator`](https://vueuse.org/integrations/useAsyncValidator/) — wrapper for [`async-validator`](https://github.com/yiminghe/async-validator) - [`useAxios`](https://vueuse.org/integrations/useAxios/) — wrapper for [`axios`](https://github.com/axios/axios) - - [`useChangeCase`](https://vueuse.org/integrations/useChangeCase/) — wrapper for [`change-case`](https://github.com/blakeembrey/change-case) + - [`useChangeCase`](https://vueuse.org/integrations/useChangeCase/) — reactive wrapper for [`change-case`](https://github.com/blakeembrey/change-case) - [`useCookies`](https://vueuse.org/integrations/useCookies/) — wrapper for [`universal-cookie`](https://www.npmjs.com/package/universal-cookie) - [`useDrauu`](https://vueuse.org/integrations/useDrauu/) — reactive instance for [drauu](https://github.com/antfu/drauu) - [`useFocusTrap`](https://vueuse.org/integrations/useFocusTrap/) — reactive wrapper for [`focus-trap`](https://github.com/focus-trap/focus-trap) diff --git a/packages/integrations/README.md b/packages/integrations/README.md index 094e71b7bd2..1b379f5034f 100644 --- a/packages/integrations/README.md +++ b/packages/integrations/README.md @@ -16,7 +16,7 @@ npm i @vueuse/integrations - [`useAsyncValidator`](https://vueuse.org/integrations/useAsyncValidator/) — wrapper for [`async-validator`](https://github.com/yiminghe/async-validator) - [`useAxios`](https://vueuse.org/integrations/useAxios/) — wrapper for [`axios`](https://github.com/axios/axios) - - [`useChangeCase`](https://vueuse.org/integrations/useChangeCase/) — wrapper for [`change-case`](https://github.com/blakeembrey/change-case) + - [`useChangeCase`](https://vueuse.org/integrations/useChangeCase/) — reactive wrapper for [`change-case`](https://github.com/blakeembrey/change-case) - [`useCookies`](https://vueuse.org/integrations/useCookies/) — wrapper for [`universal-cookie`](https://www.npmjs.com/package/universal-cookie) - [`useDrauu`](https://vueuse.org/integrations/useDrauu/) — reactive instance for [drauu](https://github.com/antfu/drauu) - [`useFocusTrap`](https://vueuse.org/integrations/useFocusTrap/) — reactive wrapper for [`focus-trap`](https://github.com/focus-trap/focus-trap) diff --git a/packages/math/index.ts b/packages/math/index.ts index 9b3afb506fa..98964ea05ef 100644 --- a/packages/math/index.ts +++ b/packages/math/index.ts @@ -1 +1,4 @@ +export * from './logicAnd' +export * from './logicNot' +export * from './logicOr' export * from './useProjection' diff --git a/packages/shared/logicAnd/index.md b/packages/math/logicAnd/index.md similarity index 70% rename from packages/shared/logicAnd/index.md rename to packages/math/logicAnd/index.md index 290514a1e47..cf4a022f771 100644 --- a/packages/shared/logicAnd/index.md +++ b/packages/math/logicAnd/index.md @@ -1,5 +1,5 @@ --- -category: Utilities +category: '@Math' alias: and related: logicNot, logicOr --- @@ -11,7 +11,8 @@ related: logicNot, logicOr ## Usage ```ts -import { logicAnd } from '@vueuse/core' +import { logicAnd } from '@vueuse/math' +import { whenever } from '@vueuse/core' const a = ref(true) const b = ref(false) diff --git a/packages/shared/logicAnd/index.ts b/packages/math/logicAnd/index.ts similarity index 76% rename from packages/shared/logicAnd/index.ts rename to packages/math/logicAnd/index.ts index 900893696e2..b776138ffad 100644 --- a/packages/shared/logicAnd/index.ts +++ b/packages/math/logicAnd/index.ts @@ -1,7 +1,7 @@ import type { ComputedRef } from 'vue-demi' import { computed } from 'vue-demi' -import { resolveUnref } from '../resolveUnref' -import type { MaybeComputedRef } from '../utils' +import { resolveUnref } from '@vueuse/shared' +import type { MaybeComputedRef } from '@vueuse/shared' /** * `AND` conditions for refs. diff --git a/packages/shared/logicNot/index.md b/packages/math/logicNot/index.md similarity index 62% rename from packages/shared/logicNot/index.md rename to packages/math/logicNot/index.md index 4c848cfc758..2c78b85a5d4 100644 --- a/packages/shared/logicNot/index.md +++ b/packages/math/logicNot/index.md @@ -1,5 +1,5 @@ --- -category: Utilities +category: '@Math' alias: not --- @@ -10,7 +10,8 @@ alias: not ## Usage ```ts -import { logicNot } from '@vueuse/core' +import { logicNot } from '@vueuse/math' +import { whenever } from '@vueuse/core' const a = ref(true) diff --git a/packages/shared/logicNot/index.ts b/packages/math/logicNot/index.ts similarity index 75% rename from packages/shared/logicNot/index.ts rename to packages/math/logicNot/index.ts index 93295023f48..c214ba18052 100644 --- a/packages/shared/logicNot/index.ts +++ b/packages/math/logicNot/index.ts @@ -1,7 +1,7 @@ import type { ComputedRef } from 'vue-demi' import { computed } from 'vue-demi' -import { resolveUnref } from '../resolveUnref' -import type { MaybeComputedRef } from '../utils' +import { resolveUnref } from '@vueuse/shared' +import type { MaybeComputedRef } from '@vueuse/shared' /** * `NOT` conditions for refs. diff --git a/packages/shared/logicOr/index.md b/packages/math/logicOr/index.md similarity index 69% rename from packages/shared/logicOr/index.md rename to packages/math/logicOr/index.md index 3d269f9e249..23b7b99fe14 100644 --- a/packages/shared/logicOr/index.md +++ b/packages/math/logicOr/index.md @@ -1,5 +1,5 @@ --- -category: Utilities +category: '@Math' alias: or related: logicAnd, logicNot --- @@ -11,7 +11,8 @@ related: logicAnd, logicNot ## Usage ```ts -import { logicOr } from '@vueuse/core' +import { logicOr } from '@vueuse/math' +import { whenever } from '@vueuse/core' const a = ref(true) const b = ref(false) diff --git a/packages/shared/logicOr/index.ts b/packages/math/logicOr/index.ts similarity index 76% rename from packages/shared/logicOr/index.ts rename to packages/math/logicOr/index.ts index 997eb95ffcd..d5ef82b43ac 100644 --- a/packages/shared/logicOr/index.ts +++ b/packages/math/logicOr/index.ts @@ -1,7 +1,7 @@ import type { ComputedRef } from 'vue-demi' import { computed } from 'vue-demi' -import { resolveUnref } from '../resolveUnref' -import type { MaybeComputedRef } from '../utils' +import { resolveUnref } from '@vueuse/shared' +import type { MaybeComputedRef } from '@vueuse/shared' /** * `OR` conditions for refs. diff --git a/packages/shared/index.ts b/packages/shared/index.ts index c0e5795d66c..16e60331e7a 100644 --- a/packages/shared/index.ts +++ b/packages/shared/index.ts @@ -7,9 +7,6 @@ export * from './createSharedComposable' export * from './extendRef' export * from './get' export * from './isDefined' -export * from './logicAnd' -export * from './logicNot' -export * from './logicOr' export * from './makeDestructurable' export * from './reactify' export * from './reactifyObject'