diff --git a/packages/nuqs/package.json b/packages/nuqs/package.json index d09fa0c4..9e7a21bb 100644 --- a/packages/nuqs/package.json +++ b/packages/nuqs/package.json @@ -35,6 +35,9 @@ "files": [ "dist/", "server.d.ts", + "server/cache.d.ts", + "server/serializer.d.ts", + "server/parsers.d.ts", "adapters/react.d.ts", "adapters/next.d.ts", "adapters/next/app.d.ts", @@ -60,6 +63,21 @@ "import": "./dist/server.js", "require": "./esm-only.cjs" }, + "./server/cache": { + "types": "./dist/server/cache.d.ts", + "import": "./dist/server/cache.js", + "require": "./esm-only.cjs" + }, + "./server/serializer": { + "types": "./dist/server/serializer.d.ts", + "import": "./dist/server/serializer.js", + "require": "./esm-only.cjs" + }, + "./server/parsers": { + "types": "./dist/server/parsers.d.ts", + "import": "./dist/server/parsers.js", + "require": "./esm-only.cjs" + }, "./adapters/react": { "types": "./dist/adapters/react.d.ts", "import": "./dist/adapters/react.js", diff --git a/packages/nuqs/server/cache.d.ts b/packages/nuqs/server/cache.d.ts new file mode 100644 index 00000000..81432905 --- /dev/null +++ b/packages/nuqs/server/cache.d.ts @@ -0,0 +1,7 @@ +// This file is needed for projects that have `moduleResolution` set to `node` +// in their tsconfig.json to be able to `import {} from 'nuqs/server/cache'`. +// 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/cache' diff --git a/packages/nuqs/server/parsers.d.ts b/packages/nuqs/server/parsers.d.ts new file mode 100644 index 00000000..43a0495b --- /dev/null +++ b/packages/nuqs/server/parsers.d.ts @@ -0,0 +1,7 @@ +// 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 new file mode 100644 index 00000000..561a67a0 --- /dev/null +++ b/packages/nuqs/server/serializer.d.ts @@ -0,0 +1,7 @@ +// 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' diff --git a/packages/nuqs/src/index.server.cache.ts b/packages/nuqs/src/index.server.cache.ts new file mode 100644 index 00000000..e9967989 --- /dev/null +++ b/packages/nuqs/src/index.server.cache.ts @@ -0,0 +1,2 @@ +export { createSearchParamsCache } from './cache' +export type { HistoryOptions, Nullable, Options, SearchParams } from './defs' diff --git a/packages/nuqs/src/index.server.parsers.ts b/packages/nuqs/src/index.server.parsers.ts new file mode 100644 index 00000000..2fc2d573 --- /dev/null +++ b/packages/nuqs/src/index.server.parsers.ts @@ -0,0 +1,2 @@ +export type { HistoryOptions, Nullable, Options, SearchParams } from './defs' +export * from './parsers' diff --git a/packages/nuqs/src/index.server.serializer.ts b/packages/nuqs/src/index.server.serializer.ts new file mode 100644 index 00000000..e2c0411d --- /dev/null +++ b/packages/nuqs/src/index.server.serializer.ts @@ -0,0 +1,2 @@ +export type { HistoryOptions, Nullable, Options, SearchParams } from './defs' +export { createSerializer } from './serializer' diff --git a/packages/nuqs/tsup.config.ts b/packages/nuqs/tsup.config.ts index 2120fa7f..96bfb083 100644 --- a/packages/nuqs/tsup.config.ts +++ b/packages/nuqs/tsup.config.ts @@ -34,7 +34,10 @@ const entrypoints = { 'adapters/testing': 'src/adapters/testing.ts' }, server: { - server: 'src/index.server.ts' + server: 'src/index.server.ts', + 'server/cache': 'src/index.server.cache.ts', + 'server/parsers': 'src/index.server.parsers.ts', + 'server/serializer': 'src/index.server.serializer.ts' } }