@arbor-education/design-system.components

中文文档
4.9.1发布于 2026/11/06MITTypeScriptES Module近 30 天下载 3653

The component library for the design system (the baby)

原始使用文档
文档目录15 节
  1. Release
  2. Storybook
  3. Consuming the package
  4. Local setup
  5. Prerequisites
  6. Steps
  7. Commands
  8. Development
  9. Building
  10. Testing
  11. Linting
  12. Creating a new component
  13. Local development with a consumer project
  14. Version management
  15. Contributing

@arbor-education/design-system.components

The React component library for the Arbor design system. Components are built with TypeScript, styled with Sass, developed in Storybook, and tested with Vitest. This library serves millions of students and educators across the UK — handle with care.


Release

The latest version of the design system available to install is:

NPM Version

Storybook

The component library is documented and previewed in Storybook.

Storybook

Production Storybook (built on every push to main): https://main--6aad454d6baef787355e085a.chromatic.com/

Per-PR Storybook previews: every pull request automatically triggers a Chromatic build. Once it completes, a bot will comment on your PR with links to both the Storybook preview and the Chromatic visual diff for that branch.


To start the development server on port 6006:

yarn storybook

To run the story tests:

yarn test:storybook

Consuming the package

If you're integrating this library into a consumer project, check out the guide on Confluence:

Consuming the design system NPM package


Local setup

Prerequisites

  • nvm for Node version management
  • yarn for package management

Steps

nvm use
yarn install
yarn storybook

Storybook will build and open in your browser with hot reloading ready for development.


Commands

Development

CommandDescription
yarn storybookStart Storybook dev server on port 6006
yarn watchWatch mode — rebuilds and pushes to Yalc consumers on changes

Building

CommandDescription
yarn buildFull production build (TypeScript + tsc-alias + Sass)
yarn tscTypeScript compilation only
yarn check-typesType check without emitting files

Testing

CommandDescription
yarn testRun Vitest in watch mode
yarn test:coverageRun tests once with coverage report

Linting

CommandDescription
yarn style-lintLint SCSS files with stylelint

ESLint runs automatically on staged TypeScript files via lint-staged on git commit.


Creating a new component

Use the scaffolding script to generate all necessary files for a new component:

yarn create-component <ComponentName>

This creates Component.tsx, Component.test.tsx, Component.stories.tsx, and component.scss, and automatically adds the exports to src/index.ts and src/index.scss.


Local development with a consumer project

This library uses Yalc for local linking.

First time setup — install Yalc globally:

npm i yalc -g

Link the library to a consumer project:

# In this repo — build and publish to the local Yalc store
yarn build
yalc publish

# In the consumer project — add the local package
yalc add @arbor-education/design-system.components

For active development with hot updates, use watch mode instead:

# In this repo — automatically rebuilds and pushes to Yalc on file changes
yarn watch

Version management

This library uses Changesets for versioning and changelog generation.

If your change affects the public API (new components, changed props, removed exports), create a changeset before opening your PR:

yarn changeset

Contributing

Before opening a PR, please read CONTRIBUTING.md. Key points:

  • One PR, one thing — if the title needs "and" or "also", split it
  • Keep meaningful code diffs under 400 lines
  • All tests must pass (yarn test:coverage)
  • All type checks must pass (yarn check-types)
  • Use the PR template — fill in every section

版本与发布记录

@arbor-education/design-system.components 共发布 122 个版本,首次发布于 2025/10/09;过去 12 个月发布了 118 个版本。

版本发布日期距今
4.9.1latest2026/11/061 天前
4.9.02026/11/052 天前
4.8.02026/11/052 天前
4.7.12026/11/025 天前
4.7.02026/10/308 天前
4.6.32026/10/2612 天前

其他发布通道:test → 0.0.6-test.2,alpha → 4.7.0-alpha.0。

关于 @arbor-education/design-system.components 的常见问题

@arbor-education/design-system.components 是什么?

The component library for the design system (the baby)

如何安装 @arbor-education/design-system.components?

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

@arbor-education/design-system.components 支持 TypeScript 吗?

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

@arbor-education/design-system.components 支持 ESM 还是 CommonJS?

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

@arbor-education/design-system.components 可以商用吗?

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

@arbor-education/design-system.components 的下载量有多少?

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

@arbor-education/design-system.components 还在维护吗?

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