From b51bb9058ff6f60831aed4afa148afcd0aa7c924 Mon Sep 17 00:00:00 2001 From: cloxl Date: Thu, 15 Jan 2026 19:01:20 +0800 Subject: [PATCH 1/4] fix(ci): improve release notes generation and fix version format --- .github/workflows/release.yml | 75 ++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b896aa..da2e150 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,33 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate release notes + id: release_notes + run: | + VERSION="${{ github.ref_name }}" + VERSION_NO_V="${VERSION#v}" + + # Get previous tag + PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") + + # Generate changelog + echo "CHANGELOG<> $GITHUB_OUTPUT + if [ -n "$PREV_TAG" ]; then + echo "## What's Changed" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${VERSION}" >> $GITHUB_OUTPUT + else + echo "Initial release" >> $GITHUB_OUTPUT + fi + echo "EOF" >> $GITHUB_OUTPUT + + echo "VERSION_NO_V=${VERSION_NO_V}" >> $GITHUB_OUTPUT - name: Create GitHub Release uses: softprops/action-gh-release@v2 @@ -24,37 +51,65 @@ jobs: name: Release ${{ github.ref_name }} draft: false prerelease: false + generate_release_notes: true body: | - ## 更新内容 + ${{ steps.release_notes.outputs.CHANGELOG }} + + ## Installation - ## 安装 + ```bash + pip install xhshow==${{ steps.release_notes.outputs.VERSION_NO_V }} + ``` + + Or upgrade from previous version: ```bash - pip install xhshow==${{ github.ref_name }} + pip install --upgrade xhshow ``` - ## 使用方法 + ## Quick Start ```python - from xhshow import Xhshow + from xhshow import Xhshow, SessionManager + # Basic usage client = Xhshow() - # GET请求签名 + # GET request signature signature = client.sign_xs_get( uri="/api/sns/web/v1/user_posted", a1_value="your_a1_cookie_value", - params={"num": "30", "cursor": "", "user_id": "123"} + params={"num": "30", "user_id": "123"} ) - # POST请求签名 + # POST request signature signature = client.sign_xs_post( - uri="/api/sns/web/v1/login", + uri="/api/sns/web/v1/comment/post", a1_value="your_a1_cookie_value", - payload={"username": "test", "password": "123456"} + payload={"note_id": "123", "content": "Great!"} + ) + + # Generate complete headers with session management + session = SessionManager() + headers = client.sign_headers_get( + uri="/api/sns/web/v1/homefeed", + cookies={"a1": "your_a1_value", "web_session": "..."}, + params={"page": "1"}, + session=session ) ``` + ## Documentation + + - [GitHub Repository](https://github.com/${{ github.repository }}) + - [PyPI Package](https://pypi.org/project/xhshow/${{ steps.release_notes.outputs.VERSION_NO_V }}/) + + ## Supported Python Versions + + - Python 3.10+ + - Python 3.11 + - Python 3.12 + pypi: name: Publish to PyPI runs-on: ubuntu-latest From 514a43241f83a9b373365ad6dec1ab66174b3e5c Mon Sep 17 00:00:00 2001 From: cloxl Date: Thu, 15 Jan 2026 19:22:29 +0800 Subject: [PATCH 2/4] feat: add bilingual issue templates for better community contribution - Add English and Chinese issue templates - Bug Report templates (bug_report.yml, bug_report_cn.yml) - Feature Request templates (feature_request.yml, feature_request_cn.yml) - API Proposal templates (api_proposal.yml, api_proposal_cn.yml) - Configure template settings in config.yml - Separate templates by language for better UX - All templates include structured forms with validation - API Proposal template designed for issue #60 discussion --- .github/ISSUE_TEMPLATE/api_proposal.yml | 213 ++++++++++++++++++ .github/ISSUE_TEMPLATE/api_proposal_cn.yml | 213 ++++++++++++++++++ .github/ISSUE_TEMPLATE/bug_report.yml | 104 +++++++++ .github/ISSUE_TEMPLATE/bug_report_cn.yml | 104 +++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 + .github/ISSUE_TEMPLATE/feature_request.yml | 80 +++++++ .github/ISSUE_TEMPLATE/feature_request_cn.yml | 80 +++++++ 7 files changed, 805 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/api_proposal.yml create mode 100644 .github/ISSUE_TEMPLATE/api_proposal_cn.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report_cn.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request_cn.yml diff --git a/.github/ISSUE_TEMPLATE/api_proposal.yml b/.github/ISSUE_TEMPLATE/api_proposal.yml new file mode 100644 index 0000000..d957004 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/api_proposal.yml @@ -0,0 +1,213 @@ +name: API Proposal +description: Propose a new syntax sugar API design for xhshow +title: "[API]: " +labels: ["enhancement", "api-design"] +body: + - type: markdown + attributes: + value: | + ## API Design Proposal + + Thank you for proposing a new API design! This template helps structure your proposal for community discussion. + + **Important Requirements:** + - All new APIs must be fully backward compatible + - Focus on practical use cases and developer experience + - Provide clear examples and documentation + + - type: input + id: api-name + attributes: + label: API Name + description: What is the proposed API method/class name? + placeholder: "e.g., sign_batch(), XhsClient, auto_refresh_session()" + validations: + required: true + + - type: dropdown + id: api-type + attributes: + label: API Type + description: What type of API are you proposing? + options: + - "New Method" + - "New Class" + - "New Parameter" + - "Helper Function" + - "Context Manager" + - "Decorator" + - "Other" + validations: + required: true + + - type: textarea + id: motivation + attributes: + label: Motivation + description: Why do we need this API? What problem does it solve? + placeholder: | + Currently, developers need to... + This API would simplify... + validations: + required: true + + - type: textarea + id: use-case + attributes: + label: Use Case + description: Describe the specific use case this API addresses + placeholder: | + When building a web scraper that... + When handling multiple requests to... + validations: + required: true + + - type: textarea + id: current-approach + attributes: + label: Current Approach (Before) + description: How do developers currently accomplish this task? + placeholder: | + ```python + # Current verbose way + client = Xhshow() + headers1 = client.sign_headers_get(...) + headers2 = client.sign_headers_get(...) + headers3 = client.sign_headers_get(...) + ``` + render: python + validations: + required: true + + - type: textarea + id: proposed-usage + attributes: + label: Proposed API Usage (After) + description: Show how your proposed API would work + placeholder: | + ```python + # New simplified way + client = Xhshow() + results = client.sign_batch([ + {"uri": "...", "params": {...}}, + {"uri": "...", "params": {...}}, + {"uri": "...", "params": {...}}, + ]) + ``` + render: python + validations: + required: true + + - type: textarea + id: api-signature + attributes: + label: API Signature + description: Provide the proposed method/class signature with type hints + placeholder: | + ```python + def sign_batch( + self, + requests: list[dict[str, Any]], + cookies: dict[str, Any] | str, + *, + xsec_appid: str = "xhs-pc-web", + timestamp: float | None = None, + session: SessionManager | None = None + ) -> list[dict[str, str]]: + """ + Generate signatures for multiple requests in batch. + + Args: + requests: List of request configurations + cookies: Cookie dictionary or string + xsec_appid: Application identifier + timestamp: Unix timestamp + session: Optional session manager + + Returns: + List of header dictionaries with signatures + + Examples: + >>> client = Xhshow() + >>> results = client.sign_batch([...]) + """ + pass + ``` + render: python + validations: + required: true + + - type: textarea + id: benefits + attributes: + label: Benefits + description: What are the key benefits of this API? + placeholder: | + - Reduces boilerplate code by X% + - Improves performance for batch operations + - Makes the API more intuitive for beginners + - Follows Python best practices + validations: + required: true + + - type: checkboxes + id: compatibility + attributes: + label: Backward Compatibility + description: Compatibility commitment + options: + - label: This API is fully backward compatible (does not break existing code) + required: true + - label: This API follows existing naming conventions in xhshow + required: false + - label: I have considered edge cases and error handling + required: false + + - type: textarea + id: alternatives + attributes: + label: Alternative Designs + description: Have you considered any alternative API designs? + placeholder: | + Alternative 1: Use a decorator pattern... + Alternative 2: Implement as a context manager... + + - type: textarea + id: implementation + attributes: + label: Implementation Notes + description: Any thoughts on how this could be implemented? + placeholder: | + This could be implemented by... + Dependencies needed: ... + Complexity: Low/Medium/High + + - type: textarea + id: documentation + attributes: + label: Documentation Impact + description: What documentation changes would be needed? + placeholder: | + - Add new section to README + - Update examples in docs/ + - Add docstring examples + + - type: textarea + id: testing + attributes: + label: Testing Strategy + description: How should this API be tested? + placeholder: | + - Unit tests for basic functionality + - Integration tests with real requests + - Performance benchmarks + + - type: textarea + id: additional + attributes: + label: Additional Context + description: Any other context, links, or references? + placeholder: | + Related issues: #... + Similar APIs in other libraries: ... + References: ... diff --git a/.github/ISSUE_TEMPLATE/api_proposal_cn.yml b/.github/ISSUE_TEMPLATE/api_proposal_cn.yml new file mode 100644 index 0000000..d8ebe5b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/api_proposal_cn.yml @@ -0,0 +1,213 @@ +name: API 提案 +description: 为 xhshow 提议新的语法糖 API 设计 +title: "[API]: " +labels: ["enhancement", "api-design"] +body: + - type: markdown + attributes: + value: | + ## API 设计提案 + + 感谢你提出 API 设计建议!此模板帮助构建你的提案以便社区讨论。 + + **重要要求:** + - 所有新 API 必须完全向后兼容 + - 关注实际用例和开发者体验 + - 提供清晰的示例和文档 + + - type: input + id: api-name + attributes: + label: API 名称 + description: 提议的 API 方法/类名称是什么? + placeholder: "例如: sign_batch(), XhsClient, auto_refresh_session()" + validations: + required: true + + - type: dropdown + id: api-type + attributes: + label: API 类型 + description: 你提议的是什么类型的 API? + options: + - "新方法" + - "新类" + - "新参数" + - "辅助函数" + - "上下文管理器" + - "装饰器" + - "其他" + validations: + required: true + + - type: textarea + id: motivation + attributes: + label: 动机 + description: 为什么需要这个 API?它解决了什么问题? + placeholder: | + 目前开发者需要... + 这个 API 将简化... + validations: + required: true + + - type: textarea + id: use-case + attributes: + label: 使用场景 + description: 描述这个 API 解决的具体使用场景 + placeholder: | + 在构建网页爬虫时... + 在处理多个请求时... + validations: + required: true + + - type: textarea + id: current-approach + attributes: + label: 当前方法 (改进前) + description: 开发者目前如何完成这个任务? + placeholder: | + ```python + # 当前冗长的方式 + client = Xhshow() + headers1 = client.sign_headers_get(...) + headers2 = client.sign_headers_get(...) + headers3 = client.sign_headers_get(...) + ``` + render: python + validations: + required: true + + - type: textarea + id: proposed-usage + attributes: + label: 提议的 API 用法 (改进后) + description: 展示你提议的 API 将如何工作 + placeholder: | + ```python + # 新的简化方式 + client = Xhshow() + results = client.sign_batch([ + {"uri": "...", "params": {...}}, + {"uri": "...", "params": {...}}, + {"uri": "...", "params": {...}}, + ]) + ``` + render: python + validations: + required: true + + - type: textarea + id: api-signature + attributes: + label: API 签名 + description: 提供带类型注解的方法/类签名 + placeholder: | + ```python + def sign_batch( + self, + requests: list[dict[str, Any]], + cookies: dict[str, Any] | str, + *, + xsec_appid: str = "xhs-pc-web", + timestamp: float | None = None, + session: SessionManager | None = None + ) -> list[dict[str, str]]: + """ + 批量生成多个请求的签名。 + + Args: + requests: 请求配置列表 + cookies: Cookie 字典或字符串 + xsec_appid: 应用标识符 + timestamp: Unix 时间戳 + session: 可选的会话管理器 + + Returns: + 包含签名的请求头字典列表 + + Examples: + >>> client = Xhshow() + >>> results = client.sign_batch([...]) + """ + pass + ``` + render: python + validations: + required: true + + - type: textarea + id: benefits + attributes: + label: 优势 + description: 这个 API 的主要优势是什么? + placeholder: | + - 减少 X% 的样板代码 + - 提升批量操作的性能 + - 让初学者更容易使用 + - 遵循 Python 最佳实践 + validations: + required: true + + - type: checkboxes + id: compatibility + attributes: + label: 向后兼容性 + description: 兼容性承诺 + options: + - label: 此 API 完全向后兼容 (不会破坏现有代码) + required: true + - label: 此 API 遵循 xhshow 现有的命名约定 + required: false + - label: 我已考虑边界情况和错误处理 + required: false + + - type: textarea + id: alternatives + attributes: + label: 替代设计 + description: 你是否考虑过任何替代的 API 设计? + placeholder: | + 替代方案 1: 使用装饰器模式... + 替代方案 2: 实现为上下文管理器... + + - type: textarea + id: implementation + attributes: + label: 实现说明 + description: 对如何实现有什么想法吗? + placeholder: | + 可以通过...实现 + 需要的依赖: ... + 复杂度: 低/中/高 + + - type: textarea + id: documentation + attributes: + label: 文档影响 + description: 需要哪些文档变更? + placeholder: | + - 在 README 中添加新章节 + - 更新 docs/ 中的示例 + - 添加文档字符串示例 + + - type: textarea + id: testing + attributes: + label: 测试策略 + description: 应该如何测试这个 API? + placeholder: | + - 基本功能的单元测试 + - 真实请求的集成测试 + - 性能基准测试 + + - type: textarea + id: additional + attributes: + label: 补充信息 + description: 任何其他上下文、链接或参考资料? + placeholder: | + 相关 issue: #... + 其他库中的类似 API: ... + 参考资料: ... diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..2ded189 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,104 @@ +name: Bug Report +description: Report a bug or unexpected behavior +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + - type: textarea + id: description + attributes: + label: Bug Description + description: A clear and concise description of what the bug is + placeholder: Tell us what you see! + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Steps to Reproduce + description: Steps to reproduce the behavior + placeholder: | + 1. Import xhshow with '...' + 2. Call method '...' + 3. See error + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen + placeholder: What should happen? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: Actual Behavior + description: What actually happened? + placeholder: What did happen? + validations: + required: true + + - type: textarea + id: code + attributes: + label: Code Sample + description: Please provide a minimal code sample that reproduces the issue + placeholder: | + ```python + from xhshow import Xhshow + + client = Xhshow() + # Your code here + ``` + render: python + validations: + required: true + + - type: textarea + id: traceback + attributes: + label: Error Traceback + description: If applicable, paste the full error traceback + render: shell + + - type: input + id: version + attributes: + label: xhshow Version + description: Which version of xhshow are you using? + placeholder: "0.1.8" + validations: + required: true + + - type: input + id: python-version + attributes: + label: Python Version + description: Which version of Python are you using? + placeholder: "3.12" + validations: + required: true + + - type: input + id: os + attributes: + label: Operating System + description: Which operating system are you using? + placeholder: "Windows 11 / Ubuntu 22.04 / macOS 14" + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Additional Context + description: Add any other context about the problem here diff --git a/.github/ISSUE_TEMPLATE/bug_report_cn.yml b/.github/ISSUE_TEMPLATE/bug_report_cn.yml new file mode 100644 index 0000000..2466214 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_cn.yml @@ -0,0 +1,104 @@ +name: Bug 报告 +description: 报告错误或异常行为 +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + 感谢你填写此 Bug 报告! + + - type: textarea + id: description + attributes: + label: Bug 描述 + description: 清晰简洁地描述这个 Bug + placeholder: 告诉我们你遇到了什么 + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: 复现步骤 + description: 如何复现这个问题 + placeholder: | + 1. 导入 xhshow 并调用 '...' + 2. 调用方法 '...' + 3. 看到错误 + validations: + required: true + + - type: textarea + id: expected + attributes: + label: 期望行为 + description: 清晰地描述你期望发生什么 + placeholder: 应该发生什么? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: 实际行为 + description: 实际发生了什么? + placeholder: 实际发生了什么? + validations: + required: true + + - type: textarea + id: code + attributes: + label: 代码示例 + description: 请提供能够复现问题的最小代码示例 + placeholder: | + ```python + from xhshow import Xhshow + + client = Xhshow() + # 你的代码 + ``` + render: python + validations: + required: true + + - type: textarea + id: traceback + attributes: + label: 错误堆栈 + description: 如果适用,请粘贴完整的错误堆栈 + render: shell + + - type: input + id: version + attributes: + label: xhshow 版本 + description: 你使用的 xhshow 版本是什么? + placeholder: "0.1.8" + validations: + required: true + + - type: input + id: python-version + attributes: + label: Python 版本 + description: 你使用的 Python 版本是什么? + placeholder: "3.12" + validations: + required: true + + - type: input + id: os + attributes: + label: 操作系统 + description: 你使用的操作系统是什么? + placeholder: "Windows 11 / Ubuntu 22.04 / macOS 14" + validations: + required: true + + - type: textarea + id: additional + attributes: + label: 补充信息 + description: 添加关于此问题的其他信息 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..4313d0d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: GitHub Discussions + url: https://github.com/cloxl/xhshow/discussions + about: For questions and discussions about using xhshow + - name: 中文讨论区 (Chinese Discussions) + url: https://github.com/cloxl/xhshow/discussions + about: 使用 xhshow 的问题和讨论 + - name: Documentation + url: https://github.com/cloxl/xhshow#readme + about: Check the documentation for usage guides and examples diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..ba95a39 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,80 @@ +name: Feature Request +description: Suggest a new feature or enhancement +title: "[Feature]: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for suggesting a new feature! Please provide as much detail as possible. + + - type: textarea + id: problem + attributes: + label: Problem Statement + description: Is your feature request related to a problem? Please describe. + placeholder: I'm always frustrated when... + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: Describe the solution you'd like + placeholder: I would like to see... + validations: + required: true + + - type: textarea + id: example + attributes: + label: Usage Example + description: Show how you would use this feature + placeholder: | + ```python + from xhshow import Xhshow + + client = Xhshow() + # Example of how the new feature would work + result = client.new_feature(...) + ``` + render: python + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives Considered + description: Describe any alternative solutions or features you've considered + placeholder: I also thought about... + + - type: dropdown + id: breaking + attributes: + label: Breaking Changes + description: Would this feature require breaking changes to existing APIs? + options: + - "No - Fully backward compatible" + - "Yes - Would break existing code" + - "Not sure" + validations: + required: true + + - type: checkboxes + id: compatibility + attributes: + label: Compatibility Requirements + description: Important compatibility considerations + options: + - label: This feature must maintain full backward compatibility with existing versions + required: false + - label: I have checked that this feature doesn't conflict with existing functionality + required: false + + - type: textarea + id: additional + attributes: + label: Additional Context + description: Add any other context, screenshots, or examples about the feature request here diff --git a/.github/ISSUE_TEMPLATE/feature_request_cn.yml b/.github/ISSUE_TEMPLATE/feature_request_cn.yml new file mode 100644 index 0000000..ccdf46d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request_cn.yml @@ -0,0 +1,80 @@ +name: 功能请求 +description: 提议新功能或改进 +title: "[Feature]: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + 感谢你提出新功能建议!请尽可能提供详细信息。 + + - type: textarea + id: problem + attributes: + label: 问题陈述 + description: 你的功能请求是否与某个问题相关?请描述。 + placeholder: 我在使用时总是遇到... + validations: + required: true + + - type: textarea + id: solution + attributes: + label: 提议的解决方案 + description: 描述你想要的解决方案 + placeholder: 我希望看到... + validations: + required: true + + - type: textarea + id: example + attributes: + label: 使用示例 + description: 展示你将如何使用这个功能 + placeholder: | + ```python + from xhshow import Xhshow + + client = Xhshow() + # 新功能的使用示例 + result = client.new_feature(...) + ``` + render: python + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: 考虑过的替代方案 + description: 描述你考虑过的任何替代解决方案或功能 + placeholder: 我还考虑过... + + - type: dropdown + id: breaking + attributes: + label: 破坏性变更 + description: 这个功能是否需要破坏性变更? + options: + - "否 - 完全向后兼容" + - "是 - 会破坏现有代码" + - "不确定" + validations: + required: true + + - type: checkboxes + id: compatibility + attributes: + label: 兼容性要求 + description: 重要的兼容性考虑 + options: + - label: 此功能必须保持与现有版本的完全向后兼容 + required: false + - label: 我已确认此功能不会与现有功能冲突 + required: false + + - type: textarea + id: additional + attributes: + label: 补充信息 + description: 添加关于功能请求的其他信息、截图或示例 From 0ab306dd7c2538cf681603f99f8c7f74a85949aa Mon Sep 17 00:00:00 2001 From: cloxl Date: Thu, 15 Jan 2026 19:26:51 +0800 Subject: [PATCH 3/4] fix(ci): use unique heredoc delimiter to prevent changelog truncation - Change EOF to CHANGELOG_EOF as heredoc delimiter - Prevent commit messages containing 'EOF' from breaking changelog generation - Improve robustness of release notes generation --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da2e150..401089c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") # Generate changelog - echo "CHANGELOG<> $GITHUB_OUTPUT + echo "CHANGELOG<> $GITHUB_OUTPUT if [ -n "$PREV_TAG" ]; then echo "## What's Changed" >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT @@ -40,7 +40,7 @@ jobs: else echo "Initial release" >> $GITHUB_OUTPUT fi - echo "EOF" >> $GITHUB_OUTPUT + echo "CHANGELOG_EOF" >> $GITHUB_OUTPUT echo "VERSION_NO_V=${VERSION_NO_V}" >> $GITHUB_OUTPUT From 7ddf62354adc97c5a9b494fccdc64f79665c390e Mon Sep 17 00:00:00 2001 From: cloxl Date: Thu, 15 Jan 2026 19:41:58 +0800 Subject: [PATCH 4/4] refactor(templates): consolidate to bilingual templates with general discussion option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace 6 separate templates (3 EN + 3 CN) with 4 bilingual templates - Add General Discussion template as fallback option - All templates now use bilingual format (中文 | English) - Simplify user experience: 6 options → 4 options - Templates: 1. Bug 报告 | Bug Report 2. 功能请求 | Feature Request 3. API 语法糖提案 | API Proposal 4. 通用讨论 | General Discussion (new) - Update config.yml with simplified contact links - Maintain blank_issues_enabled: false for structured contributions --- .github/ISSUE_TEMPLATE/api_proposal.yml | 153 ++++++------- .github/ISSUE_TEMPLATE/api_proposal_cn.yml | 213 ------------------ .github/ISSUE_TEMPLATE/bug_report.yml | 57 ++--- .github/ISSUE_TEMPLATE/bug_report_cn.yml | 104 --------- .github/ISSUE_TEMPLATE/config.yml | 7 +- .github/ISSUE_TEMPLATE/feature_request.yml | 57 +++-- .github/ISSUE_TEMPLATE/feature_request_cn.yml | 80 ------- .github/ISSUE_TEMPLATE/general.yml | 39 ++++ 8 files changed, 165 insertions(+), 545 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/api_proposal_cn.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report_cn.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request_cn.yml create mode 100644 .github/ISSUE_TEMPLATE/general.yml diff --git a/.github/ISSUE_TEMPLATE/api_proposal.yml b/.github/ISSUE_TEMPLATE/api_proposal.yml index d957004..48e38c3 100644 --- a/.github/ISSUE_TEMPLATE/api_proposal.yml +++ b/.github/ISSUE_TEMPLATE/api_proposal.yml @@ -1,75 +1,76 @@ -name: API Proposal -description: Propose a new syntax sugar API design for xhshow +name: API 语法糖提案 | API Proposal +description: 为 xhshow 提议新的语法糖 API 设计 | Propose a new syntax sugar API design for xhshow title: "[API]: " labels: ["enhancement", "api-design"] body: - type: markdown attributes: value: | - ## API Design Proposal + ## API 设计提案 | API Design Proposal + 感谢你提出 API 设计建议!此模板帮助构建你的提案以便社区讨论。 Thank you for proposing a new API design! This template helps structure your proposal for community discussion. - **Important Requirements:** - - All new APIs must be fully backward compatible - - Focus on practical use cases and developer experience - - Provide clear examples and documentation + **重要要求 | Important Requirements:** + - 所有新 API 必须完全向后兼容 | All new APIs must be fully backward compatible + - 关注实际用例和开发者体验 | Focus on practical use cases and developer experience + - 提供清晰的示例和文档 | Provide clear examples and documentation - type: input id: api-name attributes: - label: API Name - description: What is the proposed API method/class name? - placeholder: "e.g., sign_batch(), XhsClient, auto_refresh_session()" + label: API 名称 | API Name + description: 提议的 API 方法/类名称 | The proposed API method/class name + placeholder: "例如 | e.g.: sign_batch(), XhsClient, auto_refresh_session()" validations: required: true - type: dropdown id: api-type attributes: - label: API Type - description: What type of API are you proposing? + label: API 类型 | API Type + description: 你提议的是什么类型的 API? | What type of API are you proposing? options: - - "New Method" - - "New Class" - - "New Parameter" - - "Helper Function" - - "Context Manager" - - "Decorator" - - "Other" + - "新方法 | New Method" + - "新类 | New Class" + - "新参数 | New Parameter" + - "辅助函数 | Helper Function" + - "上下文管理器 | Context Manager" + - "装饰器 | Decorator" + - "其他 | Other" validations: required: true - type: textarea id: motivation attributes: - label: Motivation - description: Why do we need this API? What problem does it solve? + label: 动机 | Motivation + description: 为什么需要这个 API?它解决了什么问题? | Why do we need this API? What problem does it solve? placeholder: | - Currently, developers need to... - This API would simplify... + 目前开发者需要... | Currently, developers need to... + 这个 API 将简化... | This API would simplify... validations: required: true - type: textarea id: use-case attributes: - label: Use Case - description: Describe the specific use case this API addresses + label: 使用场景 | Use Case + description: 描述这个 API 解决的具体使用场景 | Describe the specific use case this API addresses placeholder: | - When building a web scraper that... - When handling multiple requests to... + 在构建网页爬虫时... | When building a web scraper... + 在处理多个请求时... | When handling multiple requests... validations: required: true - type: textarea id: current-approach attributes: - label: Current Approach (Before) - description: How do developers currently accomplish this task? + label: 当前方法 (改进前) | Current Approach (Before) + description: 开发者目前如何完成这个任务? | How do developers currently accomplish this task? placeholder: | ```python - # Current verbose way + # 当前冗长的方式 | Current verbose way client = Xhshow() headers1 = client.sign_headers_get(...) headers2 = client.sign_headers_get(...) @@ -82,11 +83,11 @@ body: - type: textarea id: proposed-usage attributes: - label: Proposed API Usage (After) - description: Show how your proposed API would work + label: 提议的 API 用法 (改进后) | Proposed API Usage (After) + description: 展示你提议的 API 将如何工作 | Show how your proposed API would work placeholder: | ```python - # New simplified way + # 新的简化方式 | New simplified way client = Xhshow() results = client.sign_batch([ {"uri": "...", "params": {...}}, @@ -101,8 +102,8 @@ body: - type: textarea id: api-signature attributes: - label: API Signature - description: Provide the proposed method/class signature with type hints + label: API 签名 | API Signature + description: 提供带类型注解的方法/类签名 | Provide the proposed method/class signature with type hints placeholder: | ```python def sign_batch( @@ -115,16 +116,18 @@ body: session: SessionManager | None = None ) -> list[dict[str, str]]: """ + 批量生成多个请求的签名。 Generate signatures for multiple requests in batch. Args: - requests: List of request configurations - cookies: Cookie dictionary or string - xsec_appid: Application identifier - timestamp: Unix timestamp - session: Optional session manager + requests: 请求配置列表 | List of request configurations + cookies: Cookie 字典或字符串 | Cookie dictionary or string + xsec_appid: 应用标识符 | Application identifier + timestamp: Unix 时间戳 | Unix timestamp + session: 可选的会话管理器 | Optional session manager Returns: + 包含签名的请求头字典列表 List of header dictionaries with signatures Examples: @@ -140,74 +143,44 @@ body: - type: textarea id: benefits attributes: - label: Benefits - description: What are the key benefits of this API? + label: 优势 | Benefits + description: 这个 API 的主要优势是什么? | What are the key benefits of this API? placeholder: | - - Reduces boilerplate code by X% - - Improves performance for batch operations - - Makes the API more intuitive for beginners - - Follows Python best practices + - 减少 X% 的样板代码 | Reduces boilerplate code by X% + - 提升批量操作的性能 | Improves performance for batch operations + - 让初学者更容易使用 | Makes the API more intuitive for beginners + - 遵循 Python 最佳实践 | Follows Python best practices validations: required: true - type: checkboxes id: compatibility attributes: - label: Backward Compatibility - description: Compatibility commitment + label: 向后兼容性 | Backward Compatibility + description: 兼容性承诺 | Compatibility commitment options: - - label: This API is fully backward compatible (does not break existing code) + - label: 此 API 完全向后兼容 (不会破坏现有代码) | This API is fully backward compatible (does not break existing code) required: true - - label: This API follows existing naming conventions in xhshow + - label: 此 API 遵循 xhshow 现有的命名约定 | This API follows existing naming conventions in xhshow required: false - - label: I have considered edge cases and error handling + - label: 我已考虑边界情况和错误处理 | I have considered edge cases and error handling required: false - type: textarea id: alternatives attributes: - label: Alternative Designs - description: Have you considered any alternative API designs? + label: 替代设计 | Alternative Designs + description: 你是否考虑过任何替代的 API 设计? | Have you considered any alternative API designs? placeholder: | - Alternative 1: Use a decorator pattern... - Alternative 2: Implement as a context manager... - - - type: textarea - id: implementation - attributes: - label: Implementation Notes - description: Any thoughts on how this could be implemented? - placeholder: | - This could be implemented by... - Dependencies needed: ... - Complexity: Low/Medium/High - - - type: textarea - id: documentation - attributes: - label: Documentation Impact - description: What documentation changes would be needed? - placeholder: | - - Add new section to README - - Update examples in docs/ - - Add docstring examples - - - type: textarea - id: testing - attributes: - label: Testing Strategy - description: How should this API be tested? - placeholder: | - - Unit tests for basic functionality - - Integration tests with real requests - - Performance benchmarks + 替代方案 1: 使用装饰器模式... | Alternative 1: Use a decorator pattern... + 替代方案 2: 实现为上下文管理器... | Alternative 2: Implement as a context manager... - type: textarea id: additional attributes: - label: Additional Context - description: Any other context, links, or references? + label: 补充信息 | Additional Context + description: 任何其他上下文、链接或参考资料? | Any other context, links, or references? placeholder: | - Related issues: #... - Similar APIs in other libraries: ... - References: ... + 相关 issue | Related issues: #... + 其他库中的类似 API | Similar APIs in other libraries: ... + 参考资料 | References: ... diff --git a/.github/ISSUE_TEMPLATE/api_proposal_cn.yml b/.github/ISSUE_TEMPLATE/api_proposal_cn.yml deleted file mode 100644 index d8ebe5b..0000000 --- a/.github/ISSUE_TEMPLATE/api_proposal_cn.yml +++ /dev/null @@ -1,213 +0,0 @@ -name: API 提案 -description: 为 xhshow 提议新的语法糖 API 设计 -title: "[API]: " -labels: ["enhancement", "api-design"] -body: - - type: markdown - attributes: - value: | - ## API 设计提案 - - 感谢你提出 API 设计建议!此模板帮助构建你的提案以便社区讨论。 - - **重要要求:** - - 所有新 API 必须完全向后兼容 - - 关注实际用例和开发者体验 - - 提供清晰的示例和文档 - - - type: input - id: api-name - attributes: - label: API 名称 - description: 提议的 API 方法/类名称是什么? - placeholder: "例如: sign_batch(), XhsClient, auto_refresh_session()" - validations: - required: true - - - type: dropdown - id: api-type - attributes: - label: API 类型 - description: 你提议的是什么类型的 API? - options: - - "新方法" - - "新类" - - "新参数" - - "辅助函数" - - "上下文管理器" - - "装饰器" - - "其他" - validations: - required: true - - - type: textarea - id: motivation - attributes: - label: 动机 - description: 为什么需要这个 API?它解决了什么问题? - placeholder: | - 目前开发者需要... - 这个 API 将简化... - validations: - required: true - - - type: textarea - id: use-case - attributes: - label: 使用场景 - description: 描述这个 API 解决的具体使用场景 - placeholder: | - 在构建网页爬虫时... - 在处理多个请求时... - validations: - required: true - - - type: textarea - id: current-approach - attributes: - label: 当前方法 (改进前) - description: 开发者目前如何完成这个任务? - placeholder: | - ```python - # 当前冗长的方式 - client = Xhshow() - headers1 = client.sign_headers_get(...) - headers2 = client.sign_headers_get(...) - headers3 = client.sign_headers_get(...) - ``` - render: python - validations: - required: true - - - type: textarea - id: proposed-usage - attributes: - label: 提议的 API 用法 (改进后) - description: 展示你提议的 API 将如何工作 - placeholder: | - ```python - # 新的简化方式 - client = Xhshow() - results = client.sign_batch([ - {"uri": "...", "params": {...}}, - {"uri": "...", "params": {...}}, - {"uri": "...", "params": {...}}, - ]) - ``` - render: python - validations: - required: true - - - type: textarea - id: api-signature - attributes: - label: API 签名 - description: 提供带类型注解的方法/类签名 - placeholder: | - ```python - def sign_batch( - self, - requests: list[dict[str, Any]], - cookies: dict[str, Any] | str, - *, - xsec_appid: str = "xhs-pc-web", - timestamp: float | None = None, - session: SessionManager | None = None - ) -> list[dict[str, str]]: - """ - 批量生成多个请求的签名。 - - Args: - requests: 请求配置列表 - cookies: Cookie 字典或字符串 - xsec_appid: 应用标识符 - timestamp: Unix 时间戳 - session: 可选的会话管理器 - - Returns: - 包含签名的请求头字典列表 - - Examples: - >>> client = Xhshow() - >>> results = client.sign_batch([...]) - """ - pass - ``` - render: python - validations: - required: true - - - type: textarea - id: benefits - attributes: - label: 优势 - description: 这个 API 的主要优势是什么? - placeholder: | - - 减少 X% 的样板代码 - - 提升批量操作的性能 - - 让初学者更容易使用 - - 遵循 Python 最佳实践 - validations: - required: true - - - type: checkboxes - id: compatibility - attributes: - label: 向后兼容性 - description: 兼容性承诺 - options: - - label: 此 API 完全向后兼容 (不会破坏现有代码) - required: true - - label: 此 API 遵循 xhshow 现有的命名约定 - required: false - - label: 我已考虑边界情况和错误处理 - required: false - - - type: textarea - id: alternatives - attributes: - label: 替代设计 - description: 你是否考虑过任何替代的 API 设计? - placeholder: | - 替代方案 1: 使用装饰器模式... - 替代方案 2: 实现为上下文管理器... - - - type: textarea - id: implementation - attributes: - label: 实现说明 - description: 对如何实现有什么想法吗? - placeholder: | - 可以通过...实现 - 需要的依赖: ... - 复杂度: 低/中/高 - - - type: textarea - id: documentation - attributes: - label: 文档影响 - description: 需要哪些文档变更? - placeholder: | - - 在 README 中添加新章节 - - 更新 docs/ 中的示例 - - 添加文档字符串示例 - - - type: textarea - id: testing - attributes: - label: 测试策略 - description: 应该如何测试这个 API? - placeholder: | - - 基本功能的单元测试 - - 真实请求的集成测试 - - 性能基准测试 - - - type: textarea - id: additional - attributes: - label: 补充信息 - description: 任何其他上下文、链接或参考资料? - placeholder: | - 相关 issue: #... - 其他库中的类似 API: ... - 参考资料: ... diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2ded189..f622a53 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,57 +1,58 @@ -name: Bug Report -description: Report a bug or unexpected behavior +name: Bug 报告 | Bug Report +description: 报告错误或异常行为 | Report a bug or unexpected behavior title: "[Bug]: " labels: ["bug"] body: - type: markdown attributes: value: | + 感谢你填写此 Bug 报告! Thanks for taking the time to fill out this bug report! - type: textarea id: description attributes: - label: Bug Description - description: A clear and concise description of what the bug is - placeholder: Tell us what you see! + label: Bug 描述 | Bug Description + description: 清晰简洁地描述这个 Bug | A clear and concise description of what the bug is + placeholder: 告诉我们你遇到了什么 | Tell us what you see validations: required: true - type: textarea id: reproduce attributes: - label: Steps to Reproduce - description: Steps to reproduce the behavior + label: 复现步骤 | Steps to Reproduce + description: 如何复现这个问题 | Steps to reproduce the behavior placeholder: | - 1. Import xhshow with '...' - 2. Call method '...' - 3. See error + 1. 导入 xhshow 并调用 '...' | Import xhshow with '...' + 2. 调用方法 '...' | Call method '...' + 3. 看到错误 | See error validations: required: true - type: textarea id: expected attributes: - label: Expected Behavior - description: A clear and concise description of what you expected to happen - placeholder: What should happen? + label: 期望行为 | Expected Behavior + description: 你期望发生什么 | What you expected to happen + placeholder: 应该发生什么? | What should happen? validations: required: true - type: textarea id: actual attributes: - label: Actual Behavior - description: What actually happened? - placeholder: What did happen? + label: 实际行为 | Actual Behavior + description: 实际发生了什么? | What actually happened? + placeholder: 实际发生了什么? | What did happen? validations: required: true - type: textarea id: code attributes: - label: Code Sample - description: Please provide a minimal code sample that reproduces the issue + label: 代码示例 | Code Sample + description: 请提供能够复现问题的最小代码示例 | Please provide a minimal code sample that reproduces the issue placeholder: | ```python from xhshow import Xhshow @@ -66,15 +67,15 @@ body: - type: textarea id: traceback attributes: - label: Error Traceback - description: If applicable, paste the full error traceback + label: 错误堆栈 | Error Traceback + description: 如果适用,请粘贴完整的错误堆栈 | If applicable, paste the full error traceback render: shell - type: input id: version attributes: - label: xhshow Version - description: Which version of xhshow are you using? + label: xhshow 版本 | xhshow Version + description: 你使用的 xhshow 版本 | Which version of xhshow are you using placeholder: "0.1.8" validations: required: true @@ -82,8 +83,8 @@ body: - type: input id: python-version attributes: - label: Python Version - description: Which version of Python are you using? + label: Python 版本 | Python Version + description: 你使用的 Python 版本 | Which version of Python are you using placeholder: "3.12" validations: required: true @@ -91,8 +92,8 @@ body: - type: input id: os attributes: - label: Operating System - description: Which operating system are you using? + label: 操作系统 | Operating System + description: 你使用的操作系统 | Which operating system are you using placeholder: "Windows 11 / Ubuntu 22.04 / macOS 14" validations: required: true @@ -100,5 +101,5 @@ body: - type: textarea id: additional attributes: - label: Additional Context - description: Add any other context about the problem here + label: 补充信息 | Additional Context + description: 添加关于此问题的其他信息 | Add any other context about the problem here diff --git a/.github/ISSUE_TEMPLATE/bug_report_cn.yml b/.github/ISSUE_TEMPLATE/bug_report_cn.yml deleted file mode 100644 index 2466214..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report_cn.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Bug 报告 -description: 报告错误或异常行为 -title: "[Bug]: " -labels: ["bug"] -body: - - type: markdown - attributes: - value: | - 感谢你填写此 Bug 报告! - - - type: textarea - id: description - attributes: - label: Bug 描述 - description: 清晰简洁地描述这个 Bug - placeholder: 告诉我们你遇到了什么 - validations: - required: true - - - type: textarea - id: reproduce - attributes: - label: 复现步骤 - description: 如何复现这个问题 - placeholder: | - 1. 导入 xhshow 并调用 '...' - 2. 调用方法 '...' - 3. 看到错误 - validations: - required: true - - - type: textarea - id: expected - attributes: - label: 期望行为 - description: 清晰地描述你期望发生什么 - placeholder: 应该发生什么? - validations: - required: true - - - type: textarea - id: actual - attributes: - label: 实际行为 - description: 实际发生了什么? - placeholder: 实际发生了什么? - validations: - required: true - - - type: textarea - id: code - attributes: - label: 代码示例 - description: 请提供能够复现问题的最小代码示例 - placeholder: | - ```python - from xhshow import Xhshow - - client = Xhshow() - # 你的代码 - ``` - render: python - validations: - required: true - - - type: textarea - id: traceback - attributes: - label: 错误堆栈 - description: 如果适用,请粘贴完整的错误堆栈 - render: shell - - - type: input - id: version - attributes: - label: xhshow 版本 - description: 你使用的 xhshow 版本是什么? - placeholder: "0.1.8" - validations: - required: true - - - type: input - id: python-version - attributes: - label: Python 版本 - description: 你使用的 Python 版本是什么? - placeholder: "3.12" - validations: - required: true - - - type: input - id: os - attributes: - label: 操作系统 - description: 你使用的操作系统是什么? - placeholder: "Windows 11 / Ubuntu 22.04 / macOS 14" - validations: - required: true - - - type: textarea - id: additional - attributes: - label: 补充信息 - description: 添加关于此问题的其他信息 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 4313d0d..9a47d6b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,10 +2,7 @@ blank_issues_enabled: false contact_links: - name: GitHub Discussions url: https://github.com/cloxl/xhshow/discussions - about: For questions and discussions about using xhshow - - name: 中文讨论区 (Chinese Discussions) - url: https://github.com/cloxl/xhshow/discussions - about: 使用 xhshow 的问题和讨论 + about: For general questions and discussions | 一般性问题和讨论 - name: Documentation url: https://github.com/cloxl/xhshow#readme - about: Check the documentation for usage guides and examples + about: Check the documentation for usage guides | 查看使用指南和文档 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index ba95a39..5d9227e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,42 +1,47 @@ -name: Feature Request -description: Suggest a new feature or enhancement +name: 功能请求 | Feature Request +description: 提议新功能或改进 | Suggest a new feature or enhancement title: "[Feature]: " labels: ["enhancement"] body: - type: markdown attributes: value: | + 感谢你提出新功能建议!请尽可能提供详细信息。 Thanks for suggesting a new feature! Please provide as much detail as possible. - type: textarea id: problem attributes: - label: Problem Statement - description: Is your feature request related to a problem? Please describe. - placeholder: I'm always frustrated when... + label: 问题陈述 | Problem Statement + description: 你的功能请求是否与某个问题相关? | Is your feature request related to a problem? + placeholder: | + 我在使用时总是遇到... + I'm always frustrated when... validations: required: true - type: textarea id: solution attributes: - label: Proposed Solution - description: Describe the solution you'd like - placeholder: I would like to see... + label: 提议的解决方案 | Proposed Solution + description: 描述你想要的解决方案 | Describe the solution you'd like + placeholder: | + 我希望看到... + I would like to see... validations: required: true - type: textarea id: example attributes: - label: Usage Example - description: Show how you would use this feature + label: 使用示例 | Usage Example + description: 展示你将如何使用这个功能 | Show how you would use this feature placeholder: | ```python from xhshow import Xhshow client = Xhshow() - # Example of how the new feature would work + # 新功能的使用示例 | Example of how the new feature would work result = client.new_feature(...) ``` render: python @@ -46,35 +51,37 @@ body: - type: textarea id: alternatives attributes: - label: Alternatives Considered - description: Describe any alternative solutions or features you've considered - placeholder: I also thought about... + label: 考虑过的替代方案 | Alternatives Considered + description: 你考虑过的任何替代解决方案 | Any alternative solutions or features you've considered + placeholder: | + 我还考虑过... + I also thought about... - type: dropdown id: breaking attributes: - label: Breaking Changes - description: Would this feature require breaking changes to existing APIs? + label: 破坏性变更 | Breaking Changes + description: 这个功能是否需要破坏性变更? | Would this feature require breaking changes? options: - - "No - Fully backward compatible" - - "Yes - Would break existing code" - - "Not sure" + - "否 - 完全向后兼容 | No - Fully backward compatible" + - "是 - 会破坏现有代码 | Yes - Would break existing code" + - "不确定 | Not sure" validations: required: true - type: checkboxes id: compatibility attributes: - label: Compatibility Requirements - description: Important compatibility considerations + label: 兼容性确认 | Compatibility Confirmation + description: 重要的兼容性考虑 | Important compatibility considerations options: - - label: This feature must maintain full backward compatibility with existing versions + - label: 此功能必须保持与现有版本的完全向后兼容 | This feature must maintain full backward compatibility required: false - - label: I have checked that this feature doesn't conflict with existing functionality + - label: 我已确认此功能不会与现有功能冲突 | I have checked that this feature doesn't conflict with existing functionality required: false - type: textarea id: additional attributes: - label: Additional Context - description: Add any other context, screenshots, or examples about the feature request here + label: 补充信息 | Additional Context + description: 添加其他信息、截图或示例 | Add any other context, screenshots, or examples diff --git a/.github/ISSUE_TEMPLATE/feature_request_cn.yml b/.github/ISSUE_TEMPLATE/feature_request_cn.yml deleted file mode 100644 index ccdf46d..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request_cn.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: 功能请求 -description: 提议新功能或改进 -title: "[Feature]: " -labels: ["enhancement"] -body: - - type: markdown - attributes: - value: | - 感谢你提出新功能建议!请尽可能提供详细信息。 - - - type: textarea - id: problem - attributes: - label: 问题陈述 - description: 你的功能请求是否与某个问题相关?请描述。 - placeholder: 我在使用时总是遇到... - validations: - required: true - - - type: textarea - id: solution - attributes: - label: 提议的解决方案 - description: 描述你想要的解决方案 - placeholder: 我希望看到... - validations: - required: true - - - type: textarea - id: example - attributes: - label: 使用示例 - description: 展示你将如何使用这个功能 - placeholder: | - ```python - from xhshow import Xhshow - - client = Xhshow() - # 新功能的使用示例 - result = client.new_feature(...) - ``` - render: python - validations: - required: true - - - type: textarea - id: alternatives - attributes: - label: 考虑过的替代方案 - description: 描述你考虑过的任何替代解决方案或功能 - placeholder: 我还考虑过... - - - type: dropdown - id: breaking - attributes: - label: 破坏性变更 - description: 这个功能是否需要破坏性变更? - options: - - "否 - 完全向后兼容" - - "是 - 会破坏现有代码" - - "不确定" - validations: - required: true - - - type: checkboxes - id: compatibility - attributes: - label: 兼容性要求 - description: 重要的兼容性考虑 - options: - - label: 此功能必须保持与现有版本的完全向后兼容 - required: false - - label: 我已确认此功能不会与现有功能冲突 - required: false - - - type: textarea - id: additional - attributes: - label: 补充信息 - description: 添加关于功能请求的其他信息、截图或示例 diff --git a/.github/ISSUE_TEMPLATE/general.yml b/.github/ISSUE_TEMPLATE/general.yml new file mode 100644 index 0000000..750ac17 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general.yml @@ -0,0 +1,39 @@ +name: 通用讨论 | General Discussion +description: 其他问题、疑问或讨论 | Other questions, inquiries, or discussions +title: "[讨论 | Discussion]: " +labels: ["question"] +body: + - type: markdown + attributes: + value: | + 如果你的问题不属于 Bug 报告、功能请求或 API 提案,可以使用此模板。 + If your issue doesn't fit into Bug Report, Feature Request, or API Proposal, use this template. + + - type: textarea + id: content + attributes: + label: 问题描述 | Description + description: 请详细描述你想讨论或咨询的内容 | Please describe what you want to discuss or ask about + placeholder: | + 请尽可能详细地描述你的问题或想法... + Please describe your question or idea in detail... + validations: + required: true + + - type: textarea + id: context + attributes: + label: 相关背景 | Context + description: 提供相关的背景信息或使用场景 | Provide relevant background or use case + placeholder: | + 例如,你在什么场景下遇到这个问题? + For example, in what scenario did you encounter this? + + - type: textarea + id: additional + attributes: + label: 补充信息 | Additional Information + description: 添加任何其他相关信息 | Add any other relevant information + placeholder: | + 代码示例、截图、链接等... + Code examples, screenshots, links, etc...