From d201deb60a34fe10b1904bc448dfdc3a5db2c615 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Sat, 14 Sep 2024 19:08:13 +0000 Subject: [PATCH] api-client/package: configure tsup output and exports --- packages/api-client/.gitignore | 1 + packages/api-client/package.json | 21 ++++++++++++++++++++- packages/api-client/src/index.ts | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 packages/api-client/.gitignore create mode 100644 packages/api-client/src/index.ts diff --git a/packages/api-client/.gitignore b/packages/api-client/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/api-client/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 8b9dd7d5..ce309390 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -3,7 +3,10 @@ "version": "0.0.1", "description": "", "main": "index.js", - "scripts": {}, + "scripts": { + "build": "tsup", + "dev": "tsup --watch" + }, "keywords": [], "author": "imput ", "license": "MIT", @@ -13,5 +16,21 @@ "turnstile-types": "^1.2.2", "typescript": "^5.4.5", "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"] } } diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts new file mode 100644 index 00000000..1150310b --- /dev/null +++ b/packages/api-client/src/index.ts @@ -0,0 +1,3 @@ +export * from "./turnstile-api"; +export * from "./unauthenticated-api"; +export * from "./types/interface";