Agent-focused notes for safe, fast contributions. Format reference: agents.md.
npm i
npm run typecheck
npm run testExamples:
cd examples/react && npm i && npm run dev
cd examples/svelte && npm i && npm run devconformal:getPath,setPath,decode,parseFormData,serialize,coerceString,coerceNumber,coerceBigint,coerceBoolean,coerceDate,coerceFile,coerceArray; types:PathsFromObject,Submissionconformal/valibot:coerceString,coerceNumber,coerceBoolean,coerceDate,coerceBigint,coerceFile,coerceArray(experimental)conformal/zod:string,number,boolean,date,bigint,enum,file,url,email,object,array(deprecated)
Exports live in src/index.ts, src/valibot/index.ts, and src/zod/index.ts.
parseFormDatais synchronous; throwTypeError("Schema validation must be synchronous")if schema returns a Promise.setPath/getPathare immutable and prototype‑safe (block__proto__,constructor.prototype); support nested arrays/objects and sparse indices.Submissionalways includesinput; separatefieldErrors(dot/bracket paths, numeric indices in brackets) fromformErrors.serialize: number/bigint →.toString(), boolean →"on"/""(configurable),Date→ ISO via.toISOString().- Types
InputValue<T>andPathsFromObject<T>must remain correct for nested structures and browser types.
- TypeScript strict mode (see
tsconfig.jsonflags). - ESM-only, isomorphic runtime (no Node-only APIs).
- Prettier formatting:
npm run format:write. - Keep runtime deps minimal;
valibotis an optional peer dependency.
# Fast local CI
npm run format:check && npm run typecheck && npm run test
# Focus tests
npx vitest run -t "<name>" # by test name
npx vitest run test/parse.test.ts- Add a Valibot coercion pipe: edit
src/valibot/coerce.ts, re-export insrc/valibot/index.ts, add tests intest/valibot/coerce.test.ts, update README's Valibot section. - Fix path bug: add failing test in
test/path.test.ts, updatesrc/path.ts(immutability + guards), run full checks. - Public API change: update
src/index.ts, tests, README; keep exports stable.