diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..c86ba17 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,147 @@ +name: 🐛 Bug Report | Bug 报告 +description: Create a bug report to help us improve | 创建Bug报告帮助我们改进 +title: "[Bug]: " +labels: ["bug", "needs-triage"] +assignees: [] +body: + - type: markdown + attributes: + value: | + 感谢您花时间填写此Bug报告!请尽可能详细地描述问题。 + + Thank you for taking the time to fill out this bug report! Please describe the issue in as much detail as possible. + + - type: checkboxes + id: prerequisites + attributes: + label: 前置条件 | Prerequisites + description: 在提交之前,请确认您已经检查了以下内容 + options: + - label: 我已经搜索了现有的Issues,确认这个问题还没有被报告过 + required: true + - label: 我正在使用最新版本的 goofish-client + required: true + - label: 我已经阅读了文档和README + required: true + + - type: input + id: version + attributes: + label: 版本信息 | Version + description: 您使用的 goofish-client 版本是什么? + placeholder: "例如: 1.1.2" + validations: + required: true + + - type: dropdown + id: environment + attributes: + label: 运行环境 | Environment + description: 您在什么环境下遇到的问题? + options: + - Node.js + - Browser (浏览器) + - React Native + - Electron + - Next.js + - Nuxt.js + - Other (其他) + validations: + required: true + + - type: input + id: node-version + attributes: + label: Node.js 版本 | Node.js Version + description: 如果适用,请提供您的 Node.js 版本 + placeholder: "例如: v18.17.0" + + - type: textarea + id: description + attributes: + label: 问题描述 | Bug Description + description: 请清楚简洁地描述这个Bug + placeholder: 详细描述您遇到的问题... + validations: + required: true + + - type: textarea + id: expected + attributes: + label: 期望行为 | Expected Behavior + description: 描述您期望发生什么 + placeholder: 描述您期望的正确行为... + validations: + required: true + + - type: textarea + id: actual + attributes: + label: 实际行为 | Actual Behavior + description: 描述实际发生了什么 + placeholder: 描述实际发生的错误行为... + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: 重现步骤 | Steps to Reproduce + description: 请提供详细的重现步骤 + placeholder: | + 1. 导入 goofish-client + 2. 创建客户端实例 + 3. 调用特定方法 + 4. 观察错误 + value: | + 1. + 2. + 3. + 4. + validations: + required: true + + - type: textarea + id: code-sample + attributes: + label: 代码示例 | Code Sample + description: 如果可能,请提供最小可重现的代码示例 + render: typescript + placeholder: | + import { Goofish } from 'goofish-client'; + + const client = new Goofish({ + cookie: 'your-cookie' + }); + + // 重现Bug的代码... + + - type: textarea + id: error-logs + attributes: + label: 错误日志 | Error Logs + description: 请粘贴相关的错误信息、堆栈跟踪或日志 + render: shell + placeholder: 粘贴错误信息和堆栈跟踪... + + - type: textarea + id: additional-context + attributes: + label: 其他信息 | Additional Context + description: 添加任何其他可能有助于我们理解问题的信息 + placeholder: | + - 网络环境 + - 特殊配置 + - 相关的第三方库 + - 截图(如果适用) + + - type: checkboxes + id: impact + attributes: + label: 影响程度 | Impact Level + description: 这个Bug对您的影响程度如何? + options: + - label: 阻塞性 - 完全无法使用库的核心功能 + - label: 严重 - 影响主要功能,有临时解决方案 + - label: 中等 - 影响部分功能,不影响主流程 + - label: 轻微 - 小问题,不影响正常使用 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e26d132 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,21 @@ +blank_issues_enabled: false +contact_links: + - name: 📖 Documentation | 文档 + url: https://11273.github.io/goofish-client/ + about: Browse the complete documentation | 浏览完整文档 + + - name: 💬 GitHub Discussions | GitHub 讨论 + url: https://github.com/11273/goofish-client/discussions + about: Ask questions and discuss with the community | 在社区中提问和讨论 + + - name: 🔒 Security Advisory | 安全咨询 + url: https://github.com/11273/goofish-client/security/advisories + about: Report security vulnerabilities privately | 私密报告安全漏洞 + + - name: 📧 Contact Maintainer | 联系维护者 + url: https://github.com/11273 + about: Contact the project maintainer directly | 直接联系项目维护者 + + - name: ⭐ Star the Project | 为项目点星 + url: https://github.com/11273/goofish-client + about: Show your support by starring the project | 通过点星表示支持 diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 0000000..73714de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,161 @@ +name: 📚 Documentation | 文档改进 +description: Suggest improvements to documentation | 建议改进文档 +title: "[Docs]: " +labels: ["documentation", "good first issue"] +assignees: [] +body: + - type: markdown + attributes: + value: | + 感谢您帮助改进文档!清晰的文档对项目非常重要。 + + Thank you for helping improve our documentation! Clear documentation is crucial for the project. + + - type: checkboxes + id: prerequisites + attributes: + label: 前置条件 | Prerequisites + description: 在提交之前,请确认您已经检查了以下内容 + options: + - label: 我已经搜索了现有的Issues,确认这个问题还没有被报告过 + required: true + - label: 我已经浏览了现有的文档 + required: true + + - type: dropdown + id: doc-type + attributes: + label: 文档类型 | Documentation Type + description: 这是关于哪种类型的文档? + options: + - README.md + - API Reference (API参考) + - Getting Started Guide (入门指南) + - Examples (示例) + - Troubleshooting (故障排除) + - Contributing Guide (贡献指南) + - Code Comments (代码注释) + - TypeScript Types (类型定义) + - Other (其他) + validations: + required: true + + - type: dropdown + id: issue-type + attributes: + label: 问题类型 | Issue Type + description: 这是什么类型的文档问题? + options: + - Missing Information (信息缺失) + - Incorrect Information (信息错误) + - Unclear Explanation (解释不清) + - Outdated Content (内容过时) + - Typo/Grammar (拼写/语法错误) + - Translation (翻译相关) + - Code Example Issues (代码示例问题) + - Structure/Organization (结构/组织问题) + - Other (其他) + validations: + required: true + + - type: input + id: location + attributes: + label: 文档位置 | Documentation Location + description: 请指出具体的文件路径或URL + placeholder: "例如: docs/api/search.md 或 https://11273.github.io/goofish-client/api/search" + validations: + required: true + + - type: textarea + id: current-content + attributes: + label: 当前内容 | Current Content + description: 请引用当前有问题的文档内容(如果适用) + placeholder: | + 请粘贴当前的文档内容或描述当前的问题... + + - type: textarea + id: description + attributes: + label: 问题描述 | Issue Description + description: 请详细描述文档中的问题 + placeholder: | + 例如: + - 缺少关于错误处理的说明 + - 示例代码无法运行 + - 参数说明不清楚 + - 中文翻译有误 + validations: + required: true + + - type: textarea + id: suggested-improvement + attributes: + label: 改进建议 | Suggested Improvement + description: 您建议如何改进这部分文档? + placeholder: | + 请提供具体的改进建议,如: + - 添加什么内容 + - 如何重新组织 + - 更好的解释方式 + - 修正的代码示例 + validations: + required: true + + - type: textarea + id: proposed-content + attributes: + label: 建议内容 | Proposed Content + description: 如果可能,请提供建议的文档内容 + render: markdown + placeholder: | + ## 建议的新内容 + + 请在这里写下您建议的文档内容... + + - type: dropdown + id: user-type + attributes: + label: 用户类型 | User Type + description: 从什么角度提出这个建议? + options: + - Beginner (初学者) + - Intermediate User (中级用户) + - Advanced User (高级用户) + - Contributor (贡献者) + - Maintainer (维护者) + + - type: checkboxes + id: affected-areas + attributes: + label: 影响范围 | Affected Areas + description: 这个改进可能影响哪些方面? + options: + - label: 用户体验 (User Experience) + - label: 开发效率 (Developer Productivity) + - label: 学习曲线 (Learning Curve) + - label: 项目采用 (Project Adoption) + - label: 错误减少 (Error Reduction) + + - type: checkboxes + id: contribution + attributes: + label: 贡献意愿 | Contribution + description: 您是否愿意帮助改进文档? + options: + - label: 我愿意提交Pull Request来改进这部分文档 + - label: 我可以帮助审核文档改进 + - label: 我可以提供更多的例子和用例 + - label: 我可以帮助翻译文档 + + - type: textarea + id: additional-context + attributes: + label: 其他信息 | Additional Context + description: 添加任何其他相关信息 + placeholder: | + - 用户反馈 + - 社区讨论 + - 相关的Issues或Pull Requests + - 参考资料 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..8189e3a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,158 @@ +name: ✨ Feature Request | 功能请求 +description: Suggest an idea for this project | 为这个项目提出新功能建议 +title: "[Feature]: " +labels: ["enhancement", "needs-discussion"] +assignees: [] +body: + - type: markdown + attributes: + value: | + 感谢您提出功能建议!请详细描述您希望添加的功能。 + + Thank you for suggesting a new feature! Please describe the feature you'd like to see added in detail. + + - type: checkboxes + id: prerequisites + attributes: + label: 前置条件 | Prerequisites + description: 在提交之前,请确认您已经检查了以下内容 + options: + - label: 我已经搜索了现有的Issues和Pull Requests,确认这个功能还没有被提出过 + required: true + - label: 我已经阅读了文档,确认这个功能不存在 + required: true + - label: 这个功能请求符合项目的目标和范围 + required: true + + - type: dropdown + id: feature-type + attributes: + label: 功能类型 | Feature Type + description: 这是什么类型的功能请求? + options: + - API Enhancement (API增强) + - New API Endpoint (新API接口) + - Developer Experience (开发体验) + - Performance Improvement (性能改进) + - Security Enhancement (安全增强) + - Documentation (文档) + - Testing (测试) + - Configuration (配置) + - Other (其他) + validations: + required: true + + - type: dropdown + id: priority + attributes: + label: 优先级 | Priority + description: 您认为这个功能的优先级如何? + options: + - Low (低) - 有就更好 + - Medium (中) - 对某些用户场景有帮助 + - High (高) - 对大多数用户都很重要 + - Critical (关键) - 必须有的功能 + validations: + required: true + + - type: textarea + id: problem + attributes: + label: 问题描述 | Problem Description + description: 您遇到了什么问题?这个功能请求是为了解决什么问题? + placeholder: | + 例如:我在使用当前的搜索功能时,无法按照商品的发布时间进行排序,这让我很难找到最新的商品... + validations: + required: true + + - type: textarea + id: solution + attributes: + label: 解决方案 | Proposed Solution + description: 您希望的解决方案是什么?请详细描述您想要的功能。 + placeholder: | + 例如:希望在搜索API中添加一个新的排序选项 `sortBy: 'publishTime'`,允许用户按发布时间排序搜索结果... + validations: + required: true + + - type: textarea + id: api-design + attributes: + label: API 设计 | API Design + description: 如果涉及新的API,请描述您期望的API设计 + render: typescript + placeholder: | + // 例如: + interface SearchOptions { + keyword: string; + sortBy?: 'relevance' | 'price' | 'publishTime'; // 新增 + sortOrder?: 'asc' | 'desc'; + } + + // 或新的方法: + await client.api.mtop.item.getItemHistory(itemId); + + - type: textarea + id: use-cases + attributes: + label: 使用场景 | Use Cases + description: 请描述这个功能的具体使用场景 + placeholder: | + 1. 作为买家,我想要查看最新发布的商品 + 2. 作为开发者,我需要为我的应用提供时间排序功能 + 3. 作为数据分析师,我需要按时间分析商品发布趋势 + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: 替代方案 | Alternatives Considered + description: 您是否考虑过其他解决方案?为什么它们不够好? + placeholder: | + 例如: + - 我尝试过在客户端手动排序,但这需要获取所有数据,效率很低 + - 我考虑过使用其他库,但它们不支持这个平台的API + - 我想过绕过这个限制,但会违反平台的使用条款 + + - type: textarea + id: implementation + attributes: + label: 实现建议 | Implementation Suggestions + description: 如果您有实现想法,请分享 + placeholder: | + - 可能需要修改 SearchParams 接口 + - 在 search.service.ts 中添加新的参数处理 + - 更新文档和示例 + + - type: checkboxes + id: contribution + attributes: + label: 贡献意愿 | Contribution + description: 您是否愿意帮助实现这个功能? + options: + - label: 我愿意提交Pull Request来实现这个功能 + - label: 我可以帮助测试这个功能 + - label: 我可以帮助更新文档 + - label: 我可以提供更多的使用场景和反馈 + + - type: textarea + id: additional-context + attributes: + label: 其他信息 | Additional Context + description: 添加任何其他相关信息、截图或参考资料 + placeholder: | + - 相关的官方API文档链接 + - 其他库的实现参考 + - 用户反馈或社区讨论 + - 截图或mockup + + - type: checkboxes + id: breaking-changes + attributes: + label: 兼容性 | Compatibility + description: 这个功能是否可能引入破坏性变更? + options: + - label: 这个功能可以向后兼容地添加 + - label: 这个功能可能需要破坏性变更 + - label: 我不确定兼容性影响 diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000..0187527 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,158 @@ +name: ❓ Question | 提问 +description: Ask a question about using goofish-client | 询问关于使用 goofish-client 的问题 +title: "[Question]: " +labels: ["question", "needs-answer"] +assignees: [] +body: + - type: markdown + attributes: + value: | + 欢迎提问!我们很乐意帮助您解决使用中遇到的问题。 + + Welcome! We're happy to help you with any questions about using goofish-client. + + 💡 **提示**: 如果是Bug报告,请使用 "Bug Report" 模板。如果是功能请求,请使用 "Feature Request" 模板。 + + - type: checkboxes + id: prerequisites + attributes: + label: 前置条件 | Prerequisites + description: 在提问之前,请确认您已经检查了以下内容 + options: + - label: 我已经搜索了现有的Issues和Discussions + required: true + - label: 我已经查看了项目文档和README + required: true + - label: 我已经查看了示例代码 + required: true + + - type: dropdown + id: question-type + attributes: + label: 问题类型 | Question Type + description: 这是什么类型的问题? + options: + - How to use (如何使用) + - Best practices (最佳实践) + - Configuration (配置相关) + - Authentication (认证相关) + - API Usage (API使用) + - Error Understanding (错误理解) + - Performance (性能相关) + - Integration (集成相关) + - Troubleshooting (故障排除) + - Other (其他) + validations: + required: true + + - type: input + id: version + attributes: + label: 版本信息 | Version + description: 您使用的 goofish-client 版本 + placeholder: "例如: 1.1.2" + validations: + required: true + + - type: dropdown + id: environment + attributes: + label: 运行环境 | Environment + description: 您在什么环境下使用? + options: + - Node.js + - Browser (浏览器) + - React Native + - Electron + - Next.js + - Nuxt.js + - Other (其他) + + - type: textarea + id: question + attributes: + label: 详细问题 | Detailed Question + description: 请详细描述您的问题 + placeholder: | + 请清楚地描述您想了解的内容: + - 您想实现什么功能? + - 您遇到了什么困难? + - 您期望的结果是什么? + validations: + required: true + + - type: textarea + id: current-code + attributes: + label: 当前代码 | Current Code + description: 如果适用,请分享您当前的代码 + render: typescript + placeholder: | + import { Goofish } from 'goofish-client'; + + // 您当前的代码... + + - type: textarea + id: what-tried + attributes: + label: 已尝试的方法 | What I've Tried + description: 请描述您已经尝试过的解决方法 + placeholder: | + 例如: + - 我尝试了文档中的示例,但是... + - 我查看了源码,发现... + - 我在网上搜索了相关信息,但是... + + - type: textarea + id: expected-outcome + attributes: + label: 期望结果 | Expected Outcome + description: 您希望实现什么结果? + placeholder: | + 描述您期望的行为或结果... + + - type: dropdown + id: urgency + attributes: + label: 紧急程度 | Urgency + description: 这个问题对您的项目有多重要? + options: + - Low (低) - 学习目的,不急 + - Medium (中) - 会影响开发进度 + - High (高) - 阻塞了主要功能 + - Critical (紧急) - 生产环境问题 + + - type: textarea + id: context + attributes: + label: 使用场景 | Use Case Context + description: 请描述您的具体使用场景 + placeholder: | + 例如: + - 我正在开发一个商品比价应用 + - 我需要为我的网站添加商品搜索功能 + - 我在做数据分析项目 + + - type: checkboxes + id: help-type + attributes: + label: 需要的帮助 | Type of Help Needed + description: 您希望得到什么类型的帮助? + options: + - label: 代码示例 (Code examples) + - label: 概念解释 (Concept explanation) + - label: 最佳实践建议 (Best practice recommendations) + - label: 故障排除指导 (Troubleshooting guidance) + - label: 替代方案 (Alternative approaches) + - label: 文档或资源推荐 (Documentation or resource recommendations) + + - type: textarea + id: additional-info + attributes: + label: 其他信息 | Additional Information + description: 任何其他可能有助于回答您问题的信息 + placeholder: | + - 相关的错误消息 + - 网络环境特殊情况 + - 项目的特殊要求 + - 截图或日志 diff --git a/.github/ISSUE_TEMPLATE/security.yml b/.github/ISSUE_TEMPLATE/security.yml new file mode 100644 index 0000000..780606e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/security.yml @@ -0,0 +1,169 @@ +name: 🔒 Security Issue | 安全问题 +description: Report a security vulnerability (use private reporting) | 报告安全漏洞(请使用私密报告) +title: "[Security]: " +labels: ["security", "needs-immediate-attention"] +assignees: [] +body: + - type: markdown + attributes: + value: | + ⚠️ **重要提醒 | IMPORTANT NOTICE** + + **请不要在公开Issue中报告安全漏洞!** + **DO NOT report security vulnerabilities in public issues!** + + 如果您发现了安全漏洞,请使用以下方式私密报告: + - GitHub私有安全咨询: [Security Advisories](https://github.com/11273/goofish-client/security/advisories) + - 或联系项目维护者 + + If you've found a security vulnerability, please report it privately via: + - GitHub Security Advisories: [Security Advisories](https://github.com/11273/goofish-client/security/advisories) + - Or contact the project maintainers directly + + --- + + 此模板仅用于非敏感的安全相关讨论,如: + - 安全最佳实践建议 + - 安全文档改进 + - 安全配置问题 + + This template is only for non-sensitive security-related discussions such as: + - Security best practice suggestions + - Security documentation improvements + - Security configuration questions + + - type: checkboxes + id: not-vulnerability + attributes: + label: 确认 | Confirmation + description: 请确认这不是安全漏洞报告 + options: + - label: 我确认这不是安全漏洞报告,而是关于安全最佳实践、文档或配置的讨论 + required: true + + - type: dropdown + id: security-topic + attributes: + label: 安全话题类型 | Security Topic Type + description: 这是关于什么类型的安全话题? + options: + - Security Best Practices (安全最佳实践) + - Security Documentation (安全文档) + - Authentication Guidance (认证指导) + - Credential Management (凭证管理) + - Network Security (网络安全) + - Privacy Concerns (隐私问题) + - Compliance (合规性) + - Security Configuration (安全配置) + - Other Security Discussion (其他安全讨论) + validations: + required: true + + - type: textarea + id: description + attributes: + label: 描述 | Description + description: 请详细描述您的安全相关问题或建议 + placeholder: | + 例如: + - 建议在文档中添加关于Cookie安全存储的最佳实践 + - 询问如何在生产环境中安全地管理认证凭证 + - 建议添加关于网络请求安全的说明 + validations: + required: true + + - type: textarea + id: current-situation + attributes: + label: 当前情况 | Current Situation + description: 请描述当前的情况或您观察到的问题 + placeholder: | + 例如: + - 当前文档没有提到Cookie的安全存储 + - 示例代码中硬编码了认证信息 + - 缺少关于HTTPS使用的说明 + + - type: textarea + id: suggested-improvement + attributes: + label: 改进建议 | Suggested Improvement + description: 您建议如何改进当前的安全性? + placeholder: | + 例如: + - 在文档中添加安全最佳实践章节 + - 更新示例代码以展示安全的凭证管理 + - 添加安全配置选项 + - 改进错误消息以避免信息泄露 + validations: + required: true + + - type: textarea + id: impact + attributes: + label: 潜在影响 | Potential Impact + description: 请描述这个安全改进可能带来的影响 + placeholder: | + 例如: + - 帮助用户避免常见的安全陷阱 + - 提高库的整体安全性 + - 减少误用导致的安全风险 + - 提升用户对库的信任度 + + - type: dropdown + id: priority + attributes: + label: 优先级 | Priority + description: 您认为这个安全改进的优先级如何? + options: + - Low (低) - 一般性改进 + - Medium (中) - 重要的安全改进 + - High (高) - 关键的安全问题 + - Critical (紧急) - 需要立即关注 + + - type: checkboxes + id: affected-areas + attributes: + label: 影响范围 | Affected Areas + description: 这个改进可能影响哪些方面? + options: + - label: 文档和指南 (Documentation and guides) + - label: 代码示例 (Code examples) + - label: 库的API设计 (Library API design) + - label: 配置选项 (Configuration options) + - label: 错误处理 (Error handling) + - label: 日志记录 (Logging) + - label: 依赖管理 (Dependency management) + + - type: textarea + id: references + attributes: + label: 参考资料 | References + description: 请提供相关的安全标准、文档或最佳实践的链接 + placeholder: | + 例如: + - OWASP安全指南 + - Node.js安全最佳实践 + - 相关的安全标准或规范 + - 其他项目的安全实践参考 + + - type: checkboxes + id: contribution + attributes: + label: 贡献意愿 | Contribution + description: 您是否愿意帮助实现这些安全改进? + options: + - label: 我愿意帮助编写安全文档 + - label: 我可以协助审核安全相关的代码 + - label: 我可以提供安全测试 + - label: 我可以分享更多的安全最佳实践 + + - type: textarea + id: additional-context + attributes: + label: 其他信息 | Additional Context + description: 添加任何其他相关的安全信息或上下文 + placeholder: | + - 相关的安全事件或案例 + - 行业特定的安全要求 + - 用户反馈或社区讨论 + - 其他安全工具或库的参考 diff --git a/package.json b/package.json index 4fcaebc..9461bbc 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "files": [ "dist", "README.md", + "SECURITY.md", + "CONTRIBUTING.md", "assets", "LICENSE" ],