my website at ewancroft.uk
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ui): replace $app/environment with typeof window check in stores

Removes the SvelteKit-specific `browser` import from colorTheme and
wolfMode stores, replacing it with `typeof window !== 'undefined'`.
This makes @ewanc26/ui usable in plain Svelte projects outside of
SvelteKit, resolving the svelte-package warning on build.

+4 -3
+2 -1
packages/ui/src/lib/stores/colorTheme.ts
··· 1 1 import { writable } from 'svelte/store'; 2 - import { browser } from '$app/environment'; 3 2 import { DEFAULT_THEME, type ColorTheme } from '../config/themes.config.js'; 3 + 4 + const browser = typeof window !== 'undefined'; 4 5 5 6 interface ColorThemeState { 6 7 current: ColorTheme;
+2 -1
packages/ui/src/lib/stores/wolfMode.ts
··· 1 1 import { writable } from 'svelte/store'; 2 - import { browser } from '$app/environment'; 2 + 3 + const browser = typeof window !== 'undefined'; 3 4 4 5 const wolfSounds = [ 5 6 'awoo', 'awooo', 'howl', 'ahroo', 'owww', 'yip', 'yap', 'arf', 'ruff', 'woof',
-1
packages/ui/tsconfig.json
··· 15 15 "declaration": true, 16 16 "declarationMap": true, 17 17 "paths": { 18 - "$app/environment": ["./node_modules/@sveltejs/kit/src/runtime/app/environment.js"], 19 18 "$app/stores": ["./node_modules/@sveltejs/kit/src/runtime/app/stores.js"] 20 19 } 21 20 },