From 99dc0ff9cef297ac39da05d46acabed9b2ded5a6 Mon Sep 17 00:00:00 2001 From: Thibaut SEVERAC Date: Fri, 5 Jan 2024 16:22:42 +0100 Subject: [PATCH] Hotfix : Fix ESM exports (#441) * update exports * correct paths * correct type, and apply modifications on others packages --- packages/react-cookie/package.json | 14 +++++++++++--- packages/universal-cookie-express/package.json | 14 +++++++++++--- packages/universal-cookie-koa/package.json | 14 +++++++++++--- packages/universal-cookie/package.json | 15 +++++++++++---- 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/packages/react-cookie/package.json b/packages/react-cookie/package.json index ba1a172..168ee2c 100644 --- a/packages/react-cookie/package.json +++ b/packages/react-cookie/package.json @@ -3,13 +3,21 @@ "version": "7.0.0", "description": "Universal cookies for React", "main": "cjs/index.js", + "types": "cjs/index.d.ts", + "module": "esm/index.mjs", "exports": { ".": { - "import": "./esm/index.mjs", - "require": "./cjs/index.js" + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.mjs" + }, + "require": { + "types": "./cjs/index.d.ts", + "default": "./cjs/index.js" + }, + "default": "./cjs/index.js" } }, - "types": "esm/index.d.ts", "sideEffects": false, "files": [ "esm", diff --git a/packages/universal-cookie-express/package.json b/packages/universal-cookie-express/package.json index a26e40b..c99b9c8 100644 --- a/packages/universal-cookie-express/package.json +++ b/packages/universal-cookie-express/package.json @@ -3,13 +3,21 @@ "version": "7.0.0", "description": "Hook cookies get/set on Express for server-rendering", "main": "cjs/index.js", + "types": "cjs/index.d.ts", + "module": "esm/index.mjs", "exports": { ".": { - "import": "./esm/index.mjs", - "require": "./cjs/index.js" + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.mjs" + }, + "require": { + "types": "./cjs/index.d.ts", + "default": "./cjs/index.js" + }, + "default": "./cjs/index.js" } }, - "types": "esm/index.d.ts", "sideEffects": false, "files": [ "esm", diff --git a/packages/universal-cookie-koa/package.json b/packages/universal-cookie-koa/package.json index 2d378f0..0b300f9 100644 --- a/packages/universal-cookie-koa/package.json +++ b/packages/universal-cookie-koa/package.json @@ -3,13 +3,21 @@ "version": "7.0.0", "description": "Hook cookies get/set on Koa for server-rendering", "main": "cjs/index.js", + "types": "cjs/index.d.ts", + "module": "esm/index.mjs", "exports": { ".": { - "import": "./esm/index.mjs", - "require": "./cjs/index.js" + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.mjs" + }, + "require": { + "types": "./cjs/index.d.ts", + "default": "./cjs/index.js" + }, + "default": "./cjs/index.js" } }, - "types": "esm/index.d.ts", "sideEffects": false, "files": [ "esm", diff --git a/packages/universal-cookie/package.json b/packages/universal-cookie/package.json index 00bbdfa..34127ae 100644 --- a/packages/universal-cookie/package.json +++ b/packages/universal-cookie/package.json @@ -2,14 +2,21 @@ "name": "universal-cookie", "version": "7.0.0", "description": "Universal cookies for JavaScript", - "main": "cjs/index.js", + "types": "cjs/index.d.ts", + "module": "esm/index.mjs", "exports": { ".": { - "import": "./esm/index.mjs", - "require": "./cjs/index.js" + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.mjs" + }, + "require": { + "types": "./cjs/index.d.ts", + "default": "./cjs/index.js" + }, + "default": "./cjs/index.js" } }, - "types": "esm/index.d.ts", "sideEffects": false, "files": [ "esm",