@colibri-social/lexicons

中文文档
2.37.0发布于 2026/11/07MITTypeScriptES Module构建来源已验证近 30 天下载 3037

Colibri lexicon schemas and the types generated from them

原始使用文档
文档目录5 节
  1. Layout
  2. The atproto space lexicons
  3. Space types
  4. Conventions the test enforces
  5. Commands

@colibri-social/lexicons

Every Colibri Social schema, the space type declarations, and the TypeScript generated from them.

Layout

  • lexicons/social/colibri/**: Colibri's own schemas
  • lexicons/com/atproto/{space,memberspace,managedspace,personalspace}/**: vendored from bluesky-social/atproto, pinned to the commit in lexicons/com/atproto/PINNED_COMMIT. Do not edit them!
  • src/generated/**: produced by pnpm codegen, verified by CI

The atproto space lexicons

lexicons/com/atproto/PINNED_COMMIT holds a commit hash, and CI fetches every vendored file from bluesky-social/atproto at that commit and fails if a single byte differs.

To move the pin:

ref=<new commit sha>
for f in packages/lexicons/lexicons/com/atproto/{space,memberspace,managedspace,personalspace}/*.json; do
  rel="lexicons/com/atproto/${f#packages/lexicons/lexicons/com/atproto/}"
  curl -sfL "https://raw.githubusercontent.com/bluesky-social/atproto/$ref/$rel" -o "$f"
done
printf '%s\n' "$ref" > packages/lexicons/lexicons/com/atproto/PINNED_COMMIT
pnpm codegen

Then read the diff. A re-vendor is a protocol change and needs a changeset.

Space types

Seven, each a lexicon whose main is "type": "space". The name field is what an OAuth consent screen shows a user, so it is written for people, not developers. Which space holds what is at the docs.

A channel is a space. The space key is the channel's identity and its configuration is the record at key self inside it, which is why the channel record carries no community or category field.

Conventions the test enforces

src/conformance.test.ts fails the build on any of these:

  • a document whose id does not match its path
  • a reference that does not resolve, uses the legacy lex: prefix, or spells out its own document instead of using #name
  • a method with no declared errors, an error that is not PascalCase, or an error with no description
  • a limit parameter that is not an integer with a minimum and a default, or an output that marks cursor required
  • a definition or property with no description
  • an em dash or a semicolon in any description
  • a space type listing a collection that is not a defined record, or with no consent-screen name
  • a permission set naming a method or space type that does not exist
  • a method not covered by any permission set, which is what stops a new endpoint shipping that no client can be granted

Commands

pnpm --filter @colibri-social/lexicons codegen

版本与发布记录

@colibri-social/lexicons 共发布 42 个版本,首次发布于 2026/08/23;过去 12 个月发布了 42 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.37.0latest2026/11/073 天前
2.36.02026/11/064 天前
2.35.02026/10/3010 天前
2.34.02026/10/2813 天前
2.33.02026/10/2417 天前
2.32.02026/10/2318 天前

关于 @colibri-social/lexicons 的常见问题

@colibri-social/lexicons 是什么?

Colibri lexicon schemas and the types generated from them

如何安装 @colibri-social/lexicons?

在项目目录运行 npm install @colibri-social/lexicons,或使用 pnpm add / yarn add / bun add。

@colibri-social/lexicons 支持 TypeScript 吗?

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

@colibri-social/lexicons 支持 ESM 还是 CommonJS?

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

@colibri-social/lexicons 可以商用吗?

@colibri-social/lexicons 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@colibri-social/lexicons 的下载量有多少?

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

@colibri-social/lexicons 还在维护吗?

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