cogsbox-shape 0.5.210 → 0.5.212

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.
@@ -32,17 +32,7 @@ function issueMatchesRelatedFields(issue, relatedFields) {
32
32
  const leaf = String(issue.path.at(-1) ?? "");
33
33
  return relatedFields.has(leaf);
34
34
  }
35
- export function wireShapeValidationOptions(box, params) {
36
- const entry = box[params.stateKey];
37
- if (!entry)
38
- return;
39
- params.setOptions({
40
- validation: {
41
- zodSchemaV4: entry.validators?.client ?? entry.schemas.client,
42
- onBlur: "error",
43
- },
44
- });
45
- }
35
+ export function wireShapeValidationOptions(box, params) { }
46
36
  /** Cross-field refine errors only — field rules are handled by state via setOptions. */
47
37
  export function validateShapeRefines(box, params) {
48
38
  if (params.event.activityType !== "blur")
@@ -93,7 +83,17 @@ const { createPlugin } = createPluginContext({
93
83
  export function createShapePlugin(box) {
94
84
  return createPlugin("shape")
95
85
  .initialState(() => buildInitialState(box))
96
- .transformState((params) => wireShapeValidationOptions(box, params))
86
+ .transformState((params) => {
87
+ const entry = box[params.stateKey];
88
+ if (!entry)
89
+ return;
90
+ params.setOptions({
91
+ validation: {
92
+ zodSchemaV4: entry.validators?.client ?? entry.schemas.client,
93
+ onBlur: "error",
94
+ },
95
+ });
96
+ })
97
97
  .onFormUpdate((params) => {
98
98
  if (params.options?.logs) {
99
99
  console.log("[shape]", params.stateKey, params.path, params.event.activityType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-shape",
3
- "version": "0.5.210",
3
+ "version": "0.5.212",
4
4
  "description": "A TypeScript library for creating type-safe database schemas with Zod validation, SQL type definitions, and automatic client/server transformations. Unifies client, server, and database types through a single schema definition, with built-in support for relationships and serialization.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",