### Install @coze-arch/pkg-root-webpack-plugin
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/utils/pkg-root-webpack-plugin/README.md
Add the package to your project's dependencies in package.json and run 'rush update' to install.
```json
{
"dependencies": {
"@coze-arch/pkg-root-webpack-plugin": "workspace:*"
}
}
```
--------------------------------
### Run Development Server
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/README.md
Use this command to start the local development server for coze-design.
```bash
rushx dev
```
--------------------------------
### Example output of `clear-build-cache`
Source: https://context7.com/coze-dev/rush-arch/llms.txt
Illustrates the typical output when the `clear-build-cache` script is executed, showing which directories and files are cleaned.
```sh
# Output example:
# Clean common/temp/build-cache
# Clean packages/utils/logger/tsconfig.tsbuildinfo
# Clean packages/utils/logger/.eslintcache
# Clean packages/components/coze-design/lib
```
--------------------------------
### Start npm MCP Server CLI
Source: https://context7.com/coze-dev/rush-arch/llms.txt
Use this command to start the MCP server in HTTP/SSE mode for IDE integrations or stdio mode for direct terminal/LLM use. For HTTP mode, specify the port. The stdio mode communicates over stdin/stdout.
```sh
npx @coze-arch/npm-mcp-server@latest serve --port 3000
```
```sh
npx @coze-arch/npm-mcp-server@latest start
```
--------------------------------
### Install Rush Globally
Source: https://github.com/coze-dev/rush-arch/blob/main/README.md
Install the Microsoft Rush tool globally if it's not already present on your system. This is a prerequisite for monorepo development.
```sh
npm install -g @microsoft/rush
```
--------------------------------
### Run NPM MCP Server Locally
Source: https://github.com/coze-dev/rush-arch/blob/main/README.md
If developing locally, navigate to the 'mcp/npm' directory and use this command to start the HTTP server.
```sh
cd mcp/npm
npm run serve
```
--------------------------------
### Line Progress Examples
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/progress/index.mdx
Demonstrates basic line progress with default settings, custom height, and custom stroke color.
```tsx
import { Progress } from '@coze-arch/coze-design';
```
--------------------------------
### Start NPM MCP Server on a Custom Port
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md
Specify a custom port when starting the server using npx. The server will be accessible at http://localhost:/sse.
```sh
npx @coze-arch/npm-mcp-server@latest serve --port 4000
```
--------------------------------
### Update and Install Monorepo Dependencies
Source: https://github.com/coze-dev/rush-arch/blob/main/README.md
After cloning, run this command to ensure all project dependencies within the monorepo are updated and installed correctly.
```sh
rush update
```
--------------------------------
### Basic Usage of PkgRootWebpackPlugin
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/utils/pkg-root-webpack-plugin/README.md
Import and use the PkgRootWebpackPlugin in your project. Specific usage examples are pending.
```typescript
import { /* exported functions/components */ } from '@coze-arch/pkg-root-webpack-plugin';
// Example usage
// TODO: Add specific usage examples
```
--------------------------------
### Badge Positioning Examples
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/badge/index.mdx
Illustrates how to position the Badge component using the 'position' prop, including rightTop and rightBottom.
```tsx
import { Badge } from '@coze-arch/coze-design';
BD
BD
```
--------------------------------
### Search npm Packages via MCP Client
Source: https://context7.com/coze-dev/rush-arch/llms.txt
This TypeScript example demonstrates how to use the MCP client to search for npm packages. It connects to an SSE transport, calls the 'searchNpmPackages' tool with various filters and pagination options, and then parses the results. Ensure the client is configured with necessary capabilities.
```typescript
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
const transport = new SSEClientTransport(new URL('http://localhost:3000/sse'));
const client = new Client({ name: 'my-client', version: '1.0.0' }, {
capabilities: { tools: {} },
});
await client.connect(transport);
const result = await client.callTool({
name: 'searchNpmPackages',
arguments: {
keyword: 'state management',
size: 5,
from: 0,
quality: 0.65, // 0–1, default 0.65
popularity: 0.98, // 0–1, default 0.98
maintenance: 0.5, // 0–1, default 0.5
registry: 'https://registry.npmjs.org', // or 'https://registry.npmmirror.com'
},
});
const packages = JSON.parse(result.content[0].text);
// [
// {
// package: {
// name: 'redux', version: '5.0.1', description: '...', keywords: [...],
// author: '...', publisher: { username: '...', email: '...' }, date: '...'
// },
// score: { final: 0.92, detail: { popularity: 0.98, quality: 0.87, maintenance: 0.91 } },
// searchScore: 100000.321
// }, ...
// ]
await client.close();
```
--------------------------------
### Start NPM MCP Server in Terminal Mode with NPX
Source: https://github.com/coze-dev/rush-arch/blob/main/README.md
This command starts the NPM MCP Server in terminal mode using npx, suitable for direct execution.
```sh
npx @coze-arch/npm-mcp-server@latest start
```
--------------------------------
### Closable Banner Example
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/banner.mdx
Illustrates how to make a banner closable using the 'closeIcon' prop. The example also shows how to implement custom closing logic with a 'useState' hook and a custom close action.
```tsx
import { Banner } from '@coze-arch/coze-design';
import { useState } from 'react';
const Demo = () => {
const [visible, setVisible] = useState(true);
return visible ? (
这是一条可关闭的提示信息
setVisible(false)}
>
不再显示
}
/>
) : null;
};
export default Demo;
```
--------------------------------
### Banner as Card Example
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/banner/index.mdx
Shows how to style the Banner component to resemble a card by setting `card=true` and `fullMode=false`. Includes a title, description, and a call-to-action button.
```tsx
import { Banner } from '@coze-arch/coze-design';
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
Don't Show Again
}
>
```
--------------------------------
### Serve NPM MCP Server with NPX
Source: https://github.com/coze-dev/rush-arch/blob/main/README.md
Use this command to directly run the NPM MCP Server without cloning the repository. It starts the server on port 3000 by default.
```sh
npx @coze-arch/npm-mcp-server@latest serve
```
--------------------------------
### Badge Component Examples
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/badge/index.mdx
Demonstrates different types and usages of the Badge component, including default, alt, and mini types, with counts and custom styles.
```tsx
import { Badge } from '@coze-arch/coze-design';
BDBot竞技场BD
```
--------------------------------
### CozInputNumber Size Examples
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/input-number/index.mdx
Demonstrates how to set the size of the CozInputNumber component using the 'size' prop. Supports 'default' and 'small' presets.
```tsx
import { CozInputNumber } from '@coze-arch/coze-design';
```
--------------------------------
### Circle Progress Examples
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/progress/index.mdx
Shows circle progress with default settings and a custom stroke color. Note: 'type="width"' in the source appears to be a typo and should likely be 'type="circle"'.
```tsx
import { Progress } from '@coze-arch/coze-design';
```
--------------------------------
### Custom Illustration Sizing
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/illustration.mdx
This example demonstrates how to apply arbitrary custom dimensions to an illustration using the width and height props, overriding default or predefined sizes.
```tsx
import { IconCozIllusDone } from '@coze-arch/coze-design/illustrations';
const Demo = () => (
);
export default Demo;
```
--------------------------------
### Progress Size Variants
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/progress.mdx
Demonstrates the three preset sizes (small, default, large) for the Progress component, including a custom height example for the default size.
```tsx
import { Progress } from '@coze-arch/coze-design';
const Demo = () => (
);
export default Demo;
```
--------------------------------
### Build Project
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/README.md
Execute this command to build the coze-design project for production.
```bash
rushx build
```
--------------------------------
### Run npm MCP Server CLI
Source: https://context7.com/coze-dev/rush-arch/llms.txt
Instructions on how to run the @coze-arch/npm-mcp-server using its CLI for both HTTP/SSE and stdio modes.
```APIDOC
## Run npm MCP Server CLI
### Description
This section details how to execute the `@coze-arch/npm-mcp-server` binary using `npx` to start the Model Context Protocol (MCP) server.
### Usage
**HTTP mode — connects on `http://localhost:3000/sse`**
```sh
npx @coze-arch/npm-mcp-server@latest serve --port 3000
```
**stdio mode — communicate over stdin/stdout**
```sh
npx @coze-arch/npm-mcp-server@latest start
```
### Cursor MCP Configuration
To configure Cursor to use the server, add the following to your `settings.json` under `Model Context Protocol → servers`:
```json
http://localhost:3000/sse
```
```
--------------------------------
### Button Disabled State Examples
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/button/index.mdx
Configure the disabled state of the Button component by setting the `disabled` prop to `true`. This example shows various button colors and sizes in a disabled state.
```tsx
import { Button } from '@coze-arch/coze-design';
```
--------------------------------
### Basic Usage
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/step.mdx
Demonstrates the most basic usage of the Steps component.
```APIDOC
## Basic Usage
Most basic usage of the steps bar.
```tsx
import { CozSteps } from '@coze-arch/coze-design';
const Demo = () => (
);
export default Demo;
```
```
--------------------------------
### Small Size SegmentTab Example
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/segment-tab/index.mdx
Renders a SegmentTab with the 'small' size. Use this for more compact UIs.
```tsx
import { SegmentTab } from '@coze-arch/coze-design';
```
--------------------------------
### Component Introduction
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/segment-tab/index.mdx
Demonstrates how to import the SegmentTab component from the '@coze-arch/coze-design' package.
```APIDOC
## Component Introduction
Import the `SegmentTab` component from `@coze-arch/coze-design`:
```tsx
import { SegmentTab } from '@coze-arch/coze-design';
```
```
--------------------------------
### Run Tests
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md
Execute the project's test suite.
```sh
npm run test
```
--------------------------------
### Import Avatar Component
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/stories/Introduction.mdx
Import the Avatar component from the '@coze-arch/coze-design' package. Ensure this package is installed in your project.
```javascript
import { Avatar } from '@coze-arch/coze-design'
```
--------------------------------
### Navigate to Project Directory
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/mcp/npm/README.md
Change directory into the NPM MCP server part of the monorepo.
```sh
cd rush-arch/mcp/npm
```
--------------------------------
### Default SegmentTab Example
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/segment-tab/index.mdx
Renders a SegmentTab with default size and options. Use this for standard tabbed interfaces.
```tsx
import { SegmentTab } from '@coze-arch/coze-design';
```
--------------------------------
### Rush Publish and Release CLI (Shell)
Source: https://context7.com/coze-dev/rush-arch/llms.txt
A three-subcommand CLI for managing the full release lifecycle: generating change files, bumping versions, creating release branches, and publishing to npm. Use '--dry-run' for testing changes before applying them. Ensure NPM_AUTH_TOKEN is set for CI publishes.
```shell
# 1. Generate change files from the current commit message
rush-publish change --commit-msg "feat: add new button component"
# 2. Bump version and create a release branch (dry-run)
rush-publish pub \
--bump-type minor \
--to @coze-arch/coze-design \
--dry-run
# Publish only specific packages
rush-publish pub \
--only @coze-arch/arco-icon @coze-arch/arco-illustration \
--bump-type patch \
--repo-url git@github.com:coze-dev/rush-arch.git
# Publish alpha/beta directly without creating a branch
rush-publish pub \
--bump-type alpha \
--from @coze-arch/coze-design \
--release
# 3. Trigger actual npm publish from a release commit/tag (CI use)
NPM_AUTH_TOKEN=xxx rush-publish release \
--registry https://registry.npmjs.org \
--allow-branches main release
```
--------------------------------
### Basic Usage
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/pagination/index.mdx
Demonstrates the most basic usage of the CozPagination component.
```APIDOC
## Basic Usage
Most basic pagination usage.
```tsx
import { CozPagination } from '@coze-arch/coze-design';
console.log(page, pageSize)}
/>;
```
```
--------------------------------
### Search and Change Callbacks
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/search.mdx
Demonstrates how to handle search events with `onSearch` and input changes with `onChange`.
```tsx
import { Search } from '@coze-arch/coze-design';
const Demo = () => (
console.log('搜索值:', value)}
onChange={(value, e) => console.log('输入值:', value)}
/>
);
export default Demo;
```
--------------------------------
### CozInputNumber Error State Example
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/input-number/index.mdx
Shows how to set the CozInputNumber component to an error state using the 'error' prop.
```tsx
import { CozInputNumber } from '@coze-arch/coze-design';
;
```
--------------------------------
### Select Component Sizes
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/select.mdx
Illustrates how to use different sizes for the Select component. It supports 'default' and 'small' sizes.
```tsx
import { Select } from '@coze-arch/coze-design';
const Demo = () => (
默认尺寸
小尺寸
);
export default Demo;
```
--------------------------------
### CozInputNumber Disabled State Example
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/input-number/index.mdx
Illustrates how to disable the CozInputNumber component using the 'disabled' prop and setting an initial value.
```tsx
import { CozInputNumber } from '@coze-arch/coze-design';
;
```
--------------------------------
### Import Input Component
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/docs/docs/resource/components/input.mdx
How to import the Input component into your project.
```tsx
import { Input } from '@coze-arch/coze-design';
```
--------------------------------
### SVG Node Preview
Source: https://github.com/coze-dev/rush-arch/blob/main/packages/components/coze-design/src/components/icon/index.mdx
Example of an SVG node generated by the icon component. It defaults to 'currentColor' for fill and '1em' for height and width.
```html