From c43f2d74e545883714c6ae155f47fd1a43cad5dd Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Feb 2023 16:52:48 +0800 Subject: [PATCH 01/74] test: upgrade github actions node version for 4.x (#40825) * test: upgrade github actions node version * chore: upgrade @testing-library/* * chore: upgrade @testing-library/* * fix: preview build * fix: preview build --- .github/workflows/codeball.yml | 21 ------------- .github/workflows/preview-build.yml | 4 +++ .github/workflows/size-limit.yml | 4 +++ .github/workflows/test.yml | 46 ++++++++++++++++++++++++++++- package.json | 1 + 5 files changed, 54 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/codeball.yml diff --git a/.github/workflows/codeball.yml b/.github/workflows/codeball.yml deleted file mode 100644 index 1e796958b02b..000000000000 --- a/.github/workflows/codeball.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Codeball -on: - pull_request: {} - pull_request_review_comment: - types: [created, edited] - -jobs: - codeball_job: - runs-on: ubuntu-latest - name: Codeball - steps: - # Run Codeball on all new Pull Requests and Review Comments! 🚀 - # For customizations and more documentation, see https://github.com/sturdy-dev/codeball-action - - name: Codeball - uses: sturdy-dev/codeball-action@v2 - with: - # Settings for "Codeball Approver" - approvePullRequests: "false" - labelPullRequestsWhenApproved: "true" - labelPullRequestsWhenReviewNeeded: "true" - failJobsWhenReviewNeeded: "false" diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 0af77d36c4ec..e037dcc71422 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -57,6 +57,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 8abd9ff04248..b59ab3fa96d9 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -25,6 +25,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: cache package-lock.json uses: actions/cache@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d8f938cd861..315ce19e1460 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: cache package-lock.json uses: actions/cache@v3 with: @@ -51,6 +55,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -73,6 +81,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -95,6 +107,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -119,6 +135,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -151,6 +171,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -189,6 +213,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -244,6 +272,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -323,7 +355,11 @@ jobs: runs-on: ubuntu-latest needs: [normal-test] steps: - - uses: actions/checkout@v3 + - name: checkout + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 - uses: actions/download-artifact@v3 with: name: coverage-artifacts @@ -346,6 +382,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -393,6 +433,10 @@ jobs: if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json # lib only run in master branch not in pull request if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} diff --git a/package.json b/package.json index 723a017773b1..61c1e598712e 100644 --- a/package.json +++ b/package.json @@ -167,6 +167,7 @@ "@qixian.cs/github-contributors-list": "^1.0.3", "@size-limit/file": "^8.0.0", "@stackblitz/sdk": "^1.3.0", + "@testing-library/dom": "^9.0.0", "@testing-library/jest-dom": "^5.16.3", "@testing-library/react": "^12.0.0", "@testing-library/user-event": "^14.4.2", From a42a4880756a1d31cd0e6fa8b8fa02c04871bdaa Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 21 Feb 2023 18:02:43 +0800 Subject: [PATCH 02/74] Update default.less (#40823) --- components/style/themes/default.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 7321f9b20b19..5c5b47f7d94f 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -270,7 +270,7 @@ @checkbox-check-color: #fff; @checkbox-check-bg: @checkbox-check-color; @checkbox-border-width: @border-width-base; -@checkbox-border-radius: @border-radius-base; +@checkbox-border-radius: @border-radius-sm; @checkbox-group-item-margin-right: 8px; // Descriptions From 9c0033029d07a7ba86b49d092df852f5bd9a2452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 22 Feb 2023 11:46:43 +0800 Subject: [PATCH 03/74] docs: rm ood link close #40869 --- components/version/version.ts | 1 + docs/react/introduce.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 components/version/version.ts diff --git a/components/version/version.ts b/components/version/version.ts new file mode 100644 index 000000000000..94a6ef837d2d --- /dev/null +++ b/components/version/version.ts @@ -0,0 +1 @@ +export default '5.2.2'; diff --git a/docs/react/introduce.zh-CN.md b/docs/react/introduce.zh-CN.md index d7f3e15ae094..d175d21f629b 100644 --- a/docs/react/introduce.zh-CN.md +++ b/docs/react/introduce.zh-CN.md @@ -52,7 +52,7 @@ title: Ant Design of React - 稳定版:[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) -你可以订阅:https://github.com/ant-design/ant-design/releases.atom 或 https://app.releasly.co/sites/ant-design/ant-design 来获得版本发布的通知。 +你可以订阅:https://github.com/ant-design/ant-design/releases.atom 来获得版本发布的通知。 ## 安装 From 4a3cd57d815e0d7c859b4967b5c88c911bf9cd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 22 Feb 2023 13:17:53 +0800 Subject: [PATCH 04/74] chore: add missing deps --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 61c1e598712e..fd78839baefd 100644 --- a/package.json +++ b/package.json @@ -227,6 +227,7 @@ "fetch-jsonp": "^1.1.3", "fs-extra": "^10.0.0", "full-icu": "^1.3.0", + "gh-pages": "^5.0.0", "glob": "^8.0.1", "http-server": "^14.0.0", "husky": "^8.0.1", From b4015b637005f70cc9d852b87a350911e5569ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Mon, 27 Feb 2023 23:32:27 +0800 Subject: [PATCH 05/74] chore: test clean up log (#40955) --- tests/setup.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/setup.js b/tests/setup.js index afd91cdbfe96..25f9bf9901d4 100644 --- a/tests/setup.js +++ b/tests/setup.js @@ -4,6 +4,21 @@ const util = require('util'); // eslint-disable-next-line no-console console.log('Current React Version:', React.version); +const originConsoleErr = console.error; + +// Hack off React warning to avoid too large log in CI. +console.error = (...args) => { + const str = args.join('').replace(/\n/g, ''); + + if ( + ['validateDOMNesting', 'on an unmounted component', 'not wrapped in act'].every( + (warn) => !str.includes(warn), + ) + ) { + originConsoleErr(...args); + } +}; + /* eslint-disable global-require */ if (typeof window !== 'undefined') { global.window.resizeTo = (width, height) => { @@ -17,7 +32,7 @@ if (typeof window !== 'undefined') { Object.defineProperty(global.window, 'matchMedia', { writable: true, configurable: true, - value: jest.fn(query => ({ + value: jest.fn((query) => ({ matches: query.includes('max-width'), addListener: jest.fn(), removeListener: jest.fn(), From 7a3c4921b117d26d8b120ba129027d18b35bdcdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E6=9E=AB?= <7971419+crazyair@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:07:35 +0800 Subject: [PATCH 06/74] fix: remove Cascader warning when use displayRender and multiple together (#40940) --- components/cascader/index.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index f1fea0f67fd4..b23c30da3f60 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -176,12 +176,6 @@ const Cascader = React.forwardRef((props: CascaderProps, ref: React.Ref Date: Tue, 28 Feb 2023 11:03:12 +0800 Subject: [PATCH 07/74] =?UTF-8?q?fix:=20=E6=B3=9B=E5=9E=8B=E9=9D=9E?= =?UTF-8?q?=E5=BF=85=E4=BC=A0=20(#40960)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/cascader/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index b23c30da3f60..c662355b4cfa 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -101,7 +101,7 @@ type MultipleCascaderProps = Omit = UnionCascaderProps & { +export type CascaderProps = UnionCascaderProps & { multiple?: boolean; size?: SizeType; disabled?: boolean; @@ -122,7 +122,7 @@ export interface CascaderRef { blur: () => void; } -const Cascader = React.forwardRef((props: CascaderProps, ref: React.Ref) => { +const Cascader = React.forwardRef((props: CascaderProps, ref: React.Ref) => { const { prefixCls: customizePrefixCls, size: customizeSize, From 7ba8c7a8f292202cc675bc34304cce1c15b758e1 Mon Sep 17 00:00:00 2001 From: Amumu Date: Fri, 17 Mar 2023 00:28:18 +0800 Subject: [PATCH 08/74] chore: fix ci failed (#41286) * chore: fix ci failed * chore: update demo --- .../__snapshots__/demo-extend.test.tsx.snap | 4159 ++--------------- components/upload/demo/crop-image.md | 2 +- 2 files changed, 399 insertions(+), 3762 deletions(-) diff --git a/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap b/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap index 508737e7b360..b12b58eba58f 100644 --- a/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap +++ b/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap @@ -1,102 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./components/drawer/demo/basic-right.md extend context correctly 1`] = ` -Array [ - , -
-
-