From 750ecaadb4e157c0efd75423a42d84004d6445d0 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 12 Dec 2022 02:00:03 +0900 Subject: [PATCH] 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 1bde130d..d67d8e8f 100644 --- a/packages/calendar/package.json +++ b/packages/calendar/package.json @@ -1,13 +1,30 @@ { "name": "@h6s/calendar", "version": "1.0.6", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "module": "esm/index.mjs", - "sideEffects": false, + "main": "src/index.ts", + "exports": { + ".": { + "require": "./src/index.ts", + "import": "./src/index.ts" + }, + "./package.json": "./package.json" + }, "publishConfig": { - "access": "public" + "access": "public", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./esm/index.mjs", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, + "import": "./esm/index.mjs", + "main": "./dist/index.js", + "types": "dist/index.d.ts", + "module": "esm/index.mjs" }, + "sideEffects": false, "scripts": { "prepack": "yarn build", "prebuild": "rimraf dist esm", diff --git a/packages/table/package.json b/packages/table/package.json index 7e8e160f..691be4da 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -1,13 +1,30 @@ { "name": "@h6s/table", "version": "1.0.3", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "module": "esm/index.mjs", - "sideEffects": false, + "main": "src/index.ts", + "exports": { + ".": { + "require": "./src/index.ts", + "import": "./src/index.ts" + }, + "./package.json": "./package.json" + }, "publishConfig": { - "access": "public" + "access": "public", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./esm/index.mjs", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, + "import": "./esm/index.mjs", + "main": "./dist/index.js", + "types": "dist/index.d.ts", + "module": "esm/index.mjs" }, + "sideEffects": false, "scripts": { "prepack": "yarn build", "prebuild": "rimraf dist esm",