Skip to content

Commit

Permalink
✨ feat: Support React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jan 6, 2025
1 parent 8114b44 commit 08008b9
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 34 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
npm run build:toc
git add .
npm run type-check
npm run lint:circular
npx --no-install lint-staged
4 changes: 4 additions & 0 deletions clean-package.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
indent: 2,
remove: ['scripts', 'lint-staged', 'devDependencies', 'publishConfig', 'clean-package'],
};
42 changes: 22 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
"docs:dev": "dumi dev",
"doctor": "father doctor",
"lint": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
"lint:circular": "dpdm src/**/*.{ts,tsx} --warning false --tree false --exit-code circular:1 -T true",
"lint:md": "remark . --quiet --frail --output",
"lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
"prepack": "clean-package",
"postpack": "clean-package restore",
"prepare": "husky && npm run setup",
"prepublishOnly": "npm run build",
"prettier": "prettier -c --write --no-error-on-unmatched-pattern \"**/**\"",
Expand All @@ -54,7 +57,7 @@
"test": "vitest --passWithNoTests",
"test:coverage": "vitest run --coverage --passWithNoTests",
"test:update": "vitest -u",
"type-check": "tsc -p tsconfig-check.json"
"type-check": "tsc --noEmit"
},
"lint-staged": {
"*.md": [
Expand Down Expand Up @@ -83,50 +86,49 @@
"@types/lodash-es": "^4.17.12",
"@types/pangu": "^4.0.2",
"@types/query-string": "^6.3.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@vitest/coverage-v8": "~1.2.2",
"babel-plugin-antd-style": "^1.0.4",
"commitlint": "^18.6.1",
"concurrently": "^8.2.2",
"consola": "^3.2.3",
"consola": "^3.3.3",
"cross-env": "^7.0.3",
"dumi": "^2.4.14",
"dumi-theme-lobehub": "^1.10.9",
"dpdm": "^3.14.0",
"dumi": "^2.4.17",
"dumi-theme-lobehub": "^1.11.0",
"eslint": "^8.57.1",
"father": "^4.5.1",
"glob": "^11.0.0",
"gray-matter": "^4.0.3",
"husky": "^9.1.7",
"jsdom": "^23.2.0",
"lint-staged": "^15.2.10",
"lint-staged": "^15.3.0",
"lodash-es": "^4.17.21",
"markdown-table": "^3.0.4",
"multi-semantic-release": "^3.0.2",
"p-map": "^7.0.2",
"polished": "^4.3.1",
"prettier": "^3.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"p-map": "^7.0.3",
"prettier": "^3.4.2",
"remark": "^14.0.3",
"remark-cli": "^11.0.0",
"semantic-release": "^21.1.2",
"sharp": "^0.33.5",
"stylelint": "^15.11.0",
"svgo-browser": "^1.3.8",
"swr": "^2.2.5",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"vitest": "~1.2.2"
},
"peerDependencies": {
"@lobehub/ui": ">=1",
"antd": ">=5",
"antd-style": ">=3",
"lucide-react": ">=0.396.0",
"react": ">=18",
"react-dom": ">=18",
"react-layout-kit": ">=1"
"@babel/runtime": "^7.0.0",
"@lobehub/ui": "^1.160.0",
"antd": "^5.22.0",
"antd-style": "^3.7.0",
"lucide-react": "^0.469.0",
"polished": "^4.0.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"react-layout-kit": "^1.0.0"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/useSvgo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import SvgoClient, { SvgoConfig } from '@/components/Editor/svgo';

export const useSvgo = (svg: string, config: SvgoConfig) => {
const svgoInstance = useRef<SvgoClient>();
const svgoInstance = useRef<SvgoClient>(null);
const [isLoading, setIsLoading] = useState(true);
const [newSvg, setNewSvg] = useState(svg);

Expand Down
7 changes: 0 additions & 7 deletions tsconfig-check.json

This file was deleted.

15 changes: 9 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
"esModuleInterop": true,
"jsx": "react-jsx",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "es6",
"types": ["vitest/globals"],
"paths": {
"@@/*": [".dumi/tmp/*"],
"@/*": ["src/*"],
"@lobehub/icons": ["src"],
"@lobehub/icons/*": ["src/*"]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"types": ["vitest/globals"]
}
},
"include": ["src", "docs", "scripts", ".dumirc.ts", "*.ts"]
"include": ["src", "docs", "tests", ".dumirc.ts", ".fatherrc.ts"]
}

0 comments on commit 08008b9

Please sign in to comment.