@aussieljk/forkbook 0.0.1-13 → 0.0.1-15

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 (231) hide show
  1. package/dist/_browser-chunks/{Color-2EUQ6NXV.js → Color-OSKHEBLS.js} +1 -1
  2. package/dist/_browser-chunks/{WithTooltip-QCFTNB6P.js → WithTooltip-IPJFQHVQ.js} +1 -1
  3. package/dist/_browser-chunks/chunk-4ZGQ4YQ2.js +20 -0
  4. package/dist/_browser-chunks/{chunk-ZF5SPY56.js → chunk-74S4GA34.js} +1 -1
  5. package/dist/_browser-chunks/{chunk-S7N7Z5TY.js → chunk-TRXLBGLS.js} +21 -2
  6. package/dist/_browser-chunks/{chunk-UH3XTEOQ.js → chunk-XRILAR4S.js} +13 -13
  7. package/dist/_node-chunks/{attached-runtime-7IRDQUTZ.js → attached-runtime-5ABH72AY.js} +28 -28
  8. package/dist/_node-chunks/{builder-manager-YTALSWKQ.js → builder-manager-4T5FVGUR.js} +18 -15
  9. package/dist/_node-chunks/{chunk-LR4W5G37.js → chunk-2FWG2MQN.js} +6 -6
  10. package/dist/_node-chunks/chunk-2YVNFDPN.js +18 -0
  11. package/dist/_node-chunks/{chunk-TSJ3JCNN.js → chunk-33IC7FUB.js} +9 -9
  12. package/dist/_node-chunks/{chunk-SXX75O2D.js → chunk-46E6YIPW.js} +7 -7
  13. package/dist/_node-chunks/{chunk-OH5M2YER.js → chunk-4BWBFTBZ.js} +7 -7
  14. package/dist/_node-chunks/{chunk-ADCQYK3Z.js → chunk-4ELXERU6.js} +6 -6
  15. package/dist/_node-chunks/{chunk-4CZJ4SFH.js → chunk-4GGXQOD4.js} +8 -8
  16. package/dist/_node-chunks/{chunk-PGIDRLZ5.js → chunk-4ISTQSCO.js} +19 -7
  17. package/dist/_node-chunks/{chunk-OSIENBU6.js → chunk-4XKLH4I3.js} +6 -6
  18. package/dist/_node-chunks/{chunk-TQ5YAQ4Y.js → chunk-56L6SVSQ.js} +6 -6
  19. package/dist/_node-chunks/{chunk-XC7K4QEX.js → chunk-5NWCUFPU.js} +6 -6
  20. package/dist/_node-chunks/{chunk-DIC4T2UO.js → chunk-5Y53QRNN.js} +6 -6
  21. package/dist/_node-chunks/{chunk-BFQJF3ID.js → chunk-6DHYHTHM.js} +8 -8
  22. package/dist/_node-chunks/{chunk-LMGI47HP.js → chunk-6H3FQSQV.js} +52 -22
  23. package/dist/_node-chunks/{chunk-ST3KB36E.js → chunk-6WHTGFDB.js} +6 -6
  24. package/dist/_node-chunks/{chunk-VJLLEKWR.js → chunk-767UK7PX.js} +9 -9
  25. package/dist/_node-chunks/{chunk-GRN6WQC3.js → chunk-7IYNKFXW.js} +10 -10
  26. package/dist/_node-chunks/{chunk-6JSZY5TJ.js → chunk-7LYHZMJO.js} +6 -6
  27. package/dist/_node-chunks/{chunk-GQZZQB4K.js → chunk-7RE5WNOM.js} +7 -7
  28. package/dist/_node-chunks/{chunk-I26RGEVQ.js → chunk-A3EPCOVV.js} +7 -7
  29. package/dist/_node-chunks/chunk-AK4RPNTY.js +137 -0
  30. package/dist/_node-chunks/{chunk-MK2RPLWT.js → chunk-AUUVNECB.js} +7 -7
  31. package/dist/_node-chunks/{chunk-EM6AYELK.js → chunk-B6JJQARD.js} +9 -9
  32. package/dist/_node-chunks/chunk-BVF25DJF.js +20 -0
  33. package/dist/_node-chunks/{chunk-EFX2VA4Q.js → chunk-DASUWWHV.js} +6 -6
  34. package/dist/_node-chunks/{chunk-NDVIMCIX.js → chunk-DJPS7LWH.js} +7 -7
  35. package/dist/_node-chunks/{chunk-K6TEIAKH.js → chunk-DTFPS5QE.js} +7 -7
  36. package/dist/_node-chunks/{chunk-O46DZ2KC.js → chunk-EHPAFXPB.js} +8 -8
  37. package/dist/_node-chunks/{chunk-KUZSE7ZD.js → chunk-FFE4YDDE.js} +9 -9
  38. package/dist/_node-chunks/{chunk-4YWZLOAF.js → chunk-FJE2XPLI.js} +6 -6
  39. package/dist/_node-chunks/{chunk-7SPDKMDQ.js → chunk-FSSOM72N.js} +14 -14
  40. package/dist/_node-chunks/{chunk-BZQF5KUE.js → chunk-FVHSCRCK.js} +7 -7
  41. package/dist/_node-chunks/{chunk-F2AFT3P7.js → chunk-G6M5USWY.js} +8 -8
  42. package/dist/_node-chunks/{chunk-OVJZBW54.js → chunk-G7NZ27DS.js} +7 -7
  43. package/dist/_node-chunks/{chunk-E56UKDJR.js → chunk-GRJPH3NW.js} +8 -8
  44. package/dist/_node-chunks/{chunk-KEXQ3BON.js → chunk-H4IDYTC4.js} +7 -7
  45. package/dist/_node-chunks/{chunk-NRP4FGRT.js → chunk-H5AAYJZE.js} +8 -8
  46. package/dist/_node-chunks/{chunk-PUBZLLNL.js → chunk-HK47D3O3.js} +7 -7
  47. package/dist/_node-chunks/{chunk-M4MRBEJI.js → chunk-J2ZTT2OP.js} +33 -23
  48. package/dist/_node-chunks/{chunk-NIOVXWQZ.js → chunk-JAPFAHXG.js} +6 -6
  49. package/dist/_node-chunks/{chunk-3F3673RQ.js → chunk-JC4I7ZVM.js} +7 -7
  50. package/dist/_node-chunks/{chunk-7YLKDHLZ.js → chunk-JCQU3LND.js} +7 -7
  51. package/dist/_node-chunks/{chunk-33T4HNF2.js → chunk-JQKD337A.js} +6 -6
  52. package/dist/_node-chunks/{chunk-4IIWFG7O.js → chunk-JYQSJLIK.js} +8 -8
  53. package/dist/_node-chunks/{chunk-HCMHVV7N.js → chunk-KFZRX33G.js} +8 -8
  54. package/dist/_node-chunks/{chunk-PQXP5FZ2.js → chunk-KIAQML4H.js} +8 -8
  55. package/dist/_node-chunks/{chunk-Y64FM6U7.js → chunk-LHRQTTE7.js} +8 -8
  56. package/dist/_node-chunks/{chunk-NSNBFXVB.js → chunk-LNMVMXBN.js} +7 -7
  57. package/dist/_node-chunks/chunk-M6LN66WA.js +20 -0
  58. package/dist/_node-chunks/{chunk-SHP6447T.js → chunk-M75NG64K.js} +7 -7
  59. package/dist/_node-chunks/{chunk-YDM7NH4T.js → chunk-MBTS4OBP.js} +6 -6
  60. package/dist/_node-chunks/chunk-MBTTUFUX.js +11 -0
  61. package/dist/_node-chunks/{chunk-JUVUVVHI.js → chunk-MLJPAH4O.js} +6 -6
  62. package/dist/_node-chunks/{chunk-RMUBUNBY.js → chunk-NGFVR7UO.js} +6 -6
  63. package/dist/_node-chunks/{chunk-3FLRYZLJ.js → chunk-ONKMPF4O.js} +6 -6
  64. package/dist/_node-chunks/{chunk-B4XAZ2OC.js → chunk-OS6P62RS.js} +16 -20
  65. package/dist/_node-chunks/{chunk-GC7NA2Y7.js → chunk-QAQWINPN.js} +7 -7
  66. package/dist/_node-chunks/{chunk-IDPQ3CVN.js → chunk-QF4WUMRT.js} +10 -10
  67. package/dist/_node-chunks/{chunk-I36FPWMO.js → chunk-QF5RQWCH.js} +6 -6
  68. package/dist/_node-chunks/{chunk-BSXI35KM.js → chunk-QZR6HJVD.js} +7 -7
  69. package/dist/_node-chunks/chunk-R5H4DAON.js +19 -0
  70. package/dist/_node-chunks/{chunk-MWQIBOUB.js → chunk-RENIT4CI.js} +6 -6
  71. package/dist/_node-chunks/{chunk-4B52HLKK.js → chunk-SJVTZ4IO.js} +23 -23
  72. package/dist/_node-chunks/{chunk-ALHQVE5R.js → chunk-SL53Q3H4.js} +6 -6
  73. package/dist/_node-chunks/{chunk-7YQIVUEK.js → chunk-T34DVPWM.js} +6 -6
  74. package/dist/_node-chunks/{chunk-WWJKLYU5.js → chunk-TVDV6YAE.js} +8 -8
  75. package/dist/_node-chunks/{chunk-26ERGIQH.js → chunk-U6T34IDM.js} +6 -6
  76. package/dist/_node-chunks/{chunk-GLNHSUKT.js → chunk-UAU6RMOS.js} +19 -19
  77. package/dist/_node-chunks/{chunk-ZHVOUP6D.js → chunk-UMWJISED.js} +6 -6
  78. package/dist/_node-chunks/{chunk-LPIPPSMS.js → chunk-UO3EXKJC.js} +6 -6
  79. package/dist/_node-chunks/{chunk-NTUTJAD4.js → chunk-VCKRLODV.js} +8 -8
  80. package/dist/_node-chunks/{chunk-CESXIP3N.js → chunk-VS4AUXP2.js} +6 -6
  81. package/dist/_node-chunks/{chunk-PU33WSBW.js → chunk-VUHK6VXL.js} +12 -12
  82. package/dist/_node-chunks/{chunk-PJCSZR4T.js → chunk-VUP4EHUR.js} +8 -8
  83. package/dist/_node-chunks/{chunk-3L2QRDKH.js → chunk-VXDKI65K.js} +26 -26
  84. package/dist/_node-chunks/{chunk-DTNEHO4J.js → chunk-W32FBKF3.js} +10 -10
  85. package/dist/_node-chunks/{chunk-DY7F7B6V.js → chunk-W6AOA2O5.js} +7 -7
  86. package/dist/_node-chunks/{chunk-QWZZX2HN.js → chunk-W7352H3Q.js} +6 -6
  87. package/dist/_node-chunks/{chunk-S33FEPQ3.js → chunk-WMUNVUVG.js} +6 -6
  88. package/dist/_node-chunks/{chunk-M7BVABR2.js → chunk-WTZ24FWN.js} +8 -8
  89. package/dist/_node-chunks/{chunk-NAXIA2JI.js → chunk-X3BAGYZJ.js} +8 -8
  90. package/dist/_node-chunks/{chunk-3ZAENV5A.js → chunk-XERNMHVC.js} +6 -6
  91. package/dist/_node-chunks/chunk-XU6HITGZ.js +25 -0
  92. package/dist/_node-chunks/chunk-XV76A4CX.js +47 -0
  93. package/dist/_node-chunks/{chunk-CEIESR4U.js → chunk-XWHHBYMV.js} +6 -6
  94. package/dist/_node-chunks/{chunk-UYEX6LW6.js → chunk-Y3FJT543.js} +7 -7
  95. package/dist/_node-chunks/{chunk-DAEUTT3I.js → chunk-YHYL4HYS.js} +6 -6
  96. package/dist/_node-chunks/{chunk-DPOWAA4P.js → chunk-ZNT3JZI2.js} +7 -7
  97. package/dist/_node-chunks/{chunk-GIKCT5KG.js → chunk-ZPWEQZYR.js} +7 -7
  98. package/dist/_node-chunks/{chunk-3NH7IHUS.js → chunk-ZSTCVYOA.js} +6 -6
  99. package/dist/_node-chunks/dist-2H6YEUMD.js +16 -0
  100. package/dist/_node-chunks/dist-HL4THRGZ.js +27 -0
  101. package/dist/_node-chunks/{local-runtime-BKID5MBG.js → local-runtime-W3N7O65Q.js} +19 -19
  102. package/dist/_node-chunks/{mdx-plugin-7BOUDCZB.js → mdx-plugin-NVSAW2N3.js} +13 -13
  103. package/dist/_node-chunks/{monorepo-FRHSAJB7.js → monorepo-JDWM46J3.js} +11 -11
  104. package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-7BHSAJP4.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-56HEREMG.js} +11 -11
  105. package/dist/_node-chunks/optimized-tests-VZGTWCG4.js +22 -0
  106. package/dist/_node-chunks/{pattern-copy-play-6TGV6WS4.js → pattern-copy-play-ZWHYXQK5.js} +9 -9
  107. package/dist/_node-chunks/postinstallAddon-5TRUTJXJ.js +20 -0
  108. package/dist/_node-chunks/{rehype-external-links-EE2HT4QP.js → rehype-external-links-ME2XNDXH.js} +9 -9
  109. package/dist/_node-chunks/{rehype-slug-ZKRW2V6Z.js → rehype-slug-2UJLYPC6.js} +9 -9
  110. package/dist/_node-chunks/{relaxed-limits-6Q7VRQC5.js → relaxed-limits-XWE3S456.js} +11 -11
  111. package/dist/_node-chunks/{run-EBHIAT35.js → run-5YG73LXV.js} +17 -17
  112. package/dist/_node-chunks/{run-6Y3ZTASZ.js → run-DNDPGCFE.js} +15 -15
  113. package/dist/_node-chunks/{setup-6XIF77JT.js → setup-MDNSLQIJ.js} +8 -8
  114. package/dist/_node-chunks/{vitest.config.4.template-GMQNQ4UW.js → vitest.config.4.template-TXAUMPSS.js} +7 -7
  115. package/dist/addon-a11y/manager.js +4 -4
  116. package/dist/addon-a11y/preset.js +7 -7
  117. package/dist/addon-comments/manager.js +346 -0
  118. package/dist/addon-comments/preset.js +52 -0
  119. package/dist/addon-comments/preview.js +101 -0
  120. package/dist/addon-docs/blocks.js +10 -10
  121. package/dist/addon-docs/manager.js +2 -2
  122. package/dist/addon-docs/preset.js +10 -10
  123. package/dist/addon-links/preview.d.ts +1 -1
  124. package/dist/addon-mcp/preset.js +138 -38
  125. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +13 -1
  126. package/dist/addon-themes/postinstall.js +7 -7
  127. package/dist/addon-vitest/constants.js +8 -8
  128. package/dist/addon-vitest/manager.js +3 -3
  129. package/dist/addon-vitest/node/coverage-reporter.js +8 -8
  130. package/dist/addon-vitest/node/vitest.js +16 -16
  131. package/dist/addon-vitest/postinstall.js +10 -10
  132. package/dist/addon-vitest/preset.js +14 -14
  133. package/dist/addon-vitest/vitest-plugin/global-setup.js +7 -7
  134. package/dist/addon-vitest/vitest-plugin/index.js +12 -12
  135. package/dist/babel/index.js +11 -11
  136. package/dist/bin/core.js +56 -56
  137. package/dist/bin/dispatcher.js +10 -10
  138. package/dist/bin/loader.js +8 -8
  139. package/dist/builder-vite/index.js +15 -15
  140. package/dist/builder-vite/preset.js +13 -13
  141. package/dist/channels/index.d.ts +2 -2
  142. package/dist/channels/index.js +68 -17
  143. package/dist/{chunk-BCG2ui5q.d.ts → chunk-BRMwIGWt.d.ts} +14 -3
  144. package/dist/{chunk-LWwxlbee.d.ts → chunk-C4-cnJ1R.d.ts} +1 -1
  145. package/dist/{chunk-u_gGuTrz.d.ts → chunk-QtkUsZCs.d.ts} +27 -2
  146. package/dist/{chunk-BV_hETtB.d.ts → chunk-s5Ka0eSs.d.ts} +1 -1
  147. package/dist/cli/index.d.ts +1 -1
  148. package/dist/cli/index.js +21 -21
  149. package/dist/cli/tools/sdk/child-host.d.ts +1 -1
  150. package/dist/cli/tools/sdk/child-host.js +17 -17
  151. package/dist/cli/tools/sdk/index.d.ts +2 -2
  152. package/dist/cli/tools/sdk/index.js +18 -18
  153. package/dist/cli-commands/bin/index.js +7 -7
  154. package/dist/common/index.d.ts +3 -3
  155. package/dist/common/index.js +34 -34
  156. package/dist/components/index.js +29 -29
  157. package/dist/core-events/index.d.ts +3 -2
  158. package/dist/core-events/index.js +3 -1
  159. package/dist/core-server/index.d.ts +23 -3
  160. package/dist/core-server/index.js +206 -103
  161. package/dist/core-server/presets/common-manager.js +18 -10
  162. package/dist/core-server/presets/common-override-preset.js +10 -10
  163. package/dist/core-server/presets/common-preset.js +38 -38
  164. package/dist/create/bin/index.js +7 -7
  165. package/dist/create/index.js +15 -15
  166. package/dist/csf/index.js +1 -1
  167. package/dist/csf-tools/index.js +12 -12
  168. package/dist/manager/_manager-chunks/{globals-runtime-UFDJQlo-.js → globals-runtime-BUEqXras.js} +4 -4
  169. package/dist/manager/_manager-chunks/{globals-runtime-Ddp2jFET.js → globals-runtime-BsHjh8rR.js} +2 -2
  170. package/dist/manager/_manager-chunks/{globals-runtime-CCZrdft6.js → globals-runtime-CQ0Et7dZ.js} +2 -2
  171. package/dist/manager/_manager-chunks/{globals-runtime-C59T0h-j.js → globals-runtime-DChrMWvh.js} +1 -1
  172. package/dist/manager/_manager-chunks/{globals-runtime-Cccwtspx.js → globals-runtime-DiIxNujJ.js} +2 -2
  173. package/dist/manager/_manager-chunks/{globals-runtime-BgWmCsA7.js → globals-runtime-DjkYleFR.js} +163 -93
  174. package/dist/manager/_manager-chunks/{runtime-Db8fJ2MP.js → runtime-BMoEpoix.js} +24 -21
  175. package/dist/manager/_manager-chunks/{runtime-DC3oEVlM.js → runtime-BWASr_zc.js} +2 -2
  176. package/dist/manager/_manager-chunks/{runtime-D_FDSHFG.js → runtime-B_e-Zdqt.js} +12 -8
  177. package/dist/manager/_manager-chunks/{runtime-lPbyY_f5.js → runtime-CEi1oIg2.js} +405 -311
  178. package/dist/manager/_manager-chunks/{runtime-td6oYfU6.js → runtime-CLIeRJL-.js} +2 -2
  179. package/dist/manager/_manager-chunks/{runtime-AvqHE9rM.js → runtime-CWZ9qCi4.js} +54 -27
  180. package/dist/manager/_manager-chunks/{runtime-D8QxTQiI.js → runtime-CXOuNYw-.js} +3 -3
  181. package/dist/manager/_manager-chunks/{runtime-4wMiTjjZ.js → runtime-C_H6vGzi.js} +6 -5
  182. package/dist/manager/_manager-chunks/{runtime-DCOIOn4T.js → runtime-Dn2myy1z.js} +8 -8
  183. package/dist/manager/_manager-chunks/{runtime-CZtDJIYj.js → runtime-TSEq5lJd.js} +1 -1
  184. package/dist/manager/globals-runtime.js +1 -1
  185. package/dist/manager/runtime.js +1 -1
  186. package/dist/manager-api/index.d.ts +1 -1
  187. package/dist/manager-errors.d.ts +1 -1
  188. package/dist/mcp/index.js +8 -8
  189. package/dist/mocking-utils/index.js +9 -9
  190. package/dist/nextjs-vite/node/index.js +7 -7
  191. package/dist/nextjs-vite/preset.js +15 -11
  192. package/dist/nextjs-vite/vite-plugin/index.js +7 -7
  193. package/dist/nextjs-vite-plugin/index.js +8 -8
  194. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
  195. package/dist/node-logger/index.js +9 -9
  196. package/dist/oxc-parser/index.js +10 -10
  197. package/dist/oxc-parser/worker.js +10 -10
  198. package/dist/preview/_chunks/{runtime-tyJLgv6h.js → runtime-COMyPEkR.js} +97 -27
  199. package/dist/preview/_chunks/{runtime-CdZ1yk7m.js → runtime-CqTqsVg2.js} +2 -2
  200. package/dist/preview/_chunks/{runtime-U1Ycy25F.js → runtime-CrKf1OM4.js} +2 -2
  201. package/dist/preview/_chunks/{runtime-CsO4apr9.js → runtime-YJlypwja.js} +30 -5
  202. package/dist/preview/runtime.js +1 -1
  203. package/dist/preview-api/index.d.ts +2 -2
  204. package/dist/preview-api/index.js +1 -1
  205. package/dist/preview-errors.d.ts +1 -1
  206. package/dist/react/docgen/docgen-worker.js +11 -11
  207. package/dist/react/preset.js +13 -13
  208. package/dist/react-native/bin/get-stories.js +8 -8
  209. package/dist/react-native/metro/node.js +10 -10
  210. package/dist/react-native/metro/withForkbook.js +13 -13
  211. package/dist/react-native/scripts/generate.js +8 -8
  212. package/dist/react-vite/node/index.js +7 -7
  213. package/dist/react-vite/preset.d.ts +3 -1
  214. package/dist/react-vite/preset.js +16 -9
  215. package/dist/server-errors.d.ts +1 -1
  216. package/dist/server-errors.js +9 -9
  217. package/dist/shared/open-service/index.d.ts +1 -1
  218. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
  219. package/dist/telemetry/index.js +11 -11
  220. package/dist/types/index.d.ts +2 -2
  221. package/package.json +13 -1
  222. package/dist/_node-chunks/chunk-5A5XOSRM.js +0 -19
  223. package/dist/_node-chunks/chunk-5T6Q7HT3.js +0 -11
  224. package/dist/_node-chunks/chunk-6DRDJF2Q.js +0 -20
  225. package/dist/_node-chunks/chunk-HJVZQS65.js +0 -25
  226. package/dist/_node-chunks/chunk-LJ5JRR5Q.js +0 -18
  227. package/dist/_node-chunks/chunk-MKSEM5C2.js +0 -20
  228. package/dist/_node-chunks/dist-CFCU4PZG.js +0 -27
  229. package/dist/_node-chunks/dist-PFMT5YJK.js +0 -16
  230. package/dist/_node-chunks/optimized-tests-F5LCOTXH.js +0 -22
  231. package/dist/_node-chunks/postinstallAddon-4RININ5C.js +0 -20
@@ -1,44 +1,44 @@
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";
1
+ import CJS_COMPAT_NODE_URL_wr9w1e50s8 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_wr9w1e50s8 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_wr9w1e50s8 from "node:module";
4
4
 
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);
5
+ var __filename = CJS_COMPAT_NODE_URL_wr9w1e50s8.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_wr9w1e50s8.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_wr9w1e50s8.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-LMGI47HP.js";
14
+ } from "../_node-chunks/chunk-6H3FQSQV.js";
15
15
  import {
16
16
  BananaSlug
17
- } from "../_node-chunks/chunk-DIC4T2UO.js";
17
+ } from "../_node-chunks/chunk-5Y53QRNN.js";
18
18
  import {
19
19
  fromMarkdown,
20
20
  mdxFromMarkdown,
21
21
  mdxjs
22
- } from "../_node-chunks/chunk-PQXP5FZ2.js";
22
+ } from "../_node-chunks/chunk-KIAQML4H.js";
23
23
  import {
24
24
  withRouteDepth
25
- } from "../_node-chunks/chunk-E56UKDJR.js";
25
+ } from "../_node-chunks/chunk-GRJPH3NW.js";
26
26
  import {
27
27
  debounce
28
- } from "../_node-chunks/chunk-7YLKDHLZ.js";
28
+ } from "../_node-chunks/chunk-JCQU3LND.js";
29
29
  import {
30
30
  require_lib
31
- } from "../_node-chunks/chunk-GQZZQB4K.js";
31
+ } from "../_node-chunks/chunk-7RE5WNOM.js";
32
32
  import {
33
33
  Parser,
34
34
  init_acorn,
35
35
  require_acorn_jsx
36
- } from "../_node-chunks/chunk-KEXQ3BON.js";
36
+ } from "../_node-chunks/chunk-H4IDYTC4.js";
37
37
  import {
38
38
  isTelemetryModuleEnabled,
39
39
  telemetry,
40
40
  withSpan
41
- } from "../_node-chunks/chunk-4CZJ4SFH.js";
41
+ } from "../_node-chunks/chunk-4GGXQOD4.js";
42
42
  import {
43
43
  getEffectiveToolAvailability,
44
44
  getManifestStatus,
@@ -48,37 +48,37 @@ import {
48
48
  isClaudePreviewLaunch,
49
49
  isModuleGraphSupported,
50
50
  resolveSkillInputs
51
- } from "../_node-chunks/chunk-DTNEHO4J.js";
51
+ } from "../_node-chunks/chunk-W32FBKF3.js";
52
52
  import {
53
53
  CLAUDE_PREVIEW_AGENT_NAME
54
- } from "../_node-chunks/chunk-5A5XOSRM.js";
55
- import "../_node-chunks/chunk-ADCQYK3Z.js";
56
- import "../_node-chunks/chunk-LJ5JRR5Q.js";
54
+ } from "../_node-chunks/chunk-R5H4DAON.js";
55
+ import "../_node-chunks/chunk-4ELXERU6.js";
56
+ import "../_node-chunks/chunk-2YVNFDPN.js";
57
57
  import {
58
58
  detectAgent
59
- } from "../_node-chunks/chunk-HJVZQS65.js";
60
- import "../_node-chunks/chunk-NIOVXWQZ.js";
61
- import "../_node-chunks/chunk-BFQJF3ID.js";
59
+ } from "../_node-chunks/chunk-XU6HITGZ.js";
60
+ import "../_node-chunks/chunk-JAPFAHXG.js";
61
+ import "../_node-chunks/chunk-6DHYHTHM.js";
62
62
  import {
63
63
  userOrAutoTitleFromSpecifier
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";
64
+ } from "../_node-chunks/chunk-SJVTZ4IO.js";
65
+ import "../_node-chunks/chunk-HK47D3O3.js";
66
+ import "../_node-chunks/chunk-FVHSCRCK.js";
67
+ import "../_node-chunks/chunk-YHYL4HYS.js";
68
68
  import {
69
69
  resolveImport,
70
70
  supportedExtensions
71
- } from "../_node-chunks/chunk-GLNHSUKT.js";
72
- import "../_node-chunks/chunk-4YWZLOAF.js";
73
- import "../_node-chunks/chunk-NAXIA2JI.js";
71
+ } from "../_node-chunks/chunk-UAU6RMOS.js";
72
+ import "../_node-chunks/chunk-FJE2XPLI.js";
73
+ import "../_node-chunks/chunk-X3BAGYZJ.js";
74
74
  import {
75
75
  require_src
76
- } from "../_node-chunks/chunk-NTUTJAD4.js";
77
- import "../_node-chunks/chunk-3F3673RQ.js";
78
- import "../_node-chunks/chunk-CEIESR4U.js";
76
+ } from "../_node-chunks/chunk-VCKRLODV.js";
77
+ import "../_node-chunks/chunk-JC4I7ZVM.js";
78
+ import "../_node-chunks/chunk-XWHHBYMV.js";
79
79
  import {
80
80
  logger
81
- } from "../_node-chunks/chunk-M7BVABR2.js";
81
+ } from "../_node-chunks/chunk-WTZ24FWN.js";
82
82
  import {
83
83
  ChangeDetectionFailureError,
84
84
  ChangeDetectionUnavailableError,
@@ -122,84 +122,84 @@ import {
122
122
  useStatics,
123
123
  withTelemetry,
124
124
  writeManifests
125
- } from "../_node-chunks/chunk-3L2QRDKH.js";
125
+ } from "../_node-chunks/chunk-VXDKI65K.js";
126
126
  import {
127
127
  UniversalStore
128
- } from "../_node-chunks/chunk-DPOWAA4P.js";
128
+ } from "../_node-chunks/chunk-ZNT3JZI2.js";
129
129
  import {
130
130
  buildStoryPathMap,
131
131
  urlPathDepth
132
- } from "../_node-chunks/chunk-S33FEPQ3.js";
132
+ } from "../_node-chunks/chunk-WMUNVUVG.js";
133
133
  import {
134
134
  init_build,
135
135
  parse
136
- } from "../_node-chunks/chunk-OH5M2YER.js";
137
- import "../_node-chunks/chunk-26ERGIQH.js";
136
+ } from "../_node-chunks/chunk-4BWBFTBZ.js";
137
+ import "../_node-chunks/chunk-U6T34IDM.js";
138
138
  import {
139
139
  registerToolset
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";
140
+ } from "../_node-chunks/chunk-EHPAFXPB.js";
141
+ import "../_node-chunks/chunk-QZR6HJVD.js";
142
+ import "../_node-chunks/chunk-DJPS7LWH.js";
143
+ import "../_node-chunks/chunk-BVF25DJF.js";
144
144
  import {
145
145
  STORY_FILE_TEST_REGEXP,
146
146
  getStoryImportPathFromEntry
147
- } from "../_node-chunks/chunk-4IIWFG7O.js";
147
+ } from "../_node-chunks/chunk-JYQSJLIK.js";
148
148
  import {
149
149
  getService,
150
150
  registerService,
151
151
  writeOpenServiceStaticFiles
152
- } from "../_node-chunks/chunk-GRN6WQC3.js";
152
+ } from "../_node-chunks/chunk-7IYNKFXW.js";
153
153
  import {
154
154
  Channel,
155
155
  describeService,
156
156
  getRegisteredServices,
157
157
  listServices
158
- } from "../_node-chunks/chunk-VJLLEKWR.js";
158
+ } from "../_node-chunks/chunk-767UK7PX.js";
159
159
  import {
160
160
  isEqual
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";
161
+ } from "../_node-chunks/chunk-AUUVNECB.js";
162
+ import "../_node-chunks/chunk-MLJPAH4O.js";
163
+ import "../_node-chunks/chunk-5NWCUFPU.js";
164
+ import "../_node-chunks/chunk-T34DVPWM.js";
165
165
  import {
166
166
  Tag
167
- } from "../_node-chunks/chunk-MWQIBOUB.js";
168
- import "../_node-chunks/chunk-NRP4FGRT.js";
169
- import "../_node-chunks/chunk-NSNBFXVB.js";
167
+ } from "../_node-chunks/chunk-RENIT4CI.js";
168
+ import "../_node-chunks/chunk-H5AAYJZE.js";
169
+ import "../_node-chunks/chunk-LNMVMXBN.js";
170
170
  import {
171
171
  up2 as up
172
- } from "../_node-chunks/chunk-OSIENBU6.js";
172
+ } from "../_node-chunks/chunk-4XKLH4I3.js";
173
173
  import {
174
174
  invariant
175
- } from "../_node-chunks/chunk-I36FPWMO.js";
175
+ } from "../_node-chunks/chunk-QF5RQWCH.js";
176
176
  import {
177
177
  resolvePackageDir,
178
178
  safeResolveModule
179
- } from "../_node-chunks/chunk-UYEX6LW6.js";
180
- import "../_node-chunks/chunk-33T4HNF2.js";
179
+ } from "../_node-chunks/chunk-Y3FJT543.js";
180
+ import "../_node-chunks/chunk-JQKD337A.js";
181
181
  import {
182
182
  StorybookError
183
- } from "../_node-chunks/chunk-F2AFT3P7.js";
183
+ } from "../_node-chunks/chunk-G6M5USWY.js";
184
184
  import {
185
185
  require_picocolors
186
- } from "../_node-chunks/chunk-SHP6447T.js";
186
+ } from "../_node-chunks/chunk-M75NG64K.js";
187
187
  import {
188
188
  storyIndexPathToAbsolutePath
189
- } from "../_node-chunks/chunk-I26RGEVQ.js";
190
- import "../_node-chunks/chunk-QWZZX2HN.js";
189
+ } from "../_node-chunks/chunk-A3EPCOVV.js";
190
+ import "../_node-chunks/chunk-W7352H3Q.js";
191
191
  import {
192
192
  slash
193
- } from "../_node-chunks/chunk-MKSEM5C2.js";
193
+ } from "../_node-chunks/chunk-M6LN66WA.js";
194
194
  import {
195
195
  glob
196
- } from "../_node-chunks/chunk-HCMHVV7N.js";
197
- import "../_node-chunks/chunk-DY7F7B6V.js";
196
+ } from "../_node-chunks/chunk-KFZRX33G.js";
197
+ import "../_node-chunks/chunk-W6AOA2O5.js";
198
198
  import {
199
199
  __commonJS,
200
200
  __require,
201
201
  __toESM
202
- } from "../_node-chunks/chunk-6JSZY5TJ.js";
202
+ } from "../_node-chunks/chunk-7LYHZMJO.js";
203
203
 
204
204
  // ../../node_modules/@discoveryjs/json-ext/package.json
205
205
  var require_package = __commonJS({
@@ -1538,7 +1538,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
1538
1538
  // files can be e.g. '**/foo/*/*.js' so we just want the last bit,
1539
1539
  // because the directory could already be within the files part (e.g. './x/foo/bar')
1540
1540
  basename(specifier.files)
1541
- ), { glob: glob2 } = await import("../_node-chunks/dist-CFCU4PZG.js");
1541
+ ), { glob: glob2 } = await import("../_node-chunks/dist-HL4THRGZ.js");
1542
1542
  (await glob2(slash(dirGlob), {
1543
1543
  ...commonGlobOptions(dirGlob),
1544
1544
  expandDirectories: !1
@@ -1594,7 +1594,7 @@ function registerIndexJsonRoute({
1594
1594
  basename2(filePath).startsWith("preview") && ((await storyIndexGeneratorPromise).invalidateAll(), maybeInvalidate());
1595
1595
  }), app.use("/index.json", async (_req, res) => {
1596
1596
  try {
1597
- let index = await (await storyIndexGeneratorPromise).getIndex();
1597
+ let index = await (await storyIndexGeneratorPromise).getIndexWithFileErrors();
1598
1598
  res.setHeader("Content-Type", "application/json"), res.setHeader("Access-Control-Allow-Origin", "*"), res.setHeader(
1599
1599
  "Access-Control-Allow-Headers",
1600
1600
  "Origin, X-Requested-With, Content-Type, Accept"
@@ -2846,9 +2846,17 @@ async function storybookDevServer(options, server) {
2846
2846
  getPreviewBuilder(resolvedPreviewBuilder),
2847
2847
  getManagerBuilder(),
2848
2848
  useStatics(app, options)
2849
- ]);
2850
- options.debugWebpack && logConfig2("Preview webpack config", await previewBuilder.getConfig(options));
2851
- let managerResult = options.previewOnly ? void 0 : await withSpan(
2849
+ ]), listening = new Promise((resolve10, reject) => {
2850
+ server.once("error", reject), app.listen({ port: options.port, host: getListenHost(options.host) }, resolve10);
2851
+ }).then(() => addLoopbackListener(server));
2852
+ listening.catch(() => {
2853
+ }), storyIndexGeneratorPromise.then((generator) => generator?.getIndex()).catch(() => {
2854
+ }), options.debugWebpack && logConfig2("Preview webpack config", await previewBuilder.getConfig(options));
2855
+ let bailBuilders = async () => {
2856
+ await disposeChangeDetectionRuntime(), await managerBuilder?.bail().catch(() => {
2857
+ }), await previewBuilder?.bail().catch(() => {
2858
+ });
2859
+ }, managerPromise = options.previewOnly ? Promise.resolve(void 0) : withSpan(
2852
2860
  "forkbook.manager-start",
2853
2861
  {},
2854
2862
  () => managerBuilder.start({
@@ -2858,8 +2866,9 @@ async function storybookDevServer(options, server) {
2858
2866
  server,
2859
2867
  channel: options.channel
2860
2868
  })
2861
- ), previewResult = await Promise.resolve();
2862
- logger11.debug("Starting preview.."), previewResult = await withSpan(
2869
+ );
2870
+ logger11.debug("Starting preview..");
2871
+ let previewPromise = withSpan(
2863
2872
  "forkbook.preview-start",
2864
2873
  {},
2865
2874
  () => previewBuilder.start({
@@ -2868,12 +2877,15 @@ async function storybookDevServer(options, server) {
2868
2877
  router: app,
2869
2878
  server,
2870
2879
  channel: options.channel
2871
- }).catch(async (e) => {
2872
- throw logger11.error("Failed to build the preview"), process.exitCode = 1, await disposeChangeDetectionRuntime(), await managerBuilder?.bail().catch(() => {
2873
- }), await previewBuilder?.bail().catch(() => {
2874
- }), e;
2875
2880
  })
2876
- );
2881
+ ).catch((e) => {
2882
+ throw logger11.error("Failed to build the preview"), process.exitCode = 1, e;
2883
+ }), managerResult, previewResult;
2884
+ try {
2885
+ [managerResult, previewResult] = await Promise.all([managerPromise, previewPromise]);
2886
+ } catch (e) {
2887
+ throw await bailBuilders(), e;
2888
+ }
2877
2889
  let adapter;
2878
2890
  try {
2879
2891
  adapter = previewBuilder.changeDetectionAdapter?.();
@@ -2881,9 +2893,6 @@ async function storybookDevServer(options, server) {
2881
2893
  logger11.warn("Change detection: adapter initialisation failed"), logger11.debug(err instanceof Error ? err.stack ?? err.message : String(err));
2882
2894
  }
2883
2895
  resolveChangeDetectionAdapter(adapter), changeDetectionService.start();
2884
- let listening = new Promise((resolve10, reject) => {
2885
- server.once("error", reject), app.listen({ port: options.port, host: getListenHost(options.host) }, resolve10);
2886
- }).then(() => addLoopbackListener(server));
2887
2896
  try {
2888
2897
  let [indexGenerator] = await Promise.all([storyIndexGeneratorPromise, listening]);
2889
2898
  if (indexGenerator && !options.ci && !options.smokeTest && options.open) {
@@ -2894,9 +2903,7 @@ async function storybookDevServer(options, server) {
2894
2903
  });
2895
2904
  }
2896
2905
  } catch (e) {
2897
- throw await disposeChangeDetectionRuntime(), await managerBuilder?.bail().catch(() => {
2898
- }), await previewBuilder?.bail().catch(() => {
2899
- }), e;
2906
+ throw await bailBuilders(), e;
2900
2907
  }
2901
2908
  features?.componentsManifest && registerManifests({ app, presets: options.presets }), doTelemetry(app, core, storyIndexGeneratorPromise, options);
2902
2909
  async function cancelTelemetry() {
@@ -2934,6 +2941,7 @@ import { WebSocket, WebSocketServer } from "ws";
2934
2941
  import events from "@aussieljk/forkbook/internal/core-events";
2935
2942
  var CORE_EVENT_SENDERS = {
2936
2943
  [events.CHANNEL_WS_DISCONNECT]: "any",
2944
+ [events.CHANNEL_WS_RECONNECT]: "any",
2937
2945
  [events.CHANNEL_CREATED]: "manager",
2938
2946
  [events.CONFIG_ERROR]: "preview",
2939
2947
  [events.STORY_INDEX_INVALIDATED]: "server",
@@ -3554,7 +3562,12 @@ async function buildDevStandalone(options) {
3554
3562
  ), cacheOutputDir = resolvePathInStorybookCache2("public", cacheKey), outputDir = resolve7(options.outputDir || cacheOutputDir);
3555
3563
  options.smokeTest && (outputDir = cacheOutputDir), options.port = port, options.versionCheck = versionCheck, options.configType = "DEVELOPMENT", options.configDir = configDir, options.cacheKey = cacheKey, options.outputDir = outputDir, options.serverChannelUrl = getServerChannelUrl(port, options), options.localAddress = localAddress, options.networkAddress = networkAddress;
3556
3564
  let config = await loadMainConfig2(options), { core, framework } = config, corePresets = [], frameworkName = typeof framework == "string" ? framework : framework?.name;
3557
- validateFrameworkName(frameworkName), frameworkName && corePresets.push(join10(frameworkName, "preset")), frameworkName = frameworkName || "custom";
3565
+ validateFrameworkName(frameworkName), frameworkName && corePresets.push(join10(frameworkName, "preset")), (config.addons ?? []).some(
3566
+ (addon) => (typeof addon == "string" ? addon : addon.name).includes("addon-comments")
3567
+ ) || corePresets.push({
3568
+ name: "@aussieljk/forkbook/addon-comments/preset",
3569
+ options: { forkbookDefaultComments: !0 }
3570
+ }), frameworkName = frameworkName || "custom";
3558
3571
  let packageManager = JsPackageManagerFactory.getPackageManager({
3559
3572
  configDir: options.configDir
3560
3573
  }), server = await getServer(options), presets = await loadAllPresets2({
@@ -3744,19 +3757,63 @@ import {
3744
3757
  normalizeStoryPath
3745
3758
  } from "@aussieljk/forkbook/internal/common";
3746
3759
  import { combineTags, storyNameFromExport, toId } from "@aussieljk/forkbook/internal/csf/csf-utils";
3747
- import { loadConfig } from "@aussieljk/forkbook/internal/csf-tools";
3748
- import { logger as logger16, once } from "@aussieljk/forkbook/internal/node-logger";
3760
+ import { loadConfig as loadConfig2 } from "@aussieljk/forkbook/internal/csf-tools";
3761
+ import { logger as logger16, once as once2 } from "@aussieljk/forkbook/internal/node-logger";
3749
3762
  import { isExampleStoryId as isExampleStoryId2 } from "@aussieljk/forkbook/internal/telemetry";
3750
3763
  var import_picocolors7 = __toESM(require_picocolors(), 1);
3751
3764
  var TsconfigPaths = __toESM(require_lib(), 1);
3752
- import { dedent as dedent7 } from "ts-dedent";
3765
+ import { dedent as dedent8 } from "ts-dedent";
3753
3766
 
3754
3767
  // src/docs-tools/shared.ts
3755
3768
  var ADDON_ID = "@aussieljk/forkbook/docs", PANEL_ID = `${ADDON_ID}/panel`;
3756
3769
  var anchorBlockIdFromId = (storyId) => `anchor--${storyId}`, SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`;
3757
3770
 
3758
- // src/shared/story-index/sortStories.ts
3771
+ // src/core-server/utils/get-story-sort-parameter.ts
3772
+ import { generate } from "@aussieljk/forkbook/internal/babel";
3773
+ import { loadConfig } from "@aussieljk/forkbook/internal/csf-tools";
3774
+ import { once } from "@aussieljk/forkbook/internal/node-logger";
3775
+ import { transformSync } from "rolldown/utils";
3759
3776
  import { dedent as dedent6 } from "ts-dedent";
3777
+ var STORY_SORT_PATH = ["parameters", "options", "storySort"];
3778
+ function getStorySortParameter(previewCode) {
3779
+ if (!previewCode || !previewCode.includes("storySort"))
3780
+ return;
3781
+ let node, config;
3782
+ try {
3783
+ config = loadConfig(previewCode).parse(), node = config.get(STORY_SORT_PATH);
3784
+ } catch {
3785
+ return;
3786
+ }
3787
+ if (!node)
3788
+ return;
3789
+ let nodeType = node.type;
3790
+ if (nodeType === "ArrowFunctionExpression" || nodeType === "FunctionExpression" || nodeType === "ObjectMethod")
3791
+ try {
3792
+ let source = generate(node).code, wrapped = `export default (${nodeType === "ObjectMethod" ? `function ${source}` : source});`, { code, errors } = transformSync("story-sort.tsx", wrapped, { lang: "tsx" });
3793
+ if (errors.length)
3794
+ throw new Error(errors[0].message);
3795
+ let body = code.replace(/export default\s*/, "return ");
3796
+ return new Function(body)();
3797
+ } catch (err) {
3798
+ once.warn(dedent6`
3799
+ Unable to evaluate parameters.options.storySort from the preview file. The function must
3800
+ not use imports or variables from outside its body.
3801
+
3802
+ ${String(err)}
3803
+ `);
3804
+ return;
3805
+ }
3806
+ let value = config.getValue(STORY_SORT_PATH);
3807
+ if (value && typeof value == "object")
3808
+ return value;
3809
+ once.warn(dedent6`
3810
+ Unable to read parameters.options.storySort from the preview file. Use an inline object, for
3811
+ example { order: ['Intro', 'Components'] }, or an inline function.
3812
+ `);
3813
+ }
3814
+
3815
+ // src/shared/story-index/sortStories.ts
3816
+ import { dedent as dedent7 } from "ts-dedent";
3760
3817
 
3761
3818
  // src/shared/story-index/storySort.ts
3762
3819
  var STORY_KIND_PATH_SEPARATOR = /\s*\/\s*/, storySort = (options = {}) => (a, b) => {
@@ -3807,7 +3864,7 @@ var toComparator = (storySortParameter) => typeof storySortParameter == "functio
3807
3864
  try {
3808
3865
  return sortStoriesCommon(stories, storySortParameter, fileNameOrder);
3809
3866
  } catch (err) {
3810
- throw new Error(dedent6`
3867
+ throw new Error(dedent7`
3811
3868
  Error sorting stories with sort parameter ${storySortParameter}:
3812
3869
 
3813
3870
  > ${err.message}
@@ -4024,14 +4081,14 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4024
4081
  let cacheKey = this.getFindMatchingFilesCacheKey(specifier, workingDir, ignoreWarnings), cached = this.findMatchingFilesCache.get(cacheKey);
4025
4082
  if (cached)
4026
4083
  return cached;
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, {
4084
+ let pathToSubIndex = {}, globCwd = slash(resolve9(workingDir, specifier.directory)), globPattern = specifier.files.startsWith("!") ? `./${specifier.files}` : specifier.files, { glob: glob2 } = await import("../_node-chunks/dist-HL4THRGZ.js"), files = await glob2(globPattern, {
4028
4085
  absolute: !0,
4029
4086
  expandDirectories: !1,
4030
4087
  cwd: globCwd,
4031
4088
  ...commonGlobOptions2(globPattern),
4032
4089
  onlyFiles: !0
4033
4090
  });
4034
- return files.length === 0 && !ignoreWarnings && once.warn(
4091
+ return files.length === 0 && !ignoreWarnings && once2.warn(
4035
4092
  `No story files found for the specified pattern: ${import_picocolors7.default.blue(
4036
4093
  join12(specifier.directory, specifier.files)
4037
4094
  )}`
@@ -4240,7 +4297,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4240
4297
  ...dependencies.filter((d) => d !== metaDependency)
4241
4298
  ]), invariant(
4242
4299
  csfEntry,
4243
- dedent7`
4300
+ dedent8`
4244
4301
  Could not find or load CSF file at path "${result.of}" referenced by \`of={}\` in docs file "${relativePath}".
4245
4302
 
4246
4303
  - Does that file exist?
@@ -4334,6 +4391,45 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4334
4391
  async getIndex() {
4335
4392
  return (await this.getIndexAndStats()).storyIndex;
4336
4393
  }
4394
+ /**
4395
+ * Like `getIndex`, but when some story files fail to index, return the entries of the other files
4396
+ * and list the bad files in `errors`. Errors that affect the whole index (for example duplicate
4397
+ * story ids) still throw.
4398
+ */
4399
+ async getIndexWithFileErrors() {
4400
+ try {
4401
+ return await this.getIndex();
4402
+ } catch (err) {
4403
+ if (this.lastPartialIndex)
4404
+ return this.lastPartialIndex;
4405
+ throw err;
4406
+ }
4407
+ }
4408
+ async buildPartialIndex(storiesList, projectTags, fileErrors) {
4409
+ let indexEntries = {};
4410
+ try {
4411
+ for (let entry of storiesList) {
4412
+ if (entry.type === "error")
4413
+ continue;
4414
+ let existing = indexEntries[entry.id];
4415
+ indexEntries[entry.id] = existing ? this.chooseDuplicate(existing, entry, projectTags ?? []) : entry;
4416
+ }
4417
+ return {
4418
+ v: 5,
4419
+ entries: await this.sortStories(
4420
+ indexEntries,
4421
+ combineStorySorts(this.options.storySorts ?? [])
4422
+ ),
4423
+ errors: fileErrors.map((err) => ({
4424
+ importPath: slash(err.importPaths[0] ?? ""),
4425
+ importPaths: err.importPaths.map((path) => slash(path)),
4426
+ message: err.message
4427
+ }))
4428
+ };
4429
+ } catch {
4430
+ return null;
4431
+ }
4432
+ }
4337
4433
  async getIndexAndStats() {
4338
4434
  if (this.lastIndex && this.lastStats)
4339
4435
  return { storyIndex: this.lastIndex, stats: this.lastStats };
@@ -4342,8 +4438,10 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4342
4438
  let previewCode = await this.getPreviewCode(), projectTags = this.getProjectTags(previewCode), { entries: storiesList, stats } = await this.ensureExtracted({ projectTags });
4343
4439
  try {
4344
4440
  let errorEntries = storiesList.filter((entry) => entry.type === "error");
4345
- if (errorEntries.length)
4346
- throw new MultipleIndexingError(errorEntries.map((entry) => entry.err));
4441
+ if (errorEntries.length) {
4442
+ let fileErrors = errorEntries.map((entry) => entry.err);
4443
+ throw this.lastPartialIndex = await this.buildPartialIndex(storiesList, projectTags, fileErrors), new MultipleIndexingError(fileErrors);
4444
+ }
4347
4445
  let duplicateErrors = [], indexEntries = {};
4348
4446
  if (storiesList.forEach((entry) => {
4349
4447
  try {
@@ -4354,9 +4452,12 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4354
4452
  }
4355
4453
  }), duplicateErrors.length)
4356
4454
  throw new MultipleIndexingError(duplicateErrors);
4357
- let sorted = await this.sortStories(
4455
+ let previewStorySort = getStorySortParameter(previewCode), sorted = await this.sortStories(
4358
4456
  indexEntries,
4359
- combineStorySorts(this.options.storySorts ?? [])
4457
+ combineStorySorts([
4458
+ ...this.options.storySorts ?? [],
4459
+ ...previewStorySort ? [previewStorySort] : []
4460
+ ])
4360
4461
  );
4361
4462
  return this.lastStats = stats, this.lastIndex = {
4362
4463
  v: 5,
@@ -4371,10 +4472,10 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4371
4472
  Object.keys(cache5).forEach((key) => {
4372
4473
  cache5[key] = !1;
4373
4474
  });
4374
- }), this.lastIndex = null, this.lastError = null, this.invalidationListeners.forEach((listener) => listener());
4475
+ }), this.lastIndex = null, this.lastError = null, this.lastPartialIndex = null, this.invalidationListeners.forEach((listener) => listener());
4375
4476
  }
4376
4477
  invalidate(importPath, removed) {
4377
- let absolutePath = slash(resolve9(this.options.workingDir, importPath)), specifier = Array.from(this.specifierToCache.keys()).find(
4478
+ let added = !1, wasRemoved = !1, absolutePath = slash(resolve9(this.options.workingDir, importPath)), specifier = Array.from(this.specifierToCache.keys()).find(
4378
4479
  (ns) => ns.importPathMatcher.exec(importPath)
4379
4480
  );
4380
4481
  if (!specifier)
@@ -4404,10 +4505,12 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4404
4505
  (dep) => dep.dependents.splice(dep.dependents.indexOf(absolutePath), 1)
4405
4506
  );
4406
4507
  }
4407
- delete cache5[absolutePath];
4508
+ wasRemoved = absolutePath in cache5, delete cache5[absolutePath];
4408
4509
  } else
4409
- cache5[absolutePath] = !1;
4410
- this.lastIndex = null, this.lastError = null, this.invalidationListeners.forEach((listener) => listener());
4510
+ added = !(absolutePath in cache5), cache5[absolutePath] = !1;
4511
+ this.lastIndex = null, this.lastError = null, this.lastPartialIndex = null;
4512
+ let event = { importPath, added, removed: wasRemoved };
4513
+ this.invalidationListeners.forEach((listener) => listener(event));
4411
4514
  }
4412
4515
  onInvalidated(listener) {
4413
4516
  return this.invalidationListeners.add(listener), () => {
@@ -4422,7 +4525,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4422
4525
  let projectTags = [], defaultTags = [Tag.DEV, Tag.TEST, Tag.MANIFEST];
4423
4526
  if (previewCode)
4424
4527
  try {
4425
- let projectAnnotations = loadConfig(previewCode).parse(), tags = projectAnnotations.getValue(["tags"]) ?? [];
4528
+ let projectAnnotations = loadConfig2(previewCode).parse(), tags = projectAnnotations.getValue(["tags"]) ?? [];
4426
4529
  invariant(
4427
4530
  !projectAnnotations.mutationDiagnostics.some(
4428
4531
  ({ code }) => code === "unsupported-value"
@@ -4430,7 +4533,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
4430
4533
  "Preview tags must be a static array of strings"
4431
4534
  ), projectTags = tags;
4432
4535
  } catch {
4433
- once.warn(dedent7`
4536
+ once2.warn(dedent8`
4434
4537
  Unable to parse tags from project configuration. If defined, tags should be specified inline, e.g.
4435
4538
 
4436
4539
  export default {
@@ -4545,7 +4648,7 @@ function createWorkerGatedStoryDocsProvider({
4545
4648
 
4546
4649
  // src/shared/universal-store/mock.ts
4547
4650
  import { Channel as Channel5 } from "@aussieljk/forkbook/internal/channels";
4548
- import { dedent as dedent8 } from "ts-dedent";
4651
+ import { dedent as dedent9 } from "ts-dedent";
4549
4652
  var MockUniversalStore = class _MockUniversalStore extends UniversalStore {
4550
4653
  constructor(options, testUtils) {
4551
4654
  UniversalStore.isInternalConstructing = !0, super(
@@ -4561,7 +4664,7 @@ var MockUniversalStore = class _MockUniversalStore extends UniversalStore {
4561
4664
  unsubscribeAll() {
4562
4665
  if (!this.testUtils)
4563
4666
  throw new Error(
4564
- dedent8`Cannot call unsubscribeAll on a store that does not have testUtils.
4667
+ dedent9`Cannot call unsubscribeAll on a store that does not have testUtils.
4565
4668
  Please provide testUtils as the second argument when creating the store.`
4566
4669
  );
4567
4670
  let callReturnedUnsubscribeFn = (result) => {