@sme.up/ketchup2

中文文档
3.0.0-SNAPSHOT-20261102110247发布于 2026/11/02Apache-2.0TypeScriptES Module

Sme.UP web components library

原始使用文档
文档目录6 节
  1. Getting started
  2. Development
  3. Validation
  4. Visual Regression Testing
  5. Shapes and Components
  6. Allowed components data formats

Ketchup Next Gen

Ketchup2 is a TypeScript-first React component library designed specifically for Smeup business applications. It provides:

  • Pre-built UI components organized by domain (basic, functional, and complex components)
  • Data-driven architecture that works seamlessly with Smeup data structures
  • Design system integration with consistent tokens for colors, spacing, and typography
  • Comprehensive documentation via Storybook and MDX guides
  • Full test coverage with unit and visual regression testing

Key Focus: Building enterprise-grade business UIs with Smeup-specific data patterns and accessibility in mind.

Getting started

See prerequisite and Init docs page to start working on the library.

Development

See Project Structure to learn how the project is structured. See Styleguide to learn our convention. See First Example to gain confidence creating your first component

Validation

See Development Process

Visual Regression Testing

  • Canonical VRT environment is Docker (Linux + Playwright image).
  • Run local VRT with the same setup used in CI:
    • docker compose run --rm vrt
    • npm run test:vrt
  • Update snapshots locally:
    • npm run test:vrt:update
  • CI can also regenerate snapshots when PR has label update snapshots (or via manual dispatch input).

Shapes and Components

If you want to know what shapes/components are currently supported you can checkout here: Shapes Status
Component Status

Allowed components data formats

This component library is designed to work strictly with a predefined set of data formats. This ensures consistency, reliability, and full interoperability within the library and for all its consumers. Data formats

版本与发布记录

@sme.up/ketchup2 共发布 893 个版本,首次发布于 2025/03/25;过去 12 个月发布了 506 个版本。

版本发布日期距今
3.0.0-SNAPSHOT-20261102110247latest2026/11/021 天前
3.0.0-SNAPSHOT-202611021008592026/11/021 天前
3.0.0-SNAPSHOT-202611021003322026/11/021 天前
3.0.0-SNAPSHOT-202610301340502026/10/303 天前
3.0.0-SNAPSHOT-202610301340052026/10/303 天前
3.0.0-SNAPSHOT-202610300908412026/10/304 天前

其他发布通道:snapshot → 2.0.0-SNAPSHOT-20251212092736,alpha → 2.0.0-alpha.2。

关于 @sme.up/ketchup2 的常见问题

@sme.up/ketchup2 是什么?

中小企业。UP web组件库

如何安装 @sme.up/ketchup2?

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

@sme.up/ketchup2 支持 TypeScript 吗?

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

@sme.up/ketchup2 支持 ESM 还是 CommonJS?

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

@sme.up/ketchup2 需要什么版本的 Node.js?

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

@sme.up/ketchup2 可以商用吗?

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

@sme.up/ketchup2 还在维护吗?

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