From ea51d8df418d7e7bed629468e394b4a68d8a5fb9 Mon Sep 17 00:00:00 2001 From: EfeDurmaz16 Date: Thu, 27 Aug 2026 00:57:45 +0300 Subject: [PATCH] chore(ack-pay): address review polish from #120 Move schemas.test.ts next to the schemas it tests and drop the unexported timestampSchema name from the changeset. --- .changeset/dedupe-timestamp-schema.md | 7 +++---- packages/ack-pay/src/{ => schemas}/schemas.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) rename packages/ack-pay/src/{ => schemas}/schemas.test.ts (97%) diff --git a/.changeset/dedupe-timestamp-schema.md b/.changeset/dedupe-timestamp-schema.md index cf1293a6..af0b8af6 100644 --- a/.changeset/dedupe-timestamp-schema.md +++ b/.changeset/dedupe-timestamp-schema.md @@ -6,7 +6,6 @@ Reject invalid `expiresAt` values in `paymentRequestSchema` instead of throwing. Previously the `expiresAt` transform called `new Date(input).toISOString()` directly, so an unparseable value (e.g. `"invalid-date"`) threw a `RangeError` -out of `safeParse` rather than producing a validation error. A shared -`timestampSchema` now validates the date is parseable before normalizing it to -an ISO string, and the valibot and zod schemas share the same accept/reject -behavior. +out of `safeParse` rather than producing a validation error. The schema now +validates that the date is parseable before it normalizes the value to an ISO +string, and the valibot and zod schemas share the same accept/reject behavior. diff --git a/packages/ack-pay/src/schemas.test.ts b/packages/ack-pay/src/schemas/schemas.test.ts similarity index 97% rename from packages/ack-pay/src/schemas.test.ts rename to packages/ack-pay/src/schemas/schemas.test.ts index 802b45c8..735b3ead 100644 --- a/packages/ack-pay/src/schemas.test.ts +++ b/packages/ack-pay/src/schemas/schemas.test.ts @@ -1,8 +1,8 @@ import * as v from "valibot" import { describe, expect, it } from "vitest" -import { paymentRequestSchema as valibotPaymentRequestSchema } from "./schemas/valibot" -import { paymentRequestSchema as zodPaymentRequestSchema } from "./schemas/zod" +import { paymentRequestSchema as valibotPaymentRequestSchema } from "./valibot" +import { paymentRequestSchema as zodPaymentRequestSchema } from "./zod" const paymentRequest = { id: "test-payment-request-id",