@design-parity/export-driver

中文文档
1.18.0发布于 2026/11/07Apache-2.0ES Module构建来源已验证近 30 天下载 8201

The design-artifacts export driver: turns a compose-preview render and a catalog.spec.json into the importable design-artifacts/ delivery branch. Run as design-artifacts <script> [args].

原始使用文档
文档目录3 节
  1. Running a script
  2. Where the source is
  3. Tests

@design-parity/export-driver

The design-artifacts export driver. It turns a rendered @Preview module and a catalog.spec.json into the importable design-artifacts/<system> delivery branch that preview.coo.ee serves and the Figma importer reads: the catalog, design pages, design references, parity findings and issues, and the Remote Compose comparison lanes.

Rendering itself is the compose-preview CLI's job; the driver reads its output.

Running a script

Every script is one file in this package. Run any of them through the design-artifacts command, with the script's name and its own arguments:

npx -p @design-parity/export-driver@<version> design-artifacts validate-catalog-spec --spec catalog.spec.json
npx -p @design-parity/export-driver@<version> design-artifacts generate-design-catalog --help

The name may carry its .mjs or .sh extension or not. Pin an exact version: the reusable workflow that runs this driver treats the version as the code it executes.

Four inputs default to paths beside or inside a compose-ai-tools checkout, which an installed package does not have. Pass them explicitly when running from the package:

  • rc-compare --fonts <dir>: the typeface directory the Remote Compose lanes render with. RC_FONTS_DIR=<dir> sets the same default for every script and test; the published CMP/Wasm player distribution's fonts/ carries these faces.
  • RC_PLAYER_JS_BUNDLE=<bundle.js>: the Remote Compose player bundle the browser lanes and tests load.
  • COMPOSE_PREVIEW_SERVER_ROOT=<dir>: a compose-preview-server checkout (or just its server/src/main/resources/ee/schimke/composeai/cli/serve/assets/format-compare.js), which emit-design-references drives to bake each reference's match score. Without it the references publish unscored and the log says why.

Where the source is

This package is the driver's source, and its only copy: change it here. It started as a copy of compose-ai-tools' scripts/design-artifacts/ at 4986e21, which compose-ai-tools has since deleted. compose-ai-tools' workflows run this package, installed from a lockfile in .github/design-artifacts-driver/ that Renovate moves (docs/design-artifacts/CONSOLIDATION.md). bin/ and package-scripts/ exist only here.

Tests

npm test runs the driver's node --test suites through package-scripts/run-tests.mjs. That leaves out the checks that assert the driver agrees with compose-ai-tools itself (its workflow file, Kotlin sources, sample specs and lockfile), which compose-ai-tools runs against the installed package (its scripts/design-artifacts/driver-contract.test.mjs); the runner lists each with its reason. Without their inputs, the browser lanes skip (no Playwright Chromium or player bundle), the font checks are left out (no RC_FONTS_DIR) and the cross-repository mirrors skip (no COMPOSE_PREVIEW_SERVER_ROOT).

CI's export-driver-browser job supplies all of them: the published Remote Compose players from Maven Central at RC_PLAYERS_VERSION, their fonts/, three compose-preview-server sources from its latest release, and Chromium. It sets RC_CMP_WASM_REQUIRE and RC_PLAYER_JS_BUNDLE_REQUIRE, so there a missing input fails rather than skips.

版本与发布记录

@design-parity/export-driver 共发布 18 个版本,首次发布于 2026/10/06;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.18.0latest2026/11/074 天前
1.17.02026/10/2617 天前
1.16.12026/10/1824 天前
1.16.02026/10/1726 天前
1.15.02026/10/1528 天前
1.14.12026/10/1230 天前

其他发布通道:bootstrap → 0.1.24。

关于 @design-parity/export-driver 的常见问题

@design-parity/export-driver 是什么?

The design-artifacts export driver: turns a compose-preview render and a catalog.spec.json into the importable design-artifacts/ delivery branch. Run as design-artifacts <script> [args].

如何安装 @design-parity/export-driver?

在项目目录运行 npm install @design-parity/export-driver,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 design-artifacts,可以用 npx design-artifacts 直接运行。

@design-parity/export-driver 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/design-parity__export-driver 是否存在。

@design-parity/export-driver 支持 ESM 还是 CommonJS?

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

@design-parity/export-driver 需要什么版本的 Node.js?

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

@design-parity/export-driver 可以商用吗?

@design-parity/export-driver 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@design-parity/export-driver 的下载量有多少?

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

@design-parity/export-driver 还在维护吗?

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