[{"data":1,"prerenderedAt":280},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Fpackage\u002Frules\u002Fdependencies\u002Fno-pinned-singleton":48},[4,8,12,16,20,24,28,32,36,40,44],{"title":5,"path":6,"stem":7},"CLI","\u002Fcli","1.cli",{"title":9,"path":10,"stem":11},"Nuxt","\u002Fnuxt","2.nuxt",{"title":13,"path":14,"stem":15},"Vue","\u002Fvue","3.vue",{"title":17,"path":18,"stem":19},"Vite","\u002Fvite","4.vite",{"title":21,"path":22,"stem":23},"Nitro","\u002Fnitro","5.nitro",{"title":25,"path":26,"stem":27},"TypeScript","\u002Ftypescript","6.typescript",{"title":29,"path":30,"stem":31},"shadcn","\u002Fshadcn","7.shadcn",{"title":33,"path":34,"stem":35},"Package","\u002Fpackage","8.package",{"title":37,"path":38,"stem":39},"Extending Doctor","\u002Fextending","9.extending",{"title":41,"path":42,"stem":43},"MCP","\u002Fmcp","9.mcp",{"title":45,"path":46,"stem":47},"Pinia","\u002Fpinia","9.pinia",{"id":49,"title":50,"body":51,"category":57,"description":266,"diagnosticCodes":267,"docsUrl":59,"extension":270,"fix":60,"framework":271,"meta":272,"navigation":273,"pack":61,"path":275,"recommendedReplacement":276,"ruleId":62,"seo":277,"severity":63,"source":64,"sourceUrl":65,"stem":278,"why":116,"__hash__":279},"rules\u002Fpackage\u002Frules\u002Fdependencies\u002Fno-pinned-singleton.md","Declare singleton packages by range",{"type":52,"value":53,"toc":255},"minimark",[54,66,71,109,113,117,121,132,136,148,152,157,160,210,213,251],[55,56],"rule-metadata",{"category":57,"diagnosticCodes":58,"docsUrl":59,"fix":60,"pack":61,"ruleId":62,"severity":63,"source":64,"sourceUrl":65},"dependencies","PKG0005,PKG0006","https:\u002F\u002Fpnpm.io\u002Fhow-peers-are-resolved","suggestion","vite-doctor\u002Fpackage","package\u002Fno-pinned-singleton","warn","src\u002Frule-packs\u002Fpackage\u002Frules\u002Fno-pinned-singleton.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fpackage\u002Frules\u002Fno-pinned-singleton.ts",[67,68,70],"h2",{"id":69},"run-this-rule","Run this rule",[72,73,78],"pre",{"className":74,"code":75,"language":76,"meta":77,"style":77},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm vite-doctor . --extends package\u002Frecommended --rules package\u002Fno-pinned-singleton\n","bash","",[79,80,81],"code",{"__ignoreMap":77},[82,83,86,90,94,97,100,103,106],"span",{"class":84,"line":85},"line",1,[82,87,89],{"class":88},"sBMFI","pnpm",[82,91,93],{"class":92},"sfazB"," vite-doctor",[82,95,96],{"class":92}," .",[82,98,99],{"class":92}," --extends",[82,101,102],{"class":92}," package\u002Frecommended",[82,104,105],{"class":92}," --rules",[82,107,108],{"class":92}," package\u002Fno-pinned-singleton\n",[67,110,112],{"id":111},"why-it-matters","Why it matters",[114,115,116],"p",{},"An app shares a singleton only when every declaration accepts the app's version. An exact peer fails strict peer checks or makes the package manager install a second copy next to the app's, and an exact dependency installs its own copy whenever the app has another version. Two copies of Vue, Nuxt or React split their state, so injections and composables find nothing, and two copies of h3 or Drizzle fail their identity checks.",[67,118,120],{"id":119},"recommended-fix","Recommended fix",[114,122,123,124,131],{},"Declare the peer as a range that accepts the app's version, such as \"^3.5.44\", or point catalog: at a catalog entry that is a range. For a dependency, take the singleton from the app as a peer, or depend on a range. Configure more singletons with ",[82,125,126,127,130],{},"\"warn\", { \"singletons\": ",[82,128,129],{},"\"comark\", \"@ai-sdk\u002F*\""," }",".",[67,133,135],{"id":134},"useful-links","Useful links",[137,138,139],"ul",{},[140,141,142],"li",{},[143,144,147],"a",{"href":59,"rel":145},[146],"nofollow","Rule reference",[67,149,151],{"id":150},"example","Example",[153,154,156],"h3",{"id":155},"accept-the-apps-vue","Accept the app's Vue",[114,158,159],{},"Before",[72,161,165],{"className":162,"code":163,"language":164,"meta":77,"style":77},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ \"peerDependencies\": { \"vue\": \"3.5.44\" } }\n","json",[79,166,167],{"__ignoreMap":77},[82,168,169,173,176,180,183,186,189,191,194,196,198,200,203,205,207],{"class":84,"line":85},[82,170,172],{"class":171},"sMK4o","{",[82,174,175],{"class":171}," \"",[82,177,179],{"class":178},"spNyl","peerDependencies",[82,181,182],{"class":171},"\"",[82,184,185],{"class":171},":",[82,187,188],{"class":171}," {",[82,190,175],{"class":171},[82,192,193],{"class":88},"vue",[82,195,182],{"class":171},[82,197,185],{"class":171},[82,199,175],{"class":171},[82,201,202],{"class":92},"3.5.44",[82,204,182],{"class":171},[82,206,130],{"class":171},[82,208,209],{"class":171}," }\n",[114,211,212],{},"After",[72,214,216],{"className":162,"code":215,"language":164,"meta":77,"style":77},"{ \"peerDependencies\": { \"vue\": \"^3.5.44\" } }\n",[79,217,218],{"__ignoreMap":77},[82,219,220,222,224,226,228,230,232,234,236,238,240,242,245,247,249],{"class":84,"line":85},[82,221,172],{"class":171},[82,223,175],{"class":171},[82,225,179],{"class":178},[82,227,182],{"class":171},[82,229,185],{"class":171},[82,231,188],{"class":171},[82,233,175],{"class":171},[82,235,193],{"class":88},[82,237,182],{"class":171},[82,239,185],{"class":171},[82,241,175],{"class":171},[82,243,244],{"class":92},"^3.5.44",[82,246,182],{"class":171},[82,248,130],{"class":171},[82,250,209],{"class":171},[252,253,254],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":77,"searchDepth":256,"depth":256,"links":257},2,[258,259,260,261,262],{"id":69,"depth":256,"text":70},{"id":111,"depth":256,"text":112},{"id":119,"depth":256,"text":120},{"id":134,"depth":256,"text":135},{"id":150,"depth":256,"text":151,"children":263},[264],{"id":155,"depth":265,"text":156},3,"Find published workspace packages that declare an exact version of a package the app must load once, such as vue, nuxt, nitro, h3, vite, react or drizzle-orm, in peerDependencies, dependencies or optionalDependencies. catalog: and workspace: specifiers are resolved to the range pnpm publishes. Add packages with the singletons option.",[268,269],"PKG0005","PKG0006","md","package",{},{"title":274},"Pinned singletons","\u002Fpackage\u002Frules\u002Fdependencies\u002Fno-pinned-singleton","Declare the peer as a range that accepts the app's version, such as \"^3.5.44\", or point catalog: at a catalog entry that is a range. For a dependency, take the singleton from the app as a peer, or depend on a range. Configure more singletons with [\"warn\", { \"singletons\": [\"comark\", \"@ai-sdk\u002F*\"] }].",{"title":50,"description":266},"package\u002Frules\u002Fdependencies\u002Fno-pinned-singleton","BCMYW1Q156hKbFwhsCl3gX-1TUU64speh3VXMaTH1rE",1795268785966]