@tap-payments/os-micro-frontend-shared

中文文档
0.3.265发布于 2026/11/02MITTypeScriptES Module

Shared components and utilities for Tap Payments micro frontends

原始使用文档
文档目录14 节
  1. What is this?
  2. Quick Start
  3. Documentation
  4. Key Features
  5. Development
  6. Publishing
  7. Automated (Recommended)
  8. Manual
  9. Contributing
  10. Project Structure
  11. Tech Stack
  12. License
  13. Links
  14. Support

os-micro-frontend-shared

Shared React component library for Tap Payments micro frontends

npm version License: MIT

What is this?

A comprehensive React component library providing:

  • 100+ UI components (buttons, tables, dialogs, forms, filters)
  • 18 custom hooks (toast, window dimensions, theme mode)
  • 47 utility modules (date/currency formatting, validation)
  • Full TypeScript support with type definitions
  • MUI-based theming with dark/light modes and RTL/LTR support
  • High-performance virtual tables for large datasets

Quick Start

npm install @tap-payments/os-micro-frontend-shared
# or
yarn add @tap-payments/os-micro-frontend-shared
import { Button, VirtualTable, useToast } from '@tap-payments/os-micro-frontend-shared'

function MyApp() {
  const toast = useToast()

  return (
    <Button variant="primary" onClick={() => toast.success('Hello!')}>
      Click me
    </Button>
  )
}

Documentation

📚 Full Documentation →

DocumentDescriptionRead Time
OverviewCapabilities, package specs, features15 min
Setup & StackInstallation, commands, workflows10 min
ArchitectureLayout, exports, module boundaries15 min
Component GuideAll components categorized with examplesReference
Component DevelopmentBuilding new components20 min

For Developers: Read in order: overview → setup → component guide.

Key Features

  • ✅ ESM-only - Modern module system with tree-shaking
  • ✅ Peer dependencies - Avoid version conflicts
  • ✅ Full TypeScript - Complete type safety
  • ✅ 100+ Components - Comprehensive UI library
  • ✅ Virtual tables - High-performance lists
  • ✅ React Hook Form - Integrated form components
  • ✅ Theming - Dark/light modes, RTL/LTR
  • ✅ Memoized - Optimized for performance

Development

# Install dependencies
yarn install

# Start dev server
yarn dev

# Build library
yarn build

# Test locally in another project
yarn push:local   # requires yalc

See Setup Guide for detailed instructions.

Publishing

Merging a PR to main automatically:

  1. Bumps patch version
  2. Commits version change
  3. Builds library
  4. Publishes to npm

The version commit uses the format chore(release): vX.Y.Z.

To find the commit for a published version:

git log --oneline --grep="release: vX.Y.Z"

Manual

# Test version (with -test tag)
yarn push:test

# Production
yarn push

See Publishing for details.

Contributing

  1. Create feature branch
  2. Make changes in src/
  3. Run yarn lint:fix and yarn prettier:fix
  4. Commit (pre-commit hooks will run)
  5. Push and create PR to main

See Development for the detailed guide.

Project Structure

src/
├── components/      # 100+ React components
├── hooks/          # 18 custom React hooks
├── utils/          # 47 utility modules
├── types/          # TypeScript type definitions
├── constants/      # App constants and configs
└── theme/          # MUI theme configuration

See Folder / Module Structure for details.

Tech Stack

  • React 18 + TypeScript 5
  • MUI (Material-UI) 5 + Emotion
  • React Hook Form + Yup
  • Vite 6 (build + dev)
  • ESLint + Prettier

See Tech Stack for the complete list.

License

MIT © Tap Payments


Support

For issues, questions, or contributions, please refer to the documentation or create an issue.

版本与发布记录

@tap-payments/os-micro-frontend-shared 共发布 2,672 个版本,首次发布于 2025/05/21;过去 12 个月发布了 1383 个版本。

版本发布日期距今
0.3.265latest2026/11/02今天
0.3.264-test.17936231192026/11/021 天前
0.3.264-test.17936202472026/11/021 天前
0.3.189-payout-v1-node24-axios2026/11/021 天前
0.3.264-test.17936096942026/11/021 天前
0.3.264-test.17935486842026/11/021 天前

其他发布通道:alpha → 0.0.173-alpha-15,production-wallet-latest → 0.1.476-production-wallet-latest,production-relic-3-6-2026 → 0.1.420-production-billing-latest,production-acceptance-authentication-latest → 0.1.420-production-acceptance-authentication-latest,production-payout-latest → 0.1.420-production-payout-latest,acceptance → 0.2.28-acceptance-v1。

关于 @tap-payments/os-micro-frontend-shared 的常见问题

@tap-payments/os-micro-frontend-shared 是什么?

Tap Payments微前端的共享组件和实用程序

如何安装 @tap-payments/os-micro-frontend-shared?

在项目目录运行 npm install @tap-payments/os-micro-frontend-shared,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18)、i18next(^22)、react-dom(^18)、@mui/material(^5)、framer-motion(^10)、react-i18next(^12)、@emotion/react(^11)、@emotion/styled(^11)、react-router-dom(^7.7.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@tap-payments/os-micro-frontend-shared 支持 TypeScript 吗?

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

@tap-payments/os-micro-frontend-shared 支持 ESM 还是 CommonJS?

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

@tap-payments/os-micro-frontend-shared 可以商用吗?

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

@tap-payments/os-micro-frontend-shared 还在维护吗?

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