Skip to content

Commit 39d4196

Browse files
committed
Prepare project for open source release
1 parent f0ae834 commit 39d4196

34 files changed

Lines changed: 2116 additions & 261 deletions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Bug report
2+
description: 报告可复现的规则、引擎、导入或界面问题
3+
title: "[Bug]: "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: 感谢反馈。涉及棋局时,请先导出研究 JSON 并移除隐私信息。
9+
- type: textarea
10+
id: steps
11+
attributes:
12+
label: 复现步骤
13+
description: 从空白页面开始,逐步说明操作。
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: expected
18+
attributes:
19+
label: 期望行为
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: actual
24+
attributes:
25+
label: 实际行为
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: environment
30+
attributes:
31+
label: 环境
32+
description: 系统、浏览器、Node.js、部署方式和相关提交。
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: position
37+
attributes:
38+
label: 局面 JSON 或最小示例
39+
render: json
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Feature request
2+
description: 提议一个面向离线训练或复盘的新功能
3+
title: "[Feature]: "
4+
labels: [enhancement]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: 要解决的问题
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: 建议方案
16+
validations:
17+
required: true
18+
- type: checkboxes
19+
id: scope
20+
attributes:
21+
label: 合规确认
22+
options:
23+
- label: 该功能只用于离线训练、准备或复盘。
24+
required: true

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 改动说明
2+
3+
说明问题、实现方式和用户可见变化。
4+
5+
## 验证
6+
7+
- [ ] `pnpm build`
8+
- [ ] `pnpm test`
9+
- [ ] `pnpm test:e2e`
10+
- [ ] `pnpm lint:safety`
11+
- [ ] `pnpm audit --prod`
12+
13+
## 检查项
14+
15+
- [ ] 新行为有对应测试
16+
- [ ] 三种语言文案保持同步
17+
- [ ] 第三方文件已记录来源、许可证与校验值
18+
- [ ] 功能仅用于离线训练、准备或复盘

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
verify:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 15
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v4
19+
with:
20+
version: 11.19.0
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
cache: pnpm
26+
27+
- run: pnpm install --frozen-lockfile
28+
- run: pnpm build
29+
- run: pnpm test
30+
- run: pnpm lint:safety
31+
- run: pnpm audit --prod
32+
- run: pnpm exec playwright install --with-deps chromium
33+
- run: pnpm test:e2e

CONTRIBUTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# 贡献指南
2+
3+
感谢你愿意改进 Renju Taraguchi-10 Trap Lab。项目优先接受与离线训练、开局研究、复盘准确性、可访问性和跨平台运行相关的贡献。
4+
5+
## 行为边界
6+
7+
本项目不接受读取正在进行的比赛、接入对局网站、自动执行落子或规避赛事规定的功能。相关 Pull Request 会被关闭。
8+
9+
## 开发流程
10+
11+
1. Fork 仓库并从 `main` 创建功能分支。
12+
2. 使用 Node.js 22 和仓库声明的 pnpm 版本安装依赖。
13+
3. 保持改动范围清晰,并为行为变化补测试。
14+
4. 在提交前运行完整验证命令。
15+
5. 创建 Pull Request,说明问题、方案、测试结果和界面变化。
16+
17+
```bash
18+
corepack enable
19+
pnpm install --frozen-lockfile
20+
pnpm build
21+
pnpm test
22+
pnpm test:e2e
23+
pnpm lint:safety
24+
pnpm audit --prod
25+
```
26+
27+
## 代码约定
28+
29+
- TypeScript 保持严格类型,不使用无必要的 `any`
30+
- 规则逻辑放在 `src/core`,引擎协议放在 `src/server``src/engine`
31+
- UI 文案必须同步更新中文、英文、日文三种语言。
32+
- 引擎返回值先经过稳定接口和校验,不在组件中直接解析协议文本。
33+
- 新增二进制、模型或数据集时必须说明来源、许可证、版本和 SHA-256。
34+
- “疑似骗招”和估算胜率不得写成已证明结论。
35+
36+
## Issue 建议
37+
38+
Bug 报告请包含复现局面 JSON、操作步骤、期望行为、实际行为、浏览器与系统版本。规则争议请同时附上 RIF 或 RenjuNet 的规则来源。

0 commit comments

Comments
 (0)