Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 默认由仓库维护者审阅所有变更。
* @Hughhhhcoder
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Bug 报告
description: 报告一个可以稳定复现的问题
title: "[Bug]: "
labels:
- bug
body:
- type: markdown
attributes:
value: |
感谢反馈!提交前请先确认问题能在最新线上版本或 `master` 分支复现。

- type: input
id: browser
attributes:
label: 浏览器与版本
placeholder: 例如 Chrome 128 / Safari 18
validations:
required: true

- type: input
id: tool
attributes:
label: 受影响的工具或页面
placeholder: 例如 Markdown 编辑器、二维码工具
validations:
required: true

- type: textarea
id: steps
attributes:
label: 复现步骤
description: 请按顺序写出最小复现路径。
placeholder: |
1. 打开……
2. 输入……
3. 点击……
validations:
required: true

- type: textarea
id: expected
attributes:
label: 预期行为
validations:
required: true

- type: textarea
id: actual
attributes:
label: 实际行为
validations:
required: true

- type: textarea
id: context
attributes:
label: 补充信息
description: 可以附截图、控制台错误、操作系统或其他上下文。请先移除敏感数据。
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 在线体验
url: https://htool.vercel.app/
about: 先在最新线上版本确认问题是否可以复现。
- name: 使用文档
url: https://github.com/Hughhhhcoder/HTooL#快速开始
about: 查看安装、测试、部署和隐私说明。
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 功能建议
description: 提议一个能让 HTooL 更有用的改进
title: "[Feature]: "
labels:
- enhancement
body:
- type: textarea
id: problem
attributes:
label: 要解决的问题
description: 请描述场景和当前遇到的限制,而不仅是解决方案。
placeholder: 我在……场景下,需要……
validations:
required: true

- type: textarea
id: proposal
attributes:
label: 建议方案
description: 你希望工具如何工作?
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: 备选方案
description: 你尝试过哪些替代做法?

- type: textarea
id: context
attributes:
label: 补充信息
description: 可以附示例、草图、截图或相关链接。
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 变更摘要

<!-- 简要说明这次 PR 做了什么,以及为什么需要它。 -->

## 关联 Issue

<!-- 使用 Closes #123 或 Related #123;没有则删除这一行。 -->

## 验证方式

- [ ] `npm run test:unit`
- [ ] `npm run test:no-gradient`
- [ ] `npm run build`
- [ ] `npm run test:perf-budget`
- [ ] `npm run test:e2e`

## 检查清单

- [ ] 我已检查浅色和暗色模式。
- [ ] 我已检查移动端布局。
- [ ] 我已补充或更新了相关测试。
- [ ] 我没有提交密钥、个人数据或真实用户文件。
- [ ] 如果涉及 UI,我已附上截图或录屏。

## 兼容性与风险

<!-- 说明浏览器兼容性、性能影响、数据边界或破坏性变更。没有则填写“无”。 -->
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
verify:
name: Verify
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Run unit and component tests
run: npm run test:unit

- name: Check design constraints
run: npm run test:no-gradient

- name: Build production bundle
run: npm run build

- name: Check performance budget
run: npm run test:perf-budget

- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium

- name: Run end-to-end tests
run: npm run test:e2e
23 changes: 23 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 行为准则

## 我们的承诺

为了营造开放、友善且可持续的协作环境,参与 HTooL 的每个人都应以尊重、善意和专业的方式交流,无论其经验、背景或身份如何。

## 可接受的行为

- 使用清晰、建设性的语言提出意见;
- 讨论实现、体验和证据,而不是评价个人;
- 接受不同观点,并在有新信息时修正自己的判断;
- 尊重项目维护者和其他贡献者的时间。

## 不可接受的行为

- 骚扰、歧视、威胁、人身攻击或故意羞辱;
- 发布他人的私人信息;
- 破坏讨论、刷屏、冒充他人或以恶意方式提交内容;
- 任何不适合公开协作环境的行为。

## 执行

请通过 [维护者主页](https://github.com/Hughhhhcoder) 私下联系维护者,报告违反本准则的行为。维护者会根据事实采取适当措施,并尽可能保护报告者的隐私。
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 贡献指南

感谢你愿意改进 HTooL。小而明确的 Pull Request 更容易被审阅,也更容易保持这个工具箱的稳定和克制。

## 开始之前

1. 确认 Node.js 版本为 20 或更高版本。
2. 安装依赖:`npm ci`。
3. 启动开发环境:`npm run dev`。
4. 对行为变更先搜索现有 Issue,避免重复工作。

## 开发约定

- 页面放在 `src/views/`,跨页面组件放在 `src/components/`,纯逻辑放在 `src/utils/`。
- 新增功能时同步补充单元/组件测试;涉及用户流程时补充 E2E 测试。
- 保持工具页面响应式,并同时检查浅色和暗色模式。
- 项目当前有两个设计门禁:不要在 `src/` 中使用 CSS gradient,并确保构建产物不超过性能预算。
- 不要把密钥、个人数据或真实用户文件提交到仓库。

## 分支与提交

从 `master` 创建分支,例如:

```bash
git switch -c feat/your-change
```

提交信息建议使用简短的 Conventional Commits 风格前缀:

```text
feat: add a new utility
fix: handle invalid input
docs: improve setup guide
refactor: simplify converter state
test: cover keyboard shortcut
```

## 提交 Pull Request

提交前至少运行:

```bash
npm run check
```

如果本地没有 Playwright 浏览器,先运行 `npx playwright install chromium`。PR 描述请说明:

- 做了什么,以及为什么做;
- 如何验证;
- 是否有 UI 变化(有的话附截图或录屏);
- 是否存在兼容性、性能或破坏性变更。

PR 会经过 CI 检查。维护者可能会要求拆分范围、补测试或调整交互细节。
Loading