api-client/package: configure tsup output and exports

This commit is contained in:
dumbmoron 2024-09-14 19:08:13 +00:00
parent 00d5754ea8
commit d201deb60a
No known key found for this signature in database
3 changed files with 24 additions and 1 deletions

1
packages/api-client/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
dist

View file

@ -3,7 +3,10 @@
"version": "0.0.1", "version": "0.0.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": {}, "scripts": {
"build": "tsup",
"dev": "tsup --watch"
},
"keywords": [], "keywords": [],
"author": "imput <meow@imput.net>", "author": "imput <meow@imput.net>",
"license": "MIT", "license": "MIT",
@ -13,5 +16,21 @@
"turnstile-types": "^1.2.2", "turnstile-types": "^1.2.2",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"zod": "^3.23.8" "zod": "^3.23.8"
},
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"tsup": {
"dts": true,
"bundle": false,
"treeshake": true,
"target": "node18",
"format": ["esm", "cjs"],
"entry": ["src/**/*.ts"]
} }
} }

View file

@ -0,0 +1,3 @@
export * from "./turnstile-api";
export * from "./unauthenticated-api";
export * from "./types/interface";