hono-stripe 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +21 -0
  2. package/package.json +36 -15
package/README.md CHANGED
@@ -323,6 +323,27 @@ The docs site lives in [`docs/`](./docs) (Starlight + TypeDoc, deployed to
323
323
  Cloudflare Workers Static Assets). Run it locally with `pnpm -C docs dev`; see
324
324
  [`docs/README.md`](./docs/README.md) for build/deploy details.
325
325
 
326
+ ## Development
327
+
328
+ ```sh
329
+ pnpm test # unit tests (mocked Stripe client, no network)
330
+ pnpm test:integration # integration tests against stripe-mock
331
+ ```
332
+
333
+ The integration tests (`test/integration/`) drive the real `stripe` SDK over
334
+ HTTP against [stripe-mock](https://github.com/stripe/stripe-mock), so they
335
+ catch what mocked unit tests can't: `config` reaching the SDK, the Fetch HTTP
336
+ client on Workers, and real SDK errors flowing through `stripeErrorHandler`.
337
+ Start stripe-mock first — the run fails up front if it is not reachable:
338
+
339
+ ```sh
340
+ docker run --rm -p 12111-12112:12111-12112 stripe/stripe-mock:v0.206.0
341
+ ```
342
+
343
+ Override the address with `STRIPE_MOCK_HOST` / `STRIPE_MOCK_PORT`. stripe-mock
344
+ is stateless and does not simulate card declines, so those paths stay in the
345
+ unit tests.
346
+
326
347
  ## Bundle size
327
348
 
328
349
  Staying thin is a feature. CI enforces a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono-stripe",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "All-in-one Stripe toolkit for Hono and HonoX — typed client middleware, verified + typed webhook routing with delivery dedupe, testing fixtures, and JSX payment UI. Works on Cloudflare Workers and Node.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -8,24 +8,44 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.cjs"
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
14
19
  },
15
20
  "./webhook": {
16
- "types": "./dist/webhooks.d.ts",
17
- "import": "./dist/webhooks.js",
18
- "require": "./dist/webhooks.cjs"
21
+ "import": {
22
+ "types": "./dist/webhooks.d.ts",
23
+ "default": "./dist/webhooks.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/webhooks.d.cts",
27
+ "default": "./dist/webhooks.cjs"
28
+ }
19
29
  },
20
30
  "./testing": {
21
- "types": "./dist/testing.d.ts",
22
- "import": "./dist/testing.js",
23
- "require": "./dist/testing.cjs"
31
+ "import": {
32
+ "types": "./dist/testing.d.ts",
33
+ "default": "./dist/testing.js"
34
+ },
35
+ "require": {
36
+ "types": "./dist/testing.d.cts",
37
+ "default": "./dist/testing.cjs"
38
+ }
24
39
  },
25
40
  "./ui": {
26
- "types": "./dist/ui.d.ts",
27
- "import": "./dist/ui.js",
28
- "require": "./dist/ui.cjs"
41
+ "import": {
42
+ "types": "./dist/ui.d.ts",
43
+ "default": "./dist/ui.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/ui.d.cts",
47
+ "default": "./dist/ui.cjs"
48
+ }
29
49
  }
30
50
  },
31
51
  "files": [
@@ -42,8 +62,9 @@
42
62
  "lint:fix": "biome check --write .",
43
63
  "format": "biome format --write .",
44
64
  "format:check": "biome format .",
45
- "test": "vitest run",
46
- "test:watch": "vitest",
65
+ "test": "vitest run --project unit",
66
+ "test:watch": "vitest --project unit",
67
+ "test:integration": "vitest run --project integration",
47
68
  "size": "size-limit",
48
69
  "size:json": "size-limit --json",
49
70
  "docs:dev": "pnpm -C docs dev",