From 8c2f4a85aa2da7659289d3dbfbf37671be204f8a Mon Sep 17 00:00:00 2001 From: HaixingOoO <974758671@qq.com> Date: Sun, 2 Mar 2025 15:31:59 +0800 Subject: [PATCH] chore(Package): add pnpm workspace and pnpm manage limit --- .npmrc | 2 ++ .nvmrc | 1 + package.json | 3 ++- pnpm-workspace.yaml | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .npmrc create mode 100644 .nvmrc create mode 100644 pnpm-workspace.yaml diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..c1da78ccf5 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +# 提升依赖项到根目录,以避免重复安装相同的包 +shamefully-hoist=true \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..0828ab7947 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18 \ No newline at end of file diff --git a/package.json b/package.json index e1d3abd5ce..9b23024a88 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "changelog": "node script/generate-changelog.js", "init:component": "node script/init-component", "robot": "publish-cli robot-msg", - "prepare": "husky install" + "prepare": "husky install", + "preinstall": "npx only-allow pnpm" }, "config": { "commitizen": { diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000000..08f4a78ef1 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,4 @@ +packages: + - 'packages/**' + - 'site' + - 'test' \ No newline at end of file