Skip to content

Commit 502a312

Browse files
authored
test: unbuild (#26)
1 parent cac9740 commit 502a312

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

.github/workflows/continuous-releases.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ jobs:
2929
- name: Install dependencies
3030
run: pnpm install
3131

32+
- name: Build
33+
run: pnpm build
34+
3235
- run: npx pkg-pr-new publish

build.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineBuildConfig } from "unbuild";
2+
3+
export default defineBuildConfig({
4+
rollup: {
5+
emitCJS: true,
6+
esbuild: {
7+
treeShaking: true,
8+
},
9+
},
10+
declaration: true,
11+
outDir: "dist",
12+
clean: true,
13+
failOnWarn: false,
14+
externals: ["better-auth", "drizzle-orm", "zod", "@cloudflare/workers-types"],
15+
entries: ["./src/index.ts", "./src/client.ts", "./src/r2.ts", "./src/schema.ts", "./src/types.ts"],
16+
});

package.json

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"name": "better-auth-cloudflare",
33
"version": "0.2.5",
4+
"type": "module",
45
"description": "Seamlessly integrate better-auth with Cloudflare Workers, D1, Hyperdrive, KV, R2, and geolocation services.",
56
"author": "Zach Grimaldi",
67
"repository": {
78
"type": "git",
89
"url": "git+https://github.com/zpg6/better-auth-cloudflare.git"
910
},
10-
"main": "./dist/index.js",
11+
"main": "./dist/index.cjs",
12+
"module": "./dist/index.mjs",
1113
"types": "./dist/index.d.ts",
1214
"keywords": [
1315
"better-auth",
@@ -27,7 +29,7 @@
2729
],
2830
"scripts": {
2931
"clean": "rm -rf dist",
30-
"build": "tsc",
32+
"build": "unbuild --clean",
3133
"test": "jest",
3234
"typecheck": "tsc --noEmit",
3335
"format": "prettier --write ."
@@ -45,16 +47,29 @@
4547
"jest": "^29.7.0",
4648
"prettier": "^3.2.5",
4749
"ts-jest": "^29.1.1",
48-
"typescript": "^5.3.3"
50+
"typescript": "^5.3.3",
51+
"unbuild": "^3.0.0"
4952
},
5053
"exports": {
5154
".": {
52-
"types": "./dist/index.d.ts",
53-
"default": "./dist/index.js"
55+
"import": {
56+
"types": "./dist/index.d.ts",
57+
"default": "./dist/index.mjs"
58+
},
59+
"require": {
60+
"types": "./dist/index.d.cts",
61+
"default": "./dist/index.cjs"
62+
}
5463
},
5564
"./client": {
56-
"types": "./dist/client.d.ts",
57-
"default": "./dist/client.js"
65+
"import": {
66+
"types": "./dist/client.d.ts",
67+
"default": "./dist/client.mjs"
68+
},
69+
"require": {
70+
"types": "./dist/client.d.cts",
71+
"default": "./dist/client.cjs"
72+
}
5873
}
5974
},
6075
"publishConfig": {

0 commit comments

Comments
 (0)