diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 5129d879..e36b2eff 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -17,6 +17,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit" }, @@ -29,6 +31,17 @@ "type-fest": "catalog:" }, "publishConfig": { - "access": "public" + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/packages/cli/package.json b/packages/cli/package.json index 0724ff51..ee361a1f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -18,6 +18,8 @@ "dist" ], "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit" }, diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 23e07cef..aa180ffd 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,3 +1,5 @@ +#!/usr/bin/env node + import { AgenticApiClient } from '@agentic/platform-api-client' import { Command } from 'commander' diff --git a/packages/cli/tsup.config.ts b/packages/cli/tsup.config.ts new file mode 100644 index 00000000..5bce0cbf --- /dev/null +++ b/packages/cli/tsup.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'tsup' + +export default defineConfig([ + { + entry: ['src/cli.ts'], + outDir: 'dist', + target: 'node18', + platform: 'node', + format: ['esm'], + splitting: false, + sourcemap: true, + minify: false, + shims: true, + dts: true + } +]) diff --git a/packages/core/package.json b/packages/core/package.json index 9386603c..b931ce8f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -17,6 +17,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit", "test:unit": "vitest run" @@ -31,6 +33,17 @@ "zod-validation-error": "catalog:" }, "publishConfig": { - "access": "public" + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/packages/core/src/rate-limit-headers.ts b/packages/core/src/rate-limit-headers.ts index 9d799b16..fdeea574 100644 --- a/packages/core/src/rate-limit-headers.ts +++ b/packages/core/src/rate-limit-headers.ts @@ -20,8 +20,8 @@ export function getRateLimitHeaders( const remainingString = remaining.toString() const resetTimeString = resetTimeSeconds.toString() - // NOTE: Cloudflare and/or origin servers like to set the x- headers, which - // can be pretty confusing since the end user gets both ratelimit headers. + // NOTE: Cloudflare and/or origin servers may set the x- headers, which can + // be pretty confusing since the end user gets both ratelimit headers. // I'm hesitant to remove any extra origin headers, since they're a nice // escape hatch for sending extra metadata, and the origin may in fact have // its own separate rate-limiting policy, which we don't necessarily want to diff --git a/packages/emails/package.json b/packages/emails/package.json index 28f8740a..900a90ba 100644 --- a/packages/emails/package.json +++ b/packages/emails/package.json @@ -1,5 +1,6 @@ { "name": "@agentic/platform-emails", + "private": true, "version": "0.1.0", "description": "Email templates for the Agentic platform.", "author": "Travis Fischer ", diff --git a/packages/hono/package.json b/packages/hono/package.json index 9ac01e07..35e375f1 100644 --- a/packages/hono/package.json +++ b/packages/hono/package.json @@ -1,5 +1,6 @@ { "name": "@agentic/platform-hono", + "private": true, "version": "0.1.0", "description": "Shared Hono utilities for the Agentic platform.", "author": "Travis Fischer ", diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index 8a794a31..c482df74 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -2,16 +2,6 @@ "name": "@agentic/json-schema", "version": "0.0.1", "description": "A JSON schema validator that will run on Cloudflare workers. Supports drafts 4, 7, 2019-09, and 2020-12.", - "keywords": [ - "json-schema", - "jsonschema", - "json", - "schema", - "cloudflare", - "worker", - "workers", - "service-worker" - ], "authors": [ "Jeremy Danyow ", "Travis Fischer " @@ -30,6 +20,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit", "test:unit": "vitest run" @@ -38,6 +30,27 @@ "json-schema-test-suite": "github:json-schema-org/JSON-Schema-Test-Suite#76b529f" }, "publishConfig": { - "access": "public" - } + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } + }, + "keywords": [ + "json-schema", + "jsonschema", + "json", + "schema", + "cloudflare", + "worker", + "workers", + "service-worker" + ] } diff --git a/packages/openapi-utils/package.json b/packages/openapi-utils/package.json index e14fed4d..f3488e1f 100644 --- a/packages/openapi-utils/package.json +++ b/packages/openapi-utils/package.json @@ -17,6 +17,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit", "test:unit": "vitest run" @@ -33,11 +35,22 @@ "fast-uri": "catalog:", "plur": "catalog:" }, - "publishConfig": { - "access": "public" - }, "devDependencies": { "@hono/node-server": "catalog:", "hono": "catalog:" + }, + "publishConfig": { + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/packages/platform/package.json b/packages/platform/package.json index 1295ffc0..ae586bc5 100644 --- a/packages/platform/package.json +++ b/packages/platform/package.json @@ -17,6 +17,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit", "test:unit": "vitest run" @@ -35,6 +37,17 @@ "@types/semver": "catalog:" }, "publishConfig": { - "access": "public" + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/packages/tool-client/package.json b/packages/tool-client/package.json index 23ee635e..1d900862 100644 --- a/packages/tool-client/package.json +++ b/packages/tool-client/package.json @@ -17,6 +17,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit" }, @@ -27,5 +29,19 @@ "@agentic/platform-types": "workspace:*", "@agentic/platform-validators": "workspace:*", "ky": "catalog:" + }, + "publishConfig": { + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/packages/types/package.json b/packages/types/package.json index e3838ee8..c7cdcae2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -18,6 +18,8 @@ }, "scripts": { "generate": "openapi-typescript http://localhost:3001/docs --output ./src/openapi.d.ts", + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit", "test:unit": "vitest run" @@ -36,6 +38,17 @@ "zod-to-json-schema": "catalog:" }, "publishConfig": { - "access": "public" + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/packages/validators/package.json b/packages/validators/package.json index 58727761..38b841cb 100644 --- a/packages/validators/package.json +++ b/packages/validators/package.json @@ -17,6 +17,8 @@ ".": "./src/index.ts" }, "scripts": { + "build": "tsup", + "clean": "del dist", "test": "run-s test:*", "test:typecheck": "tsc --noEmit", "test:unit": "vitest run" @@ -26,5 +28,19 @@ "@paralleldrive/cuid2": "catalog:", "email-validator": "catalog:", "type-fest": "catalog:" + }, + "publishConfig": { + "access": "public", + "files": [ + "dist" + ], + "exports": { + "types": "./dist/index.ts", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "default": "./dist/index.js" + } + } } } diff --git a/readme.md b/readme.md index de8641a0..90fb2c62 100644 --- a/readme.md +++ b/readme.md @@ -45,6 +45,8 @@ - may need to update our `drizzle-orm` fork - simplify `AgenticToolClient` and only require one package per TS LLM SDK - `createAISDKToolsFromIdentifier(projectIdentifier)` +- how to have internal packages reference TS source and publish to npm with compiled JS? + - also publish to JSR? ## TODO: Post-MVP diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..82e76f2a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@fisch0920/config/tsconfig-node", + "include": ["*.config.ts"], + "exclude": ["node_modules"] +} diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 00000000..bbb2d78b --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'tsup' + +export default defineConfig([ + { + entry: ['src/index.ts'], + outDir: 'dist', + target: 'node18', + platform: 'node', + format: ['esm'], + splitting: false, + sourcemap: true, + minify: false, + shims: true, + dts: true + } +])