diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 6afef41..832392a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,5 +1,5 @@ -name: Bug 报告 -description: 报告一个可以稳定复现的问题 +name: Bug report +description: Report a reproducible problem title: "[Bug]: " labels: - bug @@ -7,52 +7,52 @@ body: - type: markdown attributes: value: | - 感谢反馈!提交前请先确认问题能在最新线上版本或 `master` 分支复现。 + Thanks for the report. Please confirm that the problem reproduces on the latest live version or the `master` branch. - type: input id: browser attributes: - label: 浏览器与版本 - placeholder: 例如 Chrome 128 / Safari 18 + label: Browser and version + placeholder: e.g. Chrome 128 / Safari 18 validations: required: true - type: input id: tool attributes: - label: 受影响的工具或页面 - placeholder: 例如 Markdown 编辑器、二维码工具 + label: Affected tool or page + placeholder: e.g. Markdown editor, QR code tool validations: required: true - type: textarea id: steps attributes: - label: 复现步骤 - description: 请按顺序写出最小复现路径。 + label: Steps to reproduce + description: List the smallest reproducible path in order. placeholder: | - 1. 打开…… - 2. 输入…… - 3. 点击…… + 1. Open … + 2. Enter … + 3. Click … validations: required: true - type: textarea id: expected attributes: - label: 预期行为 + label: Expected behavior validations: required: true - type: textarea id: actual attributes: - label: 实际行为 + label: Actual behavior validations: required: true - type: textarea id: context attributes: - label: 补充信息 - description: 可以附截图、控制台错误、操作系统或其他上下文。请先移除敏感数据。 + label: Additional context + description: Add screenshots, console errors, operating-system details, or other context. Remove sensitive data first. diff --git a/.github/ISSUE_TEMPLATE/bug_report_zh.yml b/.github/ISSUE_TEMPLATE/bug_report_zh.yml new file mode 100644 index 0000000..a1a8249 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_zh.yml @@ -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: 可以附截图、控制台错误、操作系统或其他上下文。请先移除敏感数据。 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e61d373..856f4fb 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,11 @@ blank_issues_enabled: true contact_links: - - name: 在线体验 + - name: Live demo url: https://htool.vercel.app/ - about: 先在最新线上版本确认问题是否可以复现。 - - name: 使用文档 - url: https://github.com/Hughhhhcoder/HTooL#快速开始 + about: Confirm whether the problem reproduces on the latest live version. + - name: English documentation + url: https://github.com/Hughhhhcoder/HTooL#quick-start + about: Read setup, testing, deployment, and privacy guidance. + - name: 简体中文文档 + url: https://github.com/Hughhhhcoder/HTooL/blob/master/README.zh-CN.md#快速开始 about: 查看安装、测试、部署和隐私说明。 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 21792b8..b87d5a1 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,5 +1,5 @@ -name: 功能建议 -description: 提议一个能让 HTooL 更有用的改进 +name: Feature request +description: Suggest an improvement that would make HTooL more useful title: "[Feature]: " labels: - enhancement @@ -7,28 +7,28 @@ body: - type: textarea id: problem attributes: - label: 要解决的问题 - description: 请描述场景和当前遇到的限制,而不仅是解决方案。 - placeholder: 我在……场景下,需要…… + label: Problem to solve + description: Describe the scenario and current limitation, not only the solution. + placeholder: In …, I need … validations: required: true - type: textarea id: proposal attributes: - label: 建议方案 - description: 你希望工具如何工作? + label: Proposed solution + description: How would you like the tool to work? validations: required: true - type: textarea id: alternatives attributes: - label: 备选方案 - description: 你尝试过哪些替代做法? + label: Alternatives considered + description: What other approaches have you tried? - type: textarea id: context attributes: - label: 补充信息 - description: 可以附示例、草图、截图或相关链接。 + label: Additional context + description: Add examples, sketches, screenshots, or related links. diff --git a/.github/ISSUE_TEMPLATE/feature_request_zh.yml b/.github/ISSUE_TEMPLATE/feature_request_zh.yml new file mode 100644 index 0000000..f737466 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request_zh.yml @@ -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: 可以附示例、草图、截图或相关链接。 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ab5ef39..a4aa04d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,12 +1,14 @@ -## 变更摘要 +
English · 简体中文
- +## Summary -## 关联 Issue + - +## Related issue -## 验证方式 + + +## Validation - [ ] `npm run test:unit` - [ ] `npm run test:no-gradient` @@ -14,14 +16,14 @@ - [ ] `npm run test:perf-budget` - [ ] `npm run test:e2e` -## 检查清单 +## Checklist -- [ ] 我已检查浅色和暗色模式。 -- [ ] 我已检查移动端布局。 -- [ ] 我已补充或更新了相关测试。 -- [ ] 我没有提交密钥、个人数据或真实用户文件。 -- [ ] 如果涉及 UI,我已附上截图或录屏。 +- [ ] I checked both light and dark modes. +- [ ] I checked the mobile layout. +- [ ] I added or updated relevant tests. +- [ ] I did not commit secrets, personal data, or real user files. +- [ ] I included screenshots or a recording for UI changes. -## 兼容性与风险 +## Compatibility and risk - + diff --git a/.github/PULL_REQUEST_TEMPLATE/zh-CN.md b/.github/PULL_REQUEST_TEMPLATE/zh-CN.md new file mode 100644 index 0000000..ca0ecd5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/zh-CN.md @@ -0,0 +1,29 @@ +English · 简体中文
+ +## 变更摘要 + + + +## 关联 Issue + + + +## 验证方式 + +- [ ] `npm run test:unit` +- [ ] `npm run test:no-gradient` +- [ ] `npm run build` +- [ ] `npm run test:perf-budget` +- [ ] `npm run test:e2e` + +## 检查清单 + +- [ ] 我已检查浅色和暗色模式。 +- [ ] 我已检查移动端布局。 +- [ ] 我已补充或更新了相关测试。 +- [ ] 我没有提交密钥、个人数据或真实用户文件。 +- [ ] 如果涉及 UI,我已附上截图或录屏。 + +## 兼容性与风险 + + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ab2cfa1..c8a5fa2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,23 +1,25 @@ -# 行为准则 +# Code of Conduct -## 我们的承诺 +English · 简体中文
-为了营造开放、友善且可持续的协作环境,参与 HTooL 的每个人都应以尊重、善意和专业的方式交流,无论其经验、背景或身份如何。 +## Our commitment -## 可接受的行为 +To create an open, friendly, and sustainable collaboration environment, everyone participating in HTooL is expected to communicate with respect, good faith, and professionalism, regardless of experience, background, or identity. -- 使用清晰、建设性的语言提出意见; -- 讨论实现、体验和证据,而不是评价个人; -- 接受不同观点,并在有新信息时修正自己的判断; -- 尊重项目维护者和其他贡献者的时间。 +## Acceptable behavior -## 不可接受的行为 +- Use clear and constructive language. +- Discuss implementation, experience, and evidence rather than judging people. +- Stay open to different perspectives and update your view when new information appears. +- Respect the time of maintainers and contributors. -- 骚扰、歧视、威胁、人身攻击或故意羞辱; -- 发布他人的私人信息; -- 破坏讨论、刷屏、冒充他人或以恶意方式提交内容; -- 任何不适合公开协作环境的行为。 +## Unacceptable behavior -## 执行 +- Harassment, discrimination, threats, personal attacks, or deliberate humiliation. +- Publishing someone else’s private information. +- Disrupting discussions, spamming, impersonating others, or submitting content maliciously. +- Any other behavior that is inappropriate for a public collaboration space. -请通过 [维护者主页](https://github.com/Hughhhhcoder) 私下联系维护者,报告违反本准则的行为。维护者会根据事实采取适当措施,并尽可能保护报告者的隐私。 +## Enforcement + +Please contact the maintainer privately through the [maintainer profile](https://github.com/Hughhhhcoder) to report a violation. Reports will be reviewed based on the available facts, with the reporter’s privacy protected as far as possible. diff --git a/CODE_OF_CONDUCT.zh-CN.md b/CODE_OF_CONDUCT.zh-CN.md new file mode 100644 index 0000000..1e3bbb8 --- /dev/null +++ b/CODE_OF_CONDUCT.zh-CN.md @@ -0,0 +1,25 @@ +# 行为准则 + +English · 简体中文
+ +## 我们的承诺 + +为了营造开放、友善且可持续的协作环境,参与 HTooL 的每个人都应以尊重、善意和专业的方式交流,无论其经验、背景或身份如何。 + +## 可接受的行为 + +- 使用清晰、建设性的语言提出意见; +- 讨论实现、体验和证据,而不是评价个人; +- 接受不同观点,并在有新信息时修正自己的判断; +- 尊重项目维护者和其他贡献者的时间。 + +## 不可接受的行为 + +- 骚扰、歧视、威胁、人身攻击或故意羞辱; +- 发布他人的私人信息; +- 破坏讨论、刷屏、冒充他人或以恶意方式提交内容; +- 任何不适合公开协作环境的行为。 + +## 执行 + +请通过 [维护者主页](https://github.com/Hughhhhcoder) 私下联系维护者,报告违反本准则的行为。维护者会根据事实采取适当措施,并尽可能保护报告者的隐私。 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3237c7..67ee0f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,31 +1,33 @@ -# 贡献指南 +# Contributing -感谢你愿意改进 HTooL。小而明确的 Pull Request 更容易被审阅,也更容易保持这个工具箱的稳定和克制。 +English · 简体中文
-## 开始之前 +Thanks for helping improve HTooL. Small, focused Pull Requests are easier to review and help keep the toolkit stable and deliberate. -1. 确认 Node.js 版本为 20 或更高版本。 -2. 安装依赖:`npm ci`。 -3. 启动开发环境:`npm run dev`。 -4. 对行为变更先搜索现有 Issue,避免重复工作。 +## Before you start -## 开发约定 +1. Use Node.js 20 or newer. +2. Install dependencies with `npm ci`. +3. Start the development environment with `npm run dev`. +4. Search existing Issues before starting behavioral changes so work is not duplicated. -- 页面放在 `src/views/`,跨页面组件放在 `src/components/`,纯逻辑放在 `src/utils/`。 -- 新增功能时同步补充单元/组件测试;涉及用户流程时补充 E2E 测试。 -- 保持工具页面响应式,并同时检查浅色和暗色模式。 -- 项目当前有两个设计门禁:不要在 `src/` 中使用 CSS gradient,并确保构建产物不超过性能预算。 -- 不要把密钥、个人数据或真实用户文件提交到仓库。 +## Development conventions -## 分支与提交 +- Put pages in `src/views/`, shared components in `src/components/`, and reusable logic in `src/utils/`. +- Add unit/component tests for new behavior and E2E coverage for user-facing flows. +- Keep tool pages responsive and check both light and dark modes. +- Respect the two current design gates: do not use CSS gradients in `src/`, and keep the production bundle within its performance budget. +- Never commit secrets, personal data, or real user files. -从 `master` 创建分支,例如: +## Branches and commits + +Create a branch from `master`, for example: ```bash git switch -c feat/your-change ``` -提交信息建议使用简短的 Conventional Commits 风格前缀: +Commit messages should use a short Conventional Commits-style prefix: ```text feat: add a new utility @@ -35,19 +37,19 @@ refactor: simplify converter state test: cover keyboard shortcut ``` -## 提交 Pull Request +## Opening a Pull Request -提交前至少运行: +Run the full verification suite before submitting: ```bash npm run check ``` -如果本地没有 Playwright 浏览器,先运行 `npx playwright install chromium`。PR 描述请说明: +If Playwright browsers are not installed, run `npx playwright install chromium` first. A PR description should explain: -- 做了什么,以及为什么做; -- 如何验证; -- 是否有 UI 变化(有的话附截图或录屏); -- 是否存在兼容性、性能或破坏性变更。 +- what changed and why; +- how it was verified; +- whether the UI changed, with screenshots or a recording when useful; +- any compatibility, performance, or breaking changes. -PR 会经过 CI 检查。维护者可能会要求拆分范围、补测试或调整交互细节。 +Every PR runs through CI. Maintainers may ask for a narrower scope, additional tests, or interaction refinements. diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md new file mode 100644 index 0000000..b4d461c --- /dev/null +++ b/CONTRIBUTING.zh-CN.md @@ -0,0 +1,55 @@ +# 贡献指南 + +English · 简体中文
+ +感谢你愿意改进 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 检查。维护者可能会要求拆分范围、补测试或调整交互细节。 diff --git a/README.md b/README.md index ee88487..c12d065 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,51 @@一套浏览器优先的实用工具箱,把常用的小工具收进一个克制、顺手的工作台。
+A browser-first utility suite that brings everyday tools into one focused, dependable workspace.
- 在线体验 + Live demo · - 报告问题 + Report an issue · - 参与贡献 + Contribute
-
+ 简体中文
+
+ 简体中文 · English +
+ + + +## 项目定位 + +HTooL 面向写作、开发和日常信息处理场景,优先把数据留在浏览器中完成处理。它不是一个需要账号和后端服务的复杂平台,而是一组打开即用、按任务分组的轻量工具。 + +## 工具一览 + +| 分组 | 工具 | 能力 | +| --- | --- | --- | +| 文档创作 | Markdown 编辑器 | 编辑、工具栏、实时预览、本地文件夹读写与保存 | +| 文档创作 | Markdown ↔ HTML | 双向转换、预览、复制与下载 | +| 图像与编码 | 图片格式转换 | 单个/批量转换、PNG/JPG/WebP/GIF 选择、质量调节 | +| 图像与编码 | 二维码工具 | 文本/链接生成、尺寸与颜色设置、图片解析、下载 | +| 图像与编码 | 手绘板 | 画笔、橡皮擦、颜色/粗细调节与 PNG 导出 | +| 系统与数据 | 数据处理工具 | 正则测试、URL 编码/解码、Base64、MD5 与 SHA-256 | +| 系统与数据 | IP 地址定位 | 查询 IPv4 的地域、时区与运营商信息 | + +## 主要特点 + +- 浏览器优先:图片转换、二维码、绘图和文本处理默认在本地完成。 +- 按需加载:Markdown、二维码等较重依赖仅在进入对应工具后加载。 +- 克制的界面:响应式布局、浅色/暗色模式,以及明确的任务分组。 +- 可验证的质量门禁:单元测试、组件测试、E2E 流程、构建体积预算和设计约束检查。 +- 可直接部署:Vercel 配置已包含单页应用路由回退规则。 + +## 技术栈 + +- [Vue 3](https://vuejs.org/) + [Vue Router](https://router.vuejs.org/) +- [Vite](https://vite.dev/) +- [Vitest](https://vitest.dev/) + [Vue Test Utils](https://test-utils.vuejs.org/) +- [Playwright](https://playwright.dev/) +- [Marked](https://marked.js.org/) + [Turndown](https://github.com/mixmark-io/turndown) +- [DOMPurify](https://github.com/cure53/DOMPurify) +- [QRCode](https://github.com/soldair/node-qrcode) + [jsQR](https://github.com/cozmo/jsQR) + +## 快速开始 + +### 环境要求 + +- Node.js 20 或更高版本 +- npm 10 或更高版本 +- 需要运行 E2E 测试时,额外安装 Playwright Chromium + +### 本地开发 + +```bash +git clone https://github.com/Hughhhhcoder/HTooL.git +cd HTooL +npm ci +npm run dev +``` + +开发服务器默认地址为English · 简体中文
-目前项目没有正式发布版本,默认仅维护 `master` 分支上的最新代码。 +## Supported scope -| 版本/分支 | 支持情况 | +HTooL does not have formal releases yet. Security reports are handled against the latest code on the `master` branch. + +| Version/branch | Support | | --- | --- | -| `master` | ✅ 接受安全问题报告 | -| 其他旧提交 | ❌ 不提供修复承诺 | +| `master` | ✅ Security reports accepted | +| Older commits | ❌ No fix commitment | -## 报告漏洞 +## Reporting a vulnerability -请不要在公开 Issue 中发布可被利用的漏洞、攻击脚本或敏感数据。请通过 [维护者主页](https://github.com/Hughhhhcoder) 的公开联系方式私下报告,并尽量附上: +Do not publish exploitable vulnerabilities, attack scripts, or sensitive data in a public Issue. Please contact the maintainer privately through the [maintainer profile](https://github.com/Hughhhhcoder) and include, when possible: -- 影响范围和复现步骤; -- 浏览器、操作系统和项目版本; -- 最小化的复现样例; -- 你认为合理的修复建议(如果有)。 +- impact and reproduction steps; +- browser, operating system, and project version; +- a minimal reproduction case; +- a suggested fix, if you have one. -收到报告后,维护者会先确认问题,再评估影响范围、修复方式和公开时间。 +The maintainer will acknowledge the report, assess its impact, and coordinate the fix and disclosure timing. diff --git a/SECURITY.zh-CN.md b/SECURITY.zh-CN.md new file mode 100644 index 0000000..ec6bbe8 --- /dev/null +++ b/SECURITY.zh-CN.md @@ -0,0 +1,23 @@ +# 安全策略 + +English · 简体中文
+ +## 支持范围 + +目前项目没有正式发布版本,默认仅维护 `master` 分支上的最新代码。 + +| 版本/分支 | 支持情况 | +| --- | --- | +| `master` | ✅ 接受安全问题报告 | +| 其他旧提交 | ❌ 不提供修复承诺 | + +## 报告漏洞 + +请不要在公开 Issue 中发布可被利用的漏洞、攻击脚本或敏感数据。请通过 [维护者主页](https://github.com/Hughhhhcoder) 的公开联系方式私下报告,并尽量附上: + +- 影响范围和复现步骤; +- 浏览器、操作系统和项目版本; +- 最小化的复现样例; +- 你认为合理的修复建议(如果有)。 + +收到报告后,维护者会先确认问题,再评估影响范围、修复方式和公开时间。