47ng / nuqs

Type-safe search params state manager for React frameworks - Like useState, but stored in the URL query string.
https://nuqs.47ng.com
MIT License
4.91k stars 105 forks source link

`pnpm add nuqs` install both remix and next #696

Closed nezouse closed 1 month ago

nezouse commented 1 month ago

Context

What's your version of nuqs?

 "nuqs": "^2.0.0"

Description

After adding nuqs to project with pnpm both next and remix (react-router) are installed. Usually you use only one of them. The issues appears with fresh pnpm package without any modifications.

Reproduction

https://github.com/nezouse/nuqs-pnpm-repro

Steps to reproduce the behavior:

Just take a look at pnpm-lock.yaml or:

  1. corepack enable
  2. corepack pnpm install

To create a repro i did:

  1. pnpm create
  2. pnpm add nuqs
franky47 commented 1 month ago

Thanks, I'm going to try and set up each framework as a peerDependency with peerDependencyMeta.*.optional: true, see if it helps. See #697 for tracking.

Edit: looks like it worked, it only hoisted react (which isn't marked as optional, I think that one's OK).

CleanShot 2024-10-22 at 23 15 46@2x

I also need to test with NPM, Yarn & Bun.

Interestingly, only yarn v1 (I haven't tested other versions) complained about React being missing from the package.json, and didn't install it.

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 2.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: