From d02322908836892bcc6085ac28d033e8fe5cc3de Mon Sep 17 00:00:00 2001 From: Amumu Date: Tue, 17 Oct 2023 20:44:23 -0500 Subject: [PATCH] chore: So many chores (#460) * fix: fix dev * demo * chore: fix * demo redirect * fix * ci * ci --- .dumi/app.tsx | 10 ++++++++++ .dumi/tsconfig.json | 6 ++++++ .github/workflows/react-component-ci.yml | 8 ++++---- README.md | 4 ++-- package.json | 3 ++- src/Tooltip.tsx | 2 +- 6 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 .dumi/app.tsx create mode 100644 .dumi/tsconfig.json diff --git a/.dumi/app.tsx b/.dumi/app.tsx new file mode 100644 index 0000000..3214087 --- /dev/null +++ b/.dumi/app.tsx @@ -0,0 +1,10 @@ +import { Navigate } from 'dumi'; +import * as React from 'react'; + +export function patchClientRoutes({ routes }) { + routes[0].children.unshift({ + id: 'demo-redirect', + path: '/demo', + element: , + }); +} diff --git a/.dumi/tsconfig.json b/.dumi/tsconfig.json new file mode 100644 index 0000000..79711a8 --- /dev/null +++ b/.dumi/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "include": [ + "**/*" + ] +} \ No newline at end of file diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 432a3fb..467f037 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: '12' + node-version: '14' - name: cache package-lock.json uses: actions/cache@v2 @@ -43,7 +43,7 @@ jobs: - name: install if: steps.node_modules_cache_id.outputs.cache-hit != 'true' run: npm ci - + lint: runs-on: ubuntu-latest steps: @@ -66,7 +66,7 @@ jobs: run: npm run lint needs: setup - + compile: runs-on: ubuntu-latest steps: @@ -89,7 +89,7 @@ jobs: run: npm run compile needs: setup - + coverage: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 089a87f..42c4d80 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ ReactDOM.render( ## Examples `npm start` and then go to - + -Online examples: +Online demo: ## API diff --git a/package.json b/package.json index edf6e53..d5c48a6 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ ], "scripts": { "compile": "father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css", + "prepare": "dumi setup", "docs:build": "dumi build", "docs:deploy": "gh-pages -d dist", "lint": "eslint src/ --ext .tsx,.ts,.jsx,.js", @@ -51,7 +52,7 @@ "@types/react-dom": "^18.0.10", "@types/warning": "^3.0.0", "cross-env": "^7.0.0", - "dumi": "^2.1.1", + "dumi": "^2.2.13", "eslint": "^7.1.0", "father": "^4.0.0", "gh-pages": "^3.1.0", diff --git a/src/Tooltip.tsx b/src/Tooltip.tsx index 6f6c2d9..1cfc415 100644 --- a/src/Tooltip.tsx +++ b/src/Tooltip.tsx @@ -74,7 +74,7 @@ const Tooltip = (props: TooltipProps, ref: React.Ref) => { } = props; const triggerRef = useRef(null); - useImperativeHandle(ref, () => triggerRef.current); + useImperativeHandle(ref, () => triggerRef.current as TriggerRef); const extraProps: Partial = { ...restProps }; if ('visible' in props) {