diff --git a/.github/ISSUE_TEMPLATE/ask-for-question.md b/.github/ISSUE_TEMPLATE/ask-for-question.md deleted file mode 100644 index 0f42cbc17d..0000000000 --- a/.github/ISSUE_TEMPLATE/ask-for-question.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: 🤔 Ask for question -about: Look for some help or ask question -title: '🤔' -labels: ❔question ---- - - - - - - -### 🏷 Version - - - - - -| Package | Version | -| -------------- | ------- | -| @antv/s2 | | -| @antv/s2-react | | -| @antv/s2-vue | | - -### Sheet Type - - - - -- [ ] PivotSheet -- [ ] TableSheet -- [ ] GridAnalysisSheet -- [ ] StrategySheet -- [ ] EditableSheet - -### 🖋 Description - - - - -### 🔗 Reproduce Link - - - - -### 😊 Expected Behavior - -### 😅 Current Behavior diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 916dadda53..0000000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -name: 🐛 Bug report -about: Let us know something is wrong. -title: '🐛' ---- - - - - -### 🏷 Version - - - - - - -| Package | Version | -| -------------- | ------- | -| @antv/s2 | | -| @antv/s2-react | | -| @antv/s2-vue | | - -### Sheet Type - - - - -- [ ] PivotSheet -- [ ] TableSheet -- [ ] GridAnalysisSheet -- [ ] StrategySheet -- [ ] EditableSheet - -### 🖋 Description - - - - -### ⌨️ Code Snapshots - - - - - - -### 🔗 Reproduce Link - - - - -### 🤔 Steps to Reproduce - - - - -### 😊 Expected Behavior - - - - -### 😅 Current Behavior - - - - -### 💻 System information - - - - -| Environment | Info | -| ------- | ------- | -| System | | -| Browser | | diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000000..0bb233dc53 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,152 @@ +name: '🐛 Bug report' +description: Create a report to help us improve, Ask questions in Discussions / 创建一个问题报告以帮助我们改进,提问请到 Discussions +title: '🐛' +body: + - type: markdown + attributes: + value: | + Report errors and exceptions found in S2. + + Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already: + + --- + + ### 反馈在 S2 中发现的错误、异常 ([提 Issue 前必读](https://github.com/antvis/S2/issues/1904))。 + + ⚠️ 在提出问题前,请确保你已经仔细阅读👓/搜索🔍过 [官方文档](https://s2.antv.antgroup.com) 和 [常见问题](https://s2.antv.antgroup.com/manual/faq) 以及 [图表示例](https://s2.antv.antgroup.com/examples), 并且已经搜索查阅过相关 [Issues 列表](https://github.com/antvis/S2/issues?q=is%3Aissue+is%3Aclosed) 和 [Discussions 列表](https://github.com/antvis/S2/discussions). 当你确定自己的问题没有解决方案时,请提交 issue。 ⚠️ + + 如果是使用问题,不知道怎么用,请移步 [Discussions 讨论区](https://github.com/antvis/S2/discussions) 并提供 [有效信息](https://github.com/antvis/S2/issues/1904) 进行[提问](https://github.com/antvis/S2/discussions/new?category=q-a)。 + + ### 参与社区共建 + + **这是一个开源项目, 我们也有繁忙的业务要做, 是用自己的业余时间在维护, 为爱发电, 精力有限, 所以有时候 issue 响应速度不是那么及时, 如果你遇到了问题, 或者对 [Issues](https://github.com/antvis/S2/issues) 和 [Discussions](https://github.com/antvis/S2/discussions) 列表的问题感兴趣, 可以直接认领并尝试修复 ([贡献指南](https://s2.antv.antgroup.com/manual/contribution)),帮助 S2 变得更好, 而不是一味的埋怨和催促, 我们不是甲方乙方的关系.** + + - type: textarea + id: version + attributes: + label: 🏷 S2 Version / S2 版本 + description: | + 请填写你实际安装到 node_modules 中的具体版本号,请确保你已经尝试过安装最新版本解决问题,并且本地和官网都能复现该问题. + 请不要写 `latest`, `2.x` 这种没有意义的版本号, + placeholder: | + 复制下方的表格, 修改对应版本号即可: + + | Package | Version | + | -------------- | ------- | + | @antv/s2 | 2.0.0 | + | @antv/s2-react | 2.0.0 | + | @antv/s2-react-components | 2.0.0 | + value: | + | Package | Version | + | -------------- | ------- | + | @antv/s2 | | + | @antv/s2-react | | + | @antv/s2-react-components | | + + validations: + required: true + + - type: checkboxes + id: sheet-type + attributes: + label: 💻 Sheet Type / 表格类型 + description: | + 请选择你具体使用的表格,这能帮助我们更快的定位问题 + options: + - label: PivotSheet + - label: TableSheet + - label: GridAnalysisSheet + - label: StrategySheet + - label: EditableSheet + + - type: textarea + id: description + attributes: + label: 🖋 Describe the bug / 问题描述 + description: | + 1. 请填写你具体的问题描述,**请不要惜字如金,尽可能的多提供一些你能想到的有用信息**。 + 2. 请至少懂表格的基本概念,会基本的 JavaScript, 统一用语,不要将 `行头` 说成 `列头`, `列头` 说成 `表头`, 统一用语,可以减少我们的沟通成本。 + + validations: + required: true + + - type: textarea + id: code + attributes: + label: ⌨️ Code Snapshots / 代码片段 + description: | + 1. 请粘贴你的**核心代码片段**,包括但不限于 `报错信息`, `s2Options 配置信息`, `s2DataConfig 数据源信息`。 + 2. 请不要粘贴你自己的业务代码, 更不要无脑粘贴一大段没有格式化的 "乱码"。 + 3. 请不要**直接粘贴官网的在线示例链接, 然后告诉我们有问题, 官网不会保存你编辑后的代码**, 请粘贴 `你的代码片段`, 或者使用 [codesandbox](https://codesandbox.io/) + 4. 请尽量不要粘贴代码的截图,请使用文本. + placeholder: | + If there is a code block, please use Markdown syntax, such as: + 请注意使用 markdown code 标签: + + ```javascript + // Your code here + ``` + validations: + required: true + + - type: input + id: link + attributes: + label: 🔗 Reproduction link / 复现链接 + description: | + 1. 请提供一个精简的可复现链接,它可以让我们更快的帮你复现,定位问题,这很重要,尽量避免 gif, 视频等形式。 + 2. 推荐使用 [codesandbox](https://codesandbox.io/), 我们提供了各种版本的模板,方便你反馈问题。[查看所有模板](https://www.yuque.com/antv/vo4vyz/bam4vz)。 + 3. [官网在线示例](https://s2.antv.vision/zh/examples/gallery) 支持在线编写代码,你可以将代码转成 `codesandbox` 并将对应的链接发给我们,请不要将官网的代码原封不动的复制给我们,请不要 `这么麻烦, 还要复现链接? 赶紧给我修啊, 很急!`, 请不要 `打了一个压缩包给你, 代码都在这, 给我修吧`,更不要 `复现步骤,联系 xxx@qq.com`。 + 4. 请不要 `开局一张图,内容全靠猜`, 我们不是侦探 + validations: + required: false + + - type: textarea + id: steps + attributes: + label: 📋 Steps to Reproduce the Bug or Issue / 重现步骤 + description: | + 1. 请不要惜字如金,粘贴一个张图或者一句话就草草了事,我们需要你详细的复现步骤,这个问题需要怎么样的操作步骤才能复现。 + 2. 不同的问题有不同的复现步骤,只有你最清楚怎么复现这个问题,比如问题需要 **滚动表格到指定位置才能复现, 但是通篇都没有提到, 而你就贴一张图, 什么信息都不给**:所以请 `1. 拖动表格滚动条,滚动到 xx 位置 2. 停留 300ms, 3. tooltip 消失`。 + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: 😊 Expected Behavior / 期望行为 + description: | + 说明这个问题的预期行为,只有你才最了解自己的代码,所以请不要让我们猜,请说明预期,不如 `数据不对,正确应该是:xx`, `布局错误:正确应该是 A 节点在 B 位置`, 如有必要请使用截图工具标注一下, 让问题更醒目。 + validations: + required: true + + - type: textarea + id: current-behavior + attributes: + label: 😅 Current Behavior / 当前行为 + description: | + 说明这个问题当前行为, 如有必要请使用截图工具标注一下, 让问题更醒目。 + validations: + required: false + + - type: checkboxes + id: OS + attributes: + label: 💻 OS / 操作系统 + options: + - label: macOS + - label: Windows + - label: Linux + - label: Others / 其他 + + - type: checkboxes + id: Browser + attributes: + label: 🌏 Browser / 浏览器 + options: + - label: Chrome + - label: Edge + - label: Firefox + - label: Safari (Limited support / 有限支持) + - label: IE (Nonsupport / 不支持) + - label: Others / 其他 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..a9145ba2b1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,6 @@ +# Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: false +contact_links: + - name: 🤔 Question / 问题咨询 + url: https://github.com/antvis/S2/discussions/new?category=q-a + about: Discuss S2 usage / 讨论 S2 使用问题 diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md deleted file mode 100644 index 518d3e947a..0000000000 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -name: 🙏 Feature request -about: Suggest an idea for this project -title: '🙏' -labels: 🙏feature request ---- - - - - -### 🏷 Version - - - - - - -| Package | Version | -| -------------- | ------- | -| @antv/s2 | | -| @antv/s2-react | | -| @antv/s2-vue | | - -### Sheet Type - - - - -- [ ] PivotSheet -- [ ] TableSheet -- [ ] GridAnalysisSheet -- [ ] StrategySheet -- [ ] EditableSheet - -### 🖋 Description - - - - -### 🏞 What problem does this feature solve - - - - -### 🧐 Suggest the API - - - -| name | type | default | description | -| ---- | ---- | ------- | ----------- | -| - | - | - | - | diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000000..e13001974b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,52 @@ +name: '🙏 Feature request' +description: I have a suggestion (and may want to implement it) / 我有一个建议(或者想参与贡献) +title: '🙏' +labels: ['🙏feature request'] +body: + - type: markdown + attributes: + value: | + 如果你遇到了问题,或者对 [Issues](https://github.com/antvis/S2/issues) 和 [Discussions](https://github.com/antvis/S2/discussions) 列表的问题感兴趣,**可以直接认领并尝试修复**,帮助 S2 变得更好,期待在 [贡献者列表](https://github.com/antvis/S2/graphs/contributors) 里看见你的头像。 + + S2 非常需要你的共建,请阅读 [贡献指南](https://s2.antv.antgroup.com/manual/contribution) 后提交 PR. + + - type: textarea + id: description + attributes: + label: Describe the feature / 功能描述 + placeholder: | + What problem does this feature solve? Where are the existing features not enough? + 这个功能能解决什么问题? 现有功能不满足的点在哪? + + validations: + required: true + + - type: textarea + id: api + attributes: + label: Design the API / API 设计 + placeholder: | + If you need to add an API, how do you want to design it? + 如果需要新增 API, 你希望怎么设计? + + | name | type | default | description | + | ---- | ---- | ------- | ----------- | + | - | - | - | - | + + value: | + | name | type | default | description | + | ---- | ---- | ------- | ----------- | + | - | - | - | - | + + validations: + required: true + + - type: dropdown + attributes: + label: Are you willing to contribute? / 是否愿意参与贡献? + options: + - Please select / 请选择 + - ✅ Yes / 是 + - ❌ No / 否 + validations: + required: true diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 9b2b2fc58c..c41599d49d 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -95,17 +95,21 @@ jobs: Hello, @${{ github.event.issue.user.login }}, your feature request has been accepted after our repeated discussion. We will schedule the development, please pay attention to the follow-up release logs. - - name: Pending - if: github.event.label.name == '💤 pending' + - name: Welcom PR + if: github.event.label.name == '⭐️ Welcom PR' uses: actions-cool/issues-helper@main with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - 你好 @${{ github.event.issue.user.login }},经过我们的反复讨论, 你的需求现已被采纳, 我们会排期开发, 但人力资源有限, 短期内无法支持, 请关注后续发布日志。当然, 如果能贡献 PR 帮助我们改进, 不胜感激! + 你好 @${{ github.event.issue.user.login }},你的反馈我们已收到, 这是一个开源项目, 我们也是用自己的业余时间在维护, 为爱发电, 精力实在有限, 👏🏻 欢迎根据 [贡献指南](https://s2.antv.antgroup.com/manual/contribution) 提交 PR. 一起参与到开源项目的建设中. - Hello, @${{ github.event.issue.user.login }}, your feature request has been accepted after our repeated discussion. We will schedule the development. However, it could not be supported in the short term since limited time, please pay attention to the follow-up release logs. Of course, looking forward for your PR! + 如果你遇到了问题,或者对 [Issues](https://github.com/antvis/S2/issues) 和 [Discussions](https://github.com/antvis/S2/discussions) 列表的问题感兴趣,可以**直接认领并尝试修复**,帮助 S2 变得更好,期待在 [贡献者列表](https://github.com/antvis/S2/graphs/contributors) 里看见你的头像。 + + Hello, @${{ github.event.issue.user.login }}, We have received your feedback, this is an open source project, we also use our spare time to maintain, for love power generation, energy is really limited, 👏 🏻 welcome according to contribution guide (https://s2.antv.antgroup.com/manual/contribution) to submit PR. Get involved in open source projects together. + + If you have a problem, Or to [Issues] (https://github.com/antvis/S2/issues) and [Discussions] (https://github.com/antvis/S2/discussions) interested in a list of questions, Can directly claim and try to repair, help S2 better, look forward to in the [contributor list] (https://github.com/antvis/S2/graphs/contributors) saw your head. - name: Rejected if: github.event.label.name == '❌ won''t support' @@ -141,3 +145,28 @@ jobs: Hello, @${{ github.event.issue.user.login }}, This feature or defect has been supported or fixed in the '2.x' version, please use the '2.x' version for development (' 1.x 'version is no longer maintained), thank you for your support and understanding. Any `2.x` version issues, please go to [issue](https://github.com/antvis/S2/issues), or [view docs](https://s2.antv.antgroup.com), the first trial: + + - name: S2 Vue + if: github.event.label.name == 's2-vue' + uses: actions-cool/issues-helper@main + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + 你好 @${{ github.event.issue.user.login }},`@antv/s2-vue` 现已停止维护,由于精力投入有限,出于维护成本,包下载量等因素综合考虑,从 `2.0.0` 正式版后不再继续更新,请基于 `@antv/s2` 自行封装,或 fork 仓库进行二次开发。 + + Hello, @${{ github.event.issue.user.login }}, `@antv/s2-vue` has stopped maintenance, due to limited energy investment, due to the comprehensive consideration of maintenance costs, package downloads and other factors, from the '2.0.0' official version will not continue to update, please based on '@antv/s2' self-encapsulation, or fork warehouse for secondary development. + + - name: G + if: github.event.label.name == 'G' + uses: actions-cool/issues-helper@main + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + 你好 @${{ github.event.issue.user.login }},这个属于底层渲染引擎 [AntV/G](https://g.antv.antgroup.com/) 的问题, 需要等待底层支持或修复后, 上层才能适配, 请耐心等待, 感谢你的理解。 + + Hello, @${{ github.event.issue.user.login }}, This belongs to the underlying rendering engine AntV/G (https://g.antv.antgroup.com/), needs to wait for the underlying support or after repair, the upper can adapter, please wait patiently, thank you for your understanding. + diff --git a/.github/workflows/issue-opend.yml b/.github/workflows/issue-opend.yml index 4225078b58..40de3619ac 100644 --- a/.github/workflows/issue-opend.yml +++ b/.github/workflows/issue-opend.yml @@ -8,7 +8,7 @@ jobs: issue-opend-check: runs-on: ubuntu-latest steps: - - name: check issue title + - name: Check issue title if: github.event.issue.title == '🤔' || github.event.issue.title == '🙏' || github.event.issue.title == '🐛' uses: actions-cool/issues-helper@main with: @@ -20,20 +20,6 @@ jobs: Hello, @${{ github.event.issue.user.login }}, please edit your issue title. a concise issue title will save everyone time. please do not leave the title as the body or empty. - # 如果 issue 的提交者无视模版, 连基本的版本号,表格类型, 描述都没有, 直接自动关闭, 不多BB. - - name: check issue body - if: contains(github.event.issue.body, 'Version') == false && contains(github.event.issue.body, 'Sheet Type') == false && contains(github.event.issue.body, 'Description') == false - uses: actions-cool/issues-helper@main - with: - actions: 'create-comment,add-labels,close-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: '⛔ invalid' - body: | - 你好 @${{ github.event.issue.user.login }},请按照 issue 模板填写相关信息, 方便大家高效沟通, 强烈推荐你阅读 [提 Issue 前必读](https://github.com/antvis/S2/issues/1904) 和 [如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393)。 - - Hello @${{ github.event.issue.user.login }}, please fill in the relevant information according to the issue template to facilitate communication efficiently. recommend you to read [提 Issue 前必读](https://github.com/antvis/S2/issues/1904) and [如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393), Thanks so much! - # 标题或正文 (版本号) 带有 next, 增加标记便于统计 - name: Auto Set Next Label if: contains(github.event.issue.title, 'next') || contains(github.event.issue.body, 'next') @@ -43,3 +29,22 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} labels: 'next' + + - name: Auto Tips + uses: actions-cool/issues-helper@main + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + 你好 @${{ github.event.issue.user.login }}: + + ### 提 Issue 须知 + + ⚠️ 在提出问题前,请确保你已经仔细阅读👓/搜索🔍过 [官方文档](https://s2.antv.antgroup.com) 和 [常见问题](https://s2.antv.antgroup.com/manual/faq) 以及 [图表示例](https://s2.antv.antgroup.com/examples), 并且已经搜索查阅过相关 [Issues 列表](https://github.com/antvis/S2/issues?q=is%3Aissue+is%3Aclosed) 和 [Discussions 列表](https://github.com/antvis/S2/discussions). 当你确定自己的问题没有解决方案时,请提交 issue。 ⚠️ + + 如果是使用问题,不知道怎么用,移步 [Discussions 讨论区](https://github.com/antvis/S2/discussions) 并提供 [有效信息](https://zhuanlan.zhihu.com/p/25795393) 进行 [提问](https://github.com/antvis/S2/discussions/new?category=q-a)。 + + ### 参与社区共建 + + **这是一个开源项目, 我们也有繁忙的业务要做, 是用自己的业余时间在维护, 为爱发电, 精力有限, 所以有时候 issue 响应速度不是那么及时, 如果你遇到了问题, 或者对 [Issues](https://github.com/antvis/S2/issues) 和 [Discussions](https://github.com/antvis/S2/discussions) 列表的问题感兴趣, 可以直接认领并尝试修复 ([贡献指南](https://s2.antv.antgroup.com/manual/contribution)),帮助 S2 变得更好, 而不是一味的埋怨和催促, 我们不是甲方乙方的关系.** diff --git a/.github/workflows/pr-auto-assign-reviewer.yml b/.github/workflows/pr-auto-assign-reviewer.yml index cc1f6cec4e..bd1ef2f812 100644 --- a/.github/workflows/pr-auto-assign-reviewer.yml +++ b/.github/workflows/pr-auto-assign-reviewer.yml @@ -21,5 +21,5 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} pr-emoji: '+1, rocket' - reviewers: 'lijinke666,wjgogogo,wuhaiyang' + reviewers: 'lijinke666,wjgogogo' review-creator: false diff --git a/.github/workflows/pr-labeled.yml b/.github/workflows/pr-labeled.yml index 5888c6a7df..233e050f61 100644 --- a/.github/workflows/pr-labeled.yml +++ b/.github/workflows/pr-labeled.yml @@ -16,9 +16,9 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body: | - 你好 @${{ github.event.pull_request.user.login }},感谢你的贡献, 为了让代码更健壮, 请根据 [贡献指南](https://s2.antv.antgroup.com/manual/contribution) 补充相应单元测试, 如果有 API 改动, 请修改 [相应的文档](https://github.com/antvis/S2/tree/master/s2-site) + 你好 @${{ github.event.pull_request.user.login }},感谢你的贡献, 为了让代码更健壮, 请根据 [贡献指南](https://s2.antv.antgroup.com/manual/contribution) 补充相应单元测试, 如果有 API 改动, 请修改 [相应的文档](https://github.com/antvis/S2/tree/next/s2-site) - Hello, @${{ github.event.pull_request.user.login }}, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the [docs](https://github.com/antvis/S2/tree/master/s2-site) if there are API changes. + Hello, @${{ github.event.pull_request.user.login }}, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the [docs](https://github.com/antvis/S2/tree/next/s2-site) if there are API changes. - name: Need more info if: github.event.label.name == '👀 need more info' diff --git a/.github/workflows/pr-notify.yml b/.github/workflows/pr-notify.yml deleted file mode 100644 index 597764612f..0000000000 --- a/.github/workflows/pr-notify.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: 🔊 PR Ding Talk Notify - -on: - pull_request_target: - types: [opened] - -jobs: - preview: - runs-on: ubuntu-latest - steps: - - name: Ding Talk PR Notify - uses: lijinke666/ding-talk-pr-notify@main - with: - ding_talk_token: ${{ secrets.DING_TALK_ACCESS_TOKEN }} - at_all: false diff --git a/.github/workflows/pr-opend.yml b/.github/workflows/pr-opend.yml new file mode 100644 index 0000000000..8a9f4de55f --- /dev/null +++ b/.github/workflows/pr-opend.yml @@ -0,0 +1,23 @@ +name: PR Opened + +on: + pull_request_target: + types: [opened] + +jobs: + preview: + runs-on: ubuntu-latest + steps: + - name: Auto tips + uses: actions-cool/issues-helper@main + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + 你好 @${{ github.event.pull_request.user.login }},非常感谢你的贡献. + 为了让代码更健壮, 请根据 [贡献指南](https://s2.antv.antgroup.com/manual/contribution) 补充相应单元测试 (文档改动或其他特殊场景除外), 如果有 API 改动, 请修改 [相应的文档](https://github.com/antvis/S2/tree/next/s2-site). + 同时请检查 `lint` 和 `test` 相关 CI 是否通过, 如果失败, 请点击 [Details] 按钮查看, 并根据日志修复. + + Hello, @${{ github.event.pull_request.user.login }}, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the [docs](https://github.com/antvis/S2/tree/next/s2-site) if there are API changes. + At the same time, please check whether the CI related to lint and test passes. If the CI fails, please click [Details] button to check and repair according to the log. diff --git a/.github/workflows/test-s2-react-components.yml b/.github/workflows/test-s2-react-components.yml new file mode 100644 index 0000000000..b8bcbf72f2 --- /dev/null +++ b/.github/workflows/test-s2-react-components.yml @@ -0,0 +1,83 @@ +name: 💯 test (@antv/s2-react-components) + +on: [pull_request] + +concurrency: + group: ${{github.workflow}}-${{github.event_name}}-${{github.ref}} + cancel-in-progress: true + +jobs: + test: + # jest-electron 需要 macOS 环境, 但是 免费用户 并发有限制, 容易排队 https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners + # runs-on: macos-latest # (目前 macos-latest 对应的是 Big Sur 11, macos-12 对应 Monterey 12) + # macOS 3-core CPU, 其他 2-core CPU + runs-on: macos-14 + if: "!contains(github.event.head_commit.message, '[skip ci]')" + strategy: + matrix: + node-version: [20] + + steps: + - uses: actions/checkout@v4 + + # Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖 + # https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm bootstrap:ci + + - name: Test + run: | + pnpm --filter @antv/s2-react-components test:ci-coverage + + - name: Upload test coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + verbose: true + + - name: Workflow failed alert + if: ${{ failure() }} + uses: actions-cool/maintain-one-comment@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 你好, @${{ github.event.pull_request.user.login }} CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 + + Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button for detailed log information and fix it. + + emojis: 'eyes' + body-include: '' + + # Github PR 列表 有显示 √ X 的提示, 但是比如一些 APP, 例如 codecov 的 patch 变低, 也会导致 出现 X, 添加label 在列表页快速识别是不是测试自身挂了 + - name: Workflow failed add test failed label + if: ${{ failure() && github.event.pull_request.number != '' }} + uses: actions-cool/issues-helper@main + with: + actions: 'add-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + labels: '🚨 test failed' + + - name: Remove test failed label + if: ${{ success() && github.event.pull_request.number != '' }} + uses: actions-cool/issues-helper@main + with: + actions: 'remove-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + labels: '🚨 test failed' diff --git a/.github/workflows/test-s2-react.yml b/.github/workflows/test-s2-react.yml new file mode 100644 index 0000000000..60df854bfd --- /dev/null +++ b/.github/workflows/test-s2-react.yml @@ -0,0 +1,83 @@ +name: 💯 test (@antv/s2-react) + +on: [pull_request] + +concurrency: + group: ${{github.workflow}}-${{github.event_name}}-${{github.ref}} + cancel-in-progress: true + +jobs: + test: + # jest-electron 需要 macOS 环境, 但是 免费用户 并发有限制, 容易排队 https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners + # runs-on: macos-latest # (目前 macos-latest 对应的是 Big Sur 11, macos-12 对应 Monterey 12) + # macOS 3-core CPU, 其他 2-core CPU + runs-on: macos-14 + if: "!contains(github.event.head_commit.message, '[skip ci]')" + strategy: + matrix: + node-version: [20] + + steps: + - uses: actions/checkout@v4 + + # Python 3.11 和 node-gyp 有兼容问题, 导致无法安装依赖 + # https://github.com/slint-ui/slint/commit/a9c48e33502fdebc36c5aa2f4f516c2218424679#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm bootstrap:ci + + - name: Test + run: | + pnpm --filter @antv/s2-react test:ci-coverage + + - name: Upload test coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + verbose: true + + - name: Workflow failed alert + if: ${{ failure() }} + uses: actions-cool/maintain-one-comment@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + body: | + 你好, @${{ github.event.pull_request.user.login }} CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 + + Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button for detailed log information and fix it. + + emojis: 'eyes' + body-include: '' + + # Github PR 列表 有显示 √ X 的提示, 但是比如一些 APP, 例如 codecov 的 patch 变低, 也会导致 出现 X, 添加label 在列表页快速识别是不是测试自身挂了 + - name: Workflow failed add test failed label + if: ${{ failure() && github.event.pull_request.number != '' }} + uses: actions-cool/issues-helper@main + with: + actions: 'add-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + labels: '🚨 test failed' + + - name: Remove test failed label + if: ${{ success() && github.event.pull_request.number != '' }} + uses: actions-cool/issues-helper@main + with: + actions: 'remove-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + labels: '🚨 test failed' diff --git a/.github/workflows/test.yml b/.github/workflows/test-s2.yml similarity index 97% rename from .github/workflows/test.yml rename to .github/workflows/test-s2.yml index f7ab65d367..7cca75115d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test-s2.yml @@ -1,4 +1,4 @@ -name: 💯 test +name: 💯 test (@antv/s2) on: [pull_request] @@ -42,7 +42,7 @@ jobs: - name: Test run: | - pnpm test:ci-coverage + pnpm --filter @antv/s2 test:ci-coverage - name: Upload test coverage uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index 97a7187978..cf073ba097 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ bootstrap() | [@antv/s2](https://github.com/antvis/S2/tree/next/packages/s2-core) | ![latest](https://img.shields.io/npm/v/@antv/s2/latest.svg?logo=npm) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2.svg?logo=npm) | | [@antv/s2-react](https://github.com/antvis/S2/tree/next/packages/s2-react) | ![latest](https://img.shields.io/npm/v/@antv/s2-react/latest.svg?logo=npm) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-react@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-react.svg?logo=npm) | | [@antv/s2-react-components](https://github.com/antvis/S2/tree/next/packages/s2-react-components) | ![latest](https://img.shields.io/npm/v/@antv/s2-react-components/latest.svg?logo=npm) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-react-components@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-react-components.svg?logo=npm) | -| [@antv/s2-vue](https://github.com/antvis/S2/tree/next/packages/s2-vue) | ![latest](https://img.shields.io/npm/v/@antv/s2-vue/latest.svg?logo=npm) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-vue@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-vue.svg?logo=npm) | +| [@antv/s2-vue](https://github.com/antvis/S2/tree/next/packages/s2-vue)(停止维护)| ![latest](https://img.shields.io/npm/v/@antv/s2-vue/latest.svg?logo=npm) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-vue@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-vue.svg?logo=npm) | ### 🖥️ 兼容环境 diff --git a/jest.config.base.js b/jest.config.base.js index 1bb0193f5e..af2e973948 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -6,6 +6,8 @@ module.exports = { setupFilesAfterEnv: ['jest-extended', './__tests__/setup.js'], clearMocks: true, collectCoverage: false, + verbose: true, + forceExit: true, collectCoverageFrom: [ 'src/**/*.{ts,tsx,js,vue}', '!**/node_modules/**', diff --git a/packages/s2-core/__tests__/unit/interaction/brush-selection/data-brush-selection-spec.ts b/packages/s2-core/__tests__/unit/interaction/brush-selection/data-brush-selection-spec.ts index d0c6f25e57..bb66b06cc8 100644 --- a/packages/s2-core/__tests__/unit/interaction/brush-selection/data-brush-selection-spec.ts +++ b/packages/s2-core/__tests__/unit/interaction/brush-selection/data-brush-selection-spec.ts @@ -361,7 +361,7 @@ describe('Interaction Data Cell Brush Selection Tests', () => { expect(result).toStrictEqual({ x: { - needScroll: true, + needScroll: false, value: maxX - VSCROLLBAR_WIDTH - EXTRA_PIXEL, }, y: { @@ -409,7 +409,7 @@ describe('Interaction Data Cell Brush Selection Tests', () => { expect(result).toStrictEqual({ x: { - needScroll: true, + needScroll: false, value: minX + EXTRA_PIXEL, }, y: { diff --git a/packages/s2-core/package.json b/packages/s2-core/package.json index 4b7e332502..8a3b71325f 100644 --- a/packages/s2-core/package.json +++ b/packages/s2-core/package.json @@ -63,9 +63,9 @@ "clean": "rimraf lib esm dist temp", "start": "pnpm test:live", "sync-event": "node ./scripts/sync-event.mjs", - "test": "jest --passWithNoTests", - "test:ci": "pnpm test -- --maxWorkers=3", - "test:ci-coverage": "pnpm test:coverage --maxWorkers=3", + "test": "jest --passWithNoTests --runInBand --detectOpenHandles", + "test:ci": "pnpm test", + "test:ci-coverage": "pnpm test:coverage", "test:coverage": "pnpm test -- --coverage", "test:live": "node ./scripts/test-live.mjs", "test:watch": "pnpm test -- --watch", diff --git a/packages/s2-react-components/package.json b/packages/s2-react-components/package.json index c01e8f8fe2..247cfe0b76 100644 --- a/packages/s2-react-components/package.json +++ b/packages/s2-react-components/package.json @@ -51,9 +51,9 @@ "build:umd": "cross-env FORMAT=umd vite build", "clean": "rimraf lib esm dist temp", "start": "cross-env PLAYGROUND=true vite", - "test": "jest --passWithNoTests", - "test:ci": "pnpm test -- --maxWorkers=3", - "test:ci-coverage": "pnpm test:coverage --maxWorkers=3", + "test": "jest --passWithNoTests --runInBand --detectOpenHandles", + "test:ci": "pnpm test", + "test:ci-coverage": "pnpm test:coverage", "test:coverage": "pnpm test -- --coverage", "test:live": "node ../s2-react/scripts/test-live.mjs", "test:watch": "pnpm test -- --watch", diff --git a/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap b/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap deleted file mode 100644 index ef442d23fe..0000000000 --- a/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap +++ /dev/null @@ -1,233 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Pagination Tests should render with antd component 1`] = ` - -
-
- -
-
    -
  • - 共计 0 条 -
  • -
  • - -
  • -
  • - - 1 - -
  • -
  • - -
  • -
-
-
-`; - -exports[`Pagination Tests should render with antd component 2`] = ` - -
-
- -
-
    -
  • - 共计 2 条 -
  • -
  • - -
  • -
  • - - 1 - -
  • -
  • - - 2 - -
  • -
  • - -
  • -
  • -
    - Go to - - Page -
    -
  • -
-
-
-`; diff --git a/packages/s2-react/__tests__/spreadsheet/pagination-spec.tsx b/packages/s2-react/__tests__/spreadsheet/pagination-spec.tsx index 0a5990cb37..5abe2ff54e 100644 --- a/packages/s2-react/__tests__/spreadsheet/pagination-spec.tsx +++ b/packages/s2-react/__tests__/spreadsheet/pagination-spec.tsx @@ -28,25 +28,34 @@ describe('Pagination Tests', () => { }); test('should render with antd component', async () => { - const { container, asFragment } = render( + const renderPagination = jest.fn(({ pagination }) => ( + `共计 ${total} 条`} + showSizeChanger={false} + showQuickJumper + {...pagination} + /> + )); + const { container } = render( - {({ pagination }) => ( - `共计 ${total} 条`} - showSizeChanger={false} - showQuickJumper - {...pagination} - /> - )} + {renderPagination} , ); await waitFor(() => { - expect(asFragment()).toMatchSnapshot(); + expect(renderPagination).toHaveBeenCalledWith({ + pagination: { + current: 1, + pageSize: 1, + total: 0, + onChange: expect.any(Function), + onShowSizeChange: expect.any(Function), + }, + }); expect( container.querySelector('.ant-pagination-options-quick-jumper'), ).toBeTruthy(); @@ -75,7 +84,7 @@ describe('Pagination Tests', () => { await waitFor(() => { const rowCell = s2.facet.getRowCells()[0]; - expect(rowCell.getTextShape().parsedStyle.y).toBe(15); + expect(rowCell.getTextShape().parsedStyle.y).toBe(16); }); }); }); diff --git a/packages/s2-react/package.json b/packages/s2-react/package.json index 1659ef2023..3aa5c7efcb 100644 --- a/packages/s2-react/package.json +++ b/packages/s2-react/package.json @@ -46,9 +46,9 @@ "build:umd": "cross-env FORMAT=umd vite build", "clean": "rimraf lib esm dist temp", "start": "cross-env PLAYGROUND=true vite", - "test": "jest --passWithNoTests", - "test:ci": "pnpm test -- --maxWorkers=3", - "test:ci-coverage": "pnpm test:coverage --maxWorkers=3", + "test": "jest --passWithNoTests --runInBand --detectOpenHandles", + "test:ci": "pnpm test", + "test:ci-coverage": "pnpm test:coverage", "test:coverage": "pnpm test -- --coverage", "test:live": "node ./scripts/test-live.mjs", "test:watch": "pnpm test -- --watch", diff --git a/packages/s2-vue/package.json b/packages/s2-vue/package.json index 384286fb4c..44121e9c00 100644 --- a/packages/s2-vue/package.json +++ b/packages/s2-vue/package.json @@ -47,9 +47,9 @@ "build:umd": "cross-env FORMAT=umd vite build", "clean": "rimraf lib esm dist temp", "start": "cross-env PLAYGROUND=true vite", - "test": "jest --passWithNoTests", - "test:ci": "pnpm test -- --maxWorkers=3", - "test:ci-coverage": "pnpm test:coverage --maxWorkers=3", + "test": "jest --passWithNoTests --runInBand --detectOpenHandles", + "test:ci": "pnpm test", + "test:ci-coverage": "pnpm test:coverage", "test:coverage": "pnpm test -- --coverage", "test:watch": "pnpm test -- --watch", "tsc": "vue-tsc --noEmit" diff --git a/s2-site/docs/manual/contribution.zh.md b/s2-site/docs/manual/contribution.zh.md index cfa1fe4318..95672704fd 100644 --- a/s2-site/docs/manual/contribution.zh.md +++ b/s2-site/docs/manual/contribution.zh.md @@ -12,8 +12,6 @@ tag: Updated 我们欢迎任何形式的贡献,不管是一个**错别字的修改**,还是**一次友好的建议**,不管是通过提交 [Issue](https://github.com/antvis/S2/issues/new/choose), 还是一个帅气 [pull request](https://github.com/antvis/S2/pulls), 亦或是参与 [discussions](https://github.com/antvis/S2/discussions) 的讨论。 -这是一个开源项目,我们也有繁忙的业务要做,是用自己的业余时间在维护,为爱发电,精力有限,所以有时候 issue 响应速度不是那么及时。 - 如果你遇到了问题,或者对 [Issues](https://github.com/antvis/S2/issues) 和 [Discussions](https://github.com/antvis/S2/discussions) 列表的问题感兴趣,可以直接认领并尝试修复,帮助 S2 变得更好,期待在 [贡献者列表](https://github.com/antvis/S2/graphs/contributors) 里看见你的头像。 ## ✍️ 分支管理