diff --git a/packages/e2e/next/tsconfig.json b/packages/e2e/next/tsconfig.json index 7d21f37f..a4ef9550 100644 --- a/packages/e2e/next/tsconfig.json +++ b/packages/e2e/next/tsconfig.json @@ -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", diff --git a/packages/nuqs/server/README.md b/packages/nuqs/server/README.md new file mode 100644 index 00000000..a64ea11c --- /dev/null +++ b/packages/nuqs/server/README.md @@ -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. diff --git a/packages/nuqs/server/cache.d.ts b/packages/nuqs/server/cache.d.ts index 81432905..c59f7861 100644 --- a/packages/nuqs/server/cache.d.ts +++ b/packages/nuqs/server/cache.d.ts @@ -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' diff --git a/packages/nuqs/server/parsers.d.ts b/packages/nuqs/server/parsers.d.ts deleted file mode 100644 index 43a0495b..00000000 --- a/packages/nuqs/server/parsers.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is needed for projects that have `moduleResolution` set to `node` -// in their tsconfig.json to be able to `import {} from 'nuqs/server/parsers'`. -// Other module resolutions strategies will look for the `exports` in `package.json`, -// but with `node`, TypeScript will look for a .d.ts file with that name at the -// root of the package. - -export * from './dist/server/parsers' diff --git a/packages/nuqs/server/serializer.d.ts b/packages/nuqs/server/serializer.d.ts deleted file mode 100644 index 561a67a0..00000000 --- a/packages/nuqs/server/serializer.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is needed for projects that have `moduleResolution` set to `node` -// in their tsconfig.json to be able to `import {} from 'nuqs/server/serializer'`. -// Other module resolutions strategies will look for the `exports` in `package.json`, -// but with `node`, TypeScript will look for a .d.ts file with that name at the -// root of the package. - -export * from './dist/server/serializer'