@dittolive/anvil

中文文档
0.0.12发布于 2026/11/06SEE LICENSE IN LICENSE.mdTypeScriptESM + CJS近 30 天下载 2561

Anvil, Ditto's React design system.

原始使用文档
文档目录7 节
  1. Installation
  2. Getting started
  3. Development
  4. Documentation
  5. Releases
  6. Package Boundary
  7. License

Anvil

Anvil is the React design system for Ditto web projects.

The component library is based on Tailwind CSS v4 and owns the shared theme, tokens, and component source detection.

Installation

Install dependencies from the repository root:

yarn install

Getting started

  1. Install the component library and Tailwind CSS.
  2. Import Tailwind and the design-system theme from your application CSS:
@import 'tailwindcss';
@import '@dittolive/anvil/theme.css';

@source './src';

Fonts are available through explicit package subpaths, for example @dittolive/anvil/font/geist/geist.css.

New icons should use the Icon component from @dittolive/anvil with a Phosphor icon passed as the svg prop.

Development

  • yarn storybook starts Storybook for local component development.
  • yarn test runs the test suite.
  • yarn lint runs linting, formatting checks, and TypeScript checks.
  • yarn build creates the production package in dist/.
  • yarn build:watch rebuilds the package when source files change.
  • yarn changeset creates a release note and semver bump for a package change.

To test local Anvil changes in another project, point that project's dependency at this checkout:

"dependencies": {
  "@dittolive/anvil": "link:../path/to/anvil"
}

Run yarn build:watch here while developing, then restore the consuming project to a released package version before committing its dependency changes.

Documentation

Run yarn storybook to browse components locally, or yarn build-storybook to produce the static documentation site.

Releases

Anvil uses Changesets for versioning, changelog generation, and npm publishing. For any user-facing package change, run yarn changeset, select the appropriate semver bump, and commit the generated .changeset/*.md file with the change.

When changes land on main, the publish workflow opens or updates a release PR that applies the pending changesets to package.json and CHANGELOG.md. Merging that release PR publishes @dittolive/anvil to npm after yarn pack:check passes.

Package Boundary

This repository is the source of truth for @dittolive/anvil. The package build is the contract: consumers should use the exports in package.json and depend on a released package version unless they are explicitly testing a local checkout.

License

Anvil is licensed under the PolyForm Noncommercial License 1.0.0. Commercial use requires separate permission from DittoLive, Inc. Please consult LICENSE.md within this package for license details.

Copyright © 2019-2026 DittoLive, Inc.

版本与发布记录

@dittolive/anvil 共发布 9 个版本,首次发布于 2026/08/13;过去 12 个月发布了 9 个版本。

版本发布日期距今
0.0.12latest2026/11/066 天前
0.0.112026/11/056 天前
0.0.102026/10/2715 天前
0.0.92026/10/1429 天前
0.0.82026/08/252 个月前
0.0.72026/08/222 个月前

关于 @dittolive/anvil 的常见问题

@dittolive/anvil 是什么?

Anvil, Ditto's React design system.

如何安装 @dittolive/anvil?

在项目目录运行 npm install @dittolive/anvil,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0 || ^19.0.0)、react-dom(^18.2.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@dittolive/anvil 支持 TypeScript 吗?

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

@dittolive/anvil 支持 ESM 还是 CommonJS?

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

@dittolive/anvil 可以商用吗?

@dittolive/anvil 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@dittolive/anvil 的下载量有多少?

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

@dittolive/anvil 还在维护吗?

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