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

@huiliyi37/dsh-client-schema-form

v0.3.0

Published

Schema/draft model layer for settings editors: rehydrates a serialized schemastery schema, validates drafts, and edits them immutably by path

Readme

@huiliyi37/dsh-client-schema-form

English | 中文

面向 settings 编辑器的 schema/草稿模型层。wire 侧的 settings.describe 携带每个 namespace 的序列化 schemastery schema(schema.toJSON() 的 ref 信封);rehydrateSchemanew Schema(json) 将其还原(rehydrate)为活的校验器——在宿主上校验分节的那份 schema 对象,就是在浏览器里校验草稿的那份对象,因此客户端校验绝不会偏离 Service Definition 的校验。编辑器各自渲染自己的控件(Models 页围绕它在此探测到的字段手写自己的卡片);该包不含任何 React,也不做任何渲染。

约定

编辑的单元是用户分节草稿:一个以不可变方式编辑的普通对象(setPath 会物化中间对象,deletePath 即逐字段重置——去掉该键,解析值便回退到组合 base 与 schema 默认值)。字段只要出现在草稿中就被标记为已覆盖hasPath)——判定采用存在性语义而非值比较,与 settings seam 的分层方式严格对应。nodeAtPath 解析可配置提供方目录 settingsPath 所寻址的 schema 节点(object 属性按名称解析,dict 条目经由 inner),编辑器因此可以在决定渲染什么之前,先探测某提供方的 profile 携带哪些字段(及其 meta.role);无法解析的路径返回 undefined,调用方因此会大声降级,而不是渲染出错误的子树。validateDraft(schema, draft) 运行还原出的校验器并返回其失败消息,页面因此可以在写入前拒绝无效草稿。

Model Experience

无。该包支撑的是浏览器配置编辑器;这里没有任何内容进入模型请求。

KV Cache effect

无;该包既不组装也不发送提供方请求。

Known Limitations and Deferred Work

  • 重建 schema 会执行所收到的信封——rehydrateSchema 会重建一个活的 schemastery 校验器,而 schemastery 通过 new Function 复活序列化过的 callback,因此 schema 信封是可执行内容,而非惰性数据。只有信封来自提供该页面的同一受信任 host 时才安全;该协议没有跨信任边界使用的惰性表示。
  • 校验是草稿级的,而非逐字段——validateDraft 报告 schemastery 的第一条失败消息及其 $.path;它不会把错误映射到各个控件。
  • 没有通用渲染器——消费方在这些辅助函数上构建功能专用表单。Web 配置面 Agent Note 记录该权衡。