- @settlekit/sdk: typed fetch HTTP client over the REST API; one resource client per /v1 resource (products, checkout, payments, entitlements, licenseKeys, apiKeys, bundles, github, discord, saas, escrow, agentServices…), AbortController timeouts, idempotency keys, SettleKitApiError envelope mapping. - @settlekit/react: SettleKitProvider, useEntitlement/useCheckout/useCredits hooks, <Paywall> + <UpgradeButton> (React 18, plan §4). - database: drizzle.config.ts + generated drizzle/0000_init.sql (48 tables, indexes, FKs) + db:generate/migrate/push/studio scripts. - infra: README, ARCHITECTURE, CONTRIBUTING, .env.example, .dockerignore, docker-compose.yml, per-app Dockerfiles + Dockerfile.next, Makefile. No tests. No CI/CD pipelines.
26 lines
999 B
TypeScript
26 lines
999 B
TypeScript
import { defineConfig } from "drizzle-kit";
|
|
|
|
/**
|
|
* Drizzle Kit configuration for the SettleKit schema.
|
|
*
|
|
* - `schema` points at the aggregated table definitions.
|
|
* - `out` is where generated SQL migrations are written (checked into git).
|
|
* - `dialect` is PostgreSQL (the platform's primary store).
|
|
*
|
|
* Generate a migration after changing the schema: pnpm --filter @settlekit/database db:generate
|
|
* Apply migrations against DATABASE_URL: pnpm --filter @settlekit/database db:migrate
|
|
*/
|
|
export default defineConfig({
|
|
// Point at compiled JS: the TS sources use NodeNext ".js" import specifiers
|
|
// that drizzle-kit's CJS bundler cannot resolve, but the emitted dist can.
|
|
// Run `pnpm --filter @settlekit/database build` before generating.
|
|
schema: "./dist/schema/index.js",
|
|
out: "./drizzle",
|
|
dialect: "postgresql",
|
|
strict: true,
|
|
verbose: true,
|
|
dbCredentials: {
|
|
url: process.env.DATABASE_URL ?? "postgres://postgres:postgres@localhost:5432/settlekit",
|
|
},
|
|
});
|