From ac3424b72744997cb79e7273191eee45ba239130 Mon Sep 17 00:00:00 2001 From: xiejay97 Date: Thu, 25 May 2023 13:12:57 +0800 Subject: [PATCH] chore: update peerDependencies --- packages/hooks/package.json | 4 ++-- packages/icons/package.json | 4 ++-- packages/ui/package.json | 6 +++--- tools/update-dependencies.ts | 5 +---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 9f24cf79..79491038 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -30,8 +30,8 @@ }, "peerDependencies": { "immer": ">=2.0.0", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "^18.0.0", + "react-dom": "^18.0.0" }, "publishConfig": { "access": "public", diff --git a/packages/icons/package.json b/packages/icons/package.json index 9c10233c..8692bf77 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -29,8 +29,8 @@ "lodash": "^4.17.21" }, "peerDependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "^18.0.0", + "react-dom": "^18.0.0" }, "publishConfig": { "access": "public", diff --git a/packages/ui/package.json b/packages/ui/package.json index 8b1fc288..61caf224 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -32,10 +32,10 @@ "rxjs": "^7.6.0" }, "peerDependencies": { - "dayjs": "^1.11.7", + "dayjs": "^1.11.0", "immer": ">=2.0.0", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "^18.0.0", + "react-dom": "^18.0.0" }, "publishConfig": { "access": "public", diff --git a/tools/update-dependencies.ts b/tools/update-dependencies.ts index 529839aa..5fef7dd1 100644 --- a/tools/update-dependencies.ts +++ b/tools/update-dependencies.ts @@ -65,10 +65,7 @@ Object.entries(workspace.projects).forEach(([projectName, projectPath]) => { const version = dependence.startsWith('@react-devui') ? 'file:../' + dependence.split('/')[1] : packageJson.devDependencies[dependence]; - if (projectPackageJson['peerDependencies'] && dependence in projectPackageJson['peerDependencies']) { - delete projectPackageJson['dependencies'][dependence]; - projectPackageJson['peerDependencies'][dependence] = version; - } else { + if (!(projectPackageJson['peerDependencies'] && dependence in projectPackageJson['peerDependencies'])) { projectPackageJson['dependencies'][dependence] = version; } }