@fabricorg/adoption-bindings

中文文档
0.2.7发布于 2026/11/07MITTypeScriptESM + CJS零依赖近 30 天下载 2259

Validates a vertical's adoption binding against a capability's published usage contract.

原始使用文档

@fabricorg/adoption-bindings

Validates a vertical's adoption binding against a capability's published usage contract.

A capability publishes what it needs filled — roles, extension slots, action intents, data shapes. A vertical adopts it by declaring a binding: which component fills each role, which fragment fills each slot, which actions it overrides, how it maps data. This package checks that the binding actually satisfies the contract, so adopting a capability is a reviewed pull request rather than a runtime surprise.

pnpm add -D @fabricorg/adoption-bindings
import { assertBindingValid } from "@fabricorg/adoption-bindings";

assertBindingValid({ contract, binding, packs, coreComponents });

validateBinding returns every finding rather than the first, so one CI run tells a vertical everything it has to change. assertBindingValid throws with each finding's path listed, for use as a build step.

What it checks

  • Every role the capability declares is bound, and no binding invents a role it does not.
  • A bound component resolves — in a registered pack, or in the core vocabulary — and a pack component declares role:<name> for the role it fills.
  • A slot fill names a declared slot and resolves to a view some known capability publishes.
  • An action override targets an intent the capability actually dispatches.
  • A data map names a view the capability publishes, and maps fields that exist in its shape.

Where this sits

This is enterprise-layer tooling. It consumes Fabric contracts; it is not part of Fabric. Per ADR 0011 no Fabric package defines a binding schema, validates a binding, or knows that bindings exist — the usage contract is Fabric's, the binding is the vertical's, and this package is the seam between them.

It ships from this repository alongside the other separately-versioned build-time tools, in the same integration tier as @fabricorg/gen-sdui. What matters is that the governance core and its hosts never interpret a binding — which the Boundary Guard enforces per package, not per repository.

版本与发布记录

@fabricorg/adoption-bindings 共发布 8 个版本,首次发布于 2026/08/27;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.2.7latest2026/11/077 天前
0.2.62026/10/3114 天前
0.2.52026/10/2223 天前
0.2.42026/10/2124 天前
0.2.32026/10/2025 天前
0.2.22026/09/052 个月前

关于 @fabricorg/adoption-bindings 的常见问题

@fabricorg/adoption-bindings 是什么?

Validates a vertical's adoption binding against a capability's published usage contract.

如何安装 @fabricorg/adoption-bindings?

在项目目录运行 npm install @fabricorg/adoption-bindings,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@fabricorg/gen-capability(^0.4.0 || ^0.5.0)、@fabricorg/experience-contracts(^1.1.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fabricorg/adoption-bindings 支持 TypeScript 吗?

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

@fabricorg/adoption-bindings 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fabricorg/adoption-bindings 可以商用吗?

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

@fabricorg/adoption-bindings 的下载量有多少?

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

@fabricorg/adoption-bindings 还在维护吗?

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