From 322eae013da1cdc24b05881e4707d03f9936b9be Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 25 Apr 2023 16:36:00 +0200 Subject: [PATCH 1/3] change to use tsup --- package.json | 13 ++++++------- tsconfig.cjs.json | 7 ------- tsconfig.esm.json | 9 --------- tsconfig.base.json => tsconfig.json | 5 +++-- 4 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 tsconfig.cjs.json delete mode 100644 tsconfig.esm.json rename tsconfig.base.json => tsconfig.json (76%) diff --git a/package.json b/package.json index 1d01939..5909df5 100644 --- a/package.json +++ b/package.json @@ -7,19 +7,17 @@ "url": "https://github.com/storybookjs/jest.git" }, "scripts": { - "build": "yarn build:esm && yarn build:cjs", - "build:esm": "tsc --project tsconfig.esm.json", - "build:cjs": "tsc --project tsconfig.cjs.json", + "build": "tsup ./src/index.ts --format cjs,esm --dts", "prerelease": "yarn build", "release": "auto shipit" }, - "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.js", + "main": "./dist/index.js", + "module": "./dist/index.,js", "license": "MIT", "files": [ "dist/**/*" ], - "types": "./dist/types/index.d.ts", + "types": "./dist/index.d.ts", "publishConfig": { "access": "public" }, @@ -31,12 +29,13 @@ }, "devDependencies": { "@auto-it/first-time-contributor": "^10.37.6", + "tsup": "^5.12.0", "@auto-it/released": "^10.37.6", "@storybook/linter-config": "^3.1.2", "@types/react": "*", "auto": "^10.37.6", "expect": "^27.3.1", - "typescript": "^4.4.3" + "typescript": "^5.0.4" }, "author": "yannbf@gmail.com", "auto": { diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json deleted file mode 100644 index 6196628..0000000 --- a/tsconfig.cjs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "outDir": "./dist/cjs", - "module": "CommonJS", - }, -} diff --git a/tsconfig.esm.json b/tsconfig.esm.json deleted file mode 100644 index 3e2451c..0000000 --- a/tsconfig.esm.json +++ /dev/null @@ -1,9 +0,0 @@ - -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "outDir": "./dist/esm", - "module": "ES6", - "target": "ES5", - }, -} diff --git a/tsconfig.base.json b/tsconfig.json similarity index 76% rename from tsconfig.base.json rename to tsconfig.json index 5c51249..9b3a7fd 100644 --- a/tsconfig.base.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { - "noImplicitAny": true, - "allowJs": true, + "strict": true, + "target": "es2020", + "module": "ESNext", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "declaration": true, From 8fdf18159eddece9e4ba2a7d3a3816941574ad53 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 26 Apr 2023 12:45:00 +0200 Subject: [PATCH 2/3] fix module entrypoint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5909df5..4da6b09 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "release": "auto shipit" }, "main": "./dist/index.js", - "module": "./dist/index.,js", + "module": "./dist/index.js", "license": "MIT", "files": [ "dist/**/*" From df816e6464df77e1abdbbf0f85befb7336388cc6 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 26 Apr 2023 13:48:48 +0200 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4da6b09..b4ead7b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "release": "auto shipit" }, "main": "./dist/index.js", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "license": "MIT", "files": [ "dist/**/*"