diff --git a/.changeset/calm-taxis-smell.md b/.changeset/calm-taxis-smell.md new file mode 100644 index 000000000..19919d8d7 --- /dev/null +++ b/.changeset/calm-taxis-smell.md @@ -0,0 +1,5 @@ +--- +'@hono/clerk-auth': patch +--- + +fix: export esm diff --git a/packages/clerk-auth/package.json b/packages/clerk-auth/package.json index 69a52add6..9f3af27b6 100644 --- a/packages/clerk-auth/package.json +++ b/packages/clerk-auth/package.json @@ -2,17 +2,31 @@ "name": "@hono/clerk-auth", "version": "1.0.1", "description": "A third-party Clerk auth middleware for Hono", - "main": "dist/index.js", + "type": "module", + "main": "dist/index.cjs", + "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist" ], "scripts": { "test": "jest", - "build": "rimraf dist && tsc", + "build": "tsup ./src/index.ts --format esm,cjs --dts", "prerelease": "yarn build && yarn test", "release": "yarn publish" }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, "license": "MIT", "publishConfig": { "registry": "https://registry.npmjs.org", @@ -34,6 +48,6 @@ "jest": "^29.7.0", "node-fetch-native": "^1.4.0", "react": "^18.2.0", - "rimraf": "^5.0.5" + "tsup": "^8.0.1" } } diff --git a/yarn.lock b/yarn.lock index f51503e43..466ecfc94 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1824,7 +1824,7 @@ __metadata: jest: "npm:^29.7.0" node-fetch-native: "npm:^1.4.0" react: "npm:^18.2.0" - rimraf: "npm:^5.0.5" + tsup: "npm:^8.0.1" peerDependencies: "@clerk/backend": 0.30.* hono: ">=3.*"