Skip to content

Commit 080ad12

Browse files
authored
Merge pull request #3178 from pyth-network/bduran/fix-nuqs
fix: fixed nuqs usage by doing a pass-through export from a new package and clamping package to ESM
2 parents d884f26 + 152b14f commit 080ad12

File tree

30 files changed

+193
-54
lines changed

30 files changed

+193
-54
lines changed

apps/developer-hub/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"katex": "catalog:",
3636
"next": "catalog:",
3737
"next-themes": "catalog:",
38-
"nuqs": "catalog:",
38+
"@pythnetwork/react-hooks": "workspace:",
3939
"react": "catalog:",
4040
"react-aria": "catalog:",
4141
"react-dom": "catalog:",
@@ -72,4 +72,4 @@
7272
"tailwindcss": "^4.1.6",
7373
"vercel": "catalog:"
7474
}
75-
}
75+
}

apps/developer-hub/src/components/Root/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { RootProviders } from "@pythnetwork/component-library/AppShell";
2+
import { NuqsAdapter } from "@pythnetwork/react-hooks/nuqs-adapters-next";
23
import { RootProvider as FumadocsRootProvider } from "fumadocs-ui/provider";
3-
import { NuqsAdapter } from "nuqs/adapters/next/app";
44
import type { ReactNode } from "react";
55

66
import "./global.css";

apps/entropy-explorer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@pythnetwork/component-library": "workspace:*",
2525
"clsx": "catalog:",
2626
"next": "catalog:",
27-
"nuqs": "catalog:",
27+
"@pythnetwork/react-hooks": "workspace:",
2828
"react": "catalog:",
2929
"react-aria": "catalog:",
3030
"react-dom": "catalog:",
@@ -52,4 +52,4 @@
5252
"stylelint-config-standard-scss": "catalog:",
5353
"vercel": "catalog:"
5454
}
55-
}
55+
}

apps/entropy-explorer/src/components/Root/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AppShell } from "@pythnetwork/component-library/AppShell";
2-
import { NuqsAdapter } from "nuqs/adapters/next/app";
2+
import { NuqsAdapter } from "@pythnetwork/react-hooks/nuqs-adapters-next";
33
import type { ReactNode } from "react";
44

55
import {

apps/insights/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"motion": "catalog:",
4141
"next": "catalog:",
4242
"next-themes": "catalog:",
43-
"nuqs": "catalog:",
43+
"@pythnetwork/react-hooks": "workspace:",
4444
"react": "catalog:",
4545
"react-aria": "catalog:",
4646
"react-dom": "catalog:",
@@ -73,4 +73,4 @@
7373
"stylelint-config-standard-scss": "catalog:",
7474
"vercel": "catalog:"
7575
}
76-
}
76+
}

apps/insights/src/components/PriceComponentDrawer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import type { Button as UnstyledButton } from "@pythnetwork/component-library/un
1212
import { StateType, useData } from "@pythnetwork/component-library/useData";
1313
import { useDrawer } from "@pythnetwork/component-library/useDrawer";
1414
import { useLogger } from "@pythnetwork/component-library/useLogger";
15+
import { parseAsString, useQueryState } from "@pythnetwork/react-hooks/nuqs";
1516
import { useMountEffect } from "@react-hookz/web";
1617
import dynamic from "next/dynamic";
1718
import { useRouter } from "next/navigation";
18-
import { parseAsString, useQueryState } from "nuqs";
1919
import type { ReactNode } from "react";
2020
import {
2121
Suspense,

apps/insights/src/components/PriceComponentsCard/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ import type {
1717
import { Table } from "@pythnetwork/component-library/Table";
1818
import { useLogger } from "@pythnetwork/component-library/useLogger";
1919
import { useQueryParamFilterPagination } from "@pythnetwork/component-library/useQueryParamsPagination";
20+
import {
21+
useQueryState,
22+
parseAsStringEnum,
23+
parseAsBoolean,
24+
} from "@pythnetwork/react-hooks/nuqs";
2025
import clsx from "clsx";
21-
import { useQueryState, parseAsStringEnum, parseAsBoolean } from "nuqs";
2226
import type { ReactNode } from "react";
2327
import { Fragment, Suspense, useMemo, useCallback } from "react";
2428
import { useFilter, useCollator } from "react-aria";

apps/insights/src/components/PriceFeed/Chart/use-chart-toolbar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { parseAsStringLiteral, useQueryState } from "nuqs";
1+
import {
2+
parseAsStringLiteral,
3+
useQueryState,
4+
} from "@pythnetwork/react-hooks/nuqs";
25

36
export const RESOLUTIONS = ["1s", "1m", "5m", "1H", "1D"] as const;
47
export type Resolution = (typeof RESOLUTIONS)[number];

apps/insights/src/components/PriceFeed/publishers-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { Switch } from "@pythnetwork/component-library/Switch";
44
import { useLogger } from "@pythnetwork/component-library/useLogger";
5-
import { useQueryState, parseAsBoolean } from "nuqs";
5+
import { useQueryState, parseAsBoolean } from "@pythnetwork/react-hooks/nuqs";
66
import { Suspense, useCallback, useMemo } from "react";
77

88
import { Cluster } from "../../services/pyth";

apps/insights/src/components/PriceFeeds/asset-class-table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { Badge } from "@pythnetwork/component-library/Badge";
44
import { Table } from "@pythnetwork/component-library/Table";
55
import { useDrawer } from "@pythnetwork/component-library/useDrawer";
66
import { useLogger } from "@pythnetwork/component-library/useLogger";
7-
import { usePathname } from "next/navigation";
87
import {
98
parseAsString,
109
parseAsInteger,
1110
useQueryStates,
1211
createSerializer,
13-
} from "nuqs";
12+
} from "@pythnetwork/react-hooks/nuqs";
13+
import { usePathname } from "next/navigation";
1414
import { useMemo } from "react";
1515
import { useCollator } from "react-aria";
1616

0 commit comments

Comments
 (0)