npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jayoncode/form-intelligence-yup

v2.2.1

Published

Yup schema adapter for @jayoncode/form-intelligence.

Readme

Form Intelligence — Yup

npm version Become a Sponsor

Bridge Yup schemas into @jayoncode/form-intelligence.

The problem

Legacy apps already validate with Yup across APIs and admin UIs. Rewriting those schemas into another validator is a migration tax; keeping two rulebooks means mismatched messages on the same fields.

The solution

yupAdapter(schema) runs your existing Yup object through Form Intelligence. Keep trusted schemas; add drafts, when() rules, and submit workflows on top.

What you get

| Capability | Detail | | ----------------------- | ------------------------------------------------------------------------------------------- | | Drop-in schema | schema: yupAdapter(yup.object({ ... })) | | Path mapping | Yup paths → form paths; friends[0].namefriends.0.name; form-level → _form | | Nested objects | Nested Yup shapes map to nested field errors | | With core workflows | Works with rules, workflow, validateOn, plugins, async submit | | Gradual migration | Reuse Yup today; adopt Zod/Valibot later without rewriting the form shell | | formatYupPath | Exported helper converting a Yup path (friends[0].name) to a form path (friends.0.name) |

Behavior notes

  • First error per path wins. yupAdapter() validates with abortEarly: false to collect every issue, but if Yup reports more than one error for the same path, only the first one encountered is kept.
  • Validate-only. yupAdapter() returns a SchemaAdapter — it validates values and returns { path: message }. It does not infer a TypeScript type for createForm's values from your Yup schema; type your initialValues (or the TValues generic) separately.

Install

npm install @jayoncode/form-intelligence @jayoncode/form-intelligence-yup yup

Usage

import { createForm, when } from "@jayoncode/form-intelligence";
import { yupAdapter } from "@jayoncode/form-intelligence-yup";
import * as yup from "yup";

const checkoutSchema = yup.object({
  plan: yup.string().oneOf(["starter", "enterprise"]).required(),
  email: yup.string().email().required(),
  seatCount: yup
    .number()
    .positive()
    .when("plan", {
      is: "enterprise",
      then: (s) => s.required(),
      otherwise: (s) => s.strip(),
    }),
});

const form = createForm({
  initialValues: { plan: "starter", email: "", seatCount: undefined },
  schema: yupAdapter(checkoutSchema),
  validateOn: "onBlur",
  rules: [when("plan").equals("enterprise").show("seatCount")],
  workflow: {
    autosave: { enabled: true, debounceMs: 800, onSave: (v) => api.saveDraft(v) },
  },
  async onSubmit(values) {
    await api.checkout(values);
  },
});

formatYupPath

formatYupPath(path: string | undefined): string is the same path-mapping logic yupAdapter() uses internally, exported for reuse:

import { formatYupPath } from "@jayoncode/form-intelligence-yup";

formatYupPath("friends[0].name"); // "friends.0.name"
formatYupPath(undefined); // "_form"

Docs

https://itsjayoncode.github.io/joc/packages/form-intelligence/modules/adapters

License

MIT © JayOnCode