Skip to content

Commit 547a90a

Browse files
v1.1.4
1 parent 772cf55 commit 547a90a

File tree

6 files changed

+43
-19
lines changed

6 files changed

+43
-19
lines changed

packages/minimal-shared/package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "minimal-shared",
33
"author": "Minimals",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"description": "Shared hooks and utils used by Minimal UI and Zone UI.",
66
"keywords": [
77
"typescript",
@@ -63,25 +63,29 @@
6363
"lint:print": "npx eslint --print-config eslint.config.mjs > eslint-show-config.json",
6464
"clean": "rm -rf node_modules .turbo .next out dist build",
6565
"re:build": "pnpm clean && pnpm install && pnpm test && pnpm build",
66-
"tsc:print": "npx tsc --showConfig"
66+
"tsc:print": "npx tsc --showConfig",
67+
"check-types": "npx tsc --noEmit"
6768
},
6869
"dependencies": {
69-
"es-toolkit": "^1.39.10"
70+
"es-toolkit": "^1.42.0"
7071
},
7172
"devDependencies": {
72-
"@testing-library/jest-dom": "^6.8.0",
73+
"@testing-library/jest-dom": "^6.9.1",
7374
"@testing-library/react": "^16.3.0",
74-
"@types/node": "^24.5.2",
75-
"@types/react": "19.1.14",
75+
"@types/node": "^24.10.1",
76+
"@types/react": "19.2.7",
77+
"eslint": "^9.39.1",
7678
"internal-eslint-config": "workspace:*",
7779
"internal-ts-config": "workspace:*",
78-
"jsdom": "^27.0.0",
79-
"react": "^19.0.0",
80-
"tsup": "^8.5.0",
81-
"typescript": "^5.9.2",
82-
"vitest": "^3.2.4"
80+
"jsdom": "^27.2.0",
81+
"react": "^19.2.1",
82+
"react-dom": "19.2.1",
83+
"tsup": "^8.5.1",
84+
"typescript": "^5.9.3",
85+
"vitest": "^4.0.15"
8386
},
8487
"peerDependencies": {
85-
"react": "^18.0.0 || ^19.0.0"
88+
"react": "^18.0.0 || >=19.0.1 <19.1.0 || >=19.1.2 <19.2.0 || >=19.2.1",
89+
"react-dom": "^18.0.0 || >=19.0.1 <19.1.0 || >=19.1.2 <19.2.0 || >=19.2.1"
8690
}
8791
}

packages/minimal-shared/src/hooks/use-back-to-top/use-back-to-top.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function useBackToTop(
6262

6363
// Debounce the scroll handler to improve performance
6464
const debouncedHandleScroll = useMemo(() => {
65-
let timeoutId: NodeJS.Timeout;
65+
let timeoutId: ReturnType<typeof setTimeout>;
6666

6767
return () => {
6868
clearTimeout(timeoutId);

packages/minimal-shared/src/hooks/use-cookies/use-cookies.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import type { CookieOptions } from '../../utils/cookies';
2+
13
import { useMemo, useState, useEffect, useCallback } from 'react';
24

35
import { setCookie, getCookie, removeCookie } from '../../utils/cookies';
46

5-
import type { CookieOptions } from '../../utils/cookies';
6-
77
// ----------------------------------------------------------------------
88

99
/**

packages/minimal-shared/src/hooks/use-countdown-seconds/use-countdown-seconds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function useCountdownSeconds(defaultValue: number): UseCountdownSecondsRe
5050
}, [defaultValue]);
5151

5252
useEffect(() => {
53-
let interval: NodeJS.Timeout | null = null;
53+
let interval: ReturnType<typeof setInterval> | null = null;
5454

5555
if (isCounting && value > 0) {
5656
interval = setInterval(() => {

packages/minimal-shared/src/hooks/use-double-click/use-double-click.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function useDoubleClick({
3535
doubleClick,
3636
timeout = 250,
3737
}: UseDoubleClickProps): UseDoubleClickReturn {
38-
const clickTimeout = useRef<NodeJS.Timeout | null>(null);
38+
const clickTimeout = useRef<ReturnType<typeof setTimeout> | null>(null);
3939

4040
const clearClickTimeout = useCallback(() => {
4141
if (clickTimeout.current) {

packages/minimal-shared/src/utils/url/url.test.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,32 @@ import {
1212
const originalLocation = window.location;
1313

1414
beforeAll(() => {
15+
const url = new URL('https://example.com');
16+
1517
delete (window as any).location;
16-
(window as any).location = new URL('https://example.com');
18+
19+
Object.defineProperty(window, 'location', {
20+
value: {
21+
...originalLocation,
22+
href: url.href,
23+
origin: url.origin,
24+
protocol: url.protocol,
25+
host: url.host,
26+
hostname: url.hostname,
27+
pathname: url.pathname,
28+
search: url.search,
29+
hash: url.hash,
30+
},
31+
writable: true,
32+
configurable: true,
33+
});
1734
});
1835

1936
afterAll(() => {
20-
window.location = originalLocation;
37+
Object.defineProperty(window, 'location', {
38+
value: originalLocation,
39+
configurable: true,
40+
});
2141
});
2242

2343
const mapWithIndex = <T extends readonly any[][]>(cases: T) =>

0 commit comments

Comments
 (0)