From 6f8c83672f75d6b6cea42fa75fc873d726917f93 Mon Sep 17 00:00:00 2001 From: Jacob Estes Date: Wed, 7 Oct 2026 18:47:02 -0400 Subject: [PATCH] fix: declare each framework as an optional peer dependency Every shipped entry imports one framework at runtime (react, vue, preact/hooks, solid-js, @angular/core, @nuxt/kit) but package.json declared none of them, so strict package managers (pnpm, Yarn PnP) could not link a framework to this package and the import resolved through whatever happened to be hoisted. In a workspace holding two React versions that produced two React instances in one render ("Cannot read properties of null (reading 'useState')" from useAutoAnimate), and the hoist pick changed between installs. Peers were removed in 029b1a6 after #4 / #32 / #64 because a caret range (react ^16.8.0) made npm 7 fail on React 17/18. These ranges are open-ended (>=) with the minimum each entry's API needs, so every stable release satisfies them and npm has nothing to conflict about, and they are optional so no framework is ever auto-installed or asked about in another framework's project. No runtime change; pnpm-lock.yaml unchanged. Co-Authored-By: Claude Fable 5.1 --- package.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/package.json b/package.json index 50375930..803d614f 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,34 @@ "default": "./index.mjs" } }, + "peerDependencies": { + "@angular/core": ">=16.0.0", + "@nuxt/kit": ">=3.0.0", + "preact": ">=10.0.0", + "react": ">=16.8.0", + "solid-js": ">=1.0.0", + "vue": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@angular/core": { + "optional": true + }, + "@nuxt/kit": { + "optional": true + }, + "preact": { + "optional": true + }, + "react": { + "optional": true + }, + "solid-js": { + "optional": true + }, + "vue": { + "optional": true + } + }, "devDependencies": { "@angular/core": "^17.1.0", "@formkit/vue": "^1.6.5",