Skip to content

Commit 8d07519

Browse files
committed
fix: Forward exports in the nuqs/server/cache.d.ts
For some reason, the classic trick of forwarding everything doesn't work under `nuqs/server/*`. We're also removing the temporary imports' `moduleResolution: 'node'` helpers, as v3 will both remove them and require a moduleResolution set to either 'bundler' or 'nodeNext'.
1 parent 13e6140 commit 8d07519

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

packages/e2e/next/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"alwaysStrict": false, // Don't emit "use strict" to avoid conflicts with "use client"
77
// Modules
88
"module": "ESNext",
9-
"moduleResolution": "node",
9+
"moduleResolution": "bundler",
1010
"resolveJsonModule": true,
1111
// Language & Environment
1212
"target": "ESNext",

packages/nuqs/server/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Why just the cache here?
2+
3+
Those "top-level" .d.ts files are used to help projects with `moduleResolution: 'node'`
4+
resolve the correct imports.
5+
6+
The other two imports under server, `nuqs/server/parsers` and `nuqs/server/serializer`
7+
are temporary and will be removed in nuqs@3.0.0.
8+
9+
Also, nuqs@3.0.0 will require a `moduleResolution: 'bundler' | 'nodeNext` setting in your tsconfig.json.

packages/nuqs/server/cache.d.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
// but with `node`, TypeScript will look for a .d.ts file with that name at the
55
// root of the package.
66

7-
export * from './dist/server/cache'
7+
export { createSearchParamsCache } from './dist/server/cache'
8+
export type {
9+
HistoryOptions,
10+
Nullable,
11+
Options,
12+
SearchParams
13+
} from './dist/server/cache'

packages/nuqs/server/parsers.d.ts

-7
This file was deleted.

packages/nuqs/server/serializer.d.ts

-7
This file was deleted.

0 commit comments

Comments
 (0)