diff --git a/.changeset/poor-cars-film.md b/.changeset/poor-cars-film.md new file mode 100644 index 00000000..5a9416d0 --- /dev/null +++ b/.changeset/poor-cars-film.md @@ -0,0 +1,5 @@ +--- +'@hono/firebase-auth': patch +--- + +fix: export esm diff --git a/packages/firebase-auth/package.json b/packages/firebase-auth/package.json index 0e833072..74053b52 100644 --- a/packages/firebase-auth/package.json +++ b/packages/firebase-auth/package.json @@ -2,7 +2,9 @@ "name": "@hono/firebase-auth", "version": "1.3.3", "description": "A third-party firebase 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" @@ -11,10 +13,23 @@ "start-firebase-emulator": "firebase emulators:start --project example-project12345", "test-with-emulator": "firebase emulators:exec --project example-project12345 'vitest run'", "test": "vitest run", - "build": "tsc", - "prerelease": "yarn build", + "build": "tsup ./src/index.ts --format esm,cjs --dts", + "publint": "publint", + "prerelease": "yarn build && arn publint", "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", "repository": { "type": "git", @@ -38,7 +53,8 @@ "hono": "^3.11.7", "miniflare": "^3.20231025.1", "prettier": "^2.7.1", + "tsup": "^8.0.1", "typescript": "^4.7.4", "vitest": "^0.34.6" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index bac29ca5..754c45a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1426,6 +1426,7 @@ __metadata: hono: "npm:^3.11.7" miniflare: "npm:^3.20231025.1" prettier: "npm:^2.7.1" + tsup: "npm:^8.0.1" typescript: "npm:^4.7.4" vitest: "npm:^0.34.6" peerDependencies: