From 21c99ad78ee58b3d25ea1bf02d56e633d1b97cd9 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 12 Dec 2022 02:00:03 +0900 Subject: [PATCH 1/2] fix(package.json): edit main, exports and fields of publishConfig to improve DX --- packages/calendar/package.json | 27 ++++++++++++++++++++++----- packages/table/package.json | 27 ++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/packages/calendar/package.json b/packages/calendar/package.json index 25fb4002..d6b4b736 100644 --- a/packages/calendar/package.json +++ b/packages/calendar/package.json @@ -1,16 +1,33 @@ { "name": "@h6s/calendar", "version": "1.0.7", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "module": "esm/index.mjs", + "sideEffects": false, + "main": "./src/index.ts", "files": [ "dist", "esm" ], - "sideEffects": false, + "exports": { + ".": { + "require": "./src/index.ts", + "import": "./src/index.ts" + }, + "./package.json": "./package.json" + }, "publishConfig": { - "access": "public" + "access": "public", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.js", + "import": "./esm/index.mjs" + }, + "./package.json": "./package.json" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "import": "./esm/index.mjs", + "module": "./esm/index.mjs" }, "scripts": { "prepack": "yarn build", diff --git a/packages/table/package.json b/packages/table/package.json index 8ce410b9..0de6a555 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -1,16 +1,33 @@ { "name": "@h6s/table", "version": "1.0.4", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "module": "esm/index.mjs", + "sideEffects": false, + "main": "./src/index.ts", "files": [ "dist", "esm" ], - "sideEffects": false, + "exports": { + ".": { + "require": "./src/index.ts", + "import": "./src/index.ts" + }, + "./package.json": "./package.json" + }, "publishConfig": { - "access": "public" + "access": "public", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.js", + "import": "./esm/index.mjs" + }, + "./package.json": "./package.json" + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "import": "./esm/index.mjs", + "module": "./esm/index.mjs" }, "scripts": { "prepack": "yarn build", From 5d994630efadfb01ddf8c273620d3f2c0a763e80 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Tue, 13 Dec 2022 00:28:49 +0900 Subject: [PATCH 2/2] fix(package.json): remove unnecessary relative paths --- packages/calendar/package.json | 10 +++++----- packages/table/package.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/calendar/package.json b/packages/calendar/package.json index d6b4b736..042eb0ee 100644 --- a/packages/calendar/package.json +++ b/packages/calendar/package.json @@ -2,7 +2,7 @@ "name": "@h6s/calendar", "version": "1.0.7", "sideEffects": false, - "main": "./src/index.ts", + "main": "src/index.ts", "files": [ "dist", "esm" @@ -24,10 +24,10 @@ }, "./package.json": "./package.json" }, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "import": "./esm/index.mjs", - "module": "./esm/index.mjs" + "main": "dist/index.js", + "types": "dist/index.d.ts", + "import": "esm/index.mjs", + "module": "esm/index.mjs" }, "scripts": { "prepack": "yarn build", diff --git a/packages/table/package.json b/packages/table/package.json index 0de6a555..6e58edaf 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -2,7 +2,7 @@ "name": "@h6s/table", "version": "1.0.4", "sideEffects": false, - "main": "./src/index.ts", + "main": "src/index.ts", "files": [ "dist", "esm" @@ -24,10 +24,10 @@ }, "./package.json": "./package.json" }, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "import": "./esm/index.mjs", - "module": "./esm/index.mjs" + "main": "dist/index.js", + "types": "dist/index.d.ts", + "import": "esm/index.mjs", + "module": "esm/index.mjs" }, "scripts": { "prepack": "yarn build",