diff --git a/.changeset/fuzzy-spies-film.md b/.changeset/fuzzy-spies-film.md new file mode 100644 index 00000000..7914d44c --- /dev/null +++ b/.changeset/fuzzy-spies-film.md @@ -0,0 +1,5 @@ +--- +"runed": patch +--- + +breaking: remove `IsSupported` diff --git a/packages/runed/src/lib/utilities/AnimationFrames/index.ts b/packages/runed/src/lib/utilities/AnimationFrames/index.ts deleted file mode 100644 index 8ba0dd46..00000000 --- a/packages/runed/src/lib/utilities/AnimationFrames/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./AnimationFrames.svelte.js"; diff --git a/packages/runed/src/lib/utilities/Context/index.ts b/packages/runed/src/lib/utilities/Context/index.ts deleted file mode 100644 index efc2f504..00000000 --- a/packages/runed/src/lib/utilities/Context/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Context } from "./Context.js"; diff --git a/packages/runed/src/lib/utilities/Debounced/index.ts b/packages/runed/src/lib/utilities/Debounced/index.ts deleted file mode 100644 index acaa123f..00000000 --- a/packages/runed/src/lib/utilities/Debounced/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Debounced.svelte.js"; diff --git a/packages/runed/src/lib/utilities/ElementRect/index.ts b/packages/runed/src/lib/utilities/ElementRect/index.ts deleted file mode 100644 index 1dff9d11..00000000 --- a/packages/runed/src/lib/utilities/ElementRect/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ElementRect } from "./ElementRect.svelte.js"; diff --git a/packages/runed/src/lib/utilities/ElementSize/index.ts b/packages/runed/src/lib/utilities/ElementSize/index.ts deleted file mode 100644 index e95f7aa1..00000000 --- a/packages/runed/src/lib/utilities/ElementSize/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ElementSize.svelte.js"; diff --git a/packages/runed/src/lib/utilities/FiniteStateMachine/index.ts b/packages/runed/src/lib/utilities/FiniteStateMachine/index.ts deleted file mode 100644 index 168b82a2..00000000 --- a/packages/runed/src/lib/utilities/FiniteStateMachine/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./FiniteStateMachine.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsFocusWithin/index.ts b/packages/runed/src/lib/utilities/IsFocusWithin/index.ts deleted file mode 100644 index 3162a475..00000000 --- a/packages/runed/src/lib/utilities/IsFocusWithin/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./IsFocusWithin.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsIdle/index.ts b/packages/runed/src/lib/utilities/IsIdle/index.ts deleted file mode 100644 index 98058a0a..00000000 --- a/packages/runed/src/lib/utilities/IsIdle/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./IsIdle.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsInViewport/index.ts b/packages/runed/src/lib/utilities/IsInViewport/index.ts deleted file mode 100644 index 359c2ec4..00000000 --- a/packages/runed/src/lib/utilities/IsInViewport/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./IsInViewport.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsMounted/index.ts b/packages/runed/src/lib/utilities/IsMounted/index.ts deleted file mode 100644 index 563269b4..00000000 --- a/packages/runed/src/lib/utilities/IsMounted/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./IsMounted.svelte.js"; diff --git a/packages/runed/src/lib/utilities/PersistedState/index.ts b/packages/runed/src/lib/utilities/PersistedState/index.ts deleted file mode 100644 index 6c1ab3ff..00000000 --- a/packages/runed/src/lib/utilities/PersistedState/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./PersistedState.svelte.js"; diff --git a/packages/runed/src/lib/utilities/PressedKeys/index.ts b/packages/runed/src/lib/utilities/PressedKeys/index.ts deleted file mode 100644 index 390fb310..00000000 --- a/packages/runed/src/lib/utilities/PressedKeys/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { PressedKeys } from "./PressedKeys.svelte.js"; diff --git a/packages/runed/src/lib/utilities/Previous/index.ts b/packages/runed/src/lib/utilities/Previous/index.ts deleted file mode 100644 index d277a1b2..00000000 --- a/packages/runed/src/lib/utilities/Previous/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Previous.svelte.js"; diff --git a/packages/runed/src/lib/utilities/StateHistory/index.ts b/packages/runed/src/lib/utilities/StateHistory/index.ts deleted file mode 100644 index 9656b718..00000000 --- a/packages/runed/src/lib/utilities/StateHistory/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./StateHistory.svelte.js"; diff --git a/packages/runed/src/lib/utilities/activeElement/activeElement.svelte.ts b/packages/runed/src/lib/utilities/active-element/active-element.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/activeElement/activeElement.svelte.ts rename to packages/runed/src/lib/utilities/active-element/active-element.svelte.ts diff --git a/packages/runed/src/lib/utilities/activeElement/ActiveElement.test.svelte.ts b/packages/runed/src/lib/utilities/active-element/active-element.test.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/activeElement/ActiveElement.test.svelte.ts rename to packages/runed/src/lib/utilities/active-element/active-element.test.svelte.ts diff --git a/packages/runed/src/lib/utilities/active-element/index.ts b/packages/runed/src/lib/utilities/active-element/index.ts new file mode 100644 index 00000000..2088da81 --- /dev/null +++ b/packages/runed/src/lib/utilities/active-element/index.ts @@ -0,0 +1 @@ +export * from "./active-element.svelte.js"; diff --git a/packages/runed/src/lib/utilities/activeElement/index.ts b/packages/runed/src/lib/utilities/activeElement/index.ts deleted file mode 100644 index 31a52974..00000000 --- a/packages/runed/src/lib/utilities/activeElement/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./activeElement.svelte.js"; diff --git a/packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts b/packages/runed/src/lib/utilities/animation-frames/animation-frames.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/AnimationFrames/AnimationFrames.svelte.ts rename to packages/runed/src/lib/utilities/animation-frames/animation-frames.svelte.ts diff --git a/packages/runed/src/lib/utilities/animation-frames/index.ts b/packages/runed/src/lib/utilities/animation-frames/index.ts new file mode 100644 index 00000000..9620b836 --- /dev/null +++ b/packages/runed/src/lib/utilities/animation-frames/index.ts @@ -0,0 +1 @@ +export * from "./animation-frames.svelte.js"; diff --git a/packages/runed/src/lib/utilities/Context/Context.ts b/packages/runed/src/lib/utilities/context/context.ts similarity index 100% rename from packages/runed/src/lib/utilities/Context/Context.ts rename to packages/runed/src/lib/utilities/context/context.ts diff --git a/packages/runed/src/lib/utilities/context/index.ts b/packages/runed/src/lib/utilities/context/index.ts new file mode 100644 index 00000000..1244f57a --- /dev/null +++ b/packages/runed/src/lib/utilities/context/index.ts @@ -0,0 +1 @@ +export { Context } from "./context.js"; diff --git a/packages/runed/src/lib/utilities/Debounced/Debounced.svelte.ts b/packages/runed/src/lib/utilities/debounced/debounced.svelte.ts similarity index 96% rename from packages/runed/src/lib/utilities/Debounced/Debounced.svelte.ts rename to packages/runed/src/lib/utilities/debounced/debounced.svelte.ts index a7fc8a25..06ede2ed 100644 --- a/packages/runed/src/lib/utilities/Debounced/Debounced.svelte.ts +++ b/packages/runed/src/lib/utilities/debounced/debounced.svelte.ts @@ -1,4 +1,4 @@ -import { useDebounce } from "../useDebounce/useDebounce.svelte.js"; +import { useDebounce } from "../use-debounce/use-debounce.svelte.js"; import { watch } from "../watch/watch.svelte.js"; import type { Getter, MaybeGetter } from "$lib/internal/types.js"; import { noop } from "$lib/internal/utils/function.js"; diff --git a/packages/runed/src/lib/utilities/Debounced/Debounced.test.svelte.ts b/packages/runed/src/lib/utilities/debounced/debounced.test.svelte.ts similarity index 96% rename from packages/runed/src/lib/utilities/Debounced/Debounced.test.svelte.ts rename to packages/runed/src/lib/utilities/debounced/debounced.test.svelte.ts index 44e43266..50ddda40 100644 --- a/packages/runed/src/lib/utilities/Debounced/Debounced.test.svelte.ts +++ b/packages/runed/src/lib/utilities/debounced/debounced.test.svelte.ts @@ -1,5 +1,5 @@ import { describe, expect } from "vitest"; -import { Debounced } from "./Debounced.svelte.js"; +import { Debounced } from "./index.js"; import { testWithEffect } from "$lib/test/util.svelte.js"; describe("Debounced", () => { diff --git a/packages/runed/src/lib/utilities/debounced/index.ts b/packages/runed/src/lib/utilities/debounced/index.ts new file mode 100644 index 00000000..2d8afc47 --- /dev/null +++ b/packages/runed/src/lib/utilities/debounced/index.ts @@ -0,0 +1 @@ +export * from "./debounced.svelte.js"; diff --git a/packages/runed/src/lib/utilities/ElementRect/ElementRect.svelte.ts b/packages/runed/src/lib/utilities/element-rect/element-rect.svelte.ts similarity index 92% rename from packages/runed/src/lib/utilities/ElementRect/ElementRect.svelte.ts rename to packages/runed/src/lib/utilities/element-rect/element-rect.svelte.ts index 3ed07f6a..0e3d5d50 100644 --- a/packages/runed/src/lib/utilities/ElementRect/ElementRect.svelte.ts +++ b/packages/runed/src/lib/utilities/element-rect/element-rect.svelte.ts @@ -1,6 +1,6 @@ import { extract } from "../extract/extract.svelte.js"; -import { useMutationObserver } from "../useMutationObserver/useMutationObserver.svelte.js"; -import { useResizeObserver } from "../useResizeObserver/useResizeObserver.svelte.js"; +import { useMutationObserver } from "../use-mutation-observer/use-mutation-observer.svelte.js"; +import { useResizeObserver } from "../use-resize-observer/use-resize-observer.svelte.js"; import type { MaybeElementGetter, WritableProperties } from "$lib/internal/types.js"; import type { ConfigurableWindow } from "$lib/internal/configurable-globals.js"; diff --git a/packages/runed/src/lib/utilities/element-rect/index.ts b/packages/runed/src/lib/utilities/element-rect/index.ts new file mode 100644 index 00000000..d66f2078 --- /dev/null +++ b/packages/runed/src/lib/utilities/element-rect/index.ts @@ -0,0 +1 @@ +export { ElementRect } from "./element-rect.svelte.js"; diff --git a/packages/runed/src/lib/utilities/ElementSize/ElementSize.svelte.ts b/packages/runed/src/lib/utilities/element-size/element-size.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/ElementSize/ElementSize.svelte.ts rename to packages/runed/src/lib/utilities/element-size/element-size.svelte.ts diff --git a/packages/runed/src/lib/utilities/element-size/index.ts b/packages/runed/src/lib/utilities/element-size/index.ts new file mode 100644 index 00000000..42f14866 --- /dev/null +++ b/packages/runed/src/lib/utilities/element-size/index.ts @@ -0,0 +1 @@ +export * from "./element-size.svelte.js"; diff --git a/packages/runed/src/lib/utilities/FiniteStateMachine/FiniteStateMachine.svelte.ts b/packages/runed/src/lib/utilities/finite-state-machine/finite-state-machine.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/FiniteStateMachine/FiniteStateMachine.svelte.ts rename to packages/runed/src/lib/utilities/finite-state-machine/finite-state-machine.svelte.ts diff --git a/packages/runed/src/lib/utilities/FiniteStateMachine/FiniteStateMachine.test.svelte.ts b/packages/runed/src/lib/utilities/finite-state-machine/finite-state-machine.test.svelte.ts similarity index 99% rename from packages/runed/src/lib/utilities/FiniteStateMachine/FiniteStateMachine.test.svelte.ts rename to packages/runed/src/lib/utilities/finite-state-machine/finite-state-machine.test.svelte.ts index 9703d374..a9374a93 100644 --- a/packages/runed/src/lib/utilities/FiniteStateMachine/FiniteStateMachine.test.svelte.ts +++ b/packages/runed/src/lib/utilities/finite-state-machine/finite-state-machine.test.svelte.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import { type Action, FiniteStateMachine } from "./FiniteStateMachine.svelte.js"; +import { type Action, FiniteStateMachine } from "./finite-state-machine.svelte.js"; describe("FiniteStateMachine", () => { describe("simple toggle switch", () => { diff --git a/packages/runed/src/lib/utilities/finite-state-machine/index.ts b/packages/runed/src/lib/utilities/finite-state-machine/index.ts new file mode 100644 index 00000000..8935ec7d --- /dev/null +++ b/packages/runed/src/lib/utilities/finite-state-machine/index.ts @@ -0,0 +1 @@ +export * from "./finite-state-machine.svelte.js"; diff --git a/packages/runed/src/lib/utilities/index.ts b/packages/runed/src/lib/utilities/index.ts index ca7ed246..2b36e79d 100644 --- a/packages/runed/src/lib/utilities/index.ts +++ b/packages/runed/src/lib/utilities/index.ts @@ -1,23 +1,23 @@ -export * from "./activeElement/index.js"; -export * from "./onClickOutside/index.js"; -export * from "./useDebounce/index.js"; -export * from "./ElementSize/index.js"; -export * from "./useEventListener/index.js"; -export * from "./IsIdle/index.js"; -export * from "./IsMounted/index.js"; -export * from "./StateHistory/index.js"; -export * from "./Previous/index.js"; +export * from "./active-element/index.js"; +export * from "./on-click-outside/index.js"; +export * from "./use-debounce/index.js"; +export * from "./element-size/index.js"; +export * from "./use-event-listener/index.js"; +export * from "./is-idle/index.js"; +export * from "./is-mounted/index.js"; +export * from "./state-history/index.js"; +export * from "./previous/index.js"; export * from "./watch/index.js"; -export * from "./Debounced/index.js"; -export * from "./PressedKeys/index.js"; -export * from "./ElementRect/index.js"; -export * from "./useMutationObserver/index.js"; -export * from "./useResizeObserver/index.js"; -export * from "./AnimationFrames/index.js"; -export * from "./useIntersectionObserver/index.js"; -export * from "./IsFocusWithin/index.js"; -export * from "./FiniteStateMachine/index.js"; -export * from "./PersistedState/index.js"; -export * from "./useGeolocation/index.js"; -export * from "./Context/index.js"; -export * from "./IsInViewport/index.js"; +export * from "./debounced/index.js"; +export * from "./pressed-keys/index.js"; +export * from "./element-rect/index.js"; +export * from "./use-mutation-observer/index.js"; +export * from "./use-resize-observer/index.js"; +export * from "./animation-frames/index.js"; +export * from "./use-intersection-observer/index.js"; +export * from "./is-focus-within/index.js"; +export * from "./finite-state-machine/index.js"; +export * from "./persisted-state/index.js"; +export * from "./use-geolocation/index.js"; +export * from "./context/index.js"; +export * from "./is-in-viewport/index.js"; diff --git a/packages/runed/src/lib/utilities/is-focus-within/index.ts b/packages/runed/src/lib/utilities/is-focus-within/index.ts new file mode 100644 index 00000000..ee30c5d3 --- /dev/null +++ b/packages/runed/src/lib/utilities/is-focus-within/index.ts @@ -0,0 +1 @@ +export * from "./is-focus-within.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsFocusWithin/IsFocusWithin.svelte.ts b/packages/runed/src/lib/utilities/is-focus-within/is-focus-within.svelte.ts similarity index 87% rename from packages/runed/src/lib/utilities/IsFocusWithin/IsFocusWithin.svelte.ts rename to packages/runed/src/lib/utilities/is-focus-within/is-focus-within.svelte.ts index d35466a8..0e713840 100644 --- a/packages/runed/src/lib/utilities/IsFocusWithin/IsFocusWithin.svelte.ts +++ b/packages/runed/src/lib/utilities/is-focus-within/is-focus-within.svelte.ts @@ -1,5 +1,8 @@ import type { MaybeElementGetter } from "$lib/internal/types.js"; -import { ActiveElement, type ActiveElementOptions } from "../activeElement/activeElement.svelte.js"; +import { + ActiveElement, + type ActiveElementOptions, +} from "../active-element/active-element.svelte.js"; import { extract } from "../extract/extract.svelte.js"; export interface IsFocusWithinOptions extends ActiveElementOptions {} diff --git a/packages/runed/src/lib/utilities/IsFocusWithin/IsFocusWithin.test.svelte.ts b/packages/runed/src/lib/utilities/is-focus-within/is-focus-within.test.svelte.ts similarity index 98% rename from packages/runed/src/lib/utilities/IsFocusWithin/IsFocusWithin.test.svelte.ts rename to packages/runed/src/lib/utilities/is-focus-within/is-focus-within.test.svelte.ts index cd3be683..ef42e7d0 100644 --- a/packages/runed/src/lib/utilities/IsFocusWithin/IsFocusWithin.test.svelte.ts +++ b/packages/runed/src/lib/utilities/is-focus-within/is-focus-within.test.svelte.ts @@ -1,6 +1,6 @@ import { effectRootScope } from "$lib/test/util.svelte.js"; import { describe, expect } from "vitest"; -import { IsFocusWithin } from "./IsFocusWithin.svelte.js"; +import { IsFocusWithin } from "./is-focus-within.svelte.js"; describe("IsFocusWithin", () => { let shadowHost: HTMLElement; diff --git a/packages/runed/src/lib/utilities/is-idle/index.ts b/packages/runed/src/lib/utilities/is-idle/index.ts new file mode 100644 index 00000000..8229534a --- /dev/null +++ b/packages/runed/src/lib/utilities/is-idle/index.ts @@ -0,0 +1 @@ +export * from "./is-idle.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsIdle/IsIdle.svelte.ts b/packages/runed/src/lib/utilities/is-idle/is-idle.svelte.ts similarity index 94% rename from packages/runed/src/lib/utilities/IsIdle/IsIdle.svelte.ts rename to packages/runed/src/lib/utilities/is-idle/is-idle.svelte.ts index d127821e..0b671372 100644 --- a/packages/runed/src/lib/utilities/IsIdle/IsIdle.svelte.ts +++ b/packages/runed/src/lib/utilities/is-idle/is-idle.svelte.ts @@ -1,7 +1,7 @@ import { extract } from "../extract/index.js"; -import { useDebounce } from "../useDebounce/index.js"; +import { useDebounce } from "../use-debounce/index.js"; import type { MaybeGetter } from "$lib/internal/types.js"; -import { useEventListener } from "$lib/utilities/useEventListener/useEventListener.svelte.js"; +import { useEventListener } from "$lib/utilities/use-event-listener/use-event-listener.svelte.js"; import { defaultWindow, type ConfigurableDocument, diff --git a/packages/runed/src/lib/utilities/IsIdle/IsIdle.test.svelte.ts b/packages/runed/src/lib/utilities/is-idle/is-idle.test.svelte.ts similarity index 97% rename from packages/runed/src/lib/utilities/IsIdle/IsIdle.test.svelte.ts rename to packages/runed/src/lib/utilities/is-idle/is-idle.test.svelte.ts index d96fae5a..de52b038 100644 --- a/packages/runed/src/lib/utilities/IsIdle/IsIdle.test.svelte.ts +++ b/packages/runed/src/lib/utilities/is-idle/is-idle.test.svelte.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { IsIdle } from "./IsIdle.svelte.js"; +import { IsIdle } from "./is-idle.svelte.js"; import { testWithEffect, vitestSetTimeoutWrapper } from "$lib/test/util.svelte.js"; describe("IsIdle", () => { diff --git a/packages/runed/src/lib/utilities/is-in-viewport/index.ts b/packages/runed/src/lib/utilities/is-in-viewport/index.ts new file mode 100644 index 00000000..b0ee7bc8 --- /dev/null +++ b/packages/runed/src/lib/utilities/is-in-viewport/index.ts @@ -0,0 +1 @@ +export * from "./is-in-viewport.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsInViewport/IsInViewport.svelte.ts b/packages/runed/src/lib/utilities/is-in-viewport/is-in-viewport.svelte.ts similarity index 93% rename from packages/runed/src/lib/utilities/IsInViewport/IsInViewport.svelte.ts rename to packages/runed/src/lib/utilities/is-in-viewport/is-in-viewport.svelte.ts index 498e80a2..b045da63 100644 --- a/packages/runed/src/lib/utilities/IsInViewport/IsInViewport.svelte.ts +++ b/packages/runed/src/lib/utilities/is-in-viewport/is-in-viewport.svelte.ts @@ -3,7 +3,7 @@ import type { MaybeElementGetter } from "$lib/internal/types.js"; import { useIntersectionObserver, type UseIntersectionObserverOptions, -} from "../useIntersectionObserver/useIntersectionObserver.svelte.js"; +} from "../use-intersection-observer/use-intersection-observer.svelte.js"; export type IsInViewportOptions = ConfigurableWindow & UseIntersectionObserverOptions; diff --git a/packages/runed/src/lib/utilities/is-mounted/index.ts b/packages/runed/src/lib/utilities/is-mounted/index.ts new file mode 100644 index 00000000..c573eaaf --- /dev/null +++ b/packages/runed/src/lib/utilities/is-mounted/index.ts @@ -0,0 +1 @@ +export * from "./is-mounted.svelte.js"; diff --git a/packages/runed/src/lib/utilities/IsMounted/IsMounted.svelte.ts b/packages/runed/src/lib/utilities/is-mounted/is-mounted.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/IsMounted/IsMounted.svelte.ts rename to packages/runed/src/lib/utilities/is-mounted/is-mounted.svelte.ts diff --git a/packages/runed/src/lib/utilities/on-click-outside/index.ts b/packages/runed/src/lib/utilities/on-click-outside/index.ts new file mode 100644 index 00000000..e83b9fe4 --- /dev/null +++ b/packages/runed/src/lib/utilities/on-click-outside/index.ts @@ -0,0 +1 @@ +export * from "./on-click-outside.svelte.js"; diff --git a/packages/runed/src/lib/utilities/onClickOutside/onClickOutside.svelte.ts b/packages/runed/src/lib/utilities/on-click-outside/on-click-outside.svelte.ts similarity index 99% rename from packages/runed/src/lib/utilities/onClickOutside/onClickOutside.svelte.ts rename to packages/runed/src/lib/utilities/on-click-outside/on-click-outside.svelte.ts index 191223a7..fac5da42 100644 --- a/packages/runed/src/lib/utilities/onClickOutside/onClickOutside.svelte.ts +++ b/packages/runed/src/lib/utilities/on-click-outside/on-click-outside.svelte.ts @@ -10,7 +10,7 @@ import { isElement } from "$lib/internal/utils/is.js"; import { sleep } from "$lib/internal/utils/sleep.js"; import { on } from "svelte/events"; import { extract } from "../extract/extract.svelte.js"; -import { useDebounce } from "../useDebounce/useDebounce.svelte.js"; +import { useDebounce } from "../use-debounce/use-debounce.svelte.js"; import { watch } from "../watch/watch.svelte.js"; export type OnClickOutsideOptions = ConfigurableWindow & diff --git a/packages/runed/src/lib/utilities/onClickOutside/onClickOutside.test.svelte.ts b/packages/runed/src/lib/utilities/on-click-outside/on-click-outside.test.svelte.ts similarity index 99% rename from packages/runed/src/lib/utilities/onClickOutside/onClickOutside.test.svelte.ts rename to packages/runed/src/lib/utilities/on-click-outside/on-click-outside.test.svelte.ts index ecc26ba0..6141db78 100644 --- a/packages/runed/src/lib/utilities/onClickOutside/onClickOutside.test.svelte.ts +++ b/packages/runed/src/lib/utilities/on-click-outside/on-click-outside.test.svelte.ts @@ -1,6 +1,6 @@ import { describe, expect, vi, beforeEach, afterEach } from "vitest"; import { tick } from "svelte"; -import { onClickOutside } from "./onClickOutside.svelte.js"; +import { onClickOutside } from "./on-click-outside.svelte.js"; import { testWithEffect } from "$lib/test/util.svelte.js"; describe("onClickOutside", () => { diff --git a/packages/runed/src/lib/utilities/onClickOutside/index.ts b/packages/runed/src/lib/utilities/onClickOutside/index.ts deleted file mode 100644 index e5dbf1be..00000000 --- a/packages/runed/src/lib/utilities/onClickOutside/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./onClickOutside.svelte.js"; diff --git a/packages/runed/src/lib/utilities/persisted-state/index.ts b/packages/runed/src/lib/utilities/persisted-state/index.ts new file mode 100644 index 00000000..062847f8 --- /dev/null +++ b/packages/runed/src/lib/utilities/persisted-state/index.ts @@ -0,0 +1 @@ +export * from "./persisted-state.svelte.js"; diff --git a/packages/runed/src/lib/utilities/PersistedState/PersistedState.svelte.ts b/packages/runed/src/lib/utilities/persisted-state/persisted-state.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/PersistedState/PersistedState.svelte.ts rename to packages/runed/src/lib/utilities/persisted-state/persisted-state.svelte.ts diff --git a/packages/runed/src/lib/utilities/PersistedState/PersistedState.test.svelte.ts b/packages/runed/src/lib/utilities/persisted-state/persisted-state.test.svelte.ts similarity index 98% rename from packages/runed/src/lib/utilities/PersistedState/PersistedState.test.svelte.ts rename to packages/runed/src/lib/utilities/persisted-state/persisted-state.test.svelte.ts index 0371ba55..9a0b462f 100644 --- a/packages/runed/src/lib/utilities/PersistedState/PersistedState.test.svelte.ts +++ b/packages/runed/src/lib/utilities/persisted-state/persisted-state.test.svelte.ts @@ -1,7 +1,7 @@ import { describe, expect } from "vitest"; import { testWithEffect } from "$lib/test/util.svelte.js"; -import { PersistedState } from "./PersistedState.svelte.js"; +import { PersistedState } from "./persisted-state.svelte.js"; const key = "test-key"; const initialValue = "test-value"; diff --git a/packages/runed/src/lib/utilities/pressed-keys/index.ts b/packages/runed/src/lib/utilities/pressed-keys/index.ts new file mode 100644 index 00000000..8cb62f38 --- /dev/null +++ b/packages/runed/src/lib/utilities/pressed-keys/index.ts @@ -0,0 +1 @@ +export { PressedKeys } from "./pressed-keys.svelte.js"; diff --git a/packages/runed/src/lib/utilities/PressedKeys/PressedKeys.svelte.ts b/packages/runed/src/lib/utilities/pressed-keys/pressed-keys.svelte.ts similarity index 92% rename from packages/runed/src/lib/utilities/PressedKeys/PressedKeys.svelte.ts rename to packages/runed/src/lib/utilities/pressed-keys/pressed-keys.svelte.ts index 130b25fa..6d027875 100644 --- a/packages/runed/src/lib/utilities/PressedKeys/PressedKeys.svelte.ts +++ b/packages/runed/src/lib/utilities/pressed-keys/pressed-keys.svelte.ts @@ -1,5 +1,5 @@ import { defaultWindow, type ConfigurableWindow } from "$lib/internal/configurable-globals.js"; -import { useEventListener } from "../useEventListener/useEventListener.svelte.js"; +import { useEventListener } from "../use-event-listener/use-event-listener.svelte.js"; export type PressedKeysOptions = ConfigurableWindow; /** diff --git a/packages/runed/src/lib/utilities/previous/index.ts b/packages/runed/src/lib/utilities/previous/index.ts new file mode 100644 index 00000000..9c45eae4 --- /dev/null +++ b/packages/runed/src/lib/utilities/previous/index.ts @@ -0,0 +1 @@ +export * from "./previous.svelte.js"; diff --git a/packages/runed/src/lib/utilities/Previous/Previous.svelte.ts b/packages/runed/src/lib/utilities/previous/previous.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/Previous/Previous.svelte.ts rename to packages/runed/src/lib/utilities/previous/previous.svelte.ts diff --git a/packages/runed/src/lib/utilities/Previous/Previous.test.svelte.ts b/packages/runed/src/lib/utilities/previous/previous.test.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/Previous/Previous.test.svelte.ts rename to packages/runed/src/lib/utilities/previous/previous.test.svelte.ts diff --git a/packages/runed/src/lib/utilities/state-history/index.ts b/packages/runed/src/lib/utilities/state-history/index.ts new file mode 100644 index 00000000..a0c4565d --- /dev/null +++ b/packages/runed/src/lib/utilities/state-history/index.ts @@ -0,0 +1 @@ +export * from "./state-history.svelte.js"; diff --git a/packages/runed/src/lib/utilities/StateHistory/StateHistory.svelte.ts b/packages/runed/src/lib/utilities/state-history/state-history.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/StateHistory/StateHistory.svelte.ts rename to packages/runed/src/lib/utilities/state-history/state-history.svelte.ts diff --git a/packages/runed/src/lib/utilities/StateHistory/StateHistory.test.svelte.ts b/packages/runed/src/lib/utilities/state-history/state-history.test.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/StateHistory/StateHistory.test.svelte.ts rename to packages/runed/src/lib/utilities/state-history/state-history.test.svelte.ts diff --git a/packages/runed/src/lib/utilities/use-debounce/index.ts b/packages/runed/src/lib/utilities/use-debounce/index.ts new file mode 100644 index 00000000..1b167be0 --- /dev/null +++ b/packages/runed/src/lib/utilities/use-debounce/index.ts @@ -0,0 +1 @@ +export * from "./use-debounce.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useDebounce/useDebounce.svelte.ts b/packages/runed/src/lib/utilities/use-debounce/use-debounce.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/useDebounce/useDebounce.svelte.ts rename to packages/runed/src/lib/utilities/use-debounce/use-debounce.svelte.ts diff --git a/packages/runed/src/lib/utilities/useDebounce/useDebounce.test.svelte.ts b/packages/runed/src/lib/utilities/use-debounce/use-debounce.test.svelte.ts similarity index 98% rename from packages/runed/src/lib/utilities/useDebounce/useDebounce.test.svelte.ts rename to packages/runed/src/lib/utilities/use-debounce/use-debounce.test.svelte.ts index 46c64ed9..d9619b4a 100644 --- a/packages/runed/src/lib/utilities/useDebounce/useDebounce.test.svelte.ts +++ b/packages/runed/src/lib/utilities/use-debounce/use-debounce.test.svelte.ts @@ -1,5 +1,5 @@ import { describe, expect, vi } from "vitest"; -import { useDebounce } from "./useDebounce.svelte.js"; +import { useDebounce } from "./use-debounce.svelte.js"; import { testWithEffect } from "$lib/test/util.svelte.js"; describe("useDebounce", () => { diff --git a/packages/runed/src/lib/utilities/use-event-listener/index.ts b/packages/runed/src/lib/utilities/use-event-listener/index.ts new file mode 100644 index 00000000..4e5c0750 --- /dev/null +++ b/packages/runed/src/lib/utilities/use-event-listener/index.ts @@ -0,0 +1 @@ +export * from "./use-event-listener.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useEventListener/useEventListener.svelte.ts b/packages/runed/src/lib/utilities/use-event-listener/use-event-listener.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/useEventListener/useEventListener.svelte.ts rename to packages/runed/src/lib/utilities/use-event-listener/use-event-listener.svelte.ts diff --git a/packages/runed/src/lib/utilities/use-geolocation/index.ts b/packages/runed/src/lib/utilities/use-geolocation/index.ts new file mode 100644 index 00000000..17cc63e7 --- /dev/null +++ b/packages/runed/src/lib/utilities/use-geolocation/index.ts @@ -0,0 +1 @@ +export * from "./use-geolocation.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useGeolocation/useGeolocation.svelte.ts b/packages/runed/src/lib/utilities/use-geolocation/use-geolocation.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/useGeolocation/useGeolocation.svelte.ts rename to packages/runed/src/lib/utilities/use-geolocation/use-geolocation.svelte.ts diff --git a/packages/runed/src/lib/utilities/use-intersection-observer/index.ts b/packages/runed/src/lib/utilities/use-intersection-observer/index.ts new file mode 100644 index 00000000..d972de5d --- /dev/null +++ b/packages/runed/src/lib/utilities/use-intersection-observer/index.ts @@ -0,0 +1 @@ +export * from "./use-intersection-observer.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useIntersectionObserver/useIntersectionObserver.svelte.ts b/packages/runed/src/lib/utilities/use-intersection-observer/use-intersection-observer.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/useIntersectionObserver/useIntersectionObserver.svelte.ts rename to packages/runed/src/lib/utilities/use-intersection-observer/use-intersection-observer.svelte.ts diff --git a/packages/runed/src/lib/utilities/use-mutation-observer/index.ts b/packages/runed/src/lib/utilities/use-mutation-observer/index.ts new file mode 100644 index 00000000..8a936015 --- /dev/null +++ b/packages/runed/src/lib/utilities/use-mutation-observer/index.ts @@ -0,0 +1 @@ +export * from "./use-mutation-observer.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useMutationObserver/useMutationObserver.svelte.ts b/packages/runed/src/lib/utilities/use-mutation-observer/use-mutation-observer.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/useMutationObserver/useMutationObserver.svelte.ts rename to packages/runed/src/lib/utilities/use-mutation-observer/use-mutation-observer.svelte.ts diff --git a/packages/runed/src/lib/utilities/use-resize-observer/index.ts b/packages/runed/src/lib/utilities/use-resize-observer/index.ts new file mode 100644 index 00000000..532ba69d --- /dev/null +++ b/packages/runed/src/lib/utilities/use-resize-observer/index.ts @@ -0,0 +1 @@ +export { useResizeObserver } from "./use-resize-observer.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useResizeObserver/useResizeObserver.svelte.ts b/packages/runed/src/lib/utilities/use-resize-observer/use-resize-observer.svelte.ts similarity index 100% rename from packages/runed/src/lib/utilities/useResizeObserver/useResizeObserver.svelte.ts rename to packages/runed/src/lib/utilities/use-resize-observer/use-resize-observer.svelte.ts diff --git a/packages/runed/src/lib/utilities/useDebounce/index.ts b/packages/runed/src/lib/utilities/useDebounce/index.ts deleted file mode 100644 index d8279f17..00000000 --- a/packages/runed/src/lib/utilities/useDebounce/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./useDebounce.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useEventListener/index.ts b/packages/runed/src/lib/utilities/useEventListener/index.ts deleted file mode 100644 index 4455e9d1..00000000 --- a/packages/runed/src/lib/utilities/useEventListener/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./useEventListener.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useGeolocation/index.ts b/packages/runed/src/lib/utilities/useGeolocation/index.ts deleted file mode 100644 index 9b59393a..00000000 --- a/packages/runed/src/lib/utilities/useGeolocation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./useGeolocation.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useIntersectionObserver/index.ts b/packages/runed/src/lib/utilities/useIntersectionObserver/index.ts deleted file mode 100644 index b08ddcc8..00000000 --- a/packages/runed/src/lib/utilities/useIntersectionObserver/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./useIntersectionObserver.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useMutationObserver/index.ts b/packages/runed/src/lib/utilities/useMutationObserver/index.ts deleted file mode 100644 index 6bb08000..00000000 --- a/packages/runed/src/lib/utilities/useMutationObserver/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./useMutationObserver.svelte.js"; diff --git a/packages/runed/src/lib/utilities/useResizeObserver/index.ts b/packages/runed/src/lib/utilities/useResizeObserver/index.ts deleted file mode 100644 index 33410a23..00000000 --- a/packages/runed/src/lib/utilities/useResizeObserver/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { useResizeObserver } from "./useResizeObserver.svelte.js"; diff --git a/scripts/add-utility.mjs b/scripts/add-utility.mjs index ae8e7b8a..bacfeffd 100644 --- a/scripts/add-utility.mjs +++ b/scripts/add-utility.mjs @@ -11,13 +11,13 @@ const contentDir = "./sites/docs/src/content/utilities"; const demosDir = "./sites/docs/src/lib/components/demos"; const utilName = readlineSync.question("What is the name of the utility? "); - -const utilDir = `${utilsDir}/${utilName}`; +const kebabUtil = toKebabCase(utilName); +const utilDir = `${utilsDir}/${kebabUtil}`; const utilIndexFile = `${utilDir}/index.ts`; -const utilMainFile = `${utilDir}/${utilName}.svelte.ts`; +const utilMainFile = `${utilDir}/${kebabUtil}.svelte.ts`; const utilsBarrelFile = `${utilsDir}/index.ts`; -const contentFile = `${contentDir}/${toKebabCase(utilName)}.md`; -const demoFile = `${demosDir}/${toKebabCase(utilName)}.svelte`; +const contentFile = `${contentDir}/${kebabUtil}.md`; +const demoFile = `${demosDir}/${kebabUtil}.svelte`; fs.mkdirSync(utilDir, { recursive: true }); fs.writeFileSync(utilIndexFile, `export * from "./${utilName}.svelte.js";`); @@ -34,7 +34,7 @@ category: New --- ## Demo