From bbca1c74035c67f49f7c9ed3b7083b5a36a43fe6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 17:50:47 +0800 Subject: [PATCH 01/28] chore: standardize repository config --- .dumirc.ts | 18 ++- .github/FUNDING.yml | 2 + .github/dependabot.yml | 46 ++----- .github/workflows/codeql.yml | 22 ++-- .github/workflows/main.yml | 6 - .github/workflows/react-component-ci.yml | 15 +++ .github/workflows/react-doctor.yml | 24 ++++ .github/workflows/surge-preview.yml | 30 +++++ .gitignore | 9 +- README.md | 145 +++++++++++++---------- docs/demo/horizontal-scroll.md | 2 +- docs/index.md | 2 +- package.json | 21 +++- tsconfig.json | 20 ++-- vercel.json | 7 +- 15 files changed, 225 insertions(+), 144 deletions(-) create mode 100644 .github/FUNDING.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/react-component-ci.yml create mode 100644 .github/workflows/react-doctor.yml create mode 100644 .github/workflows/surge-preview.yml diff --git a/.dumirc.ts b/.dumirc.ts index 37524183..5536f87a 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,8 +1,22 @@ import { defineConfig } from 'dumi'; +import path from 'path'; + +const basePath = process.env.GH_PAGES ? '/virtual-list/' : '/'; +const publicPath = process.env.GH_PAGES ? '/virtual-list/' : '/'; export default defineConfig({ + alias: { + '@rc-component/virtual-list$': path.resolve('src'), + '@rc-component/virtual-list/es': path.resolve('src'), + '@rc-component/virtual-list/es/*': path.resolve('src'), + }, + mfsu: false, + favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], themeConfig: { - name: 'Tree', + name: 'Virtual List', + logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, - outputPath: '.doc', + outputPath: 'docs-dist', + base: basePath, + publicPath, }); diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..758659af --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: ant-design +open_collective: ant-design diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dc675c37..0737a7d8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,41 +1,9 @@ version: 2 updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "21:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: np - versions: - - 7.2.0 - - 7.3.0 - - 7.4.0 - - dependency-name: "@types/react" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - 17.0.3 - - dependency-name: "@types/jest" - versions: - - 26.0.20 - - 26.0.21 - - 26.0.22 - - dependency-name: react - versions: - - 16.14.0 - - 17.0.1 - - dependency-name: "@types/react-dom" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - dependency-name: typescript - versions: - - 4.1.3 - - 4.1.4 - - 4.1.5 - - 4.2.2 - - 4.2.3 + - package-ecosystem: npm + directory: '/' + schedule: + interval: weekly + day: monday + time: '21:00' + open-pull-requests-limit: 10 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f06c552e..f911ba30 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,12 +1,12 @@ -name: "CodeQL" +name: CodeQL on: push: - branches: [ "master" ] + branches: [master] pull_request: - branches: [ "master" ] + branches: [master] schedule: - - cron: "48 4 * * 3" + - cron: '40 12 * * 0' jobs: analyze: @@ -20,22 +20,24 @@ jobs: strategy: fail-fast: false matrix: - language: [ javascript ] + language: [javascript] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: - category: "/language:${{ matrix.language }}" + category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 716559ca..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: test -on: [push, pull_request] -jobs: - test: - uses: react-component/rc-test/.github/workflows/test.yml@main - secrets: inherit diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml new file mode 100644 index 00000000..d91f4b47 --- /dev/null +++ b/.github/workflows/react-component-ci.yml @@ -0,0 +1,15 @@ +name: ✅ test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + test: + uses: react-component/rc-test/.github/workflows/test-utoo.yml@main + secrets: inherit diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml new file mode 100644 index 00000000..9e0dfb91 --- /dev/null +++ b/.github/workflows/react-doctor.yml @@ -0,0 +1,24 @@ +name: React Doctor + +on: + pull_request: + branches: [master] + +permissions: + contents: read + pull-requests: write + +concurrency: + group: react-doctor-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + react-doctor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml new file mode 100644 index 00000000..c3900712 --- /dev/null +++ b/.github/workflows/surge-preview.yml @@ -0,0 +1,30 @@ +name: Surge Preview + +on: + pull_request: + branches: [master] + +permissions: + contents: read + pull-requests: write + statuses: write + +concurrency: + group: surge-preview-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec + with: + build: npm run build + dist: docs-dist + failOnMissingToken: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} diff --git a/.gitignore b/.gitignore index 615c9938..17200a37 100644 --- a/.gitignore +++ b/.gitignore @@ -11,11 +11,14 @@ pnpm-lock.yaml !tests/__mocks__/rc-util/lib !tests/__mocks__/@rc-component/util/lib bun.lockb - # umi .umi .umi-production .umi-test .env.local - -.dumi \ No newline at end of file +.dumi +lib +es +coverage +docs-dist +.vercel diff --git a/README.md b/README.md index fa110e03..b1b67f04 100644 --- a/README.md +++ b/README.md @@ -1,79 +1,98 @@ -# @rc-component/virtual-list - -React Virtual List Component which works with animation. - -[![NPM version][npm-image]][npm-url] -[![npm download][download-image]][download-url] -[![build status][github-actions-image]][github-actions-url] -[![Codecov][codecov-image]][codecov-url] -[![bundle size][bundlephobia-image]][bundlephobia-url] -[![dumi][dumi-image]][dumi-url] - -[npm-image]: https://img.shields.io/npm/v/@rc-component/virtual-list.svg?style=flat-square -[npm-url]: https://npmjs.org/package/@rc-component/virtual-list -[travis-image]: https://img.shields.io/travis/react-component/virtual-list/master?style=flat-square -[travis-url]: https://travis-ci.com/react-component/virtual-list -[github-actions-image]: https://github.com/react-component/virtual-list/actions/workflows/main.yml/badge.svg -[github-actions-url]: https://github.com/react-component/virtual-list/actions/workflows/main.yml -[codecov-image]: https://img.shields.io/codecov/c/github/react-component/virtual-list/master.svg?style=flat-square -[codecov-url]: https://app.codecov.io/gh/react-component/virtual-list -[david-url]: https://david-dm.org/react-component/virtual-list -[david-image]: https://david-dm.org/react-component/virtual-list/status.svg?style=flat-square -[david-dev-url]: https://david-dm.org/react-component/virtual-list?type=dev -[david-dev-image]: https://david-dm.org/react-component/virtual-list/dev-status.svg?style=flat-square -[download-image]: https://img.shields.io/npm/dm/@rc-component/virtual-list.svg?style=flat-square -[download-url]: https://npmjs.org/package/@rc-component/virtual-list -[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/virtual-list -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/virtual-list -[dumi-url]: https://github.com/umijs/dumi -[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square - -## Online Preview - -https://virtual-list-react-component.vercel.app/ +
+

@rc-component/virtual-list

+

📜 Virtual scrolling list component for React.

+

+ + Ant Design + +

+

Part of the Ant Design ecosystem.

+

+ npm version + npm downloads + CI + Codecov + bundle size + dumi +

+
+ +## Highlights + +- Built for React and maintained by the rc-component team. +- Used by Ant Design and other React component libraries. +- Ships TypeScript declarations with both ES module and CommonJS outputs. +- Keeps examples, tests, and preview builds aligned with the package source. -## Development +## Install ```bash -npm install -npm start -open http://localhost:8000/ +npm install @rc-component/virtual-list ``` -## Feature +## Usage + +```tsx +import List from '@rc-component/virtual-list'; -- Support react.js -- Support animation -- Support IE11+ +const data = Array.from({ length: 1000 }).map((_, index) => ({ + id: index, + label: `Item ${index}`, +})); -## Install +export default () => ( + + {(item) =>
{item.label}
} +
+); +``` -[![@rc-component/virtual-list](https://nodei.co/npm/@rc-component/virtual-list.png)](https://npmjs.org/package/@rc-component/virtual-list) +## Examples -## Usage +Run the local dumi site to explore the examples: -```tsx -import List from '@rc-component/virtual-list'; +```bash +npm install +npm start +``` + +## API + +### List + +| Prop | Description | Type | Default | +| ---------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------- | +| children | Render function for each item. The third argument contains measuring props used by legacy browser compatibility paths. | `(item, index, props) => ReactElement` | - | +| component | Custom list container element. | `string` \| `ComponentType` | `div` | +| data | Items rendered by the virtual list. | `T[]` | - | +| disabled | Disable scroll position checks, usually while coordinating animation. | `boolean` | `false` | +| fullHeight | Whether the holder should keep full height. | `boolean` | `true` | +| height | Visible list height. | `number` | - | +| itemHeight | Minimum item height used to calculate the virtual range. | `number` | - | +| itemKey | Key field or key getter for items. | `string` \| `(item) => React.Key` | - | +| onScroll | Called when the list scrolls. | `React.UIEventHandler` | - | +| styles | Custom scrollbar part styles. | `object` | - | +| virtual | Enable virtual rendering. | `boolean` | `true` | + +## Development - - {(index) =>
{index}
} -
; +```bash +npm install +npm start +npm test +npm run tsc +npm run compile +npm run build ``` -# API +## Release -## List +The release flow is handled by `@rc-component/np` from the `prepublishOnly` script: + +```bash +npm publish +``` -| Prop | Description | Type | Default | -| ---------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| children | Render props of item | (item, index, props) => ReactElement | - | -| component | Customize List dom element | string \| Component | div | -| data | Data list | Array | - | -| disabled | Disable scroll check. Usually used on animation control | boolean | false | -| height | List height | number | - | -| itemHeight | Item minimum height | number | - | -| itemKey | Match key with item | string | - | -| styles | style | { horizontalScrollBar?: React.CSSProperties; horizontalScrollBarThumb?: React.CSSProperties; verticalScrollBar?: React.CSSProperties; verticalScrollBarThumb?: React.CSSProperties; } | - | +## License -`children` provides additional `props` argument to support IE 11 scroll shaking. -It will set `style` to `visibility: hidden` when measuring. You can ignore this if no requirement on IE. +@rc-component/virtual-list is released under the MIT license. diff --git a/docs/demo/horizontal-scroll.md b/docs/demo/horizontal-scroll.md index 7afcf130..8ae96f1e 100644 --- a/docs/demo/horizontal-scroll.md +++ b/docs/demo/horizontal-scroll.md @@ -5,4 +5,4 @@ nav: path: /demo --- - \ No newline at end of file + diff --git a/docs/index.md b/docs/index.md index 8eb92fd2..501296b5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ --- -title: rc-virtual-list +title: '@rc-component/virtual-list' --- diff --git a/package.json b/package.json index 2ed54719..6762108d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@rc-component/virtual-list", "version": "1.2.0", - "description": "React Virtual List Component", + "description": "Virtual scrolling list component for React.", "engines": { "node": ">=8.x" }, @@ -28,13 +28,19 @@ "main": "./lib/index", "module": "./es/index", "scripts": { - "start": "dumi dev", - "build": "dumi build", + "build": "npm run compile && npm run docs:build", "compile": "father build", - "prepublishOnly": "npm run compile && rc-np", + "coverage": "rc-test --coverage", + "docs:build": "dumi build", + "docs:deploy": "gh-pages -d docs-dist", + "deploy": "npm run gh-pages", + "gh-pages": "cross-env GH_PAGES=1 npm run compile && npm run docs:build && npm run docs:deploy", "lint": "eslint src/ --ext .tsx,.ts", + "prepublishOnly": "npm run compile && rc-np", + "prettier": "prettier --write --ignore-unknown .", + "start": "dumi dev", "test": "rc-test", - "now-build": "npm run build" + "tsc": "tsc --noEmit" }, "peerDependencies": { "react": ">=18.0.0", @@ -59,7 +65,10 @@ "rc-test": "^7.1.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "typescript": "^5.0.0" + "typescript": "^5.0.0", + "cross-env": "^10.1.0", + "gh-pages": "^6.3.0", + "prettier": "^3.3.2" }, "dependencies": { "@babel/runtime": "^7.20.0", diff --git a/tsconfig.json b/tsconfig.json index 30faa7c5..82c7ef7a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,15 +8,13 @@ "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": [ - "src/*" - ], - "@@/*": [ - "src/.umi/*" - ], - "rc-virtual-list": [ - "src/index.ts" - ] + "@/*": ["src/*"], + "@@/*": [".dumi/tmp/*"], + "@rc-component/virtual-list": ["src/index.ts"], + "@rc-component/virtual-list/es": ["src"], + "@rc-component/virtual-list/es/*": ["src/*"] } - } -} \ No newline at end of file + }, + "include": [".dumirc.ts", "src", "tests", "docs/examples"], + "exclude": ["docs-dist", "lib", "es"] +} diff --git a/vercel.json b/vercel.json index 57c51ac8..5f9139ef 100644 --- a/vercel.json +++ b/vercel.json @@ -1,3 +1,6 @@ { - "framework": "umijs" -} \ No newline at end of file + "framework": "umijs", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "docs-dist" +} From ec1632067732aef4a67e6f5f943ddeb09e3fe065 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 18:03:03 +0800 Subject: [PATCH 02/28] chore: address review feedback --- .dumirc.ts | 5 ++--- .github/workflows/react-component-ci.yml | 2 +- .github/workflows/surge-preview.yml | 2 ++ .gitignore | 3 ++- README.md | 4 +--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index 5536f87a..a66671bd 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -6,9 +6,8 @@ const publicPath = process.env.GH_PAGES ? '/virtual-list/' : '/'; export default defineConfig({ alias: { - '@rc-component/virtual-list$': path.resolve('src'), - '@rc-component/virtual-list/es': path.resolve('src'), - '@rc-component/virtual-list/es/*': path.resolve('src'), + '@rc-component/virtual-list$': path.resolve(__dirname, 'src'), + '@rc-component/virtual-list/es': path.resolve(__dirname, 'src'), }, mfsu: false, favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index d91f4b47..a33292ef 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -11,5 +11,5 @@ permissions: jobs: test: - uses: react-component/rc-test/.github/workflows/test-utoo.yml@main + uses: react-component/rc-test/.github/workflows/test-utoo.yml@b8ebddc81ef706b50faff0242ab34ad8ecdd9a59 secrets: inherit diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index c3900712..a7021bef 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -20,6 +20,8 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false + - name: Install dependencies + run: npm install --ignore-scripts --no-audit --loglevel=warn - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec with: build: npm run build diff --git a/.gitignore b/.gitignore index 17200a37..d7e5aee8 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,8 @@ bun.lockb .umi-production .umi-test .env.local -.dumi +.dumi/tmp +.dumi/tmp-production lib es coverage diff --git a/README.md b/README.md index b1b67f04..36933d74 100644 --- a/README.md +++ b/README.md @@ -80,14 +80,12 @@ npm start npm install npm start npm test -npm run tsc -npm run compile npm run build ``` ## Release -The release flow is handled by `@rc-component/np` from the `prepublishOnly` script: +The `prepublishOnly` script runs `npm run compile` and then `rc-np` from `@rc-component/np`: ```bash npm publish From 129262ec83af1782a63b09c1cc31708ea3feb728 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Jun 2026 18:08:58 +0800 Subject: [PATCH 03/28] chore: fix surge preview inputs --- .github/workflows/surge-preview.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index a7021bef..00c68678 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -26,7 +26,6 @@ jobs: with: build: npm run build dist: docs-dist - failOnMissingToken: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} + failOnError: false + github_token: ${{ secrets.GITHUB_TOKEN }} + surge_token: ${{ secrets.SURGE_TOKEN }} From cfe5019e2c9369c981b242cb29b584687af84c85 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:27:35 +0800 Subject: [PATCH 04/28] chore: address AI review feedback --- package.json | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6762108d..70306e13 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "docs:build": "dumi build", "docs:deploy": "gh-pages -d docs-dist", "deploy": "npm run gh-pages", - "gh-pages": "cross-env GH_PAGES=1 npm run compile && npm run docs:build && npm run docs:deploy", + "gh-pages": "npm run compile && cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy", "lint": "eslint src/ --ext .tsx,.ts", "prepublishOnly": "npm run compile && rc-np", "prettier": "prettier --write --ignore-unknown .", diff --git a/tsconfig.json b/tsconfig.json index 82c7ef7a..cc89b9c5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,6 @@ "@rc-component/virtual-list/es/*": ["src/*"] } }, - "include": [".dumirc.ts", "src", "tests", "docs/examples"], + "include": [".dumirc.ts", "src", "tests", "examples"], "exclude": ["docs-dist", "lib", "es"] } From be558d14e2c05d3b0cf310e3452288ad84f322a4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 01:56:51 +0800 Subject: [PATCH 05/28] docs: standardize README release details --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 36933d74..d2d9b879 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,12 @@ npm run build ## Release -The `prepublishOnly` script runs `npm run compile` and then `rc-np` from `@rc-component/np`: - ```bash -npm publish +npm run prepublishOnly ``` +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. + ## License -@rc-component/virtual-list is released under the MIT license. +@rc-component/virtual-list is released under the [MIT](./LICENSE) license. From 5a51454d2496129e5f253be767e71882fbecf17f Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 02:17:46 +0800 Subject: [PATCH 06/28] docs: clarify Ant Design ecosystem note --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2d9b879..fbb2a8b0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Ant Design

-

Part of the Ant Design ecosystem.

+

Part of the Ant Design ecosystem.

npm version npm downloads From 5e42665450ec620b7319ac65e4d71f5b53f79d5a Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:04:07 +0800 Subject: [PATCH 07/28] docs: refine README usage and ecosystem note --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fbb2a8b0..bc9e3798 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@

@rc-component/virtual-list

+

Part of the Ant Design ecosystem.

📜 Virtual scrolling list component for React.

-

- - Ant Design - -

-

Part of the Ant Design ecosystem.

npm version npm downloads @@ -17,6 +12,7 @@

+ ## Highlights - Built for React and maintained by the rc-component team. From b425b8cfa60eeb20784ae10090f3f14ab2a9d1d7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 13:22:22 +0800 Subject: [PATCH 08/28] ci: isolate surge preview token --- .github/workflows/surge-preview.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 00c68678..cd006cf9 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -22,10 +22,15 @@ jobs: persist-credentials: false - name: Install dependencies run: npm install --ignore-scripts --no-audit --loglevel=warn + - name: Build preview + if: ${{ secrets.SURGE_TOKEN != '' }} + run: npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec + if: ${{ secrets.SURGE_TOKEN != '' }} + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: - build: npm run build dist: docs-dist failOnError: false github_token: ${{ secrets.GITHUB_TOKEN }} - surge_token: ${{ secrets.SURGE_TOKEN }} + surge_token: ${{ env.SURGE_TOKEN }} From 8a704be9d8ba0b60d481ab87a4794314ea87ee2c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:20:45 +0800 Subject: [PATCH 09/28] docs: add Chinese README --- README.md | 2 ++ README.zh-CN.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 README.zh-CN.md diff --git a/README.md b/README.md index bc9e3798..4ca5439f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@

+

English | 简体中文

+ ## Highlights diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..2e93794e --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,94 @@ +
+

@rc-component/virtual-list

+

Ant Design 生态的一部分。

+

🧾 React 虚拟列表组件,用于高性能渲染长列表。

+

+ npm version + npm downloads + CI + Codecov + bundle size + dumi +

+
+ +

English | 简体中文

+ + +## 特性 + +- Built for React and maintained by the rc-component team. +- 被 Ant Design 使用和其他 React 组件库使用。 +- 提供 TypeScript declarations with both ES module and CommonJS outputs. +- 保留 examples, tests, and preview builds aligned with the package source. + +## 安装 + +```bash +npm install @rc-component/virtual-list +``` + +## 使用 + +```tsx +import List from '@rc-component/virtual-list'; + +const data = Array.from({ length: 1000 }).map((_, index) => ({ + id: index, + label: `Item ${index}`, +})); + +export default () => ( + + {(item) =>
{item.label}
} +
+); +``` + +## 示例 + +Run the local dumi site to explore the examples: + +```bash +npm install +npm start +``` + +## API + +### List + +| 属性 | 说明 | 类型 | 默认值 | +| ---------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------- | +| children | Render function for each item. The third argument contains measuring props used by legacy browser compatibility paths. | `(item, index, props) => ReactElement` | - | +| component | Custom list container element. | `string` \| `ComponentType` | `div` | +| data | Items rendered by the virtual list. | `T[]` | - | +| disabled | Disable scroll position checks, usually while coordinating animation. | `boolean` | `false` | +| fullHeight | Whether the holder should keep full height. | `boolean` | `true` | +| height | Visible list height. | `number` | - | +| itemHeight | Minimum item height used to calculate the virtual range. | `number` | - | +| itemKey | Key field or key getter for items. | `string` \| `(item) => React.Key` | - | +| onScroll | Called when the list scrolls. | `React.UIEventHandler` | - | +| styles | Custom scrollbar part styles. | `object` | - | +| virtual | Enable virtual rendering. | `boolean` | `true` | + +## 本地开发 + +```bash +npm install +npm start +npm test +npm run build +``` + +## 发布 + +```bash +npm run prepublishOnly +``` + +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. + +## 许可证 + +@rc-component/virtual-list is released under the [MIT](./LICENSE) license. From 2597425ce19add8b7e05424f8a8dc4dbd50046fe Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 22:35:19 +0800 Subject: [PATCH 10/28] docs: add Ant Design logo to README --- README.md | 1 + README.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 4ca5439f..17d990ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@

@rc-component/virtual-list

Part of the Ant Design ecosystem.

+ Ant Design

📜 Virtual scrolling list component for React.

npm version diff --git a/README.zh-CN.md b/README.zh-CN.md index 2e93794e..6965130e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,7 @@

@rc-component/virtual-list

Ant Design 生态的一部分。

+ Ant Design

🧾 React 虚拟列表组件,用于高性能渲染长列表。

npm version From 5341593deaddbd851b628072d29b6aac3964e6e9 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 27 Jun 2026 23:04:32 +0800 Subject: [PATCH 11/28] docs: refine bilingual README branding --- README.md | 3 +-- README.zh-CN.md | 39 +++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 17d990ba..e5660ae7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@

@rc-component/virtual-list

-

Part of the Ant Design ecosystem.

- Ant Design +

Ant Design Part of the Ant Design ecosystem.

📜 Virtual scrolling list component for React.

npm version diff --git a/README.zh-CN.md b/README.zh-CN.md index 6965130e..832180e8 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,8 +1,7 @@

@rc-component/virtual-list

-

Ant Design 生态的一部分。

- Ant Design -

🧾 React 虚拟列表组件,用于高性能渲染长列表。

+

Ant Design Ant Design 生态的一部分。

+

📜 React 虚拟列表组件,用于高性能渲染长列表。

npm version npm downloads @@ -18,10 +17,10 @@ ## 特性 -- Built for React and maintained by the rc-component team. +- 面向 React 构建,并由 rc-component 团队维护。 - 被 Ant Design 使用和其他 React 组件库使用。 -- 提供 TypeScript declarations with both ES module and CommonJS outputs. -- 保留 examples, tests, and preview builds aligned with the package source. +- 提供 TypeScript 类型声明,同时输出 ES module 和 CommonJS 产物。 +- 示例、测试和预览构建与包源码保持一致。 ## 安装 @@ -48,7 +47,7 @@ export default () => ( ## 示例 -Run the local dumi site to explore the examples: +运行本地 dumi 站点查看示例: ```bash npm install @@ -61,17 +60,17 @@ npm start | 属性 | 说明 | 类型 | 默认值 | | ---------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------- | -| children | Render function for each item. The third argument contains measuring props used by legacy browser compatibility paths. | `(item, index, props) => ReactElement` | - | -| component | Custom list container element. | `string` \| `ComponentType` | `div` | -| data | Items rendered by the virtual list. | `T[]` | - | -| disabled | Disable scroll position checks, usually while coordinating animation. | `boolean` | `false` | -| fullHeight | Whether the holder should keep full height. | `boolean` | `true` | -| height | Visible list height. | `number` | - | -| itemHeight | Minimum item height used to calculate the virtual range. | `number` | - | -| itemKey | Key field or key getter for items. | `string` \| `(item) => React.Key` | - | -| onScroll | Called when the list scrolls. | `React.UIEventHandler` | - | -| styles | Custom scrollbar part styles. | `object` | - | -| virtual | Enable virtual rendering. | `boolean` | `true` | +| children | 每一项的渲染函数。第三个参数包含旧浏览器兼容路径使用的测量 props。 | `(item, index, props) => ReactElement` | - | +| component | 自定义列表容器元素。 | `string` \| `ComponentType` | `div` | +| data | 虚拟列表渲染的数据项。 | `T[]` | - | +| disabled | 禁用滚动位置检查,通常用于配合动画。 | `boolean` | `false` | +| fullHeight | holder 是否保持完整高度。 | `boolean` | `true` | +| height | 可视列表高度。 | `number` | - | +| itemHeight | 用于计算虚拟范围的最小项高度。 | `number` | - | +| itemKey | 数据项 key 字段或 key 获取函数。 | `string` \| `(item) => React.Key` | - | +| onScroll | 列表滚动时调用。 | `React.UIEventHandler` | - | +| styles | 自定义滚动条部位样式。 | `object` | - | +| virtual | 启用虚拟渲染。 | `boolean` | `true` | ## 本地开发 @@ -88,8 +87,8 @@ npm run build npm run prepublishOnly ``` -The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. +包构建完成后,发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。 ## 许可证 -@rc-component/virtual-list is released under the [MIT](./LICENSE) license. +@rc-component/virtual-list 基于 [MIT](./LICENSE) 许可证发布。 From c18bb90bcdd6b545e5ea41d71140d0f63e56eca8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 01:28:46 +0800 Subject: [PATCH 12/28] chore: standardize rc tooling and docs --- .dumirc.ts | 2 +- README.md | 4 +++- README.zh-CN.md | 4 +++- package.json | 30 +++++++++++++++--------------- tsconfig.json | 36 ++++++++++++++++++++++++++++-------- 5 files changed, 50 insertions(+), 26 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index a66671bd..1151616f 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -2,7 +2,7 @@ import { defineConfig } from 'dumi'; import path from 'path'; const basePath = process.env.GH_PAGES ? '/virtual-list/' : '/'; -const publicPath = process.env.GH_PAGES ? '/virtual-list/' : '/'; +const publicPath = basePath; export default defineConfig({ alias: { diff --git a/README.md b/README.md index e5660ae7..73554486 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,15 @@ export default () => ( ## Examples -Run the local dumi site to explore the examples: +Run the local dumi site: ```bash npm install npm start ``` +Then open `http://localhost:8000`. + ## API ### List diff --git a/README.zh-CN.md b/README.zh-CN.md index 832180e8..c22e7e63 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -47,13 +47,15 @@ export default () => ( ## 示例 -运行本地 dumi 站点查看示例: +运行本地 dumi 站点: ```bash npm install npm start ``` +然后打开 `http://localhost:8000`。 + ## API ### List diff --git a/package.json b/package.json index 70306e13..be548012 100644 --- a/package.json +++ b/package.json @@ -47,28 +47,28 @@ "react-dom": ">=18.0.0" }, "devDependencies": { - "@rc-component/father-plugin": "^2.1.3", + "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", - "@testing-library/jest-dom": "^5.17.0", - "@testing-library/react": "^13.4.0", - "@types/jest": "^30.0.0", - "@types/node": "^24.10.1", - "@types/react": "^18.0.8", - "@types/react-dom": "^18.0.3", - "@types/warning": "^3.0.0", - "dumi": "^2.2.17", - "eslint": "^8.56.0", - "eslint-plugin-unicorn": "^55.0.0", - "father": "^4.4.0", - "glob": "^7.1.6", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^15.0.7", + "@types/jest": "^29.5.14", + "@types/node": "^26.0.1", + "@types/react": "^18.3.31", + "@types/react-dom": "^18.3.7", + "@types/warning": "^3.0.4", + "dumi": "^2.4.35", + "eslint": "^8.57.1", + "eslint-plugin-unicorn": "^56.0.1", + "father": "^4.6.23", + "glob": "^13.0.6", "rc-animate": "^2.9.1", "rc-test": "^7.1.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "typescript": "^5.0.0", + "typescript": "^5.9.3", "cross-env": "^10.1.0", "gh-pages": "^6.3.0", - "prettier": "^3.3.2" + "prettier": "^3.9.0" }, "dependencies": { "@babel/runtime": "^7.20.0", diff --git a/tsconfig.json b/tsconfig.json index cc89b9c5..8b2b4f8c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,13 +8,33 @@ "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": ["src/*"], - "@@/*": [".dumi/tmp/*"], - "@rc-component/virtual-list": ["src/index.ts"], - "@rc-component/virtual-list/es": ["src"], - "@rc-component/virtual-list/es/*": ["src/*"] - } + "@/*": [ + "src/*" + ], + "@@/*": [ + ".dumi/tmp/*" + ], + "@rc-component/virtual-list": [ + "src/index.ts" + ], + "@rc-component/virtual-list/es": [ + "src" + ], + "@rc-component/virtual-list/es/*": [ + "src/*" + ] + }, + "ignoreDeprecations": "5.0" }, - "include": [".dumirc.ts", "src", "tests", "examples"], - "exclude": ["docs-dist", "lib", "es"] + "include": [ + ".dumirc.ts", + "src", + "tests", + "examples" + ], + "exclude": [ + "docs-dist", + "lib", + "es" + ] } From a7cfa75e2a6c9c3f434676f49ae07a19bd50a9d2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 02:01:10 +0800 Subject: [PATCH 13/28] chore: address standardization review comments --- .github/workflows/surge-preview.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index cd006cf9..f84b7ab6 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -20,13 +20,23 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with: persist-credentials: false + - name: Check Surge token + id: surge-token + env: + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} + run: | + if [ -n "$SURGE_TOKEN" ]; then + echo "enabled=true" >> "$GITHUB_OUTPUT" + else + echo "enabled=false" >> "$GITHUB_OUTPUT" + fi - name: Install dependencies run: npm install --ignore-scripts --no-audit --loglevel=warn - name: Build preview - if: ${{ secrets.SURGE_TOKEN != '' }} + if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec - if: ${{ secrets.SURGE_TOKEN != '' }} + if: ${{ steps.surge-token.outputs.enabled == 'true' }} env: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: From f128609969fd0f4a6673ec0b5eea02af4fd8a75d Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:25:07 +0800 Subject: [PATCH 14/28] ci: update GitHub Actions versions --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f911ba30..cff935e0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,15 +29,15 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444 with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444 with: category: '/language:${{ matrix.language }}' From 14baf8252e97821e4e8fd0356059efd60f666c48 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 12:30:39 +0800 Subject: [PATCH 15/28] ci: use resolvable CodeQL action ref --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cff935e0..f911ba30 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,15 +29,15 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444 + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e with: category: '/language:${{ matrix.language }}' From 4e87a53543762fcb39d8c1ee3c9e981eaec214ac Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 13:47:20 +0800 Subject: [PATCH 16/28] ci: use test-utoo workflow from main --- .github/workflows/react-component-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index a33292ef..d91f4b47 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -11,5 +11,5 @@ permissions: jobs: test: - uses: react-component/rc-test/.github/workflows/test-utoo.yml@b8ebddc81ef706b50faff0242ab34ad8ecdd9a59 + uses: react-component/rc-test/.github/workflows/test-utoo.yml@main secrets: inherit From d860a634da58da489729193db1afcff889b4f0ef Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:04:00 +0800 Subject: [PATCH 17/28] ci: use actions checkout v7 --- .github/workflows/codeql.yml | 2 +- .github/workflows/react-doctor.yml | 2 +- .github/workflows/surge-preview.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f911ba30..4ddf3594 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + uses: actions/checkout@v7 with: persist-credentials: false diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml index 9e0dfb91..56430b6e 100644 --- a/.github/workflows/react-doctor.yml +++ b/.github/workflows/react-doctor.yml @@ -16,7 +16,7 @@ jobs: react-doctor: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - uses: actions/checkout@v7 with: persist-credentials: false - uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3 diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index f84b7ab6..85e33da1 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -17,7 +17,7 @@ jobs: preview: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + - uses: actions/checkout@v7 with: persist-credentials: false - name: Check Surge token From b3f5b37836a45a9d72e0f48c5a06f32d0f290aef Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:32:46 +0800 Subject: [PATCH 18/28] chore: standardize package metadata --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be548012..bac0fb74 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "react-component", "virtual-list" ], - "homepage": "https://github.com/react-component/virtual-list", + "homepage": "https://react-component.github.io/virtual-list", "author": "smith3816@gmail.com", "repository": { "type": "git", From 921093d53bb8818fc0b5b17a03bf26e5a1ea7469 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 14:39:08 +0800 Subject: [PATCH 19/28] ci: standardize dependabot updates --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0737a7d8..3b730ef9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,4 +6,14 @@ updates: interval: weekly day: monday time: '21:00' + timezone: Asia/Shanghai + open-pull-requests-limit: 10 + + - package-ecosystem: github-actions + directory: '/' + schedule: + interval: weekly + day: monday + time: '21:00' + timezone: Asia/Shanghai open-pull-requests-limit: 10 From c099201e30ea91506141c8c8f30863d54d3dfae1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 17:17:13 +0800 Subject: [PATCH 20/28] chore: refine preview workflow ignores --- .github/workflows/surge-preview.yml | 1 + .prettierignore | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .prettierignore diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 85e33da1..1a44351c 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -31,6 +31,7 @@ jobs: echo "enabled=false" >> "$GITHUB_OUTPUT" fi - name: Install dependencies + if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: npm install --ignore-scripts --no-audit --loglevel=warn - name: Build preview if: ${{ steps.surge-token.outputs.enabled == 'true' }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..c466d872 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,14 @@ +node_modules +coverage +docs-dist +dist +es +lib +.dumi/tmp +.dumi/tmp-production +.vercel +package-lock.json +pnpm-lock.yaml +yarn.lock +bun.lockb +*.log From a7d4cb1e1d58f9d6d6b4bbc2e6f3e1421a793aeb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:14:43 +0800 Subject: [PATCH 21/28] chore: add father config --- .fatherrc.ts | 5 +++++ tsconfig.json | 1 + 2 files changed, 6 insertions(+) create mode 100644 .fatherrc.ts diff --git a/.fatherrc.ts b/.fatherrc.ts new file mode 100644 index 00000000..96268ae1 --- /dev/null +++ b/.fatherrc.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'father'; + +export default defineConfig({ + plugins: ['@rc-component/father-plugin'], +}); diff --git a/tsconfig.json b/tsconfig.json index 8b2b4f8c..edc503cd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,6 +28,7 @@ }, "include": [ ".dumirc.ts", + ".fatherrc.ts", "src", "tests", "examples" From 729be25c8f71ee59898698061a59785c4bee4dfe Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:40:04 +0800 Subject: [PATCH 22/28] docs: document dumi dev server port --- README.md | 2 ++ README.zh-CN.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 73554486..3b27bfac 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,8 @@ npm test npm run build ``` +The dumi site runs at `http://localhost:8000` by default. + ## Release ```bash diff --git a/README.zh-CN.md b/README.zh-CN.md index c22e7e63..df32efec 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -83,6 +83,8 @@ npm test npm run build ``` +dumi 站点默认运行在 `http://localhost:8000`。 + ## 发布 ```bash From cc2519fd1f5fba1b21750a2458e790dca1f7e0af Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 19:59:48 +0800 Subject: [PATCH 23/28] chore: standardize husky configuration --- .husky/pre-commit | 1 + package.json | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..2312dc58 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/package.json b/package.json index bac0fb74..4fbb841f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "prettier": "prettier --write --ignore-unknown .", "start": "dumi dev", "test": "rc-test", - "tsc": "tsc --noEmit" + "tsc": "tsc --noEmit", + "prepare": "husky" }, "peerDependencies": { "react": ">=18.0.0", @@ -68,7 +69,9 @@ "typescript": "^5.9.3", "cross-env": "^10.1.0", "gh-pages": "^6.3.0", - "prettier": "^3.9.0" + "prettier": "^3.9.0", + "husky": "^9.1.7", + "lint-staged": "^16.4.0" }, "dependencies": { "@babel/runtime": "^7.20.0", @@ -78,5 +81,8 @@ }, "publishConfig": { "access": "public" + }, + "lint-staged": { + "*": "prettier --write --ignore-unknown" } } From 2c394ecc7c6f228b1d1aa425aae419c3d812172c Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 20:33:56 +0800 Subject: [PATCH 24/28] chore: standardize package type entry --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4fbb841f..62e4e0d9 100644 --- a/package.json +++ b/package.json @@ -84,5 +84,6 @@ }, "lint-staged": { "*": "prettier --write --ignore-unknown" - } + }, + "types": "./es/index.d.ts" } From 2db4e0fe7b43c3b5139ee4a842a5efea7b8626fe Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:02:09 +0800 Subject: [PATCH 25/28] docs: normalize readme badges --- README.md | 13 +++++++------ README.zh-CN.md | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3b27bfac..0d63d5f0 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,14 @@

@rc-component/virtual-list

Ant Design Part of the Ant Design ecosystem.

📜 Virtual scrolling list component for React.

+

- npm version - npm downloads - CI - Codecov - bundle size - dumi + NPM version + npm downloads + build status + Codecov + bundle size + dumi

diff --git a/README.zh-CN.md b/README.zh-CN.md index df32efec..d0a3192e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -2,13 +2,14 @@

@rc-component/virtual-list

Ant Design Ant Design 生态的一部分。

📜 React 虚拟列表组件,用于高性能渲染长列表。

+

- npm version - npm downloads - CI - Codecov - bundle size - dumi + NPM version + npm downloads + build status + Codecov + bundle size + dumi

From 37de53c6ea7a14099651275c8cdfabd619f34ee6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:21:56 +0800 Subject: [PATCH 26/28] ci: limit reusable workflow secrets --- .github/workflows/react-component-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index d91f4b47..958b6753 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -12,4 +12,6 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 552ae565638a7ceaa3dce63ac4df3b58793c1385 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Jun 2026 21:30:47 +0800 Subject: [PATCH 27/28] ci: restore reusable workflow compatibility --- .github/workflows/react-component-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 958b6753..d91f4b47 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -12,6 +12,4 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: - - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + secrets: inherit From 5878ec4fc04dc569526f48d507572d2bbe9501bf Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 14:27:42 +0800 Subject: [PATCH 28/28] chore: limit reusable workflow secrets --- .github/workflows/react-component-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index d91f4b47..1d160790 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -12,4 +12,5 @@ permissions: jobs: test: uses: react-component/rc-test/.github/workflows/test-utoo.yml@main - secrets: inherit + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file