From dd23d159c52a9e34d04fac5f5578dfe4c8097d71 Mon Sep 17 00:00:00 2001 From: Avan Date: Tue, 20 Aug 2024 07:08:35 +0800 Subject: [PATCH 1/3] fix: tsc noEmit --- .gitignore | 4 +++- docs/examples/dynamic-extra.tsx | 1 - docs/examples/editable.tsx | 5 ++--- docs/examples/extra.tsx | 2 +- docs/examples/mix.tsx | 1 - docs/examples/overflow.tsx | 1 - 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 083d48b7..6517d11c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,6 @@ pnpm-lock.yaml .umi-production .umi-test .env.local -.dumi \ No newline at end of file +.dumi + +bun.lockb \ No newline at end of file diff --git a/docs/examples/dynamic-extra.tsx b/docs/examples/dynamic-extra.tsx index 3a32c937..9db9721d 100644 --- a/docs/examples/dynamic-extra.tsx +++ b/docs/examples/dynamic-extra.tsx @@ -30,7 +30,6 @@ export default () => { onChange={(curKey) => setKey(curKey)} tabBarExtraContent={extra} defaultActiveKey="8" - moreIcon="..." items={items} /> diff --git a/docs/examples/editable.tsx b/docs/examples/editable.tsx index b67b6c5b..409e0130 100644 --- a/docs/examples/editable.tsx +++ b/docs/examples/editable.tsx @@ -7,7 +7,7 @@ export default () => { const [tabs, setTabs] = React.useState( new Array(countRef.current).fill(0).map((_, index) => { return { - key: index, + key: `${index}`, content: `tab content ${index + 1}`, }; }), @@ -25,7 +25,7 @@ export default () => { return [ ...lastTabs, { - key: ++countRef.current, + key: `${++countRef.current}`, content: `tab content ${countRef.current}`, }, ]; @@ -40,7 +40,6 @@ export default () => { ({ key, label: `tab ${key}`, diff --git a/docs/examples/extra.tsx b/docs/examples/extra.tsx index 82aba4b1..958e0a74 100644 --- a/docs/examples/extra.tsx +++ b/docs/examples/extra.tsx @@ -104,7 +104,7 @@ export default () => { return (
- +
{ tabBarGutter={gutter ? 32 : null} tabBarExtraContent="extra" defaultActiveKey="30" - moreIcon="..." // moreTransitionName="233" style={{ height: fixHeight ? 300 : null }} items={tabPanes} diff --git a/docs/examples/overflow.tsx b/docs/examples/overflow.tsx index 94a23ee5..b1b271f2 100644 --- a/docs/examples/overflow.tsx +++ b/docs/examples/overflow.tsx @@ -25,7 +25,6 @@ export default () => { tabBarGutter={gutter ? 32 : null} tabBarExtraContent="extra" defaultActiveKey="8" - moreIcon="..." items={items} />
From 87fbb9487394bbbbeb721921eb8faef378eb2275 Mon Sep 17 00:00:00 2001 From: Avan Date: Tue, 20 Aug 2024 07:12:43 +0800 Subject: [PATCH 2/3] chore: add ts-ignore --- docs/examples/renderTabBar-dragable.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/examples/renderTabBar-dragable.tsx b/docs/examples/renderTabBar-dragable.tsx index 4416badf..9d4a38f5 100644 --- a/docs/examples/renderTabBar-dragable.tsx +++ b/docs/examples/renderTabBar-dragable.tsx @@ -111,6 +111,7 @@ class DraggableTabs extends React.Component { }); return ( + // @ts-ignore https://github.com/react-dnd/react-dnd/issues/3636 需要升级 15.0.0 类型支持 children 但是写法需要重新调整验证 From 71a63cd43750b460d3d99c6f3cc61449ec5a3a0a Mon Sep 17 00:00:00 2001 From: Avan Date: Tue, 20 Aug 2024 07:15:11 +0800 Subject: [PATCH 3/3] chore: update ci --- .github/workflows/main.yml | 119 ++----------------------------------- 1 file changed, 5 insertions(+), 114 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2097f2a7..5735e2d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,115 +1,6 @@ -name: CI - -on: ['push', 'pull_request'] - +name: ✅ test +on: [push, pull_request] jobs: - setup: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: cache package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts - - - name: hack for singe file - run: | - if [ ! -d "package-temp-dir" ]; then - mkdir package-temp-dir - fi - cp package-lock.json package-temp-dir - - - name: cache node_modules - id: node_modules_cache_id - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: install - if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci - - lint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: lint - run: npm run lint - - needs: setup - - compile: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: compile - run: npm run compile - - needs: setup - - coverage: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: coverage - run: npm test -- --coverage - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - needs: setup + test: + uses: react-component/rc-test/.github/workflows/test.yml@main + secrets: inherit \ No newline at end of file