@aussieljk/forkbook 0.0.1-11 → 0.0.1-13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +1 -1
  2. package/assets/create/rendererAssets/common/button.css +6 -6
  3. package/assets/create/rendererAssets/common/header.css +5 -5
  4. package/assets/create/rendererAssets/common/page.css +10 -10
  5. package/dist/_browser-chunks/{Color-QLZNXLSV.js → Color-2EUQ6NXV.js} +2 -2
  6. package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
  7. package/dist/_browser-chunks/{WithTooltip-GNLRTZDF.js → WithTooltip-QCFTNB6P.js} +5 -4
  8. package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
  9. package/dist/_browser-chunks/{chunk-6ELMKWKX.js → chunk-2WZWS7GJ.js} +1 -1
  10. package/dist/_browser-chunks/{chunk-FRAOQJDI.js → chunk-3QPZOXB7.js} +1 -5
  11. package/dist/_browser-chunks/{chunk-GRO2ZYEJ.js → chunk-4BOJAE7P.js} +12 -8
  12. package/dist/_browser-chunks/{chunk-ZHKZKFY4.js → chunk-6SL45YM3.js} +9 -13
  13. package/dist/_browser-chunks/{chunk-DS2WQZGO.js → chunk-BLCZ3C5M.js} +41 -62
  14. package/dist/_browser-chunks/{chunk-7DQREF4S.js → chunk-DHTLVXAL.js} +37 -44
  15. package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
  16. package/dist/_browser-chunks/{chunk-76222HQR.js → chunk-E6QKKKLO.js} +20 -5
  17. package/dist/_browser-chunks/{chunk-DYNTDJ3O.js → chunk-EBSOKHFG.js} +8 -2
  18. package/dist/_browser-chunks/{chunk-3M5T7BW4.js → chunk-ECMVTOVD.js} +1 -1
  19. package/dist/_browser-chunks/{chunk-EQKMUQF3.js → chunk-ENHFQXYS.js} +5 -4
  20. package/dist/_browser-chunks/{chunk-KYSD26D6.js → chunk-EW2M3URL.js} +90 -83
  21. package/dist/_browser-chunks/{chunk-I4ATZPNZ.js → chunk-FCULT3AE.js} +3 -3
  22. package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
  23. package/dist/_browser-chunks/{chunk-NGMQJMCY.js → chunk-HZFHNYRC.js} +1 -1
  24. package/dist/_browser-chunks/{chunk-5H4KFI44.js → chunk-KQJ4T6JL.js} +30 -24
  25. package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
  26. package/dist/_browser-chunks/{chunk-N3NRW5XX.js → chunk-PQRPDA4U.js} +3 -3
  27. package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
  28. package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
  29. package/dist/_browser-chunks/{chunk-TTBPZQ24.js → chunk-S7N7Z5TY.js} +47 -43
  30. package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
  31. package/dist/_browser-chunks/{chunk-WBLVFDJT.js → chunk-UH3XTEOQ.js} +716 -658
  32. package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
  33. package/dist/_browser-chunks/{chunk-O24AZJZ7.js → chunk-YJO5BK52.js} +7 -3
  34. package/dist/_browser-chunks/{chunk-3HM3VWJS.js → chunk-ZF37BMDS.js} +6 -2
  35. package/dist/_browser-chunks/{chunk-QU4RB2WU.js → chunk-ZF5SPY56.js} +4 -4
  36. package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
  37. package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
  38. package/dist/_node-chunks/{attached-runtime-J2AKT5WI.js → attached-runtime-7IRDQUTZ.js} +28 -29
  39. package/dist/_node-chunks/{builder-manager-Z4RWF4ZH.js → builder-manager-YTALSWKQ.js} +39 -28
  40. package/dist/_node-chunks/{chunk-2WVLC5M2.js → chunk-26ERGIQH.js} +6 -6
  41. package/dist/_node-chunks/{chunk-VZG3OKFO.js → chunk-33T4HNF2.js} +6 -6
  42. package/dist/_node-chunks/{chunk-ZEYODVQT.js → chunk-3F3673RQ.js} +7 -7
  43. package/dist/_node-chunks/{chunk-Y4W4B3E7.js → chunk-3FLRYZLJ.js} +6 -6
  44. package/dist/_node-chunks/{chunk-AVL7GUOZ.js → chunk-3L2QRDKH.js} +522 -1045
  45. package/dist/_node-chunks/{chunk-XO54HM4P.js → chunk-3NH7IHUS.js} +6 -6
  46. package/dist/_node-chunks/{chunk-GMKLTDKN.js → chunk-3ZAENV5A.js} +6 -6
  47. package/dist/_node-chunks/{chunk-3IIQSDCO.js → chunk-4B52HLKK.js} +53 -55
  48. package/dist/_node-chunks/chunk-4CZJ4SFH.js +281 -0
  49. package/dist/_node-chunks/{chunk-BBU2FUPC.js → chunk-4IIWFG7O.js} +13 -11
  50. package/dist/_node-chunks/{chunk-2U5J7YTA.js → chunk-4YWZLOAF.js} +6 -6
  51. package/dist/_node-chunks/{chunk-XVOIYGTJ.js → chunk-5A5XOSRM.js} +6 -6
  52. package/dist/_node-chunks/chunk-5T6Q7HT3.js +11 -0
  53. package/dist/_node-chunks/{chunk-MI7WBXWX.js → chunk-6DRDJF2Q.js} +6 -6
  54. package/dist/_node-chunks/{chunk-WBCKO5LP.js → chunk-6JSZY5TJ.js} +6 -6
  55. package/dist/_node-chunks/{chunk-3EBGFRAH.js → chunk-7SPDKMDQ.js} +32 -40
  56. package/dist/_node-chunks/{chunk-IRPQQARO.js → chunk-7YLKDHLZ.js} +7 -7
  57. package/dist/_node-chunks/{chunk-BSQB5B57.js → chunk-7YQIVUEK.js} +6 -6
  58. package/dist/_node-chunks/{chunk-PYVGF5F2.js → chunk-ADCQYK3Z.js} +6 -6
  59. package/dist/_node-chunks/{chunk-7YQTID2W.js → chunk-ALHQVE5R.js} +6 -6
  60. package/dist/_node-chunks/{chunk-MW4OAPPD.js → chunk-B4XAZ2OC.js} +8 -8
  61. package/dist/_node-chunks/{chunk-GGCOG7OV.js → chunk-BFQJF3ID.js} +283 -306
  62. package/dist/_node-chunks/{chunk-5GOXN5M4.js → chunk-BSXI35KM.js} +7 -7
  63. package/dist/_node-chunks/{chunk-TAMTPVYZ.js → chunk-BZQF5KUE.js} +7 -7
  64. package/dist/_node-chunks/{chunk-5JLVSH44.js → chunk-CEIESR4U.js} +8 -8
  65. package/dist/_node-chunks/{chunk-OJWUUSA4.js → chunk-CESXIP3N.js} +6 -6
  66. package/dist/_node-chunks/{chunk-CEYSYQLV.js → chunk-DAEUTT3I.js} +6 -6
  67. package/dist/_node-chunks/{chunk-FB2BOL6I.js → chunk-DIC4T2UO.js} +6 -6
  68. package/dist/_node-chunks/{chunk-LKITAODU.js → chunk-DPOWAA4P.js} +37 -31
  69. package/dist/_node-chunks/{chunk-W3KFVTWV.js → chunk-DTNEHO4J.js} +10 -10
  70. package/dist/_node-chunks/{chunk-C5OFHB3N.js → chunk-DY7F7B6V.js} +7 -7
  71. package/dist/_node-chunks/{chunk-FUG5LYKS.js → chunk-E56UKDJR.js} +8 -8
  72. package/dist/_node-chunks/{chunk-A7GEBS3Q.js → chunk-EFX2VA4Q.js} +6 -6
  73. package/dist/_node-chunks/{chunk-PQTEFQIJ.js → chunk-EM6AYELK.js} +10 -12
  74. package/dist/_node-chunks/{chunk-32FLWHUC.js → chunk-F2AFT3P7.js} +497 -475
  75. package/dist/_node-chunks/{chunk-OXT6T4AS.js → chunk-GC7NA2Y7.js} +7 -7
  76. package/dist/_node-chunks/{chunk-55S3GGGC.js → chunk-GIKCT5KG.js} +7 -7
  77. package/dist/_node-chunks/{chunk-PXOD36TR.js → chunk-GLNHSUKT.js} +20 -20
  78. package/dist/_node-chunks/{chunk-BKND5XP2.js → chunk-GQZZQB4K.js} +7 -7
  79. package/dist/_node-chunks/{chunk-GTXZNA2L.js → chunk-GRN6WQC3.js} +10 -10
  80. package/dist/_node-chunks/{chunk-6UASHVMR.js → chunk-HCMHVV7N.js} +8 -8
  81. package/dist/_node-chunks/{chunk-IVAOJWPF.js → chunk-HJVZQS65.js} +7 -7
  82. package/dist/_node-chunks/{chunk-ER3X3AQ7.js → chunk-I26RGEVQ.js} +7 -7
  83. package/dist/_node-chunks/{chunk-LAIED5XU.js → chunk-I36FPWMO.js} +6 -6
  84. package/dist/_node-chunks/{chunk-W7HY3ELZ.js → chunk-IDPQ3CVN.js} +474 -479
  85. package/dist/_node-chunks/{chunk-36LPBTLF.js → chunk-JUVUVVHI.js} +6 -6
  86. package/dist/_node-chunks/{chunk-DGWKJQ6G.js → chunk-K6TEIAKH.js} +62 -7
  87. package/dist/_node-chunks/{chunk-7IOSIYW2.js → chunk-KEXQ3BON.js} +7 -7
  88. package/dist/_node-chunks/{chunk-NLNAIU4I.js → chunk-KUZSE7ZD.js} +9 -9
  89. package/dist/_node-chunks/chunk-LJ5JRR5Q.js +18 -0
  90. package/dist/_node-chunks/{chunk-YBG7HVP7.js → chunk-LMGI47HP.js} +8 -8
  91. package/dist/_node-chunks/{chunk-6E34W4UX.js → chunk-LPIPPSMS.js} +6 -6
  92. package/dist/_node-chunks/{chunk-XICRXTTE.js → chunk-LR4W5G37.js} +6 -6
  93. package/dist/_node-chunks/{chunk-VKRGTLQJ.js → chunk-M4MRBEJI.js} +27 -23
  94. package/dist/_node-chunks/{chunk-REIDJUVJ.js → chunk-M7BVABR2.js} +20 -16
  95. package/dist/_node-chunks/{chunk-XCJ2ZIQ4.js → chunk-MK2RPLWT.js} +7 -7
  96. package/dist/_node-chunks/{chunk-LHNHFYK3.js → chunk-MKSEM5C2.js} +6 -6
  97. package/dist/_node-chunks/{chunk-RNRGXAFV.js → chunk-MWQIBOUB.js} +6 -6
  98. package/dist/_node-chunks/{chunk-NFDQT7UW.js → chunk-NAXIA2JI.js} +320 -316
  99. package/dist/_node-chunks/{chunk-GYFR2JLS.js → chunk-NDVIMCIX.js} +7 -7
  100. package/dist/_node-chunks/{chunk-D5ADPGA4.js → chunk-NIOVXWQZ.js} +6 -6
  101. package/dist/_node-chunks/{chunk-54EHKXV7.js → chunk-NRP4FGRT.js} +15 -9
  102. package/dist/_node-chunks/{chunk-NIQSBBT2.js → chunk-NSNBFXVB.js} +7 -7
  103. package/dist/_node-chunks/{chunk-Z2ZTDQDY.js → chunk-NTUTJAD4.js} +8 -8
  104. package/dist/_node-chunks/{chunk-XH5CXH53.js → chunk-O46DZ2KC.js} +8 -8
  105. package/dist/_node-chunks/{chunk-S3NDLFYL.js → chunk-OH5M2YER.js} +7 -7
  106. package/dist/_node-chunks/{chunk-FTYDKQCO.js → chunk-OSIENBU6.js} +6 -6
  107. package/dist/_node-chunks/{chunk-76KKKLEE.js → chunk-OVJZBW54.js} +7 -7
  108. package/dist/_node-chunks/{chunk-WO4UEQI6.js → chunk-PGIDRLZ5.js} +22 -22
  109. package/dist/_node-chunks/{chunk-J3SM62J3.js → chunk-PJCSZR4T.js} +8 -8
  110. package/dist/_node-chunks/{chunk-OPT5A55S.js → chunk-PQXP5FZ2.js} +8 -8
  111. package/dist/_node-chunks/{chunk-5P4N734V.js → chunk-PU33WSBW.js} +34 -52
  112. package/dist/_node-chunks/{chunk-APPFF22V.js → chunk-PUBZLLNL.js} +7 -7
  113. package/dist/_node-chunks/{chunk-ALGQMFMN.js → chunk-QWZZX2HN.js} +6 -6
  114. package/dist/_node-chunks/{chunk-NLLM4MDK.js → chunk-RMUBUNBY.js} +6 -6
  115. package/dist/_node-chunks/{chunk-SJXLINHV.js → chunk-S33FEPQ3.js} +6 -6
  116. package/dist/_node-chunks/{chunk-FEC5PGJO.js → chunk-SHP6447T.js} +7 -7
  117. package/dist/_node-chunks/{chunk-MBIVTOJK.js → chunk-ST3KB36E.js} +6 -6
  118. package/dist/_node-chunks/{chunk-AKMPPLT5.js → chunk-SXX75O2D.js} +7 -7
  119. package/dist/_node-chunks/{chunk-6UAJLEIO.js → chunk-TQ5YAQ4Y.js} +6 -6
  120. package/dist/_node-chunks/{chunk-R7VDUSKY.js → chunk-TSJ3JCNN.js} +16 -10
  121. package/dist/_node-chunks/{chunk-TKMXEHM4.js → chunk-UYEX6LW6.js} +7 -7
  122. package/dist/_node-chunks/{chunk-46Y5H6X5.js → chunk-VJLLEKWR.js} +138 -116
  123. package/dist/_node-chunks/{chunk-IFAV3CER.js → chunk-WWJKLYU5.js} +10 -10
  124. package/dist/_node-chunks/{chunk-MXLHIEXC.js → chunk-XC7K4QEX.js} +6 -6
  125. package/dist/_node-chunks/{chunk-GO3YSBPE.js → chunk-Y64FM6U7.js} +8 -8
  126. package/dist/_node-chunks/{chunk-T6P2EJD2.js → chunk-YDM7NH4T.js} +6 -6
  127. package/dist/_node-chunks/{chunk-XSVOMORJ.js → chunk-ZHVOUP6D.js} +6 -6
  128. package/dist/_node-chunks/dist-CFCU4PZG.js +27 -0
  129. package/dist/_node-chunks/dist-PFMT5YJK.js +16 -0
  130. package/dist/_node-chunks/{local-runtime-YDAW5RJV.js → local-runtime-BKID5MBG.js} +19 -20
  131. package/dist/_node-chunks/{mdx-plugin-XLDET5LV.js → mdx-plugin-7BOUDCZB.js} +13 -13
  132. package/dist/_node-chunks/{monorepo-NWMAHGOM.js → monorepo-FRHSAJB7.js} +11 -11
  133. package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-4B6IZ7JD.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-7BHSAJP4.js} +11 -11
  134. package/dist/_node-chunks/optimized-tests-F5LCOTXH.js +22 -0
  135. package/dist/_node-chunks/{pattern-copy-play-PJC4PO6A.js → pattern-copy-play-6TGV6WS4.js} +9 -9
  136. package/dist/_node-chunks/postinstallAddon-4RININ5C.js +20 -0
  137. package/dist/_node-chunks/{rehype-external-links-4CWXZ35U.js → rehype-external-links-EE2HT4QP.js} +9 -9
  138. package/dist/_node-chunks/{rehype-slug-QZ2PWSJH.js → rehype-slug-ZKRW2V6Z.js} +9 -9
  139. package/dist/_node-chunks/{relaxed-limits-ZQR4ER7L.js → relaxed-limits-6Q7VRQC5.js} +11 -11
  140. package/dist/_node-chunks/{run-U63AXEKZ.js → run-6Y3ZTASZ.js} +23 -21
  141. package/dist/_node-chunks/{run-BMXB2BW2.js → run-EBHIAT35.js} +18 -18
  142. package/dist/_node-chunks/{setup-NCUTUBNN.js → setup-6XIF77JT.js} +8 -8
  143. package/dist/_node-chunks/{vitest.config.4.template-4XHF7XPS.js → vitest.config.4.template-GMQNQ4UW.js} +7 -7
  144. package/dist/actions/decorator.js +16 -21
  145. package/dist/actions/index.d.ts +3 -3
  146. package/dist/actions/index.js +1 -1
  147. package/dist/addon-a11y/index.js +2 -2
  148. package/dist/addon-a11y/manager.js +11 -11
  149. package/dist/addon-a11y/preset.js +7 -7
  150. package/dist/addon-a11y/preview.d.ts +8 -2
  151. package/dist/addon-a11y/preview.js +2 -2
  152. package/dist/addon-docs/blocks.d.ts +104 -85
  153. package/dist/addon-docs/blocks.js +30 -32
  154. package/dist/addon-docs/index.d.ts +2 -2
  155. package/dist/addon-docs/index.js +3 -3
  156. package/dist/addon-docs/manager.js +4 -4
  157. package/dist/addon-docs/preset.js +12 -12
  158. package/dist/addon-docs/preview.d.ts +3 -1
  159. package/dist/addon-docs/preview.js +1 -1
  160. package/dist/addon-links/index.d.ts +2 -1
  161. package/dist/addon-links/preview.d.ts +1 -1
  162. package/dist/addon-mcp/preset.js +11 -11
  163. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +16 -16
  164. package/dist/addon-ondevice-controls/index.js +1 -1
  165. package/dist/addon-ondevice-controls/register.js +1 -1
  166. package/dist/addon-pseudo-states/index.js +1 -1
  167. package/dist/addon-pseudo-states/preview.d.ts +1 -1
  168. package/dist/addon-pseudo-states/preview.js +1 -1
  169. package/dist/addon-themes/index.d.ts +6 -5
  170. package/dist/addon-themes/postinstall.js +7 -7
  171. package/dist/addon-vitest/constants.js +8 -8
  172. package/dist/addon-vitest/manager.js +18 -9
  173. package/dist/addon-vitest/node/coverage-reporter.js +11 -11
  174. package/dist/addon-vitest/node/vitest.js +34 -34
  175. package/dist/addon-vitest/postinstall.js +10 -10
  176. package/dist/addon-vitest/preset.js +21 -20
  177. package/dist/addon-vitest/vitest-plugin/global-setup.js +22 -22
  178. package/dist/addon-vitest/vitest-plugin/index.js +69 -59
  179. package/dist/babel/index.d.ts +209 -212
  180. package/dist/babel/index.js +11 -11
  181. package/dist/bin/core.js +110 -89
  182. package/dist/bin/dispatcher.js +10 -10
  183. package/dist/bin/loader.js +8 -8
  184. package/dist/builder-vite/index.d.ts +1 -1
  185. package/dist/builder-vite/index.js +18 -18
  186. package/dist/builder-vite/preset.js +13 -13
  187. package/dist/channels/index.d.ts +1 -1
  188. package/dist/channels/index.js +2 -2
  189. package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
  190. package/dist/{chunk-Fg1Fm__9.d.ts → chunk-BCG2ui5q.d.ts} +671 -674
  191. package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
  192. package/dist/{chunk-CYuvV2sR.d.ts → chunk-BNRZY6Jq.d.ts} +3 -3
  193. package/dist/{chunk-CNqjcOmK.d.ts → chunk-BV_hETtB.d.ts} +2 -2
  194. package/dist/chunk-BcYKnZln.d.ts +10 -0
  195. package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
  196. package/dist/{chunk-Bpi2tz-6.d.ts → chunk-Bubi-WAs.d.ts} +20 -17
  197. package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
  198. package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
  199. package/dist/{chunk-DROZ9oel.d.ts → chunk-DNCU78oW.d.ts} +110 -9
  200. package/dist/{chunk-D0NUmzXp.d.ts → chunk-LWwxlbee.d.ts} +4 -4
  201. package/dist/{chunk-BXLImeLy.d.ts → chunk-u_gGuTrz.d.ts} +23 -8
  202. package/dist/cli/index.d.ts +3 -3
  203. package/dist/cli/index.js +25 -30
  204. package/dist/cli/skills/content/index.d.ts +1 -1
  205. package/dist/cli/tools/sdk/child-host.d.ts +1 -1
  206. package/dist/cli/tools/sdk/child-host.js +17 -17
  207. package/dist/cli/tools/sdk/index.d.ts +3 -3
  208. package/dist/cli/tools/sdk/index.js +18 -18
  209. package/dist/cli-commands/bin/index.js +7 -7
  210. package/dist/client-logger/index.d.ts +20 -21
  211. package/dist/client-logger/index.js +2 -1
  212. package/dist/common/index.d.ts +13 -13
  213. package/dist/common/index.js +34 -35
  214. package/dist/components/index.d.ts +46 -35
  215. package/dist/components/index.js +194 -205
  216. package/dist/core-events/index.d.ts +2 -2
  217. package/dist/core-server/index.d.ts +15 -10
  218. package/dist/core-server/index.js +706 -165
  219. package/dist/core-server/presets/common-manager.js +254 -336
  220. package/dist/core-server/presets/common-override-preset.js +10 -10
  221. package/dist/core-server/presets/common-preset.js +83 -275
  222. package/dist/create/bin/index.js +7 -7
  223. package/dist/create/index.js +15 -15
  224. package/dist/csf/csf-utils.d.ts +1 -1
  225. package/dist/csf/index.d.ts +3 -3
  226. package/dist/csf/index.js +40 -43
  227. package/dist/csf-tools/index.d.ts +52 -44
  228. package/dist/csf-tools/index.js +13 -13
  229. package/dist/docs-tools/index.d.ts +332 -16
  230. package/dist/docs-tools/index.js +3 -3
  231. package/dist/instrumenter/index.d.ts +5 -5
  232. package/dist/instrumenter/index.js +25 -15
  233. package/dist/manager/_manager-chunks/{globals-runtime-DvV_TF3-.js → globals-runtime-B4NRbNSS.js} +2 -2
  234. package/dist/manager/_manager-chunks/{globals-runtime-wjkxyMn0.js → globals-runtime-BC43T1rL.js} +4150 -50
  235. package/dist/manager/_manager-chunks/{globals-runtime-BSj0mCjE.js → globals-runtime-BgWmCsA7.js} +114 -110
  236. package/dist/manager/_manager-chunks/{globals-runtime-CA8AuIRT.js → globals-runtime-BnQ7i5wq.js} +232 -228
  237. package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
  238. package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
  239. package/dist/manager/_manager-chunks/{globals-runtime-C5gK7HhH.js → globals-runtime-C59T0h-j.js} +2 -2
  240. package/dist/manager/_manager-chunks/{globals-runtime-CCTA-XPa.js → globals-runtime-CCZrdft6.js} +5 -4
  241. package/dist/manager/_manager-chunks/{globals-runtime-BY3epqww.js → globals-runtime-CS41oTca.js} +2 -1
  242. package/dist/manager/_manager-chunks/{globals-runtime-Bu9eGDTe.js → globals-runtime-Cccwtspx.js} +288 -420
  243. package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
  244. package/dist/manager/_manager-chunks/{globals-runtime-BweHuXkK.js → globals-runtime-DCmvKMN5.js} +2 -2
  245. package/dist/manager/_manager-chunks/{globals-runtime-C92M_Vnq.js → globals-runtime-Ddp2jFET.js} +5 -5
  246. package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
  247. package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
  248. package/dist/manager/_manager-chunks/{globals-runtime-CHjExYMv.js → globals-runtime-UFDJQlo-.js} +741 -540
  249. package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
  250. package/dist/manager/_manager-chunks/{globals-runtime-Bj5KDUJi.js → globals-runtime-oRjPg2jY.js} +1 -1
  251. package/dist/manager/_manager-chunks/runtime-4wMiTjjZ.js +552 -0
  252. package/dist/manager/_manager-chunks/{runtime--hR2NZFd.js → runtime-AvqHE9rM.js} +112 -109
  253. package/dist/manager/_manager-chunks/{runtime-EPerAEAs.js → runtime-CZtDJIYj.js} +3 -3
  254. package/dist/manager/_manager-chunks/{runtime-B6NL14pz.js → runtime-D8QxTQiI.js} +6 -6
  255. package/dist/manager/_manager-chunks/{runtime-BAsOe1C_.js → runtime-DC3oEVlM.js} +49 -49
  256. package/dist/manager/_manager-chunks/{runtime-CJQZFUUj.js → runtime-DCOIOn4T.js} +46 -56
  257. package/dist/manager/_manager-chunks/{runtime-DvB1axgp.js → runtime-D_FDSHFG.js} +13 -13
  258. package/dist/manager/_manager-chunks/{runtime-Dtbhxq5m.js → runtime-Db8fJ2MP.js} +67 -500
  259. package/dist/manager/_manager-chunks/{runtime-CgRqs_SK.js → runtime-lPbyY_f5.js} +882 -869
  260. package/dist/manager/_manager-chunks/{runtime-Dem2xJbS.js → runtime-td6oYfU6.js} +739 -554
  261. package/dist/manager/globals-runtime.js +1 -1
  262. package/dist/manager/runtime.js +1 -1
  263. package/dist/manager-api/index.d.ts +1 -1
  264. package/dist/manager-api/index.js +479 -464
  265. package/dist/manager-errors.d.ts +1 -1
  266. package/dist/mcp/index.d.ts +1 -1
  267. package/dist/mcp/index.js +9 -9
  268. package/dist/mocking-utils/index.d.ts +5 -3
  269. package/dist/mocking-utils/index.js +21 -26
  270. package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
  271. package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
  272. package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
  273. package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
  274. package/dist/nextjs-vite/index.d.ts +2 -2
  275. package/dist/nextjs-vite/index.js +9 -5
  276. package/dist/nextjs-vite/node/index.js +7 -7
  277. package/dist/nextjs-vite/preset.js +12 -12
  278. package/dist/nextjs-vite/preview.d.ts +2 -1
  279. package/dist/nextjs-vite/preview.js +1 -1
  280. package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
  281. package/dist/nextjs-vite/vite-plugin/index.js +9 -9
  282. package/dist/nextjs-vite-plugin/index.js +17 -27
  283. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
  284. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
  285. package/dist/node-logger/index.d.ts +18 -18
  286. package/dist/node-logger/index.js +9 -9
  287. package/dist/oxc-parser/index.js +14 -11
  288. package/dist/oxc-parser/worker.js +10 -10
  289. package/dist/preview/_chunks/{runtime-Bcv1hJky.js → runtime-BYRCSYBN.js} +4148 -48
  290. package/dist/preview/_chunks/{runtime-WapFVPAh.js → runtime-Bvh_rfnQ.js} +2 -37
  291. package/dist/preview/_chunks/{runtime-BZ4pNS3g.js → runtime-CdZ1yk7m.js} +3 -3
  292. package/dist/preview/_chunks/{runtime-BhSZ1Mwt.js → runtime-CsO4apr9.js} +38 -42
  293. package/dist/preview/_chunks/{runtime-BUnOhg9h.js → runtime-D2MPrqbU.js} +2 -2
  294. package/dist/preview/_chunks/{runtime-BPwAnlRx.js → runtime-DS0s7U3c.js} +1 -1
  295. package/dist/preview/_chunks/{runtime-BgPhfM5P.js → runtime-U1Ycy25F.js} +736 -428
  296. package/dist/preview/_chunks/{runtime-BJwGQok8.js → runtime-tyJLgv6h.js} +221 -60
  297. package/dist/preview/runtime.js +1 -1
  298. package/dist/preview-api/index.d.ts +3 -3
  299. package/dist/preview-api/index.js +8 -8
  300. package/dist/preview-errors.d.ts +1 -1
  301. package/dist/react/docgen/docgen-worker.js +11 -11
  302. package/dist/react/entry-preview-argtypes.js +1 -1
  303. package/dist/react/entry-preview-docs.js +1 -1
  304. package/dist/react/entry-preview.js +1 -1
  305. package/dist/react/index.d.ts +5 -7
  306. package/dist/react/index.js +5 -5
  307. package/dist/react/preset.js +13 -13
  308. package/dist/react/preview.js +4 -4
  309. package/dist/react-native/bin/get-stories.js +8 -8
  310. package/dist/react-native/index.d.ts +37 -36
  311. package/dist/react-native/index.js +38 -38
  312. package/dist/react-native/metro/node.d.ts +1 -1
  313. package/dist/react-native/metro/node.js +10 -10
  314. package/dist/react-native/metro/withForkbook.d.ts +7 -7
  315. package/dist/react-native/metro/withForkbook.js +16 -16
  316. package/dist/react-native/preview.js +4 -1
  317. package/dist/react-native/scripts/generate.js +8 -8
  318. package/dist/react-native/stub.js +1 -1
  319. package/dist/react-native-ui/index.d.ts +8 -7
  320. package/dist/react-native-ui/index.js +1 -8
  321. package/dist/react-native-ui-common/index.d.ts +30 -9
  322. package/dist/react-native-ui-common/index.js +26 -31
  323. package/dist/react-vite/node/index.js +7 -7
  324. package/dist/react-vite/preset.js +7 -7
  325. package/dist/router/index.d.ts +2 -2
  326. package/dist/router/index.js +4 -2
  327. package/dist/server-errors.d.ts +1 -1
  328. package/dist/server-errors.js +9 -9
  329. package/dist/shared/open-service/index.d.ts +3 -3
  330. package/dist/shared/open-service/index.js +1 -1
  331. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
  332. package/dist/shared/open-service/toolsets/docs/public.d.ts +7 -7
  333. package/dist/telemetry/index.d.ts +38 -274
  334. package/dist/telemetry/index.js +11 -66
  335. package/dist/test/index.d.ts +2 -2
  336. package/dist/test/index.js +139 -120
  337. package/dist/theming/create.d.ts +1 -1
  338. package/dist/theming/index.d.ts +1 -1
  339. package/dist/types/index.d.ts +2 -2
  340. package/dist/types/index.js +2 -2
  341. package/package.json +16 -16
  342. package/template/nextjs-vite/cli/js/Button.jsx +2 -2
  343. package/template/nextjs-vite/cli/js/Header.jsx +1 -1
  344. package/template/nextjs-vite/cli/js/Page.jsx +1 -1
  345. package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
  346. package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
  347. package/template/nextjs-vite/cli/ts/Page.tsx +1 -1
  348. package/template/react/cli/js/Button.jsx +2 -2
  349. package/template/react/cli/js/Header.jsx +1 -1
  350. package/template/react/cli/js/Page.jsx +1 -1
  351. package/template/react/cli/ts/Button.tsx +2 -2
  352. package/template/react/cli/ts/Header.tsx +1 -1
  353. package/template/react/cli/ts/Page.tsx +1 -1
  354. package/template/react-vite/cli/js/Button.jsx +2 -2
  355. package/template/react-vite/cli/js/Header.jsx +1 -1
  356. package/template/react-vite/cli/js/Page.jsx +1 -1
  357. package/template/react-vite/cli/ts/Button.tsx +2 -2
  358. package/template/react-vite/cli/ts/Header.tsx +1 -1
  359. package/template/react-vite/cli/ts/Page.tsx +1 -1
  360. package/dist/_node-chunks/chunk-2YNXKY72.js +0 -40
  361. package/dist/_node-chunks/chunk-3NST2GUZ.js +0 -33
  362. package/dist/_node-chunks/chunk-4D325SMT.js +0 -1359
  363. package/dist/_node-chunks/chunk-APXRPW7A.js +0 -11
  364. package/dist/_node-chunks/chunk-QHBQRPDP.js +0 -155
  365. package/dist/_node-chunks/chunk-SMBAR4G6.js +0 -18
  366. package/dist/_node-chunks/chunk-SRDKK3SG.js +0 -33
  367. package/dist/_node-chunks/chunk-V5IMPC3J.js +0 -33
  368. package/dist/_node-chunks/chunk-YIAUHGY2.js +0 -69
  369. package/dist/_node-chunks/dist-C5QIQD3G.js +0 -27
  370. package/dist/_node-chunks/dist-NBRPZCHX.js +0 -16
  371. package/dist/_node-chunks/optimized-tests-EIPJR7HA.js +0 -22
  372. package/dist/_node-chunks/postinstallAddon-EOAAURMG.js +0 -20
  373. package/dist/_node-chunks/session-id-HEW5JUNB.js +0 -23
  374. package/dist/chunk-BGhyFTJO.d.ts +0 -115
  375. package/dist/chunk-DaVb55-_.d.ts +0 -124
  376. package/dist/manager/_manager-chunks/globals-runtime-Bs75QQ_I.js +0 -9987
  377. package/dist/manager/_manager-chunks/globals-runtime-WZKaeKm9.js +0 -4091
  378. package/dist/manager/_manager-chunks/runtime-5o_11Jae.js +0 -78
  379. package/dist/preview/_chunks/runtime-BsMjBzuq.js +0 -53
  380. package/dist/preview/_chunks/runtime-C1jgT6tJ.js +0 -4091
  381. package/dist/preview/_chunks/runtime-CkOhMcXf.js +0 -387
@@ -1,45 +1,44 @@
1
- import CJS_COMPAT_NODE_URL_i135z88drol from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_i135z88drol from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_i135z88drol from "node:module";
1
+ import CJS_COMPAT_NODE_URL_sfnpbdazcnb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_sfnpbdazcnb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_sfnpbdazcnb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_i135z88drol.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_i135z88drol.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_i135z88drol.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_sfnpbdazcnb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_sfnpbdazcnb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_sfnpbdazcnb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Forkbook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_dist
14
- } from "../_node-chunks/chunk-YBG7HVP7.js";
14
+ } from "../_node-chunks/chunk-LMGI47HP.js";
15
15
  import {
16
16
  BananaSlug
17
- } from "../_node-chunks/chunk-FB2BOL6I.js";
17
+ } from "../_node-chunks/chunk-DIC4T2UO.js";
18
18
  import {
19
19
  fromMarkdown,
20
20
  mdxFromMarkdown,
21
21
  mdxjs
22
- } from "../_node-chunks/chunk-OPT5A55S.js";
22
+ } from "../_node-chunks/chunk-PQXP5FZ2.js";
23
23
  import {
24
24
  withRouteDepth
25
- } from "../_node-chunks/chunk-FUG5LYKS.js";
25
+ } from "../_node-chunks/chunk-E56UKDJR.js";
26
26
  import {
27
27
  debounce
28
- } from "../_node-chunks/chunk-IRPQQARO.js";
28
+ } from "../_node-chunks/chunk-7YLKDHLZ.js";
29
29
  import {
30
30
  require_lib
31
- } from "../_node-chunks/chunk-BKND5XP2.js";
31
+ } from "../_node-chunks/chunk-GQZZQB4K.js";
32
32
  import {
33
33
  Parser,
34
34
  init_acorn,
35
35
  require_acorn_jsx
36
- } from "../_node-chunks/chunk-7IOSIYW2.js";
36
+ } from "../_node-chunks/chunk-KEXQ3BON.js";
37
37
  import {
38
38
  isTelemetryModuleEnabled,
39
39
  telemetry,
40
40
  withSpan
41
- } from "../_node-chunks/chunk-4D325SMT.js";
42
- import "../_node-chunks/chunk-V5IMPC3J.js";
41
+ } from "../_node-chunks/chunk-4CZJ4SFH.js";
43
42
  import {
44
43
  getEffectiveToolAvailability,
45
44
  getManifestStatus,
@@ -49,45 +48,42 @@ import {
49
48
  isClaudePreviewLaunch,
50
49
  isModuleGraphSupported,
51
50
  resolveSkillInputs
52
- } from "../_node-chunks/chunk-W3KFVTWV.js";
51
+ } from "../_node-chunks/chunk-DTNEHO4J.js";
53
52
  import {
54
53
  CLAUDE_PREVIEW_AGENT_NAME
55
- } from "../_node-chunks/chunk-XVOIYGTJ.js";
56
- import "../_node-chunks/chunk-PYVGF5F2.js";
57
- import "../_node-chunks/chunk-2YNXKY72.js";
58
- import "../_node-chunks/chunk-SMBAR4G6.js";
54
+ } from "../_node-chunks/chunk-5A5XOSRM.js";
55
+ import "../_node-chunks/chunk-ADCQYK3Z.js";
56
+ import "../_node-chunks/chunk-LJ5JRR5Q.js";
59
57
  import {
60
58
  detectAgent
61
- } from "../_node-chunks/chunk-IVAOJWPF.js";
62
- import "../_node-chunks/chunk-D5ADPGA4.js";
63
- import "../_node-chunks/chunk-GGCOG7OV.js";
59
+ } from "../_node-chunks/chunk-HJVZQS65.js";
60
+ import "../_node-chunks/chunk-NIOVXWQZ.js";
61
+ import "../_node-chunks/chunk-BFQJF3ID.js";
64
62
  import {
65
63
  userOrAutoTitleFromSpecifier
66
- } from "../_node-chunks/chunk-3IIQSDCO.js";
67
- import "../_node-chunks/chunk-APPFF22V.js";
68
- import "../_node-chunks/chunk-TAMTPVYZ.js";
69
- import "../_node-chunks/chunk-CEYSYQLV.js";
64
+ } from "../_node-chunks/chunk-4B52HLKK.js";
65
+ import "../_node-chunks/chunk-PUBZLLNL.js";
66
+ import "../_node-chunks/chunk-BZQF5KUE.js";
67
+ import "../_node-chunks/chunk-DAEUTT3I.js";
70
68
  import {
71
69
  resolveImport,
72
70
  supportedExtensions
73
- } from "../_node-chunks/chunk-PXOD36TR.js";
74
- import "../_node-chunks/chunk-2U5J7YTA.js";
75
- import "../_node-chunks/chunk-NFDQT7UW.js";
71
+ } from "../_node-chunks/chunk-GLNHSUKT.js";
72
+ import "../_node-chunks/chunk-4YWZLOAF.js";
73
+ import "../_node-chunks/chunk-NAXIA2JI.js";
76
74
  import {
77
75
  require_src
78
- } from "../_node-chunks/chunk-Z2ZTDQDY.js";
79
- import "../_node-chunks/chunk-ZEYODVQT.js";
80
- import "../_node-chunks/chunk-YIAUHGY2.js";
81
- import "../_node-chunks/chunk-5JLVSH44.js";
76
+ } from "../_node-chunks/chunk-NTUTJAD4.js";
77
+ import "../_node-chunks/chunk-3F3673RQ.js";
78
+ import "../_node-chunks/chunk-CEIESR4U.js";
82
79
  import {
83
80
  logger
84
- } from "../_node-chunks/chunk-REIDJUVJ.js";
81
+ } from "../_node-chunks/chunk-M7BVABR2.js";
85
82
  import {
86
83
  ChangeDetectionFailureError,
87
84
  ChangeDetectionUnavailableError,
88
85
  GitDiffProvider,
89
86
  MDX_SERVICE_ID,
90
- analyzeTestResults,
91
87
  applyServicesPresetOnce,
92
88
  createDocsToolset,
93
89
  createLocalDocsAccess,
@@ -98,17 +94,15 @@ import {
98
94
  emptyManifests,
99
95
  findStoryIds,
100
96
  fullStatusStore,
101
- fullTestProviderStore,
102
97
  getBuilders,
103
98
  getChangeDetectionReadiness,
104
- getComponentCandidates,
105
99
  getErrorLevel,
106
100
  getManagerBuilder,
101
+ getOrRecreateStore,
107
102
  getPreviewBuilder,
108
103
  getRefsFromConfig,
109
104
  getStatusStoreByTypeId,
110
105
  getStoryIdsByAbsolutePath,
111
- getTestProviderStoreById,
112
106
  getWsToken,
113
107
  loadManifests,
114
108
  mapStaticDir,
@@ -120,96 +114,92 @@ import {
120
114
  resetServicesPresetOnce,
121
115
  resolveChangeDetectionAdapter,
122
116
  reviewToolset,
123
- runStoryTests,
124
117
  sendTelemetryError,
125
118
  setChangeDetectionHost,
126
119
  setChangeDetectionReadiness,
127
- startTestProviderStore,
128
120
  storyInputArraySchema,
129
- toStoryTestResult,
130
121
  universalStatusStore,
131
- universalTestProviderStore,
132
122
  useStatics,
133
123
  withTelemetry,
134
124
  writeManifests
135
- } from "../_node-chunks/chunk-AVL7GUOZ.js";
125
+ } from "../_node-chunks/chunk-3L2QRDKH.js";
136
126
  import {
137
127
  UniversalStore
138
- } from "../_node-chunks/chunk-LKITAODU.js";
128
+ } from "../_node-chunks/chunk-DPOWAA4P.js";
139
129
  import {
140
130
  buildStoryPathMap,
141
131
  urlPathDepth
142
- } from "../_node-chunks/chunk-SJXLINHV.js";
132
+ } from "../_node-chunks/chunk-S33FEPQ3.js";
143
133
  import {
144
134
  init_build,
145
135
  parse
146
- } from "../_node-chunks/chunk-S3NDLFYL.js";
147
- import "../_node-chunks/chunk-QHBQRPDP.js";
148
- import "../_node-chunks/chunk-2WVLC5M2.js";
136
+ } from "../_node-chunks/chunk-OH5M2YER.js";
137
+ import "../_node-chunks/chunk-26ERGIQH.js";
149
138
  import {
150
139
  registerToolset
151
- } from "../_node-chunks/chunk-XH5CXH53.js";
152
- import "../_node-chunks/chunk-5GOXN5M4.js";
153
- import "../_node-chunks/chunk-GYFR2JLS.js";
154
- import "../_node-chunks/chunk-MI7WBXWX.js";
140
+ } from "../_node-chunks/chunk-O46DZ2KC.js";
141
+ import "../_node-chunks/chunk-BSXI35KM.js";
142
+ import "../_node-chunks/chunk-NDVIMCIX.js";
143
+ import "../_node-chunks/chunk-6DRDJF2Q.js";
155
144
  import {
156
145
  STORY_FILE_TEST_REGEXP,
157
146
  getStoryImportPathFromEntry
158
- } from "../_node-chunks/chunk-BBU2FUPC.js";
147
+ } from "../_node-chunks/chunk-4IIWFG7O.js";
159
148
  import {
160
149
  getService,
161
150
  registerService,
162
151
  writeOpenServiceStaticFiles
163
- } from "../_node-chunks/chunk-GTXZNA2L.js";
152
+ } from "../_node-chunks/chunk-GRN6WQC3.js";
164
153
  import {
165
154
  Channel,
166
155
  describeService,
167
156
  getRegisteredServices,
168
157
  listServices
169
- } from "../_node-chunks/chunk-46Y5H6X5.js";
170
- import "../_node-chunks/chunk-3NST2GUZ.js";
158
+ } from "../_node-chunks/chunk-VJLLEKWR.js";
171
159
  import {
172
160
  isEqual
173
- } from "../_node-chunks/chunk-XCJ2ZIQ4.js";
174
- import "../_node-chunks/chunk-36LPBTLF.js";
175
- import "../_node-chunks/chunk-MXLHIEXC.js";
176
- import "../_node-chunks/chunk-BSQB5B57.js";
161
+ } from "../_node-chunks/chunk-MK2RPLWT.js";
162
+ import "../_node-chunks/chunk-JUVUVVHI.js";
163
+ import "../_node-chunks/chunk-XC7K4QEX.js";
164
+ import "../_node-chunks/chunk-7YQIVUEK.js";
177
165
  import {
178
166
  Tag
179
- } from "../_node-chunks/chunk-RNRGXAFV.js";
180
- import "../_node-chunks/chunk-54EHKXV7.js";
181
- import "../_node-chunks/chunk-NIQSBBT2.js";
167
+ } from "../_node-chunks/chunk-MWQIBOUB.js";
168
+ import "../_node-chunks/chunk-NRP4FGRT.js";
169
+ import "../_node-chunks/chunk-NSNBFXVB.js";
182
170
  import {
183
171
  up2 as up
184
- } from "../_node-chunks/chunk-FTYDKQCO.js";
172
+ } from "../_node-chunks/chunk-OSIENBU6.js";
185
173
  import {
186
174
  invariant
187
- } from "../_node-chunks/chunk-LAIED5XU.js";
175
+ } from "../_node-chunks/chunk-I36FPWMO.js";
188
176
  import {
189
177
  resolvePackageDir,
190
178
  safeResolveModule
191
- } from "../_node-chunks/chunk-TKMXEHM4.js";
192
- import "../_node-chunks/chunk-VZG3OKFO.js";
179
+ } from "../_node-chunks/chunk-UYEX6LW6.js";
180
+ import "../_node-chunks/chunk-33T4HNF2.js";
193
181
  import {
194
182
  StorybookError
195
- } from "../_node-chunks/chunk-32FLWHUC.js";
183
+ } from "../_node-chunks/chunk-F2AFT3P7.js";
196
184
  import {
197
185
  require_picocolors
198
- } from "../_node-chunks/chunk-FEC5PGJO.js";
186
+ } from "../_node-chunks/chunk-SHP6447T.js";
199
187
  import {
200
188
  storyIndexPathToAbsolutePath
201
- } from "../_node-chunks/chunk-ER3X3AQ7.js";
202
- import "../_node-chunks/chunk-ALGQMFMN.js";
189
+ } from "../_node-chunks/chunk-I26RGEVQ.js";
190
+ import "../_node-chunks/chunk-QWZZX2HN.js";
203
191
  import {
204
192
  slash
205
- } from "../_node-chunks/chunk-LHNHFYK3.js";
206
- import "../_node-chunks/chunk-6UASHVMR.js";
207
- import "../_node-chunks/chunk-C5OFHB3N.js";
193
+ } from "../_node-chunks/chunk-MKSEM5C2.js";
194
+ import {
195
+ glob
196
+ } from "../_node-chunks/chunk-HCMHVV7N.js";
197
+ import "../_node-chunks/chunk-DY7F7B6V.js";
208
198
  import {
209
199
  __commonJS,
210
200
  __require,
211
201
  __toESM
212
- } from "../_node-chunks/chunk-WBCKO5LP.js";
202
+ } from "../_node-chunks/chunk-6JSZY5TJ.js";
213
203
 
214
204
  // ../../node_modules/@discoveryjs/json-ext/package.json
215
205
  var require_package = __commonJS({
@@ -1446,7 +1436,7 @@ import {
1446
1436
  resolveAddonName
1447
1437
  } from "@aussieljk/forkbook/internal/common";
1448
1438
  import { logger as logger4 } from "@aussieljk/forkbook/internal/node-logger";
1449
- import { getPrecedingUpgrade, telemetry as telemetry2 } from "@aussieljk/forkbook/internal/telemetry";
1439
+ import { telemetry as telemetry2 } from "@aussieljk/forkbook/internal/telemetry";
1450
1440
 
1451
1441
  // src/shared/global.ts
1452
1442
  var global2 = globalThis;
@@ -1464,7 +1454,7 @@ async function buildOrThrow(callback) {
1464
1454
  let builderErrors = err.errors;
1465
1455
  throw builderErrors && builderErrors.find(
1466
1456
  (er) => er.text?.includes("No matching export")
1467
- ) ? new NoMatchingExportError(err) : err;
1457
+ ) ? new NoMatchingExportError({ error: err }) : err;
1468
1458
  }
1469
1459
  }
1470
1460
 
@@ -1548,8 +1538,8 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
1548
1538
  // files can be e.g. '**/foo/*/*.js' so we just want the last bit,
1549
1539
  // because the directory could already be within the files part (e.g. './x/foo/bar')
1550
1540
  basename(specifier.files)
1551
- ), { glob } = await import("../_node-chunks/dist-C5QIQD3G.js");
1552
- (await glob(slash(dirGlob), {
1541
+ ), { glob: glob2 } = await import("../_node-chunks/dist-CFCU4PZG.js");
1542
+ (await glob2(slash(dirGlob), {
1553
1543
  ...commonGlobOptions(dirGlob),
1554
1544
  expandDirectories: !1
1555
1545
  })).forEach((filePath) => {
@@ -1707,20 +1697,6 @@ async function writeRoutePages(outputDir, index) {
1707
1697
  ), allPaths.length;
1708
1698
  }
1709
1699
 
1710
- // src/core-server/utils/metadata.ts
1711
- import { writeFile as writeFile3 } from "node:fs/promises";
1712
- import { getStorybookMetadata } from "@aussieljk/forkbook/internal/telemetry";
1713
- async function extractStorybookMetadata(outputFile, configDir) {
1714
- let storybookMetadata = await getStorybookMetadata(configDir);
1715
- await writeFile3(outputFile, JSON.stringify(storybookMetadata));
1716
- }
1717
- function useStorybookMetadata(app, configDir) {
1718
- app.use("/project.json", async (req, res) => {
1719
- let storybookMetadata = await getStorybookMetadata(configDir);
1720
- res.setHeader("Content-Type", "application/json"), res.write(JSON.stringify(storybookMetadata)), res.end();
1721
- });
1722
- }
1723
-
1724
1700
  // src/core-server/utils/output-stats.ts
1725
1701
  var import_json_ext = __toESM(require_src2(), 1), import_picocolors2 = __toESM(require_picocolors(), 1);
1726
1702
  import { createWriteStream } from "node:fs";
@@ -1835,7 +1811,7 @@ async function buildStaticStandalone(options) {
1835
1811
  presets.apply("core"),
1836
1812
  presets.apply("staticDirs")
1837
1813
  ]), invokedBy = process.env.FORKBOOK_INVOKED_BY;
1838
- invokedBy && telemetry2("test-run", { runner: invokedBy, watch: !1 }, { configDir: options.configDir });
1814
+ invokedBy && telemetry2("test-run", { runner: invokedBy, watch: !1 });
1839
1815
  let fullOptions = {
1840
1816
  ...options,
1841
1817
  channel,
@@ -1862,8 +1838,6 @@ async function buildStaticStandalone(options) {
1862
1838
  let index = await (await storyIndexGeneratorPromise)?.getIndex();
1863
1839
  index && (await writeRoutePages(options.outputDir, index), await copyThumbnails(options.outputDir, index, process.cwd()));
1864
1840
  })()
1865
- ), core?.disableProjectJson || effects.push(
1866
- extractStorybookMetadata(join6(options.outputDir, "project.json"), options.configDir)
1867
1841
  ), options.debugWebpack && logConfig("Preview webpack config", await previewBuilder.getConfig(fullOptions)), logger4.info("Building preview..");
1868
1842
  let startTime = process.hrtime();
1869
1843
  if (await Promise.all([
@@ -1875,7 +1849,7 @@ async function buildStaticStandalone(options) {
1875
1849
  let statsOption = options.statsJson;
1876
1850
  if (statsOption) {
1877
1851
  let target = statsOption === !0 ? options.outputDir : statsOption;
1878
- await outputStats(target, previewStats);
1852
+ await outputStats(target, previewStats || void 0);
1879
1853
  }
1880
1854
  }).catch((error) => {
1881
1855
  throw logger4.error("Failed to build the preview"), process.exitCode = 1, error;
@@ -1883,12 +1857,8 @@ async function buildStaticStandalone(options) {
1883
1857
  ...effects
1884
1858
  ]), !options.test)
1885
1859
  try {
1886
- let storyIndex = await (await storyIndexGeneratorPromise)?.getIndex(), payload = {
1887
- precedingUpgrade: await getPrecedingUpgrade()
1888
- };
1889
- storyIndex && Object.assign(payload, {
1890
- storyIndex: summarizeIndex(storyIndex)
1891
- }), await telemetry2("build", payload, { configDir: options.configDir });
1860
+ let storyIndex = await (await storyIndexGeneratorPromise)?.getIndex();
1861
+ await telemetry2("build", storyIndex ? { storyIndex: summarizeIndex(storyIndex) } : {});
1892
1862
  } catch (e) {
1893
1863
  logger4.debug?.(`Build telemetry failed: ${e instanceof Error ? e.message : String(e)}`);
1894
1864
  }
@@ -2384,8 +2354,114 @@ var ChangeDetectionService = class {
2384
2354
  }
2385
2355
  };
2386
2356
 
2357
+ // src/shared/test-provider-store/index.ts
2358
+ var UNIVERSAL_TEST_PROVIDER_STORE_OPTIONS = {
2359
+ id: "@aussieljk/forkbook/test-provider",
2360
+ leader: !0,
2361
+ initialState: {}
2362
+ };
2363
+ function createTestProviderStore({
2364
+ universalTestProviderStore: universalTestProviderStore2,
2365
+ useUniversalStore
2366
+ }) {
2367
+ let baseStore = {
2368
+ settingsChanged: () => {
2369
+ universalTestProviderStore2.untilReady().then(() => {
2370
+ universalTestProviderStore2.send({ type: "settings-changed" });
2371
+ });
2372
+ },
2373
+ onRunAll: (listener) => universalTestProviderStore2.subscribe("run-all", listener),
2374
+ onClearAll: (listener) => universalTestProviderStore2.subscribe("clear-all", listener)
2375
+ }, fullTestProviderStore2 = {
2376
+ ...baseStore,
2377
+ getFullState: universalTestProviderStore2.getState,
2378
+ setFullState: universalTestProviderStore2.setState,
2379
+ onSettingsChanged: (listener) => universalTestProviderStore2.subscribe("settings-changed", listener),
2380
+ runAll: async () => {
2381
+ await universalTestProviderStore2.untilReady(), universalTestProviderStore2.send({ type: "run-all" });
2382
+ },
2383
+ clearAll: async () => {
2384
+ await universalTestProviderStore2.untilReady(), universalTestProviderStore2.send({ type: "clear-all" });
2385
+ }
2386
+ }, getTestProviderStoreById2 = (testProviderId) => {
2387
+ let getStateForTestProvider = () => universalTestProviderStore2.getState()[testProviderId] ?? "test-provider-state:pending", setStateForTestProvider = (state) => {
2388
+ universalTestProviderStore2.untilReady().then(() => {
2389
+ universalTestProviderStore2.setState((currentState) => ({
2390
+ ...currentState,
2391
+ [testProviderId]: state
2392
+ }));
2393
+ });
2394
+ };
2395
+ return {
2396
+ ...baseStore,
2397
+ testProviderId,
2398
+ getState: getStateForTestProvider,
2399
+ setState: setStateForTestProvider,
2400
+ runWithState: async (callback) => {
2401
+ setStateForTestProvider("test-provider-state:running");
2402
+ try {
2403
+ await callback(), setStateForTestProvider("test-provider-state:succeeded");
2404
+ } catch {
2405
+ setStateForTestProvider("test-provider-state:crashed");
2406
+ }
2407
+ }
2408
+ };
2409
+ };
2410
+ return useUniversalStore ? {
2411
+ getTestProviderStoreById: getTestProviderStoreById2,
2412
+ fullTestProviderStore: fullTestProviderStore2,
2413
+ universalTestProviderStore: universalTestProviderStore2,
2414
+ useTestProviderStore: (selector) => (
2415
+ // The hook also runs without a selector and then returns the whole state.
2416
+ useUniversalStore(
2417
+ universalTestProviderStore2,
2418
+ selector
2419
+ )[0]
2420
+ )
2421
+ } : {
2422
+ getTestProviderStoreById: getTestProviderStoreById2,
2423
+ fullTestProviderStore: fullTestProviderStore2,
2424
+ universalTestProviderStore: universalTestProviderStore2
2425
+ };
2426
+ }
2427
+
2428
+ // src/core-server/stores/test-provider.ts
2429
+ function createServerTestProviderStore(leader) {
2430
+ return createTestProviderStore({
2431
+ universalTestProviderStore: UniversalStore.create({
2432
+ ...UNIVERSAL_TEST_PROVIDER_STORE_OPTIONS,
2433
+ leader
2434
+ })
2435
+ });
2436
+ }
2437
+ var cache = {};
2438
+ function getTestProviderStoreBundle() {
2439
+ return getOrRecreateStore(
2440
+ UNIVERSAL_TEST_PROVIDER_STORE_OPTIONS.id,
2441
+ cache,
2442
+ createServerTestProviderStore
2443
+ );
2444
+ }
2445
+ function startTestProviderStore() {
2446
+ getTestProviderStoreBundle();
2447
+ }
2448
+ var getTestProviderStoreById = (id) => getTestProviderStoreBundle().getTestProviderStoreById(id), fullTestProviderStore = new Proxy(
2449
+ {},
2450
+ {
2451
+ get(_target, prop) {
2452
+ let store = getTestProviderStoreBundle().fullTestProviderStore, value = Reflect.get(store, prop, store);
2453
+ return typeof value == "function" ? value.bind(store) : value;
2454
+ }
2455
+ }
2456
+ ), universalTestProviderStore = new Proxy({}, {
2457
+ get(_target, prop) {
2458
+ let store = getTestProviderStoreBundle().universalTestProviderStore, value = Reflect.get(store, prop, store);
2459
+ return typeof value == "function" ? value.bind(store) : value;
2460
+ }
2461
+ });
2462
+
2387
2463
  // src/core-server/utils/doTelemetry.ts
2388
- import { getPrecedingUpgrade as getPrecedingUpgrade2, telemetry as telemetry3 } from "@aussieljk/forkbook/internal/telemetry";
2464
+ import { telemetry as telemetry3 } from "@aussieljk/forkbook/internal/telemetry";
2389
2465
 
2390
2466
  // src/core-server/utils/versionStatus.ts
2391
2467
  var versionStatus = (versionCheck) => versionCheck.error ? "error" : versionCheck.cached ? "cached" : "success";
@@ -2396,26 +2472,14 @@ async function doTelemetry(app, core, storyIndexGeneratorPromise, options) {
2396
2472
  invariant(
2397
2473
  !versionUpdates || versionUpdates && versionCheck,
2398
2474
  "versionCheck should be defined when versionUpdates is true"
2399
- ), telemetry3(
2400
- "dev",
2401
- async () => {
2402
- let generator = await storyIndexGeneratorPromise, indexAndStats;
2403
- try {
2404
- indexAndStats = await generator?.getIndexAndStats();
2405
- } catch (err) {
2406
- return { error: err instanceof Error ? err : new Error("encountered a non-recoverable error") };
2407
- }
2408
- let payload = {
2409
- precedingUpgrade: await getPrecedingUpgrade2()
2410
- };
2411
- return indexAndStats && Object.assign(payload, {
2412
- versionStatus: versionUpdates && versionCheck ? versionStatus(versionCheck) : "disabled",
2413
- storyIndex: summarizeIndex(indexAndStats.storyIndex),
2414
- storyStats: indexAndStats.stats
2415
- }), payload;
2416
- },
2417
- { configDir: options.configDir }
2418
- );
2475
+ ), telemetry3("dev", async () => {
2476
+ let indexAndStats = await (await storyIndexGeneratorPromise)?.getIndexAndStats();
2477
+ return indexAndStats ? {
2478
+ versionStatus: versionUpdates && versionCheck ? versionStatus(versionCheck) : "disabled",
2479
+ storyIndex: summarizeIndex(indexAndStats.storyIndex),
2480
+ storyStats: indexAndStats.stats
2481
+ } : {};
2482
+ });
2419
2483
  }
2420
2484
 
2421
2485
  // src/core-server/utils/get-caching-middleware.ts
@@ -2462,11 +2526,11 @@ function isHostAllowedInternal(hostHeader, allowedHosts) {
2462
2526
  if (allowedHost === hostname || allowedHost[0] === "." && (allowedHost.slice(1) === hostname || hostname.endsWith(allowedHost))) return !0;
2463
2527
  return !1;
2464
2528
  }
2465
- var cache = /* @__PURE__ */ new WeakMap();
2529
+ var cache2 = /* @__PURE__ */ new WeakMap();
2466
2530
  function isHostAllowed(hostHeader, allowedHosts) {
2467
2531
  if (hostHeader === void 0) return !0;
2468
2532
  let cachedAllowedHosts;
2469
- if (Object.isFrozen(allowedHosts) && (cache.has(allowedHosts) || cache.set(allowedHosts, /* @__PURE__ */ new Set()), cachedAllowedHosts = cache.get(allowedHosts), cachedAllowedHosts.has(hostHeader)))
2533
+ if (Object.isFrozen(allowedHosts) && (cache2.has(allowedHosts) || cache2.set(allowedHosts, /* @__PURE__ */ new Set()), cachedAllowedHosts = cache2.get(allowedHosts), cachedAllowedHosts.has(hostHeader)))
2470
2534
  return !0;
2471
2535
  let result = isHostAllowedInternal(hostHeader, allowedHosts);
2472
2536
  return cachedAllowedHosts && result && cachedAllowedHosts.add(hostHeader), result;
@@ -2783,7 +2847,7 @@ async function storybookDevServer(options, server) {
2783
2847
  getManagerBuilder(),
2784
2848
  useStatics(app, options)
2785
2849
  ]);
2786
- options.debugWebpack && logConfig2("Preview webpack config", await previewBuilder.getConfig(options)), core?.disableProjectJson || useStorybookMetadata(app, options.configDir);
2850
+ options.debugWebpack && logConfig2("Preview webpack config", await previewBuilder.getConfig(options));
2787
2851
  let managerResult = options.previewOnly ? void 0 : await withSpan(
2788
2852
  "forkbook.manager-start",
2789
2853
  {},
@@ -2848,7 +2912,7 @@ async function storybookDevServer(options, server) {
2848
2912
  });
2849
2913
  } catch {
2850
2914
  }
2851
- await telemetry("canceled", payload, { immediate: !0 });
2915
+ await telemetry("canceled", payload);
2852
2916
  } finally {
2853
2917
  await disposeChangeDetectionRuntime(), process.exit(0);
2854
2918
  }
@@ -3056,7 +3120,7 @@ function prepareHeadlessUniversalStores() {
3056
3120
  }
3057
3121
 
3058
3122
  // src/core-server/utils/host-validation-warning.ts
3059
- import { cache as cache2, isCI } from "@aussieljk/forkbook/internal/common";
3123
+ import { cache as cache3, isCI } from "@aussieljk/forkbook/internal/common";
3060
3124
  import { logger as logger12, prompt } from "@aussieljk/forkbook/internal/node-logger";
3061
3125
  import { dedent as dedent2 } from "ts-dedent";
3062
3126
  var DOCS_URL = "https://forkbook.ljk.dev/docs/api/main-config/main-config-core#allowedhosts", getHostValidationWarning = ({
@@ -3092,7 +3156,7 @@ async function warnOnDisabledHostValidation(options) {
3092
3156
  if (!warning || (logger12.warn(warning.message), options.ci || options.smokeTest || !isInteractiveTerminal()))
3093
3157
  return;
3094
3158
  let skipPromptKey = `host-validation-prompt-skipped-${warning.id}-${options.cacheKey}`;
3095
- if (await cache2.get(skipPromptKey).catch(() => !1))
3159
+ if (await cache3.get(skipPromptKey).catch(() => !1))
3096
3160
  return;
3097
3161
  let choice = await prompt.select({
3098
3162
  message: "How do you want to proceed?",
@@ -3111,7 +3175,7 @@ async function warnOnDisabledHostValidation(options) {
3111
3175
  ],
3112
3176
  initialValue: "continue"
3113
3177
  });
3114
- choice === "abort" && process.exit(1), choice === "dont-ask" && await cache2.set(skipPromptKey, !0).catch(() => {
3178
+ choice === "abort" && process.exit(1), choice === "dont-ask" && await cache3.set(skipPromptKey, !0).catch(() => {
3115
3179
  });
3116
3180
  }
3117
3181
 
@@ -3122,43 +3186,44 @@ import { dedent as dedent4 } from "ts-dedent";
3122
3186
 
3123
3187
  // src/core-server/utils/update-check.ts
3124
3188
  var import_picocolors5 = __toESM(require_picocolors(), 1);
3125
- import { cache as cache3 } from "@aussieljk/forkbook/internal/common";
3189
+ import { cache as cache4 } from "@aussieljk/forkbook/internal/common";
3126
3190
  import { colors } from "@aussieljk/forkbook/internal/node-logger";
3127
3191
  import semver from "semver";
3128
3192
  import { dedent as dedent3 } from "ts-dedent";
3129
3193
  var { FORKBOOK_VERSION_BASE = "https://forkbook.ljk.dev", CI } = process.env, updateCheck = async (version) => {
3130
3194
  let result, time = Date.now();
3131
3195
  try {
3132
- let fromCache = await cache3.get("lastUpdateCheck", { success: !1, time: 0 });
3196
+ let fromCache = await cache4.get("lastUpdateCheck", { success: !1, time: 0 });
3133
3197
  time - 864e5 > fromCache.time && !CI ? (result = { success: !0, cached: !1, data: await (await Promise.race([
3134
3198
  fetch(`${FORKBOOK_VERSION_BASE}/versions.json?current=${version}`),
3135
3199
  // if fetch is too slow, we won't wait for it
3136
3200
  new Promise((res, rej) => global.setTimeout(rej, 1500))
3137
- ])).json(), time }, await cache3.set("lastUpdateCheck", result)) : result = { ...fromCache, cached: !0 };
3201
+ ])).json(), time }, await cache4.set("lastUpdateCheck", result)) : result = { ...fromCache, cached: !0 };
3138
3202
  } catch (error) {
3139
3203
  result = { success: !1, cached: !1, error, time };
3140
3204
  }
3141
3205
  return result;
3142
3206
  };
3143
3207
  function createUpdateMessage(updateInfo, version) {
3144
- let updateMessage;
3208
+ let latestVersion = updateInfo.data?.latest?.version;
3209
+ if (!updateInfo.success || !latestVersion)
3210
+ return "";
3145
3211
  try {
3146
- let upgradeCommand = `npx @aussieljk/forkbook@${semver.prerelease(updateInfo.data.latest.version) ? "next" : "latest"} upgrade`;
3147
- updateMessage = updateInfo.success && semver.lt(version, updateInfo.data.latest.version) ? dedent3`
3148
- ${colors.orange(
3149
- `A new version (${import_picocolors5.default.bold(updateInfo.data.latest.version)}) is available!`
3150
- )}
3212
+ if (!semver.lt(version, latestVersion))
3213
+ return "";
3214
+ let upgradeCommand = `npx @aussieljk/forkbook@${semver.prerelease(latestVersion) ? "next" : "latest"} upgrade`;
3215
+ return dedent3`
3216
+ ${colors.orange(`A new version (${import_picocolors5.default.bold(latestVersion)}) is available!`)}
3151
3217
 
3152
- ${import_picocolors5.default.gray("Upgrade now:")} ${colors.green(upgradeCommand)}
3218
+ ${import_picocolors5.default.gray("Upgrade now:")} ${colors.green(upgradeCommand)}
3153
3219
 
3154
- ${import_picocolors5.default.gray("Read full changelog:")} ${import_picocolors5.default.gray(
3220
+ ${import_picocolors5.default.gray("Read full changelog:")} ${import_picocolors5.default.gray(
3155
3221
  import_picocolors5.default.underline("https://github.com/aussieljk/forkbook/commits/master")
3156
3222
  )}
3157
- ` : "";
3223
+ `;
3158
3224
  } catch {
3159
- updateMessage = "";
3225
+ return "";
3160
3226
  }
3161
- return updateMessage;
3162
3227
  }
3163
3228
 
3164
3229
  // src/core-server/utils/output-startup-information.ts
@@ -3205,7 +3270,7 @@ ${updateMessage}` : ""}
3205
3270
  import { execFile } from "node:child_process";
3206
3271
  import { randomUUID } from "node:crypto";
3207
3272
  import { existsSync as existsSync2, rmSync } from "node:fs";
3208
- import { chmod, mkdir as mkdir4, readFile as readFile3, readdir, rename, rm as rm2, stat, writeFile as writeFile4 } from "node:fs/promises";
3273
+ import { chmod, mkdir as mkdir4, readFile as readFile3, readdir, rename, rm as rm2, stat, writeFile as writeFile3 } from "node:fs/promises";
3209
3274
  import { homedir, userInfo } from "node:os";
3210
3275
  import { findStorybookPackageRoot, normalizeAddonName } from "@aussieljk/forkbook/internal/common";
3211
3276
  import { join as join9, resolve as resolve6 } from "pathe";
@@ -3289,7 +3354,7 @@ async function writeRuntimeInstanceRecord(record, registryDir = getDefaultRuntim
3289
3354
  `${record.instanceId}.${record.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`
3290
3355
  );
3291
3356
  try {
3292
- await writeFile4(tempPath, `${JSON.stringify(record, null, 2)}
3357
+ await writeFile3(tempPath, `${JSON.stringify(record, null, 2)}
3293
3358
  `, {
3294
3359
  encoding: "utf-8",
3295
3360
  mode: RECORD_FILE_MODE
@@ -3610,7 +3675,7 @@ async function buildDevStandalone(options) {
3610
3675
  }
3611
3676
 
3612
3677
  // src/core-server/build-index.ts
3613
- import { writeFile as writeFile5 } from "node:fs/promises";
3678
+ import { writeFile as writeFile4 } from "node:fs/promises";
3614
3679
  import { normalizeStories as normalizeStories2 } from "@aussieljk/forkbook/internal/common";
3615
3680
  import { logger as logger17 } from "@aussieljk/forkbook/internal/node-logger";
3616
3681
 
@@ -3959,7 +4024,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
3959
4024
  let cacheKey = this.getFindMatchingFilesCacheKey(specifier, workingDir, ignoreWarnings), cached = this.findMatchingFilesCache.get(cacheKey);
3960
4025
  if (cached)
3961
4026
  return cached;
3962
- let pathToSubIndex = {}, globCwd = slash(resolve9(workingDir, specifier.directory)), globPattern = specifier.files.startsWith("!") ? `./${specifier.files}` : specifier.files, { glob } = await import("../_node-chunks/dist-C5QIQD3G.js"), files = await glob(globPattern, {
4027
+ let pathToSubIndex = {}, globCwd = slash(resolve9(workingDir, specifier.directory)), globPattern = specifier.files.startsWith("!") ? `./${specifier.files}` : specifier.files, { glob: glob2 } = await import("../_node-chunks/dist-CFCU4PZG.js"), files = await glob2(globPattern, {
3963
4028
  absolute: !0,
3964
4029
  expandDirectories: !1,
3965
4030
  cwd: globCwd,
@@ -3997,7 +4062,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
3997
4062
  this.specifiers,
3998
4063
  this.options.workingDir
3999
4064
  )).forEach(
4000
- ([specifier, cache4]) => this.specifierToCache.set(specifier, cache4)
4065
+ ([specifier, cache5]) => this.specifierToCache.set(specifier, cache5)
4001
4066
  );
4002
4067
  let previewCode = await this.getPreviewCode(), projectTags = this.getProjectTags(previewCode);
4003
4068
  await this.ensureExtracted({ projectTags });
@@ -4046,13 +4111,13 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4046
4111
  );
4047
4112
  let statsSummary = {};
4048
4113
  return { entries: this.specifiers.flatMap((specifier) => {
4049
- let cache4 = this.specifierToCache.get(specifier);
4114
+ let cache5 = this.specifierToCache.get(specifier);
4050
4115
  return invariant(
4051
- cache4,
4116
+ cache5,
4052
4117
  `specifier does not have a matching cache entry in specifierToCache: ${JSON.stringify(
4053
4118
  specifier
4054
4119
  )}`
4055
- ), Object.values(cache4).flatMap((entry) => entry ? entry.type === "docs" ? [entry] : entry.type === "error" ? [entry] : entry.entries.map((item) => {
4120
+ ), Object.values(cache5).flatMap((entry) => entry ? entry.type === "docs" ? [entry] : entry.type === "error" ? [entry] : entry.entries.map((item) => {
4056
4121
  if (item.type === "docs")
4057
4122
  return item;
4058
4123
  isExampleStoryId2(item.id) || addStats(item.extra.stats, statsSummary);
@@ -4063,7 +4128,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4063
4128
  }
4064
4129
  findDependencies(absoluteImports) {
4065
4130
  return [...this.specifierToCache.values()].flatMap(
4066
- (cache4) => Object.entries(cache4).filter(([fileName, cacheEntry]) => !cacheEntry || cacheEntry.type !== "stories" ? !1 : !!absoluteImports.find(
4131
+ (cache5) => Object.entries(cache5).filter(([fileName, cacheEntry]) => !cacheEntry || cacheEntry.type !== "stories" ? !1 : !!absoluteImports.find(
4067
4132
  (storyImport) => fileName.match(
4068
4133
  new RegExp(`^${storyImport.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\.[^.]+)?$`)
4069
4134
  )
@@ -4302,9 +4367,9 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4302
4367
  }
4303
4368
  }
4304
4369
  invalidateAll() {
4305
- this.specifierToCache.forEach((cache4) => {
4306
- Object.keys(cache4).forEach((key) => {
4307
- cache4[key] = !1;
4370
+ this.specifierToCache.forEach((cache5) => {
4371
+ Object.keys(cache5).forEach((key) => {
4372
+ cache5[key] = !1;
4308
4373
  });
4309
4374
  }), this.lastIndex = null, this.lastError = null, this.invalidationListeners.forEach((listener) => listener());
4310
4375
  }
@@ -4314,14 +4379,14 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4314
4379
  );
4315
4380
  if (!specifier)
4316
4381
  return;
4317
- let cache4 = this.specifierToCache.get(specifier);
4382
+ let cache5 = this.specifierToCache.get(specifier);
4318
4383
  invariant(
4319
- cache4,
4384
+ cache5,
4320
4385
  `specifier does not have a matching cache entry in specifierToCache: ${JSON.stringify(
4321
4386
  specifier
4322
4387
  )}`
4323
4388
  );
4324
- let cacheEntry = cache4[absolutePath];
4389
+ let cacheEntry = cache5[absolutePath];
4325
4390
  if (cacheEntry && cacheEntry.type === "stories") {
4326
4391
  let { dependents } = cacheEntry, invalidated = /* @__PURE__ */ new Set();
4327
4392
  this.specifierToCache.forEach((otherCache) => {
@@ -4339,9 +4404,9 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4339
4404
  (dep) => dep.dependents.splice(dep.dependents.indexOf(absolutePath), 1)
4340
4405
  );
4341
4406
  }
4342
- delete cache4[absolutePath];
4407
+ delete cache5[absolutePath];
4343
4408
  } else
4344
- cache4[absolutePath] = !1;
4409
+ cache5[absolutePath] = !1;
4345
4410
  this.lastIndex = null, this.lastError = null, this.invalidationListeners.forEach((listener) => listener());
4346
4411
  }
4347
4412
  onInvalidated(listener) {
@@ -4408,7 +4473,7 @@ var buildIndex = async (options) => {
4408
4473
  return await generator.initialize(), generator.getIndex();
4409
4474
  }, buildIndexStandalone = async (options) => {
4410
4475
  let index = await buildIndex(options);
4411
- logger17.info(`Writing index to ${options.outputFile}`), await writeFile5(options.outputFile, JSON.stringify(index));
4476
+ logger17.info(`Writing index to ${options.outputFile}`), await writeFile4(options.outputFile, JSON.stringify(index));
4412
4477
  };
4413
4478
 
4414
4479
  // src/core-server/standalone.ts
@@ -4447,7 +4512,7 @@ var getStoriesPathsFromConfig = async ({
4447
4512
  workingDir,
4448
4513
  !0
4449
4514
  )).flatMap(
4450
- ([specifier, cache4]) => StoryIndexGenerator.storyFileNames(/* @__PURE__ */ new Map([[specifier, cache4]]))
4515
+ ([specifier, cache5]) => StoryIndexGenerator.storyFileNames(/* @__PURE__ */ new Map([[specifier, cache5]]))
4451
4516
  );
4452
4517
  };
4453
4518
 
@@ -4489,6 +4554,7 @@ var MockUniversalStore = class _MockUniversalStore extends UniversalStore {
4489
4554
  ), UniversalStore.isInternalConstructing = !1, typeof testUtils?.fn == "function" && (this.testUtils = testUtils, this.getState = testUtils.fn(this.getState), this.setState = testUtils.fn(this.setState), this.subscribe = testUtils.fn(this.subscribe), this.onStateChange = testUtils.fn(this.onStateChange), this.send = testUtils.fn(this.send));
4490
4555
  }
4491
4556
  /** Create a mock universal store. This is just an alias for the constructor */
4557
+ // `State = any`: as in `UniversalStore.create`, a store made without a state type takes any state.
4492
4558
  static create(options, testUtils) {
4493
4559
  return new _MockUniversalStore(options, testUtils);
4494
4560
  }
@@ -4507,6 +4573,481 @@ var MockUniversalStore = class _MockUniversalStore extends UniversalStore {
4507
4573
  this.subscribe.mock?.results.forEach(callReturnedUnsubscribeFn), this.onStateChange.mock?.results.forEach(callReturnedUnsubscribeFn);
4508
4574
  }
4509
4575
  };
4576
+
4577
+ // src/core-server/utils/ghost-stories/get-candidates.ts
4578
+ import { readFile as readFile7 } from "node:fs/promises";
4579
+ import { babelParse, traverse } from "@aussieljk/forkbook/internal/babel";
4580
+
4581
+ // src/core-server/utils/ghost-stories/component-analyzer.ts
4582
+ var COMPLEXITY_CONFIG = {
4583
+ /** Weight applied to non-empty lines */
4584
+ locWeight: 1,
4585
+ /** Imports can be cheap, so they get a lower weight */
4586
+ importWeight: 0.5,
4587
+ /**
4588
+ * Defines what raw complexity value should map to the upper bound of a "simple" file For instance
4589
+ * 30 LOC + 4 imports = 32. This would result in a score of 0.3
4590
+ */
4591
+ simpleBaseline: 32,
4592
+ simpleScore: 0.3
4593
+ }, getComponentComplexity = (fileContent) => {
4594
+ let lines = fileContent.split(`
4595
+ `), nonEmptyLines = lines.filter((line) => line.trim() !== "").length, importCount = lines.filter((line) => line.trim().startsWith("import")).length, normalizedScore = (nonEmptyLines * COMPLEXITY_CONFIG.locWeight + importCount * COMPLEXITY_CONFIG.importWeight) / (COMPLEXITY_CONFIG.simpleBaseline / COMPLEXITY_CONFIG.simpleScore);
4596
+ return Math.min(normalizedScore, 1);
4597
+ };
4598
+
4599
+ // src/core-server/utils/ghost-stories/get-candidates.ts
4600
+ function isValidCandidate(source) {
4601
+ let ast = babelParse(source), hasJSX = !1, hasExport = !1;
4602
+ return traverse(ast, {
4603
+ JSXElement(path) {
4604
+ hasJSX = !0, hasExport && path.stop();
4605
+ },
4606
+ JSXFragment(path) {
4607
+ hasJSX = !0, hasExport && path.stop();
4608
+ },
4609
+ ExportNamedDeclaration(path) {
4610
+ hasExport = !0, hasJSX && path.stop();
4611
+ },
4612
+ ExportDefaultDeclaration(path) {
4613
+ hasExport = !0, hasJSX && path.stop();
4614
+ },
4615
+ ExportAllDeclaration(path) {
4616
+ hasExport = !0, hasJSX && path.stop();
4617
+ }
4618
+ }), hasJSX && hasExport;
4619
+ }
4620
+ async function getCandidatesForStorybook(files, sampleCount) {
4621
+ let simpleCandidates = [], analyzedCandidates = [];
4622
+ for (let file of files) {
4623
+ let source;
4624
+ try {
4625
+ if (source = await readFile7(file, "utf-8"), !isValidCandidate(source))
4626
+ continue;
4627
+ } catch {
4628
+ continue;
4629
+ }
4630
+ let complexity = getComponentComplexity(source);
4631
+ if (analyzedCandidates.push({ file, complexity }), complexity < 0.3 && (simpleCandidates.push({ file, complexity }), simpleCandidates.length >= sampleCount))
4632
+ break;
4633
+ }
4634
+ let selectedCandidates = [];
4635
+ simpleCandidates.length >= sampleCount ? selectedCandidates = simpleCandidates.sort((a, b) => a.complexity - b.complexity).slice(0, sampleCount) : selectedCandidates = analyzedCandidates.sort((a, b) => a.complexity - b.complexity).slice(0, sampleCount);
4636
+ let avgComplexity = selectedCandidates.length > 0 ? Number(
4637
+ (selectedCandidates.reduce((acc, curr) => acc + curr.complexity, 0) / selectedCandidates.length).toFixed(2)
4638
+ ) : 0;
4639
+ return {
4640
+ candidates: selectedCandidates.map(({ file }) => file),
4641
+ analyzedCount: analyzedCandidates.length,
4642
+ avgComplexity
4643
+ };
4644
+ }
4645
+ async function getComponentCandidates({
4646
+ sampleSize = 20,
4647
+ globPattern = "**/*.{tsx,jsx}",
4648
+ cwd = process.cwd()
4649
+ } = {}) {
4650
+ let globMatchCount = 0;
4651
+ try {
4652
+ let files = [];
4653
+ if (files = await glob(globPattern, {
4654
+ cwd,
4655
+ absolute: !0,
4656
+ expandDirectories: !1,
4657
+ ignore: [
4658
+ "**/node_modules/**",
4659
+ "**/.git/**",
4660
+ "**/dist/**",
4661
+ "**/__mocks__/**",
4662
+ "**/build/**",
4663
+ "**/forkbook-static/**",
4664
+ "**/*.test.*",
4665
+ "**/*.d.*",
4666
+ "**/*.config.*",
4667
+ "**/*.spec.*",
4668
+ "**/*.stories.*",
4669
+ // skip example story files that come from the CLI
4670
+ "**/stories/{Button,Header,Page}.*",
4671
+ "**/stories/{button,header,page}.*"
4672
+ ]
4673
+ }), globMatchCount = files.length, globMatchCount === 0)
4674
+ return {
4675
+ candidates: [],
4676
+ globMatchCount
4677
+ };
4678
+ let { analyzedCount, avgComplexity, candidates } = await getCandidatesForStorybook(
4679
+ files,
4680
+ sampleSize
4681
+ );
4682
+ return {
4683
+ analyzedCount,
4684
+ avgComplexity,
4685
+ candidates,
4686
+ globMatchCount
4687
+ };
4688
+ } catch {
4689
+ return {
4690
+ candidates: [],
4691
+ error: "Failed to find candidates",
4692
+ globMatchCount
4693
+ };
4694
+ }
4695
+ }
4696
+
4697
+ // src/core-server/utils/ghost-stories/run-story-tests.ts
4698
+ import { existsSync as existsSync4 } from "node:fs";
4699
+ import { mkdir as mkdir5, readFile as readFile8 } from "node:fs/promises";
4700
+ import { executeCommand, resolvePathInStorybookCache as resolvePathInStorybookCache3 } from "@aussieljk/forkbook/internal/common";
4701
+ import { join as join13 } from "pathe";
4702
+
4703
+ // src/shared/utils/ecosystem-identifier.ts
4704
+ var STYLING_PACKAGES = [
4705
+ "postcss",
4706
+ "tailwindcss",
4707
+ "autoprefixer",
4708
+ "sass",
4709
+ "less",
4710
+ "styled-components",
4711
+ "@stylexjs/*",
4712
+ "bootstrap",
4713
+ "goober",
4714
+ "stylus",
4715
+ "jss",
4716
+ "linaria",
4717
+ "bulma",
4718
+ "aphrodite",
4719
+ "semantic-ui",
4720
+ "foundation-sites",
4721
+ "fela"
4722
+ ], STATE_MANAGEMENT_PACKAGES = [
4723
+ "*redux*",
4724
+ "@reduxjs/*",
4725
+ "zustand",
4726
+ "jotai",
4727
+ "recoil",
4728
+ "mobx*",
4729
+ "valtio",
4730
+ "xstate",
4731
+ "@xstate/*",
4732
+ "effector",
4733
+ "effector-react",
4734
+ "easy-peasy"
4735
+ ];
4736
+ var I18N_PACKAGES = ["*i18n*", "*intl", "@lingui/*"], ROUTER_PACKAGES = [
4737
+ "react-router",
4738
+ "react-router-dom",
4739
+ "react-easy-router",
4740
+ "@remix-run/router",
4741
+ "expo-router",
4742
+ "@tanstack/*-router",
4743
+ "wouter",
4744
+ "@reach/router"
4745
+ ];
4746
+ function globToRegex(pattern) {
4747
+ let regexPattern = pattern.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
4748
+ return new RegExp(`^${regexPattern}$`);
4749
+ }
4750
+ function matchesPackagePattern(dependencyName, patterns) {
4751
+ return patterns.some((pattern) => globToRegex(pattern).test(dependencyName));
4752
+ }
4753
+ function isStateManagementPackage(dependencyName) {
4754
+ return matchesPackagePattern(dependencyName, STATE_MANAGEMENT_PACKAGES);
4755
+ }
4756
+ function isStylingPackage(dependencyName) {
4757
+ return matchesPackagePattern(dependencyName, STYLING_PACKAGES);
4758
+ }
4759
+ function isRouterPackage(dependencyName) {
4760
+ return matchesPackagePattern(dependencyName, ROUTER_PACKAGES);
4761
+ }
4762
+ function isI18nPackage(dependencyName) {
4763
+ return matchesPackagePattern(dependencyName, I18N_PACKAGES);
4764
+ }
4765
+
4766
+ // src/shared/utils/categorize-render-errors.ts
4767
+ var ERROR_CATEGORIES = {
4768
+ MISSING_PROVIDER: "MISSING_PROVIDER",
4769
+ MISSING_STATE_PROVIDER: "MISSING_STATE_PROVIDER",
4770
+ MISSING_ROUTER_PROVIDER: "MISSING_ROUTER_PROVIDER",
4771
+ MISSING_THEME_PROVIDER: "MISSING_THEME_PROVIDER",
4772
+ MISSING_TRANSLATION_PROVIDER: "MISSING_TRANSLATION_PROVIDER",
4773
+ MISSING_PORTAL_ROOT: "MISSING_PORTAL_ROOT",
4774
+ HOOK_USAGE_ERROR: "HOOK_USAGE_ERROR",
4775
+ MODULE_IMPORT_ERROR: "MODULE_IMPORT_ERROR",
4776
+ COMPONENT_RENDER_ERROR: "COMPONENT_RENDER_ERROR",
4777
+ SERVER_COMPONENTS_ERROR: "SERVER_COMPONENTS_ERROR",
4778
+ UNKNOWN_ERROR: "UNKNOWN_ERROR",
4779
+ // Vite related errors
4780
+ DYNAMIC_MODULE_IMPORT_ERROR: "DYNAMIC_MODULE_IMPORT_ERROR",
4781
+ // Vitest test run related errors
4782
+ TEST_FILE_IMPORT_ERROR: "TEST_FILE_IMPORT_ERROR"
4783
+ };
4784
+ function buildErrorContext(message, stack) {
4785
+ let normalizedMessage = message.toLowerCase(), normalizedStack = (stack ?? "").toLowerCase(), stackDeps = /* @__PURE__ */ new Set(), stackLines = normalizedStack.split(`
4786
+ `).filter(Boolean);
4787
+ for (let line of stackLines) {
4788
+ let depMatch = line.match(/\/deps\/([^:]+)\.js/);
4789
+ depMatch && stackDeps.add(depMatch[1]);
4790
+ }
4791
+ return {
4792
+ message,
4793
+ stack,
4794
+ normalizedMessage,
4795
+ normalizedStack,
4796
+ stackDeps
4797
+ };
4798
+ }
4799
+ var CATEGORIZATION_RULES = [
4800
+ {
4801
+ category: ERROR_CATEGORIES.MODULE_IMPORT_ERROR,
4802
+ priority: 100,
4803
+ match: (ctx) => ctx.normalizedMessage.includes("cannot find module") || ctx.normalizedMessage.includes("module not found") || ctx.normalizedMessage.includes("cannot resolve module")
4804
+ },
4805
+ {
4806
+ category: ERROR_CATEGORIES.TEST_FILE_IMPORT_ERROR,
4807
+ priority: 95,
4808
+ match: (ctx) => ctx.normalizedMessage.includes("failed to import test file")
4809
+ },
4810
+ {
4811
+ category: ERROR_CATEGORIES.DYNAMIC_MODULE_IMPORT_ERROR,
4812
+ priority: 95,
4813
+ match: (ctx) => ctx.normalizedMessage.includes("failed to fetch dynamically imported module")
4814
+ },
4815
+ {
4816
+ category: ERROR_CATEGORIES.HOOK_USAGE_ERROR,
4817
+ priority: 90,
4818
+ match: (ctx) => ctx.normalizedMessage.includes("invalid hook call") || ctx.normalizedMessage.includes("rendered more hooks") || ctx.normalizedMessage.includes("hooks can only be called") || ctx.normalizedMessage.includes("too many re-renders") || ctx.normalizedMessage.includes("maximum update depth exceeded") || ctx.normalizedMessage.includes("hook") && ctx.normalizedMessage.includes("function component")
4819
+ },
4820
+ {
4821
+ category: ERROR_CATEGORIES.MISSING_STATE_PROVIDER,
4822
+ priority: 85,
4823
+ match: (ctx) => Array.from(ctx.stackDeps).some(isStateManagementPackage) && (ctx.normalizedMessage.includes("context") || ctx.normalizedMessage.includes("undefined") || ctx.normalizedMessage.includes("null"))
4824
+ },
4825
+ {
4826
+ category: ERROR_CATEGORIES.MISSING_ROUTER_PROVIDER,
4827
+ priority: 85,
4828
+ match: (ctx) => Array.from(ctx.stackDeps).some(isRouterPackage) || ctx.normalizedMessage.includes("usenavigate") || ctx.normalizedMessage.includes("router")
4829
+ },
4830
+ {
4831
+ category: ERROR_CATEGORIES.SERVER_COMPONENTS_ERROR,
4832
+ priority: 85,
4833
+ match: (ctx) => ctx.normalizedMessage.includes("server components") || ctx.normalizedMessage.includes("use client") || ctx.normalizedMessage.includes("async/await") && ctx.normalizedMessage.includes("not supported")
4834
+ },
4835
+ {
4836
+ category: ERROR_CATEGORIES.MISSING_THEME_PROVIDER,
4837
+ priority: 80,
4838
+ match: (ctx) => Array.from(ctx.stackDeps).some(isStylingPackage) && (ctx.normalizedMessage.includes("theme") || ctx.normalizedMessage.includes("undefined")) || ctx.normalizedMessage.includes("usetheme") || ctx.normalizedMessage.includes("theme") && ctx.normalizedMessage.includes("provider")
4839
+ },
4840
+ {
4841
+ category: ERROR_CATEGORIES.MISSING_TRANSLATION_PROVIDER,
4842
+ priority: 80,
4843
+ match: (ctx) => Array.from(ctx.stackDeps).some(isI18nPackage) || ctx.normalizedMessage.includes("i18n") || ctx.normalizedMessage.includes("translation") || ctx.normalizedMessage.includes("locale")
4844
+ },
4845
+ {
4846
+ category: ERROR_CATEGORIES.MISSING_PORTAL_ROOT,
4847
+ priority: 70,
4848
+ match: (ctx) => ctx.normalizedMessage.includes("target container is not a dom element") || ctx.normalizedMessage.includes("portal") && (ctx.normalizedMessage.includes("container") || ctx.normalizedMessage.includes("root"))
4849
+ },
4850
+ {
4851
+ category: ERROR_CATEGORIES.MISSING_PROVIDER,
4852
+ priority: 60,
4853
+ match: (ctx) => ctx.normalizedMessage.includes("use") && ctx.normalizedMessage.includes("provider") || ctx.normalizedMessage.includes("<provider>") || ctx.normalizedMessage.includes("no provider") || ctx.normalizedMessage.includes("without a provider") || (ctx.normalizedMessage.includes("could not find") || ctx.normalizedMessage.includes("missing") || ctx.normalizedMessage.includes("not found")) && ctx.normalizedMessage.includes("context") || ctx.normalizedMessage.includes("context") && (ctx.normalizedMessage.includes("null") || ctx.normalizedMessage.includes("undefined"))
4854
+ },
4855
+ {
4856
+ category: ERROR_CATEGORIES.COMPONENT_RENDER_ERROR,
4857
+ priority: 10,
4858
+ match: (ctx) => ctx.normalizedMessage.includes("cannot read") || ctx.normalizedMessage.includes("is not a function") || ctx.normalizedMessage.includes("is not an object") || ctx.normalizedMessage.includes("is not defined") || ctx.normalizedMessage.includes("element type is invalid") || ctx.normalizedMessage.includes("objects are not valid as a react child") || ctx.normalizedMessage.includes("maximum call stack") || ctx.normalizedMessage.includes("render")
4859
+ }
4860
+ ], RULES = CATEGORIZATION_RULES.sort((a, b) => b.priority - a.priority);
4861
+ function categorizeError(message, stack) {
4862
+ let ctx = buildErrorContext(message, stack), rule = RULES.find((r) => r.match(ctx));
4863
+ if (!rule)
4864
+ return { category: ERROR_CATEGORIES.UNKNOWN_ERROR, matchedDependencies: [] };
4865
+ let matchedDependencies = getMatchedDependencies(rule.category, ctx);
4866
+ return { category: rule.category, matchedDependencies };
4867
+ }
4868
+ function getMatchedDependencies(category, ctx) {
4869
+ switch (category) {
4870
+ case ERROR_CATEGORIES.MISSING_STATE_PROVIDER:
4871
+ return Array.from(ctx.stackDeps).filter(isStateManagementPackage);
4872
+ case ERROR_CATEGORIES.MISSING_ROUTER_PROVIDER:
4873
+ return Array.from(ctx.stackDeps).filter(isRouterPackage);
4874
+ case ERROR_CATEGORIES.MISSING_THEME_PROVIDER:
4875
+ return Array.from(ctx.stackDeps).filter(isStylingPackage);
4876
+ case ERROR_CATEGORIES.MISSING_TRANSLATION_PROVIDER:
4877
+ return Array.from(ctx.stackDeps).filter(isI18nPackage);
4878
+ default:
4879
+ return [];
4880
+ }
4881
+ }
4882
+
4883
+ // src/shared/utils/analyze-test-results.ts
4884
+ function extractCategorizedErrors(testResults) {
4885
+ let failed = testResults.filter((r) => r.status === "FAIL" && r.error), map = /* @__PURE__ */ new Map(), uniqueErrorMessages = /* @__PURE__ */ new Set();
4886
+ for (let r of failed) {
4887
+ let { category, matchedDependencies } = categorizeError(r.error, r.stack);
4888
+ map.has(category) || map.set(category, { count: 0, uniqueErrors: /* @__PURE__ */ new Set(), matchedDependencies: /* @__PURE__ */ new Set() });
4889
+ let data = map.get(category);
4890
+ data.count++, matchedDependencies.forEach((dep) => data.matchedDependencies.add(dep)), uniqueErrorMessages.add(r.error), data.uniqueErrors.add(r.error);
4891
+ }
4892
+ let categorizedErrors = Array.from(map.entries()).reduce(
4893
+ (acc, [category, data]) => (acc[category] = {
4894
+ uniqueCount: data.uniqueErrors.size,
4895
+ count: data.count,
4896
+ matchedDependencies: Array.from(data.matchedDependencies).sort()
4897
+ }, acc),
4898
+ {}
4899
+ );
4900
+ return {
4901
+ totalErrors: failed.length,
4902
+ uniqueErrorCount: uniqueErrorMessages.size,
4903
+ categorizedErrors
4904
+ };
4905
+ }
4906
+ var CSS_CHECK_STORY_ID_SUFFIX = "--css-check";
4907
+ function summarizeResults(results) {
4908
+ let total = results.length, passed = results.filter((r) => r.status === "PASS").length, passedButEmptyRender = results.filter((r) => r.status === "PASS" && r.emptyRender).length, successRate = total > 0 ? parseFloat((passed / total).toFixed(2)) : 0, successRateWithoutEmptyRender = total > 0 ? parseFloat(((passed - passedButEmptyRender) / total).toFixed(2)) : 0, errorClassification = extractCategorizedErrors(results), cssCheckMatch = results.find(
4909
+ (r) => r.storyId.toLowerCase().endsWith(CSS_CHECK_STORY_ID_SUFFIX)
4910
+ ), cssCheck = cssCheckMatch?.status === "PASS" ? "pass" : cssCheckMatch?.status === "FAIL" ? "fail" : "not-run";
4911
+ return {
4912
+ total,
4913
+ passed,
4914
+ passedButEmptyRender,
4915
+ successRate,
4916
+ successRateWithoutEmptyRender,
4917
+ uniqueErrorCount: errorClassification.uniqueErrorCount,
4918
+ categorizedErrors: errorClassification.categorizedErrors,
4919
+ cssCheck
4920
+ };
4921
+ }
4922
+ function analyzeTestResults(results, cumulativeResults) {
4923
+ let run = summarizeResults(results), analysis = {
4924
+ total: run.total,
4925
+ passed: run.passed,
4926
+ passedButEmptyRender: run.passedButEmptyRender,
4927
+ successRate: run.successRate,
4928
+ successRateWithoutEmptyRender: run.successRateWithoutEmptyRender,
4929
+ uniqueErrorCount: run.uniqueErrorCount,
4930
+ categorizedErrors: run.categorizedErrors,
4931
+ cssCheck: run.cssCheck
4932
+ };
4933
+ if (cumulativeResults) {
4934
+ let cumulative = summarizeResults(cumulativeResults);
4935
+ analysis.cumulativeTotal = cumulative.total, analysis.cumulativePassed = cumulative.passed, analysis.cumulativePassedButEmptyRender = cumulative.passedButEmptyRender, analysis.cumulativeSuccessRate = cumulative.successRate, analysis.cumulativeSuccessRateWithoutEmptyRender = cumulative.successRateWithoutEmptyRender, analysis.cumulativeUniqueErrorCount = cumulative.uniqueErrorCount, analysis.cumulativeCategorizedErrors = cumulative.categorizedErrors, analysis.cumulativeCssCheck = cumulative.cssCheck;
4936
+ }
4937
+ return analysis;
4938
+ }
4939
+
4940
+ // src/shared/utils/to-story-test-result.ts
4941
+ var DEBUG_BANNER_RE = /^\n(?:\x1B\[\d+m)?Click to debug\b[^\n]*\n\n/;
4942
+ function extractErrorMessage(message, stack) {
4943
+ return (message ?? "").replace(DEBUG_BANNER_RE, "").split(`
4944
+ `)[0] || stack?.split(`
4945
+ `)[0] || "unknown error";
4946
+ }
4947
+ function detectEmptyRender(reports) {
4948
+ return reports?.some(
4949
+ (report) => report.type === "render-analysis" && report.result?.emptyRender === !0
4950
+ ) ?? !1;
4951
+ }
4952
+ function normalizeStatus(statusRaw) {
4953
+ return statusRaw === "passed" ? "PASS" : statusRaw === "failed" ? "FAIL" : "PENDING";
4954
+ }
4955
+ function toStoryTestResult(input) {
4956
+ if (!input.storyId)
4957
+ return null;
4958
+ let status = normalizeStatus(input.statusRaw), emptyRender = status === "PASS" && detectEmptyRender(input.reports), error, stack;
4959
+ if (input.errors && input.errors.length > 0) {
4960
+ let firstError = input.errors[0];
4961
+ error = extractErrorMessage(firstError.message, firstError.stack), stack = firstError.stack ?? firstError.message;
4962
+ }
4963
+ return {
4964
+ storyId: input.storyId,
4965
+ status,
4966
+ error,
4967
+ stack,
4968
+ emptyRender: emptyRender || void 0
4969
+ };
4970
+ }
4971
+
4972
+ // src/core-server/utils/ghost-stories/parse-vitest-report.ts
4973
+ function parseVitestResults(report) {
4974
+ let storyTestResults = [];
4975
+ for (let testSuite of report.testResults)
4976
+ for (let assertion of testSuite.assertionResults) {
4977
+ let result = toStoryTestResult({
4978
+ storyId: assertion.meta?.storyId ?? assertion.fullName,
4979
+ statusRaw: assertion.status,
4980
+ reports: assertion.meta?.reports,
4981
+ errors: assertion.failureMessages?.map((message) => ({ stack: message }))
4982
+ });
4983
+ result && storyTestResults.push(result);
4984
+ }
4985
+ return {
4986
+ summary: analyzeTestResults(storyTestResults)
4987
+ };
4988
+ }
4989
+
4990
+ // src/core-server/utils/ghost-stories/run-story-tests.ts
4991
+ async function runStoryTests(componentFilePaths, options) {
4992
+ let cwd = options?.cwd;
4993
+ try {
4994
+ let cacheDir = resolvePathInStorybookCache3("story-tests");
4995
+ await mkdir5(cacheDir, { recursive: !0 });
4996
+ let timestamp = Date.now(), outputFile = join13(cacheDir, `test-results-${timestamp}.json`), startTime = Date.now(), testFailureMessage;
4997
+ try {
4998
+ await executeCommand({
4999
+ command: "npx",
5000
+ args: [
5001
+ "vitest",
5002
+ "run",
5003
+ "--reporter=json",
5004
+ "--testTimeout=1000",
5005
+ `--outputFile=${outputFile}`,
5006
+ ...componentFilePaths
5007
+ ],
5008
+ cwd,
5009
+ stdio: "pipe",
5010
+ env: {
5011
+ FORKBOOK_INTERNAL_TEST_RUN: "1",
5012
+ ...options?.ghostRun ? { FORKBOOK_COMPONENT_PATHS: componentFilePaths.join(";") } : {}
5013
+ }
5014
+ });
5015
+ } catch (error) {
5016
+ let errorMessage = (error.stderr || String(error) || "").toLowerCase();
5017
+ errorMessage.includes("browsertype.launch") ? testFailureMessage = "Playwright is not installed" : errorMessage.includes("startup error") ? testFailureMessage = "Startup Error" : errorMessage.includes("no tests found") ? testFailureMessage = "No tests found" : errorMessage.includes("test timeout") ? testFailureMessage = "Test timeout" : errorMessage.includes("react-native-web") ? testFailureMessage = "React Native Web error" : errorMessage.includes("unhandled rejection") && (testFailureMessage = "Unhandled Rejection");
5018
+ }
5019
+ let duration = Date.now() - startTime;
5020
+ if (testFailureMessage)
5021
+ return {
5022
+ duration,
5023
+ runError: testFailureMessage
5024
+ };
5025
+ if (!existsSync4(outputFile))
5026
+ return {
5027
+ duration,
5028
+ runError: "JSON report not found"
5029
+ };
5030
+ let vitestReport;
5031
+ try {
5032
+ let resultsJson = await readFile8(outputFile, "utf8");
5033
+ vitestReport = JSON.parse(resultsJson);
5034
+ } catch {
5035
+ return {
5036
+ duration,
5037
+ runError: "Failed to read or parse JSON report"
5038
+ };
5039
+ }
5040
+ return !vitestReport.testResults || vitestReport.testResults.length === 0 ? {
5041
+ duration,
5042
+ runError: "No tests found"
5043
+ } : { ...parseVitestResults(vitestReport), duration };
5044
+ } catch {
5045
+ return {
5046
+ runError: "Uncaught error running story tests",
5047
+ duration: 0
5048
+ };
5049
+ }
5050
+ }
4510
5051
  export {
4511
5052
  ChangeDetectionFailureError,
4512
5053
  ChangeDetectionService,