Skip to content

Commit

Permalink
fix: Forward exports in the nuqs/server/cache.d.ts
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
franky47 committed Dec 27, 2024
1 parent da7cf40 commit 729b686
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/e2e/next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"alwaysStrict": false, // Don't emit "use strict" to avoid conflicts with "use client"
// Modules
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
// Language & Environment
"target": "ESNext",
Expand Down
9 changes: 9 additions & 0 deletions packages/nuqs/server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Why just the cache here?

Those "top-level" .d.ts files are used to help projects with `moduleResolution: 'node'`
resolve the correct imports.

The other two imports under server, `nuqs/server/parsers` and `nuqs/server/serializer`
are temporary and will be removed in nuqs@3.0.0.

Also, nuqs@3.0.0 will require a `moduleResolution: 'bundler' | 'nodeNext` setting in your tsconfig.json.
8 changes: 7 additions & 1 deletion packages/nuqs/server/cache.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
// but with `node`, TypeScript will look for a .d.ts file with that name at the
// root of the package.

export * from './dist/server/cache'
export { createSearchParamsCache } from './dist/server/cache'
export type {
HistoryOptions,
Nullable,
Options,
SearchParams
} from './dist/server/cache'
7 changes: 0 additions & 7 deletions packages/nuqs/server/parsers.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/nuqs/server/serializer.d.ts

This file was deleted.

0 comments on commit 729b686

Please sign in to comment.