From 4d2faed858342fe399c515508071cd6f157f26fa Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 16 Sep 2026 19:35:42 +0400 Subject: [PATCH 1/6] chore: remove paykit architecture skill --- .agents/skills/paykit-architecture/SKILL.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .agents/skills/paykit-architecture/SKILL.md diff --git a/.agents/skills/paykit-architecture/SKILL.md b/.agents/skills/paykit-architecture/SKILL.md deleted file mode 100644 index 71fdca5..0000000 --- a/.agents/skills/paykit-architecture/SKILL.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: paykit-architecture -description: not use automatically ---- - -# PayKit Architecture - -Use this before architectural, API design, Stripe integration, billing -lifecycle, database model, or product-scope decisions. - -Read `ob/spec.md` and relevant package code before making recommendations. - -Favor embedded, type-safe billing primitives that keep Stripe details isolated. -PayKit should run inside the user's app, use their database, and expose APIs that -make plans, subscriptions, entitlements, and usage billing feel like normal -application code. From 7d071084b2aff70f7e4037b013a22c0c43758d51 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 16 Sep 2026 19:36:29 +0400 Subject: [PATCH 2/6] chore: remove nvmrc and pin Node in workflows --- .github/workflows/release.yml | 2 +- .github/workflows/verify-changesets.yml | 2 +- .nvmrc | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 .nvmrc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e00023c..cd8f615 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: - node-version-file: .nvmrc + node-version: 22 cache: pnpm registry-url: "https://registry.npmjs.org" diff --git a/.github/workflows/verify-changesets.yml b/.github/workflows/verify-changesets.yml index 9fc3abb..64ae688 100644 --- a/.github/workflows/verify-changesets.yml +++ b/.github/workflows/verify-changesets.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: - node-version-file: .nvmrc + node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 2bd5a0a..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -22 From bea18bcf37a3e97e4d2f2514b6f6a8937571613c Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 16 Sep 2026 19:57:04 +0400 Subject: [PATCH 3/6] refactor: consolidate paykit build configuration --- packages/paykit/tsdown.config.ts | 45 ++++++++++++++++++++------------ tsdown.base.ts | 28 -------------------- 2 files changed, 28 insertions(+), 45 deletions(-) delete mode 100644 tsdown.base.ts diff --git a/packages/paykit/tsdown.config.ts b/packages/paykit/tsdown.config.ts index feb3ff7..8f087a5 100644 --- a/packages/paykit/tsdown.config.ts +++ b/packages/paykit/tsdown.config.ts @@ -2,22 +2,33 @@ import { fileURLToPath } from "node:url"; import { defineConfig } from "tsdown"; -import { createPackageTsdownConfig } from "../../tsdown.base.ts"; +import { preparePackageDist } from "../../scripts/prepare-package-dist.ts"; -export default defineConfig( - createPackageTsdownConfig({ - packageRoot: fileURLToPath(new URL(".", import.meta.url)), - copy: [ - { - flatten: false, - from: "src/database/migrations/**/*", - }, - ], - entry: { - index: "src/index.ts", - "cli/index": "src/cli/index.ts", - "handlers/next": "src/handlers/next.ts", - "client/index": "src/client/index.ts", +export default defineConfig({ + clean: true, + copy: [ + { + flatten: false, + from: "src/database/migrations/**/*", }, - }), -); + ], + deps: { + skipNodeModulesBundle: true, + }, + dts: true, + entry: { + index: "src/index.ts", + "cli/index": "src/cli/index.ts", + "handlers/next": "src/handlers/next.ts", + "client/index": "src/client/index.ts", + }, + fixedExtension: false, + format: "esm", + onSuccess: async () => { + await preparePackageDist(fileURLToPath(new URL(".", import.meta.url))); + }, + outDir: "dist", + platform: "node", + target: "node22", + unbundle: true, +}); diff --git a/tsdown.base.ts b/tsdown.base.ts deleted file mode 100644 index de8553f..0000000 --- a/tsdown.base.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { preparePackageDist } from "./scripts/prepare-package-dist.ts"; - -type PackageTsdownOptions = { - packageRoot: string; - entry: Record; - copy?: Array<{ from: string; flatten?: boolean }>; -}; - -export function createPackageTsdownConfig(options: PackageTsdownOptions) { - return { - clean: true, - copy: options.copy, - deps: { - skipNodeModulesBundle: true, - }, - dts: true, - entry: options.entry, - fixedExtension: false, - format: "esm", - onSuccess: async () => { - await preparePackageDist(options.packageRoot); - }, - outDir: "dist", - platform: "node", - target: "node22", - unbundle: true, - }; -} From ac606d7c65153ca509b46074a73d21958660aa40 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 16 Sep 2026 19:57:36 +0400 Subject: [PATCH 4/6] chore: remove unused lint-staged dependency --- package.json | 1 - pnpm-lock.yaml | 62 -------------------------------------------------- 2 files changed, 63 deletions(-) diff --git a/package.json b/package.json index e55608d..276fd3f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@types/node": "catalog:", "dotenv": "^17.4.2", "lefthook": "^2.1.12", - "lint-staged": "^16.2.7", "oxfmt": "^0.36.0", "oxlint": "1.66.0", "tinyglobby": "^0.2.17", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d46af4b..b6226f9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,9 +50,6 @@ importers: lefthook: specifier: ^2.1.12 version: 2.1.12 - lint-staged: - specifier: ^16.2.7 - version: 16.4.0 oxfmt: specifier: ^0.36.0 version: 0.36.0 @@ -6154,15 +6151,6 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lint-staged@16.4.0: - resolution: {integrity: sha512-lBWt8hujh/Cjysw5GYVmZpFHXDCgZzhrOm8vbcUdobADZNOK/bRshr2kM3DfgrrtR1DQhfupW9gnIXOfiFi+bw==} - engines: {node: '>=20.17'} - hasBin: true - - listr2@9.0.5: - resolution: {integrity: sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==} - engines: {node: '>=20.0.0'} - locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -6174,10 +6162,6 @@ packages: resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} engines: {node: '>=18'} - log-update@6.1.0: - resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} - engines: {node: '>=18'} - longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -7149,9 +7133,6 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rfdc@1.4.1: - resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rolldown-plugin-dts@0.23.2: resolution: {integrity: sha512-PbSqLawLgZBGcOGT3yqWBGn4cX+wh2nt5FuBGdcMHyOhoukmjbhYAl8NT9sE4U38Cm9tqLOIQeOrvzeayM0DLQ==} engines: {node: '>=20.19.0'} @@ -7337,10 +7318,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - slice-ansi@7.1.2: - resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} - engines: {node: '>=18'} - slice-ansi@8.0.0: resolution: {integrity: sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==} engines: {node: '>=20'} @@ -7422,10 +7399,6 @@ packages: strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} - string-argv@0.3.2: - resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} - engines: {node: '>=0.6.19'} - string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -13083,24 +13056,6 @@ snapshots: lines-and-columns@1.2.4: {} - lint-staged@16.4.0: - dependencies: - commander: 14.0.3 - listr2: 9.0.5 - picomatch: 4.0.4 - string-argv: 0.3.2 - tinyexec: 1.1.2 - yaml: 2.9.0 - - listr2@9.0.5: - dependencies: - cli-truncate: 5.2.0 - colorette: 2.0.20 - eventemitter3: 5.0.4 - log-update: 6.1.0 - rfdc: 1.4.1 - wrap-ansi: 9.0.2 - locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -13112,14 +13067,6 @@ snapshots: chalk: 5.6.2 is-unicode-supported: 1.3.0 - log-update@6.1.0: - dependencies: - ansi-escapes: 7.3.0 - cli-cursor: 5.0.0 - slice-ansi: 7.1.2 - strip-ansi: 7.2.0 - wrap-ansi: 9.0.2 - longest-streak@3.1.0: {} loose-envify@1.4.0: @@ -14539,8 +14486,6 @@ snapshots: reusify@1.1.0: {} - rfdc@1.4.1: {} - rolldown-plugin-dts@0.23.2(rolldown@1.0.0-rc.17)(typescript@5.9.3): dependencies: '@babel/generator': 8.0.0-rc.3 @@ -14864,11 +14809,6 @@ snapshots: slash@3.0.0: {} - slice-ansi@7.1.2: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 - slice-ansi@8.0.0: dependencies: ansi-styles: 6.2.3 @@ -14936,8 +14876,6 @@ snapshots: strict-event-emitter@0.5.1: optional: true - string-argv@0.3.2: {} - string-width@4.2.3: dependencies: emoji-regex: 8.0.0 From 62e8cbf0bf3c7f1e95543b25c50c22aab828e070 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 16 Sep 2026 19:57:46 +0400 Subject: [PATCH 5/6] docs: remove contributing guide --- CONTRIBUTING.md | 116 ------------------------------------------------ README.md | 1 - 2 files changed, 117 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index bc957db..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,116 +0,0 @@ -# Contributing to PayKit - -Thanks for your interest in contributing! This guide will help you get set up and explain how we work. - -For questions or ideas, open a [GitHub issue](https://github.com/getpaykit/paykit/issues) before starting large work. - -## Prerequisites - -- **Node.js** >= 22 -- **pnpm** (enable via `corepack enable`) -- **bun** — optional, only needed to run the demo app's scripts ([bun.sh](https://bun.sh)) - -## Local Setup - -```bash -# Fork the repository, then clone your fork -git clone https://github.com//paykit.git -cd paykit - -pnpm install -pnpm build -``` - -## Development - -```bash -pnpm dev # Watch mode (Turbo) -pnpm typecheck # tsc --build -pnpm lint # oxlint --deny-warnings -pnpm lint:fix # Auto-fix lint issues -pnpm format # oxfmt -pnpm format:check # Check formatting without writing -``` - -## Monorepo Structure - -``` -packages/ - paykit/ # Core orchestration package - dash/ # Dashboard -apps/ - demo/ # Demo app - web/ # Next.js web app -e2e/ # End-to-end tests -``` - -## Testing - -We use [Vitest](https://vitest.dev/). Run a specific test file or pattern: - -```bash -vitest /path/to/test-file -t "pattern" -``` - -- Bug fixes and new features must include tests. -- For regression tests, add a `@see` JSDoc comment with the issue URL: - -```ts -/** @see https://github.com/getpaykit/paykit/issues/123 */ -it("does not throw when ...", () => { -``` - -## Code Style - -Enforced by **oxlint** and **oxfmt** (not Prettier or Biome; do not add them). For a deeper reference on conventions and tooling, see [`AGENTS.md`](./AGENTS.md). - -Key rules: - -- TypeScript strict mode; no `any`, no `@ts-ignore` (use `@ts-expect-error` with an explanation) -- `import type` for type-only imports, separated from value imports -- `import * as z from "zod"`, never `import { z } from "zod"` -- No enums; use `as const` objects or union types -- No classes; use plain functions and objects -- Node.js built-ins use the `node:` protocol (`node:fs`, `node:path`) -- No `Buffer` in library code; use `Uint8Array` - -## Commits & Pull Requests - -We follow [Conventional Commits](https://www.conventionalcommits.org/): - -``` -feat: add Stripe webhook handler -fix: correct subscription renewal logic -docs: update README setup steps -chore: bump pnpm to 11.1.1 -``` - -- PRs target `main` -- For bug fixes or non-breaking improvements, a PR is enough -- For new features or breaking changes, open an issue first to discuss - -## Changesets - -When you change anything under `packages/`, run: - -```bash -pnpm changeset -``` - -Follow the prompts to describe the change. Commit the generated `.changeset/*.md` file with your PR. - -## Reporting Bugs - -Search [existing issues](https://github.com/getpaykit/paykit/issues) first. If none match, open a new one with: - -- A minimal reproduction -- Expected vs. actual behavior -- Node.js version and relevant package versions - -## Security - -**Do not open a public issue for security vulnerabilities.** Email [security@paykit.sh](mailto:security@paykit.sh) instead. - -## AI-Assisted Contributions - -AI-assisted PRs are welcome. The bar is the same as for any other PR: the change solves a real problem, includes tests, and the contributor can speak to the code in review. diff --git a/README.md b/README.md index 5d298d1..6dd10c2 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,6 @@ PayKit is a free and open-source project licensed under the [MIT License](./LICE You can help continue its development by: -- [Contribute to the source code](./CONTRIBUTING.md) - [Suggest new features and report issues](https://github.com/getpaykit/paykit/issues) ## Security From a6162570f7a9bc1bd1329969db8a223c0203285d Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 16 Sep 2026 19:57:56 +0400 Subject: [PATCH 6/6] docs: remove release backfill files --- .github/release-backfill/README.md | 27 --------------------------- .github/release-backfill/v0.0.6.md | 17 ----------------- .github/release-backfill/v0.1.6.md | 17 ----------------- 3 files changed, 61 deletions(-) delete mode 100644 .github/release-backfill/README.md delete mode 100644 .github/release-backfill/v0.0.6.md delete mode 100644 .github/release-backfill/v0.1.6.md diff --git a/.github/release-backfill/README.md b/.github/release-backfill/README.md deleted file mode 100644 index 8541d09..0000000 --- a/.github/release-backfill/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# GitHub release backfill - -PayKit's npm history is ahead of its public GitHub Releases. `v0.0.6` already has a Git -tag but no release. `paykitjs@0.1.6` is published on npm, but `v0.1.6` has neither a tag -nor a release. - -Review the prepared notes, then run these commands from a clean checkout of -`getpaykit/paykit`. They create only GitHub releases and the missing `v0.1.6` tag. They do -not publish npm packages. - -```sh -gh release create v0.0.6 \ - --repo getpaykit/paykit \ - --verify-tag \ - --title v0.0.6 \ - --notes-file .github/release-backfill/v0.0.6.md - -gh release create v0.1.6 \ - --repo getpaykit/paykit \ - --target 0689e655a4ae24947ecb97aceca81e798de5786f \ - --title v0.1.6 \ - --notes-file .github/release-backfill/v0.1.6.md \ - --latest -``` - -Both commands fail if the corresponding release already exists. Confirm the release -page after each command before continuing. diff --git a/.github/release-backfill/v0.0.6.md b/.github/release-backfill/v0.0.6.md deleted file mode 100644 index 428da38..0000000 --- a/.github/release-backfill/v0.0.6.md +++ /dev/null @@ -1,17 +0,0 @@ -### Features - -- Added `trustedOrigins` validation for URLs resolved from incoming requests and forwarded headers. -- Reworked `paykitjs listen` to stream webhook deliveries and apply them directly to the configured PayKit instance. Use `--forward-to` when HTTP forwarding is needed. - -### Bug fixes - -- Hardened webhook relay reconnects, retries, and replaced-session handling. -- Exported `SubscribeResult` from the public package entry point so generated declarations can name the client result type. - -## Contributors - -Thanks to everyone who contributed to this release: - -@maxktz - -**Full changelog:** [`v0.0.5...v0.0.6`](https://github.com/getpaykit/paykit/compare/v0.0.5...v0.0.6) diff --git a/.github/release-backfill/v0.1.6.md b/.github/release-backfill/v0.1.6.md deleted file mode 100644 index 06cbe6a..0000000 --- a/.github/release-backfill/v0.1.6.md +++ /dev/null @@ -1,17 +0,0 @@ -### Breaking changes - -- Made PayKit Stripe-only and moved the Stripe provider into `paykitjs`. The standalone `@paykitjs/stripe` and `@paykitjs/polar` packages, Polar support, and generic provider configuration were removed. -- Replaced the previous multi-provider database shape with the Stripe-only schema. The migration preserves Stripe data and aborts before changing the schema if it finds non-Stripe provider data or duplicate Stripe identifiers. - -### Features - -- Added USD and EUR currency configuration across product prices, validation, synchronization, subscriptions, and CLI output. -- Added Stripe configuration directly to the PayKit instance and tightened runtime option validation. - -## Contributors - -Thanks to everyone who contributed to this release: - -@maxktz - -**Full changelog:** [`v0.0.6...v0.1.6`](https://github.com/getpaykit/paykit/compare/v0.0.6...v0.1.6)