From 64ab4cdffad4995fe4c7c655af1cf45f1a238ea0 Mon Sep 17 00:00:00 2001 From: Js4 Date: Fri, 17 Jan 2025 06:29:36 +0100 Subject: [PATCH 1/2] Update Hoisted dependencies step in installation.mdx Added extra information about hoisted pnpm packages. Because without prior knowledge about hoisting you may end up with broken Prettier and EsLint. Read more here: https://github.com/pnpm/pnpm/issues/8878 --- apps/docs/content/docs/guide/installation.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/docs/content/docs/guide/installation.mdx b/apps/docs/content/docs/guide/installation.mdx index 738dfaa104..9c0fae5a49 100644 --- a/apps/docs/content/docs/guide/installation.mdx +++ b/apps/docs/content/docs/guide/installation.mdx @@ -151,6 +151,13 @@ If you are using pnpm, you need to add the following line to your `.npmrc` file ```bash public-hoist-pattern[]=*@heroui/* ``` +If you are using Prettier and/or EsLint include them accordingly. + +```bash +public-hoist-pattern[]=*@heroui/* +public-hoist-pattern[]=*eslint* +public-hoist-pattern[]=*prettier* +``` After modifying the `.npmrc` file, you need to run `pnpm install` again to ensure that the dependencies are installed correctly. From dc66863457fba528af254a12cf82759093fc37ae Mon Sep 17 00:00:00 2001 From: Js4 Date: Sat, 18 Jan 2025 00:36:16 +0100 Subject: [PATCH 2/2] Update installation.mdx Added more context to the hoist pattern --- apps/docs/content/docs/guide/installation.mdx | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/docs/guide/installation.mdx b/apps/docs/content/docs/guide/installation.mdx index 9c0fae5a49..0392bbb2ca 100644 --- a/apps/docs/content/docs/guide/installation.mdx +++ b/apps/docs/content/docs/guide/installation.mdx @@ -151,8 +151,21 @@ If you are using pnpm, you need to add the following line to your `.npmrc` file ```bash public-hoist-pattern[]=*@heroui/* ``` -If you are using Prettier and/or EsLint include them accordingly. +
+**Note**: In version <10 of pnpm the default values of the hoist pattern contains ['*eslint*', '*prettier*'] and by adding the hoist pattern they will get removed and you may experince the tools not working. +
+ +##### Additional Steps: ##### +1. **Prettier**: If you are using Prettier < v3, add it back to the hoist pattern. + +2. **ESLint**: + - If you use ESLint < v9 without the flat config, add it back. + - Some v9 setups may also require it. + +Refer to [this pnpm release note](https://github.com/pnpm/pnpm/releases/tag/v10.0.0-rc.0#:~:text=Packages%20containing%20eslint%20or%20prettier%20in%20their%20name%20are%20no%20longer%20hoisted%20to%20the%20root%20node_modules.%20The%20default%20value%20of%20the%20public%2Dhoist%2Dpattern%20setting%20has%20changed) for more details. + +Depending on your needs, your `.npmrc` file might look like this: ```bash public-hoist-pattern[]=*@heroui/* public-hoist-pattern[]=*eslint* @@ -269,6 +282,26 @@ If you are using pnpm, you need to add the following line to your `.npmrc` file public-hoist-pattern[]=*@heroui/* ``` +
+**Note**: In version <10 of pnpm the default values of the hoist pattern contains ['*eslint*', '*prettier*'] and by adding the hoist pattern they will get removed and you may experince the tools not working. +
+ +##### Additional Steps: ##### +1. **Prettier**: If you are using Prettier < v3, add it back to the hoist pattern. + +2. **ESLint**: + - If you use ESLint < v9 without the flat config, add it back. + - Some v9 setups may also require it. + +Refer to [this pnpm release note](https://github.com/pnpm/pnpm/releases/tag/v10.0.0-rc.0#:~:text=Packages%20containing%20eslint%20or%20prettier%20in%20their%20name%20are%20no%20longer%20hoisted%20to%20the%20root%20node_modules.%20The%20default%20value%20of%20the%20public%2Dhoist%2Dpattern%20setting%20has%20changed) for more details. + +Depending on your needs, your `.npmrc` file might look like this: +```bash +public-hoist-pattern[]=*@heroui/* +public-hoist-pattern[]=*eslint* +public-hoist-pattern[]=*prettier* +``` + After modifying the `.npmrc` file, you need to run `pnpm install` again to ensure that the dependencies are installed correctly. #### Tailwind CSS Setup