@clay-design-system/registry

中文文档
0.24.0发布于 2026/11/10TypeScriptES Module零依赖近 30 天下载 1858

The Clay Registry: monday.com's marketing design system as one queryable database (components, sections, tokens, assets, rules) with a zero-dependency query layer.

原始使用文档
文档目录3 节
  1. Install
  2. Use
  3. Semantic search (optional)

@clay-design-system/registry

The Clay Registry: monday.com's marketing design system (components, sections, tokens, assets, rules) as one queryable SQLite database, with a query layer that has no runtime dependencies. Read-only; internal units are not included.

Requires Node >= 22.13 (uses the built-in node:sqlite, no flag needed).

Install

pnpm add @clay-design-system/registry

Use

import { search, get, assetUrl } from '@clay-design-system/registry'

search('hero section')                          // ranked hits: [{ id, kind, name, summary, links, score }, …]
get('section.FeaturesSection')                  // one compact record (import path, story, Figma and CDN links)
get('section.FeaturesSection', { detail: true }) // every column, plus links, relations and renders
assetUrl('asset.icon.calendar')                 // https://… CDN URL

Semantic search (optional)

The database carries one int8 sentence vector per record (embeddings, meta.embedding_model). searchHits(query, { vector }) fuses their cosine ranking with BM25 when you pass the query's embedding; await registry.embed(query) computes it when the optional @clay-design-system/embeddings package is installed (in the working directory or CLAY_EMBED_DIR; it carries the 23 MB MiniLM weights, so nothing is downloaded; CLAY_SEMANTIC=0 disables it). Without a vector, or without that package, search is BM25 exactly as before. The package has no dependencies either way.

const reg = openRegistry()
const vector = await reg.embed('airy breathing room between big blocks on phones') // undefined when semantic search is off
reg.search('airy breathing room between big blocks on phones', { vector })

Also exported: list, related, assetVariants, componentsUsingToken, allowedChildren, pageRecipe, openRegistry, the Registry class, the response types, and DB_PATH (absolute path to the shipped data/clay.sqlite, built when the package is built; gitignored in the repo). The database is the only data file: every record, link and relation is in it.

版本与发布记录

@clay-design-system/registry 共发布 15 个版本,首次发布于 2026/10/19;过去 12 个月发布了 15 个版本。

版本发布日期距今
0.24.0latest2026/11/10今天
0.23.02026/11/064 天前
0.22.02026/10/2218 天前
0.21.02026/10/2218 天前
0.20.12026/10/2119 天前
0.20.02026/10/2020 天前

关于 @clay-design-system/registry 的常见问题

@clay-design-system/registry 是什么?

The Clay Registry: monday.com's marketing design system as one queryable database (components, sections, tokens, assets, rules) with a zero-dependency query layer.

如何安装 @clay-design-system/registry?

在项目目录运行 npm install @clay-design-system/registry,或使用 pnpm add / yarn add / bun add。

@clay-design-system/registry 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@clay-design-system/registry 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@clay-design-system/registry 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@clay-design-system/registry 可以商用吗?

@clay-design-system/registry 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@clay-design-system/registry 的下载量有多少?

根据 npm 官方下载统计,@clay-design-system/registry 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,858 次,日均约 62 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@clay-design-system/registry 还在维护吗?

最新版本 0.24.0 发布于 2026/11/10(今天);至今共发布 15 个版本,其中过去 12 个月发布了 15 个;首次发布于 2026/10/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。