Skip to content

Commit 384c7f3

Browse files
committed
chore: standardize repository maintenance
1 parent 0db36fe commit 384c7f3

12 files changed

Lines changed: 272 additions & 73 deletions

File tree

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: ant-design
2+
open_collective: ant-design

.github/dependabot.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5-
61
version: 2
72
updates:
8-
- package-ecosystem: "" # See documentation for possible values
9-
directory: "/" # Location of package manifests
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
time: '21:00'
9+
timezone: Asia/Shanghai
10+
open-pull-requests-limit: 10
11+
groups:
12+
npm-dependencies:
13+
patterns:
14+
- '*'
15+
16+
- package-ecosystem: github-actions
17+
directory: '/'
1018
schedule:
11-
interval: "weekly"
19+
interval: weekly
20+
day: monday
21+
time: '21:00'
22+
timezone: Asia/Shanghai
23+
open-pull-requests-limit: 10
24+
groups:
25+
github-actions:
26+
patterns:
27+
- '*'

.github/workflows/codeql.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: "CodeQL"
1+
name: 'CodeQL'
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: ['master']
66
pull_request:
7-
branches: [ "master" ]
7+
branches: ['master']
88
schedule:
9-
- cron: "53 19 * * 0"
9+
- cron: '36 13 * * 3'
1010

1111
jobs:
1212
analyze:
@@ -20,22 +20,24 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ javascript ]
23+
language: [javascript-typescript]
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v3
27+
uses: actions/checkout@v7
28+
with:
29+
persist-credentials: false
2830

2931
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
32+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
3133
with:
3234
languages: ${{ matrix.language }}
3335
queries: +security-and-quality
3436

3537
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
38+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
3739

3840
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
41+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
4042
with:
41-
category: "/language:${{ matrix.language }}"
43+
category: '/language:${{ matrix.language }}'

.github/workflows/react-doctor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: React Doctor
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
issues: write
12+
statuses: write
13+
14+
jobs:
15+
react-doctor:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v7
19+
with:
20+
fetch-depth: 0
21+
persist-credentials: false
22+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Surge Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
checks: write
10+
11+
jobs:
12+
preview:
13+
runs-on: ubuntu-latest
14+
concurrency:
15+
group: surge-preview-${{ github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
steps:
18+
- uses: actions/checkout@v7
19+
with:
20+
persist-credentials: false
21+
- name: Check Surge token
22+
id: surge-token
23+
env:
24+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
25+
run: |
26+
if [ -n "$SURGE_TOKEN" ]; then
27+
echo "enabled=true" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "enabled=false" >> "$GITHUB_OUTPUT"
30+
fi
31+
- name: Build preview
32+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
33+
run: |
34+
npm install
35+
npm run build
36+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
37+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
38+
env:
39+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
40+
with:
41+
surge_token: ${{ env.SURGE_TOKEN }}
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
dist: docs-dist
44+
failOnError: false
45+
setCommitStatus: false
46+
- name: Skip Surge preview
47+
if: ${{ steps.surge-token.outputs.enabled != 'true' }}
48+
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: ✅ test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 58 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,77 @@
1-
# @rc-component/overflow 🐾
2-
3-
[![NPM version][npm-image]][npm-url]
4-
[![npm download][download-image]][download-url]
5-
[![build status][github-actions-image]][github-actions-url]
6-
[![Codecov][codecov-image]][codecov-url]
7-
[![bundle size][bundlephobia-image]][bundlephobia-url]
8-
[![dumi][dumi-image]][dumi-url]
9-
10-
[npm-image]: http://img.shields.io/npm/v/@rc-component/overflow.svg?style=flat-square
11-
[npm-url]: http://npmjs.org/package/@rc-component/overflow
12-
[github-actions-image]: https://github.com/react-component/overflow/workflows/CI/badge.svg
13-
[github-actions-url]: https://github.com/react-component/overflow/actions
14-
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/overflow/master.svg?style=flat-square
15-
[codecov-url]: https://codecov.io/gh/react-component/overflow/branch/master
16-
[david-url]: https://david-dm.org/react-component/overflow
17-
[david-image]: https://david-dm.org/react-component/overflow/status.svg?style=flat-square
18-
[david-dev-url]: https://david-dm.org/react-component/overflow?type=dev
19-
[david-dev-image]: https://david-dm.org/react-component/overflow/dev-status.svg?style=flat-square
20-
[download-image]: https://img.shields.io/npm/dm/@rc-component/overflow.svg?style=flat-square
21-
[download-url]: https://npmjs.org/package/@rc-component/overflow
22-
[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/overflow
23-
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/overflow
24-
[dumi-url]: https://github.com/umijs/dumi
25-
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
26-
27-
Auto collapse box when overflow
28-
29-
## Live Demo
30-
31-
https://overflow-react-component.vercel.app/
1+
<div align="center">
2+
<h1>@rc-component/overflow</h1>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Part of the Ant Design ecosystem.</sub></p>
4+
<p>📦 Auto-collapse React layout primitive for rendering visible items and overflow indicators.</p>
5+
6+
<p>
7+
<a href="https://npmjs.org/package/@rc-component/overflow"><img alt="NPM version" src="https://img.shields.io/npm/v/@rc-component/overflow.svg?style=flat-square"></a>
8+
<a href="https://npmjs.org/package/@rc-component/overflow"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@rc-component/overflow.svg?style=flat-square"></a>
9+
<a href="https://github.com/react-component/overflow/actions/workflows/test.yml"><img alt="build status" src="https://github.com/react-component/overflow/actions/workflows/test.yml/badge.svg"></a>
10+
<a href="https://app.codecov.io/gh/react-component/overflow"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/react-component/overflow/master.svg?style=flat-square"></a>
11+
<a href="https://bundlephobia.com/package/@rc-component/overflow"><img alt="bundle size" src="https://img.shields.io/bundlephobia/minzip/@rc-component/overflow?style=flat-square"></a>
12+
<a href="https://github.com/umijs/dumi"><img alt="dumi" src="https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square"></a>
13+
</p>
14+
</div>
15+
16+
<p align="center">English | [简体中文](./README.zh-CN.md)</p>
17+
18+
## Highlights
19+
20+
| Area | Support |
21+
| ------- | ----------------------------------------------------------------------------------------- |
22+
| Purpose | Auto-collapse React layout primitive for rendering visible items and overflow indicators. |
23+
| Package | `@rc-component/overflow` |
24+
| Release | `@rc-component/np` / `rc-np` |
3225

3326
## Install
3427

35-
[![@rc-component/overflow](https://nodei.co/npm/@rc-component/overflow.png)](https://npmjs.org/package/@rc-component/overflow)
28+
```bash
29+
npm install @rc-component/overflow
30+
```
3631

3732
## Usage
3833

39-
```ts
40-
// TODO
34+
```tsx | pure
35+
import Overflow from '@rc-component/overflow';
36+
37+
export default () => (
38+
<Overflow
39+
data={[1, 2, 3]}
40+
renderItem={item => <span>{item}</span>}
41+
renderRest={items => <span>+{items.length}</span>}
42+
/>
43+
);
4144
```
4245

4346
## API
4447

45-
| Property | Type | Default | Description |
46-
| -------- | ---- | ------- | ----------- |
48+
| Prop | Description |
49+
| ------------ | -------------------------------- |
50+
| `data` | Items rendered by Overflow. |
51+
| `renderItem` | Render a visible item. |
52+
| `renderRest` | Render collapsed overflow items. |
4753

4854
## Development
4955

50-
```
56+
```bash
5157
npm install
5258
npm start
59+
npm test
60+
npm run lint
61+
npm run tsc
62+
npm run compile
63+
```
64+
65+
The dumi site runs at `http://localhost:8000`.
66+
67+
## Release
68+
69+
```bash
70+
npm run prepublishOnly
5371
```
5472

73+
The release flow is handled by `@rc-component/np` through the `rc-np` command when the package uses the shared release flow.
74+
5575
## License
5676

57-
@rc-component/overflow is released under the MIT license.
77+
@rc-component/overflow is released under the [MIT](./LICENSE.md) license.

README.zh-CN.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<div align="center">
2+
<h1>@rc-component/overflow</h1>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Ant Design 生态的一部分。</sub></p>
4+
<p>📦 用于自动折叠可见项与溢出项的 React 布局基础组件。</p>
5+
6+
<p>
7+
<a href="https://npmjs.org/package/@rc-component/overflow"><img alt="NPM version" src="https://img.shields.io/npm/v/@rc-component/overflow.svg?style=flat-square"></a>
8+
<a href="https://npmjs.org/package/@rc-component/overflow"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@rc-component/overflow.svg?style=flat-square"></a>
9+
<a href="https://github.com/react-component/overflow/actions/workflows/test.yml"><img alt="build status" src="https://github.com/react-component/overflow/actions/workflows/test.yml/badge.svg"></a>
10+
<a href="https://app.codecov.io/gh/react-component/overflow"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/react-component/overflow/master.svg?style=flat-square"></a>
11+
<a href="https://bundlephobia.com/package/@rc-component/overflow"><img alt="bundle size" src="https://img.shields.io/bundlephobia/minzip/@rc-component/overflow?style=flat-square"></a>
12+
<a href="https://github.com/umijs/dumi"><img alt="dumi" src="https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square"></a>
13+
</p>
14+
</div>
15+
16+
<p align="center">简体中文 | [English](./README.md)</p>
17+
18+
## 亮点
19+
20+
| 方向 | 支持 |
21+
| ---- | ------------------------------------------------- |
22+
| 定位 | 用于自动折叠可见项与溢出项的 React 布局基础组件。 |
23+
| 包名 | `@rc-component/overflow` |
24+
| 发布 | `@rc-component/np` / `rc-np` |
25+
26+
## 安装
27+
28+
```bash
29+
npm install @rc-component/overflow
30+
```
31+
32+
## 用法
33+
34+
```tsx | pure
35+
import Overflow from '@rc-component/overflow';
36+
37+
export default () => (
38+
<Overflow
39+
data={[1, 2, 3]}
40+
renderItem={item => <span>{item}</span>}
41+
renderRest={items => <span>+{items.length}</span>}
42+
/>
43+
);
44+
```
45+
46+
## API
47+
48+
| 名称 | 说明 |
49+
| ------------ | ----------------------- |
50+
| `data` | Overflow 渲染的数据项。 |
51+
| `renderItem` | 渲染可见项。 |
52+
| `renderRest` | 渲染折叠后的溢出项。 |
53+
54+
## 本地开发
55+
56+
```bash
57+
npm install
58+
npm start
59+
npm test
60+
npm run lint
61+
npm run tsc
62+
npm run compile
63+
```
64+
65+
本地 dumi 站点默认运行在 `http://localhost:8000`.
66+
67+
## 发布
68+
69+
```bash
70+
npm run prepublishOnly
71+
```
72+
73+
发布流程通过 `@rc-component/np` 提供的 `rc-np` 命令处理。
74+
75+
## 许可证
76+
77+
@rc-component/overflow 基于 [MIT](./LICENSE.md) 协议发布。

now.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)