Skip to content

Commit 0dea3fb

Browse files
committed
构建流程
1 parent b7c2903 commit 0dea3fb

24 files changed

Lines changed: 2150 additions & 705 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug 报告
3+
about: 报告一个问题
4+
title: '[Bug] '
5+
labels: bug
6+
---
7+
8+
## 问题描述
9+
10+
简要描述问题
11+
12+
## 复现步骤
13+
14+
1. ...
15+
2. ...
16+
17+
## 期望行为
18+
19+
描述你期望发生的行为
20+
21+
## 实际行为
22+
23+
描述实际发生的行为
24+
25+
## 环境信息
26+
27+
- 包名及版本:@react-editable-tables/native v0.1.0 / @react-editable-tables/formily v1.0.0
28+
- React 版本:
29+
- 浏览器:
30+
- antd 版本(Formily 方案):
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: 功能请求
3+
about: 建议一个新功能
4+
title: '[Feature] '
5+
labels: enhancement
6+
---
7+
8+
## 功能描述
9+
10+
描述你希望添加的功能
11+
12+
## 使用场景
13+
14+
描述什么场景下需要这个功能
15+
16+
## 建议的 API
17+
18+
如果有的话,描述你期望的 API 设计
19+
20+
## 其他
21+
22+
其他补充信息

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## 变更说明
2+
3+
简要描述此 PR 的变更内容
4+
5+
## 变更类型
6+
7+
- [ ] 新功能 (feat)
8+
- [ ] 修复 (fix)
9+
- [ ] 文档 (docs)
10+
- [ ] 重构 (refactor)
11+
- [ ] 其他
12+
13+
## 关联 Issue
14+
15+
Fixes #
16+
17+
## 检查清单
18+
19+
- [ ] 代码通过 `pnpm check`
20+
- [ ] 类型检查通过 `pnpm type-check`
21+
- [ ] 测试通过 `pnpm test`
22+
- [ ] 如有新功能,已添加文档

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: weekly

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [18, 20]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: pnpm
22+
- run: pnpm install
23+
- run: pnpm type-check
24+
- run: pnpm lint
25+
- run: pnpm test
26+
- run: pnpm build

.github/workflows/deploy-docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['packages/docs/**', 'packages/editable-table/src/**', 'packages/fast-editable-table/src/**']
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: pnpm
27+
- run: pnpm install
28+
- run: pnpm build:docs
29+
- uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: packages/docs/.vitepress/dist
32+
deploy:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- uses: actions/deploy-pages@v4
40+
id: deployment

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]

CODE_OF_CONDUCT.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at https://github.com/chenJJ-88/react-editable-tables/issues. All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
74+
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
76+
77+
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# 参与贡献
2+
3+
感谢你对 react-editable-tables 项目的关注!我们非常欢迎社区的参与和贡献。
4+
5+
## 开发环境搭建
6+
7+
**前置要求:** Node.js 18+,pnpm 9+
8+
9+
```bash
10+
# 克隆仓库
11+
git clone https://github.com/chenJJ-88/react-editable-tables.git
12+
cd react-editable-tables
13+
14+
# 安装依赖
15+
pnpm install
16+
17+
# 启动文档开发服务器
18+
pnpm dev:docs
19+
```
20+
21+
文档服务器启动后,访问 `http://localhost:5173` 即可预览。
22+
23+
## 代码规范
24+
25+
本项目使用 [Biome](https://biomejs.dev/) 进行代码格式化和 Lint 检查。
26+
27+
```bash
28+
# 运行格式化和 lint 检查
29+
pnpm check
30+
31+
# 自动修复格式问题
32+
pnpm format
33+
```
34+
35+
提交前请确保 `pnpm check` 无报错。
36+
37+
## 提交规范
38+
39+
本项目遵循 [Conventional Commits](https://www.conventionalcommits.org/zh-hans/) 规范。提交信息格式如下:
40+
41+
```
42+
<type>(<scope>): <subject>
43+
```
44+
45+
常用类型:
46+
47+
| 类型 | 说明 |
48+
| ---------- | ---------------------- |
49+
| `feat` | 新增功能 |
50+
| `fix` | 修复问题 |
51+
| `docs` | 文档变更 |
52+
| `chore` | 构建/工具链/配置变更 |
53+
| `refactor` | 代码重构(无功能变化) |
54+
55+
示例:
56+
57+
```
58+
feat(native): 支持行拖拽排序
59+
fix(formily): 修复 effects 注册时序问题
60+
docs: 补充自定义编辑器示例
61+
```
62+
63+
## 提交流程
64+
65+
1. Fork 本仓库到你的 GitHub 账号
66+
2. 基于 `main` 分支创建功能分支:`git checkout -b feat/your-feature`
67+
3. 开发并本地验证(`pnpm check` + `pnpm test`
68+
4. 按规范提交代码:`git commit -m "feat: your feature"`
69+
5. 推送到你的 Fork:`git push origin feat/your-feature`
70+
6. 在 GitHub 上向 `main` 分支发起 Pull Request,并填写 PR 模板
71+
72+
## Issue 报告
73+
74+
遇到 Bug 时,请通过 [Bug 报告模板](https://github.com/chenJJ-88/react-editable-tables/issues/new?template=bug_report.md) 提交 Issue,并尽量提供:
75+
76+
- 最小可复现示例(推荐使用 StackBlitz 或 CodeSandbox)
77+
- 使用的包名及版本
78+
- React 版本、浏览器类型及版本
79+
- 期望行为 vs 实际行为
80+
81+
信息越详细,问题越容易被定位和修复。
82+
83+
## 文档
84+
85+
文档位于 `packages/docs/` 目录,使用 VitePress 构建。
86+
87+
- 新增页面:在对应目录(`guide/``native/``formily/`)下创建 `.md` 文件
88+
- 更新导航:修改 `packages/docs/.vitepress/config.ts` 中的 `sidebar` 配置
89+
- 本地预览:`pnpm dev:docs`
90+
91+
欢迎补充示例、修正错误或翻译文档!

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@
77
"scripts": {
88
"dev:docs": "pnpm --filter @react-editable-tables/docs dev",
99
"build:docs": "pnpm --filter @react-editable-tables/docs build",
10+
"build": "pnpm -r --filter './packages/*' run build",
1011
"test": "pnpm -r test",
1112
"format": "biome format --write .",
1213
"lint": "biome lint .",
1314
"check": "biome check --write .",
1415
"type-check": "pnpm -r type-check"
1516
},
17+
"keywords": ["react", "editable-table", "formily", "antd", "virtual-scroll"],
18+
"author": "chenJJ-88",
1619
"license": "MIT",
20+
"repository": {
21+
"type": "git",
22+
"url": "https://github.com/chenJJ-88/react-editable-tables.git"
23+
},
24+
"homepage": "https://chenjj-88.github.io/react-editable-tables/",
25+
"bugs": {
26+
"url": "https://github.com/chenJJ-88/react-editable-tables/issues"
27+
},
1728
"devDependencies": {
18-
"@biomejs/biome": "^2.4.15"
29+
"@biomejs/biome": "^2.4.15",
30+
"tsup": "^8.5.1"
1931
},
2032
"dependencies": {
2133
"react-is": "^19.2.6"

0 commit comments

Comments
 (0)