@aussieljk/forkbook 0.0.1-16 → 0.0.1-18

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 (242) hide show
  1. package/assets/server/template.ejs +5 -1
  2. package/dist/_browser-chunks/{Color-CSCUIZNV.js → Color-CHK5SYAK.js} +1 -1
  3. package/dist/_browser-chunks/{WithTooltip-QCFTNB6P.js → WithTooltip-SLEBZZYA.js} +1 -1
  4. package/dist/_browser-chunks/{chunk-Z4YTPAKR.js → chunk-5X5VDKPT.js} +10 -10
  5. package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
  6. package/dist/_browser-chunks/{chunk-RSK2QATC.js → chunk-VCUPEQLQ.js} +1 -1
  7. package/dist/_node-chunks/{attached-runtime-M3LR7CRL.js → attached-runtime-ZWS3ITCU.js} +32 -29
  8. package/dist/_node-chunks/{builder-manager-S5R76DLZ.js → builder-manager-MFEAPDDJ.js} +41 -20
  9. package/dist/_node-chunks/{chunk-PLQUKACJ.js → chunk-3IAEGPC6.js} +6 -6
  10. package/dist/_node-chunks/{chunk-F6IRDFGE.js → chunk-3UTE6IWX.js} +8 -8
  11. package/dist/_node-chunks/{chunk-JP6U6V57.js → chunk-43EE7M6B.js} +8 -8
  12. package/dist/_node-chunks/{chunk-GG57O5WL.js → chunk-4EC6ZCAU.js} +7 -7
  13. package/dist/_node-chunks/{chunk-S6KVMMG5.js → chunk-4KYM2KSJ.js} +6 -6
  14. package/dist/_node-chunks/{chunk-PK7PIHFX.js → chunk-4QLNIRBY.js} +6 -6
  15. package/dist/_node-chunks/{chunk-T5ZUNH6T.js → chunk-4QX2ECVH.js} +6 -6
  16. package/dist/_node-chunks/{chunk-C7LQKP5N.js → chunk-4XHQ65LH.js} +6 -6
  17. package/dist/_node-chunks/{chunk-C3NHS7JV.js → chunk-5VKLBV3U.js} +21 -9
  18. package/dist/_node-chunks/chunk-66MT4R3I.js +20 -0
  19. package/dist/_node-chunks/{chunk-V5UORMCO.js → chunk-7JXTYBXL.js} +7 -7
  20. package/dist/_node-chunks/{chunk-EYI7KYY6.js → chunk-7LMKJKAQ.js} +8 -8
  21. package/dist/_node-chunks/{chunk-PAPQY3TW.js → chunk-7QJLW3RJ.js} +8 -8
  22. package/dist/_node-chunks/{chunk-3RIDLOKA.js → chunk-AAPO6DVK.js} +9 -9
  23. package/dist/_node-chunks/{chunk-RCJSAGZJ.js → chunk-AOLMH3XG.js} +15 -11
  24. package/dist/_node-chunks/{chunk-7SQTDU62.js → chunk-AP4REHEI.js} +7 -7
  25. package/dist/_node-chunks/{chunk-XLLJO7QN.js → chunk-ATMBZKPG.js} +8 -8
  26. package/dist/_node-chunks/{chunk-TTT6HKCH.js → chunk-B77YYPPE.js} +6 -6
  27. package/dist/_node-chunks/{chunk-LZR5V6AC.js → chunk-BUBLGEJK.js} +8 -8
  28. package/dist/_node-chunks/{chunk-WKOD2VTN.js → chunk-CD4UNHSD.js} +6 -6
  29. package/dist/_node-chunks/{chunk-7N4FSYG5.js → chunk-CHAPTCXW.js} +26 -26
  30. package/dist/_node-chunks/{chunk-IA5HRJZF.js → chunk-CSKLM3SG.js} +9 -9
  31. package/dist/_node-chunks/{chunk-JX2FN4Q3.js → chunk-CSYW7JSG.js} +6 -6
  32. package/dist/_node-chunks/chunk-CVS5RXU4.js +19 -0
  33. package/dist/_node-chunks/{chunk-K5XZRTQZ.js → chunk-CZXN5VUN.js} +7 -7
  34. package/dist/_node-chunks/{chunk-OGBMQXAL.js → chunk-DMQHQOWT.js} +8 -8
  35. package/dist/_node-chunks/{chunk-XY5DZDIL.js → chunk-DUJAQGDD.js} +10 -10
  36. package/dist/_node-chunks/{chunk-RY5SXMMS.js → chunk-ETOEMP6K.js} +7 -7
  37. package/dist/_node-chunks/chunk-F5JV3P2K.js +49 -0
  38. package/dist/_node-chunks/{chunk-GDBK4HY3.js → chunk-F6LG6ZTH.js} +12 -12
  39. package/dist/_node-chunks/{chunk-SUWLYB5G.js → chunk-GADZYB7K.js} +6 -6
  40. package/dist/_node-chunks/{chunk-JT7FTSPB.js → chunk-GC5GNEU6.js} +7 -7
  41. package/dist/_node-chunks/chunk-GG4A54OB.js +52 -0
  42. package/dist/_node-chunks/{chunk-76ZAQTUI.js → chunk-GXIROVYL.js} +6 -6
  43. package/dist/_node-chunks/{chunk-IJYTDXUI.js → chunk-HAQE45NF.js} +8 -8
  44. package/dist/_node-chunks/{chunk-7HEDXUYY.js → chunk-HKYFHGCD.js} +6 -6
  45. package/dist/_node-chunks/{chunk-N5DU4RGS.js → chunk-HOZK625X.js} +7 -7
  46. package/dist/_node-chunks/{chunk-NT2NODZ6.js → chunk-HP4RVLEB.js} +6 -6
  47. package/dist/_node-chunks/{chunk-KQZVI6MC.js → chunk-HTAHNPU2.js} +6 -6
  48. package/dist/_node-chunks/{chunk-5OFZSOQT.js → chunk-HZPU25LI.js} +8 -8
  49. package/dist/_node-chunks/{chunk-72BCEHLN.js → chunk-IHPNFVF3.js} +9 -9
  50. package/dist/_node-chunks/{chunk-GDWG7F53.js → chunk-IPIEE34R.js} +6 -6
  51. package/dist/_node-chunks/{chunk-AYBIJKYK.js → chunk-J3LAZZTR.js} +8 -8
  52. package/dist/_node-chunks/{chunk-4GBTYHEQ.js → chunk-J4FHHY7S.js} +7 -7
  53. package/dist/_node-chunks/{chunk-Y2FHDZ2F.js → chunk-JV3BLGQU.js} +9 -9
  54. package/dist/_node-chunks/{chunk-PYLGT7HR.js → chunk-KNYUZVVR.js} +8 -8
  55. package/dist/_node-chunks/{chunk-IW4JU27L.js → chunk-L6UNXQVV.js} +7 -7
  56. package/dist/_node-chunks/{chunk-EB7VOG5E.js → chunk-LF6QBPS2.js} +6 -6
  57. package/dist/_node-chunks/{chunk-PH4DKJCF.js → chunk-M6P773JM.js} +6 -6
  58. package/dist/_node-chunks/{chunk-BMBHJB46.js → chunk-MBQQZ53T.js} +6 -6
  59. package/dist/_node-chunks/{chunk-FJWE2TBB.js → chunk-NAQAQ5JU.js} +14 -14
  60. package/dist/_node-chunks/{chunk-K6GKT7RR.js → chunk-NL2NSBHC.js} +8 -8
  61. package/dist/_node-chunks/{chunk-UFZDQ6B2.js → chunk-O432EICO.js} +7 -7
  62. package/dist/_node-chunks/{chunk-PMYTZ2QW.js → chunk-OQF3DZON.js} +6 -6
  63. package/dist/_node-chunks/{chunk-I5YT3ZVT.js → chunk-OWAPLHBK.js} +6 -6
  64. package/dist/_node-chunks/{chunk-XXDUSVOM.js → chunk-P5UQQAVT.js} +8 -8
  65. package/dist/_node-chunks/{chunk-3VMGUWTV.js → chunk-PD2B4CCJ.js} +6 -6
  66. package/dist/_node-chunks/{chunk-S5AP3365.js → chunk-PLY7VOL7.js} +19 -19
  67. package/dist/_node-chunks/{chunk-2GKDQBC6.js → chunk-PNKI23DA.js} +11 -10
  68. package/dist/_node-chunks/{chunk-5U6PJ5YZ.js → chunk-Q5QVDDH2.js} +6 -6
  69. package/dist/_node-chunks/{chunk-XWNZORKV.js → chunk-QIYPM5FW.js} +7 -7
  70. package/dist/_node-chunks/{chunk-E5PKDO5S.js → chunk-QQNAFDRV.js} +6 -6
  71. package/dist/_node-chunks/chunk-QX47Z5FH.js +18 -0
  72. package/dist/_node-chunks/{chunk-IHOUXOSK.js → chunk-R3ICZFLN.js} +8 -8
  73. package/dist/_node-chunks/{chunk-ZTZCXWZV.js → chunk-R5L5IULY.js} +6 -6
  74. package/dist/_node-chunks/{chunk-CNIGCMVT.js → chunk-RBTE26TI.js} +6 -6
  75. package/dist/_node-chunks/chunk-RTTAFZ52.js +25 -0
  76. package/dist/_node-chunks/{chunk-YBAT4RJ7.js → chunk-RUEDYIYF.js} +6 -6
  77. package/dist/_node-chunks/{chunk-54Q363BU.js → chunk-SFXUROK4.js} +10 -10
  78. package/dist/_node-chunks/{chunk-WB6KEM5Y.js → chunk-SI3EDPTV.js} +7 -7
  79. package/dist/_node-chunks/{chunk-VXTAQURA.js → chunk-TG4TFBAD.js} +6 -6
  80. package/dist/_node-chunks/{chunk-JQYFHZ7Z.js → chunk-TMRHGLYF.js} +6 -6
  81. package/dist/_node-chunks/{chunk-UW6HXL4F.js → chunk-UANUKRU3.js} +7 -7
  82. package/dist/_node-chunks/{chunk-OKAP7V5Y.js → chunk-UDHDJDLE.js} +7 -7
  83. package/dist/_node-chunks/{chunk-5H64FI2Q.js → chunk-VCDXUGKB.js} +7 -7
  84. package/dist/_node-chunks/{chunk-QDBA3OPO.js → chunk-VQSS7OII.js} +6 -6
  85. package/dist/_node-chunks/{chunk-DNZAIWOF.js → chunk-VQXJE5RG.js} +10 -10
  86. package/dist/_node-chunks/chunk-WFGTVI33.js +20 -0
  87. package/dist/_node-chunks/{chunk-RWKRFANH.js → chunk-WPGIUS6F.js} +6 -6
  88. package/dist/_node-chunks/{chunk-VL5IW2LC.js → chunk-WRHG6PWE.js} +6 -6
  89. package/dist/_node-chunks/{chunk-BNBWGBBX.js → chunk-X5SV7UIZ.js} +7 -7
  90. package/dist/_node-chunks/{chunk-A2PJPFXZ.js → chunk-XC2RV6BH.js} +6 -6
  91. package/dist/_node-chunks/{chunk-BLNJ2DX2.js → chunk-XF4DIPLO.js} +7 -7
  92. package/dist/_node-chunks/{chunk-LYDJ7XSD.js → chunk-XFUBYI3U.js} +6 -6
  93. package/dist/_node-chunks/{chunk-47RQBQRS.js → chunk-XG72Q4LL.js} +7 -7
  94. package/dist/_node-chunks/{chunk-5CTBWF65.js → chunk-XN7EHJVR.js} +7 -7
  95. package/dist/_node-chunks/chunk-XWO2VFNK.js +298 -0
  96. package/dist/_node-chunks/chunk-YBFKJXTN.js +11 -0
  97. package/dist/_node-chunks/{chunk-2J7TLO3T.js → chunk-YCES67AJ.js} +7 -7
  98. package/dist/_node-chunks/{chunk-NMJ6S2BO.js → chunk-YF6BDZJP.js} +9 -9
  99. package/dist/_node-chunks/{chunk-4NF4B5VC.js → chunk-YPJFFP22.js} +7 -7
  100. package/dist/_node-chunks/{chunk-SZC3BDMK.js → chunk-ZCTTWMP3.js} +23 -23
  101. package/dist/_node-chunks/{chunk-HBGFSTD5.js → chunk-ZGPTFIJY.js} +6 -6
  102. package/dist/_node-chunks/dist-S4XHG4S5.js +16 -0
  103. package/dist/_node-chunks/dist-ZLGPDQAK.js +27 -0
  104. package/dist/_node-chunks/{local-runtime-HTS37XDN.js → local-runtime-VNZEXHPN.js} +19 -19
  105. package/dist/_node-chunks/{mdx-plugin-IUQIVM3G.js → mdx-plugin-B2RRIE5M.js} +13 -13
  106. package/dist/_node-chunks/{monorepo-SYIDMETZ.js → monorepo-ZOBVE7R5.js} +11 -11
  107. package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-5OYJKBOA.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-RKE5VH5C.js} +11 -11
  108. package/dist/_node-chunks/optimized-tests-GUPK5ZYE.js +22 -0
  109. package/dist/_node-chunks/{pattern-copy-play-74TXIEUZ.js → pattern-copy-play-5JYSDTHX.js} +9 -9
  110. package/dist/_node-chunks/postinstallAddon-KIZYAP3B.js +20 -0
  111. package/dist/_node-chunks/{rehype-external-links-DWA5SPB5.js → rehype-external-links-V66P44D4.js} +9 -9
  112. package/dist/_node-chunks/{rehype-slug-KAFPVNH4.js → rehype-slug-YZMIIK27.js} +9 -9
  113. package/dist/_node-chunks/{relaxed-limits-6EIL2N6I.js → relaxed-limits-DI6DQXM7.js} +11 -11
  114. package/dist/_node-chunks/{run-6W2ISL24.js → run-EIJKYUHM.js} +15 -15
  115. package/dist/_node-chunks/{run-C7CGXC2E.js → run-MVQQYDMF.js} +17 -17
  116. package/dist/_node-chunks/{setup-3LVKWS2Y.js → setup-P3E5WIHM.js} +8 -8
  117. package/dist/_node-chunks/{vitest.config.4.template-EXNOA6EO.js → vitest.config.4.template-JLKIRDI6.js} +7 -7
  118. package/dist/addon-a11y/manager.js +5 -5
  119. package/dist/addon-a11y/preset.js +7 -7
  120. package/dist/addon-comments/manager.js +10 -3
  121. package/dist/addon-comments/preset.js +8 -8
  122. package/dist/addon-docs/blocks.js +9 -9
  123. package/dist/addon-docs/manager.js +2 -2
  124. package/dist/addon-docs/preset.js +10 -10
  125. package/dist/addon-links/preview.d.ts +1 -1
  126. package/dist/addon-mcp/preset.js +23 -12
  127. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +15 -3
  128. package/dist/addon-themes/postinstall.js +7 -7
  129. package/dist/addon-vitest/constants.js +8 -8
  130. package/dist/addon-vitest/manager.js +3 -3
  131. package/dist/addon-vitest/node/coverage-reporter.js +8 -8
  132. package/dist/addon-vitest/node/vitest.js +16 -16
  133. package/dist/addon-vitest/postinstall.js +10 -10
  134. package/dist/addon-vitest/preset.js +14 -14
  135. package/dist/addon-vitest/vitest-plugin/global-setup.js +7 -7
  136. package/dist/addon-vitest/vitest-plugin/index.js +12 -12
  137. package/dist/babel/index.js +11 -11
  138. package/dist/bin/core.js +60 -59
  139. package/dist/bin/dispatcher.js +10 -10
  140. package/dist/bin/loader.js +8 -8
  141. package/dist/builder-next/index.d.ts +59 -0
  142. package/dist/builder-next/index.js +185 -0
  143. package/dist/builder-vite/index.d.ts +7 -2
  144. package/dist/builder-vite/index.js +23 -16
  145. package/dist/builder-vite/preset.js +13 -13
  146. package/dist/channels/index.d.ts +3 -2
  147. package/dist/channels/index.js +25 -3
  148. package/dist/{chunk-C4-cnJ1R.d.ts → chunk-BsO65uOb.d.ts} +1 -1
  149. package/dist/{chunk-CV4-Z2pn.d.ts → chunk-CDMZhRke.d.ts} +1 -1
  150. package/dist/chunk-CFhJCPSB.d.ts +48 -0
  151. package/dist/{chunk-BNRZY6Jq.d.ts → chunk-D2CQlXaR.d.ts} +1 -1
  152. package/dist/chunk-DtFyKAil.d.ts +142 -0
  153. package/dist/{chunk-s5Ka0eSs.d.ts → chunk-OksNJcvJ.d.ts} +1 -1
  154. package/dist/{chunk-BRMwIGWt.d.ts → chunk-ge-rSPy0.d.ts} +33 -14
  155. package/dist/{chunk-QtkUsZCs.d.ts → chunk-r-Vjut9o.d.ts} +2 -1
  156. package/dist/cli/index.d.ts +2 -2
  157. package/dist/cli/index.js +21 -21
  158. package/dist/cli/tools/sdk/child-host.d.ts +1 -1
  159. package/dist/cli/tools/sdk/child-host.js +17 -17
  160. package/dist/cli/tools/sdk/index.d.ts +2 -2
  161. package/dist/cli/tools/sdk/index.js +18 -18
  162. package/dist/cli-commands/bin/index.js +7 -7
  163. package/dist/common/index.d.ts +4 -4
  164. package/dist/common/index.js +34 -34
  165. package/dist/components/index.js +28 -28
  166. package/dist/core-server/index.d.ts +19 -4
  167. package/dist/core-server/index.js +166 -107
  168. package/dist/core-server/presets/common-manager.js +9 -9
  169. package/dist/core-server/presets/common-override-preset.js +10 -10
  170. package/dist/core-server/presets/common-preset.js +42 -39
  171. package/dist/create/bin/index.js +7 -7
  172. package/dist/create/index.js +15 -15
  173. package/dist/csf-tools/index.js +12 -12
  174. package/dist/manager/_manager-chunks/{globals-runtime-BWRrfZHd.js → globals-runtime-B4SHGLOz.js} +137 -73
  175. package/dist/manager/_manager-chunks/{globals-runtime-BshBawD_.js → globals-runtime-Bp8OD5XP.js} +4 -4
  176. package/dist/manager/_manager-chunks/{globals-runtime-BGys8g47.js → globals-runtime-CFubTdpY.js} +2 -2
  177. package/dist/manager/_manager-chunks/{globals-runtime-C-EipbnO.js → globals-runtime-CIwwmsq8.js} +1 -1
  178. package/dist/manager/_manager-chunks/{globals-runtime-Ct6r_VIk.js → globals-runtime-DnBr0uHL.js} +2 -2
  179. package/dist/manager/_manager-chunks/{globals-runtime-BimU8G7b.js → globals-runtime-DrIZ7TV0.js} +2 -2
  180. package/dist/manager/_manager-chunks/{runtime-DJCouYTq.js → runtime-4g05lOCJ.js} +3 -3
  181. package/dist/manager/_manager-chunks/{runtime-BhqfjXNm.js → runtime-B3dYQqb0.js} +2 -2
  182. package/dist/manager/_manager-chunks/{runtime-TSEq5lJd.js → runtime-B3sVeEUb.js} +1 -1
  183. package/dist/manager/_manager-chunks/{runtime-7sf36XMA.js → runtime-CDYOGzex.js} +4 -4
  184. package/dist/manager/_manager-chunks/{runtime-C6l5GIW9.js → runtime-CIywE7ED.js} +20 -20
  185. package/dist/manager/_manager-chunks/{runtime-DnHl3vQZ.js → runtime-Cd_gbHrb.js} +3 -3
  186. package/dist/manager/_manager-chunks/{runtime-CBJsfhjk.js → runtime-D7EqJrYN.js} +8 -8
  187. package/dist/manager/_manager-chunks/{runtime-BMoEpoix.js → runtime-DPTwiG8p.js} +7 -0
  188. package/dist/manager/_manager-chunks/{runtime-ByNphI7g.js → runtime-FgbxvsLo.js} +2 -2
  189. package/dist/manager/_manager-chunks/{runtime-DJfG4OGP.js → runtime-V4-aY7uL.js} +145 -145
  190. package/dist/manager/globals-runtime.js +1 -1
  191. package/dist/manager/runtime.js +1 -1
  192. package/dist/manager-api/index.d.ts +1 -1
  193. package/dist/manager-errors.d.ts +1 -1
  194. package/dist/mcp/index.js +8 -8
  195. package/dist/mocking-utils/index.js +9 -9
  196. package/dist/next/index.d.ts +189 -0
  197. package/dist/next/index.js +289 -0
  198. package/dist/nextjs-vite/node/index.js +7 -7
  199. package/dist/nextjs-vite/preset.js +11 -11
  200. package/dist/nextjs-vite/vite-plugin/index.js +7 -7
  201. package/dist/nextjs-vite-plugin/index.js +8 -8
  202. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
  203. package/dist/node-logger/index.d.ts +1 -1
  204. package/dist/node-logger/index.js +9 -9
  205. package/dist/oxc-parser/index.js +10 -10
  206. package/dist/oxc-parser/worker.js +10 -10
  207. package/dist/preview/_chunks/{runtime-YJlypwja.js → runtime-BiYuZt-X.js} +3 -3
  208. package/dist/preview/_chunks/{runtime-CrKf1OM4.js → runtime-C88AzFBv.js} +2 -2
  209. package/dist/preview/_chunks/{runtime-COMyPEkR.js → runtime-Cpzxe5eK.js} +73 -9
  210. package/dist/preview/_chunks/{runtime-CqTqsVg2.js → runtime-MYVHRAoo.js} +2 -2
  211. package/dist/preview/runtime.js +1 -1
  212. package/dist/preview-api/index.d.ts +2 -2
  213. package/dist/preview-errors.d.ts +1 -1
  214. package/dist/react/docgen/docgen-worker.js +11 -11
  215. package/dist/react/preset.js +13 -13
  216. package/dist/react-native/bin/get-stories.js +8 -8
  217. package/dist/react-native/metro/node.js +10 -10
  218. package/dist/react-native/metro/withForkbook.d.ts +2 -2
  219. package/dist/react-native/metro/withForkbook.js +13 -13
  220. package/dist/react-native/scripts/generate.js +8 -8
  221. package/dist/react-vite/node/index.js +7 -7
  222. package/dist/react-vite/preset.js +8 -8
  223. package/dist/server-errors.d.ts +1 -1
  224. package/dist/server-errors.js +9 -9
  225. package/dist/shared/open-service/index.d.ts +1 -1
  226. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
  227. package/dist/telemetry/index.js +11 -11
  228. package/dist/types/index.d.ts +1 -1
  229. package/package.json +15 -3
  230. package/skills/setup/SKILL.md +14 -0
  231. package/skills/stories/SKILL.md +21 -0
  232. package/skills/write-story/SKILL.md +14 -0
  233. package/dist/_node-chunks/chunk-CN26V2O6.js +0 -19
  234. package/dist/_node-chunks/chunk-NHIONGG3.js +0 -11
  235. package/dist/_node-chunks/chunk-QXQQQC3B.js +0 -20
  236. package/dist/_node-chunks/chunk-RR6N4UDR.js +0 -25
  237. package/dist/_node-chunks/chunk-VAU4QOZO.js +0 -20
  238. package/dist/_node-chunks/chunk-YZ5HE6CE.js +0 -18
  239. package/dist/_node-chunks/dist-5M4OQEOE.js +0 -16
  240. package/dist/_node-chunks/dist-DNAZ454H.js +0 -27
  241. package/dist/_node-chunks/optimized-tests-LAR2SZGJ.js +0 -22
  242. package/dist/_node-chunks/postinstallAddon-5GFBQQOP.js +0 -20
@@ -1,2 +1,2 @@
1
- import { $c as _default, $s as fullTestProviderStore, Ac as API_RootEntry, Bc as combineParameters, Cc as API_DocsEntry, Dc as API_IndexHash, Ec as API_HashEntry, Fc as ManagerConsumer, Gc as useChannel, Hc as useAddonState, Ic as ManagerContext, Jc as useParameter, Kc as useGlobalTypes, Lc as ManagerProvider, Mc as ActiveTabs, Nc as Combo, Oc as API_LeafEntry, Pc as Listener, Qc as useStorybookState, Qs as Tag, Rc as ManagerProviderProps, Sc as API_ComposedRef, Tc as API_GroupEntry, Uc as useArgTypes, Vc as typesX, Wc as useArgs, Xc as useStoryPrepared, Yc as useSharedState, Zc as useStorybookApi, _l as Addon_Type, al as controlOrMetaKey, bc as API, ca as registerService, cl as eventToShortcut, dc as universalStatusStore, dl as optionOrAltSymbol, ec as getTestProviderStoreById, el as isMacLike, fc as useStatusStore, fl as shortcutMatchesShortcut, gl as AddonStore, hc as UniversalStore, hl as Options, il as KeyboardEventLike, jc as API_StoryEntry, kc as API_Refs, la as useServiceQuery, lc as fullStatusStore, ll as isShortcutTaken, mc as useUniversalStore, ml as shortcutToHumanString, nc as useTestProviderStore, nl as experimental_requestResponse, ol as controlOrMetaSymbol, pc as MockUniversalStore, pl as shortcutToAriaKeyshortcuts, qc as useGlobals, rl as API_KeyCollection, sa as getService, sl as eventMatchesShortcut, tc as universalTestProviderStore, tl as RequestResponseError, ua as useServiceCommand, uc as getStatusStoreByTypeId, ul as keyToSymbol, vl as addons, wc as API_EventMap, xc as API_ComponentEntry, zc as State } from "../chunk-BRMwIGWt.js";
1
+ import { $c as _default, $s as fullTestProviderStore, Ac as API_RootEntry, Bc as combineParameters, Cc as API_DocsEntry, Dc as API_IndexHash, Ec as API_HashEntry, Fc as ManagerConsumer, Gc as useChannel, Hc as useAddonState, Ic as ManagerContext, Jc as useParameter, Kc as useGlobalTypes, Lc as ManagerProvider, Mc as ActiveTabs, Nc as Combo, Oc as API_LeafEntry, Pc as Listener, Qc as useStorybookState, Qs as Tag, Rc as ManagerProviderProps, Sc as API_ComposedRef, Tc as API_GroupEntry, Uc as useArgTypes, Vc as typesX, Wc as useArgs, Xc as useStoryPrepared, Yc as useSharedState, Zc as useStorybookApi, _l as Addon_Type, al as controlOrMetaKey, bc as API, ca as registerService, cl as eventToShortcut, dc as universalStatusStore, dl as optionOrAltSymbol, ec as getTestProviderStoreById, el as isMacLike, fc as useStatusStore, fl as shortcutMatchesShortcut, gl as AddonStore, hc as UniversalStore, hl as Options, il as KeyboardEventLike, jc as API_StoryEntry, kc as API_Refs, la as useServiceQuery, lc as fullStatusStore, ll as isShortcutTaken, mc as useUniversalStore, ml as shortcutToHumanString, nc as useTestProviderStore, nl as experimental_requestResponse, ol as controlOrMetaSymbol, pc as MockUniversalStore, pl as shortcutToAriaKeyshortcuts, qc as useGlobals, rl as API_KeyCollection, sa as getService, sl as eventMatchesShortcut, tc as universalTestProviderStore, tl as RequestResponseError, ua as useServiceCommand, uc as getStatusStoreByTypeId, ul as keyToSymbol, vl as addons, wc as API_EventMap, xc as API_ComponentEntry, zc as State } from "../chunk-ge-rSPy0.js";
2
2
  export { API, API_EventMap, type API_KeyCollection, ActiveTabs, type Addon_Type as Addon, type AddonStore, type Listener as ChannelListener, Combo, type API_ComponentEntry as ComponentEntry, type API_ComposedRef as ComposedRef, ManagerConsumer as Consumer, type API_DocsEntry as DocsEntry, type API_GroupEntry as GroupEntry, type API_HashEntry as HashEntry, type API_IndexHash as IndexHash, type API_IndexHash as StoriesHash, KeyboardEventLike, type API_LeafEntry as LeafEntry, ManagerContext, ManagerProviderProps, ManagerProvider as Provider, type API_Refs as Refs, RequestResponseError, type API_RootEntry as RootEntry, State, type Options as StoreOptions, type API_StoryEntry as StoryEntry, Tag, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, getService, UniversalStore as internal_UniversalStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, useUniversalStore as internal_useUniversalStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, optionOrAltSymbol, registerService, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useServiceCommand, useServiceQuery, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
@@ -1,4 +1,4 @@
1
- import { Hl as StorybookError, Q as StatusTypeId, q as Status } from "./chunk-BRMwIGWt.js";
1
+ import { Hl as StorybookError, Q as StatusTypeId, q as Status } from "./chunk-ge-rSPy0.js";
2
2
 
3
3
  //#region .dts-emit/code/core/src/manager-errors.d.ts
4
4
  /**
package/dist/mcp/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import CJS_COMPAT_NODE_URL_mavmgxtxjxo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_mavmgxtxjxo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_mavmgxtxjxo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_of2djqq8j1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_of2djqq8j1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_of2djqq8j1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_mavmgxtxjxo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_mavmgxtxjxo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_of2djqq8j1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_of2djqq8j1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_of2djqq8j1.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
  package_default
14
- } from "../_node-chunks/chunk-C3NHS7JV.js";
15
- import "../_node-chunks/chunk-GDWG7F53.js";
14
+ } from "../_node-chunks/chunk-5VKLBV3U.js";
15
+ import "../_node-chunks/chunk-IPIEE34R.js";
16
16
 
17
17
  // src/mcp/index.ts
18
18
  import { McpServer } from "tmcp";
@@ -1,21 +1,21 @@
1
- import CJS_COMPAT_NODE_URL_mavmgxtxjxo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_mavmgxtxjxo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_mavmgxtxjxo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_of2djqq8j1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_of2djqq8j1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_of2djqq8j1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_mavmgxtxjxo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_mavmgxtxjxo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_of2djqq8j1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_of2djqq8j1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_of2djqq8j1.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
  walk
14
- } from "../_node-chunks/chunk-3VMGUWTV.js";
14
+ } from "../_node-chunks/chunk-PD2B4CCJ.js";
15
15
  import {
16
16
  userModuleExtensions
17
- } from "../_node-chunks/chunk-VXTAQURA.js";
18
- import "../_node-chunks/chunk-GDWG7F53.js";
17
+ } from "../_node-chunks/chunk-TG4TFBAD.js";
18
+ import "../_node-chunks/chunk-IPIEE34R.js";
19
19
 
20
20
  // src/mocking-utils/automock.ts
21
21
  import MagicString from "magic-string";
@@ -0,0 +1,189 @@
1
+ import { r as DEFAULT_BASE_PATH } from "../chunk-CFhJCPSB.js";
2
+ import { a as PreviewAlias, o as PreviewRoute, s as PreviewRouteMocks } from "../chunk-DtFyKAil.js";
3
+ import { ChildProcess } from "node:child_process";
4
+
5
+ //#region .dts-emit/code/core/src/next/config.d.ts
6
+ /** The Next.js phase of `next dev`. Forkbook is only active in this phase. */
7
+ declare const PHASE_DEVELOPMENT_SERVER = "phase-development-server";
8
+ interface NextRewrite {
9
+ source: string;
10
+ destination: string;
11
+ basePath?: false;
12
+ locale?: false;
13
+ has?: unknown[];
14
+ missing?: unknown[];
15
+ }
16
+ interface NextRewriteGroups {
17
+ beforeFiles: NextRewrite[];
18
+ afterFiles: NextRewrite[];
19
+ fallback: NextRewrite[];
20
+ }
21
+ type NextRewritesResult = NextRewrite[] | Partial<NextRewriteGroups>;
22
+ /** The part of the Next.js config that Forkbook reads or changes. Other keys pass through. */
23
+ interface NextConfigObject {
24
+ rewrites?: () => NextRewritesResult | Promise<NextRewritesResult>;
25
+ skipTrailingSlashRedirect?: boolean;
26
+ allowedDevOrigins?: string[];
27
+ [key: string]: unknown;
28
+ }
29
+ type NextConfigFunction = (phase: string, context: {
30
+ defaultConfig: NextConfigObject;
31
+ [key: string]: unknown;
32
+ }) => NextConfigObject | Promise<NextConfigObject>;
33
+ type NextConfigInput = NextConfigObject | NextConfigFunction;
34
+ /** Gives a base path for Next.js. The root (`''`) is not allowed: it would hide the app. */
35
+ declare function normalizeNextBasePath(basePath: string | undefined): string;
36
+ /**
37
+ * The rewrites that send `<base>` and `<base>/*` to the Forkbook server. The Forkbook server mounts
38
+ * everything under the same base path, so the destination keeps it.
39
+ *
40
+ * @param destination The origin of the Forkbook server, for example `http://127.0.0.1:6006`.
41
+ * @param exclude Path segments under the base path that Next.js serves itself, for example
42
+ * `['iframe']` for the builder-next preview route. `<base>/iframe` and `<base>/iframe/*` then
43
+ * do not go to Forkbook. `<base>/iframe.html` still does.
44
+ */
45
+ declare function getForkbookRewrites(basePath: string, destination: string, exclude?: string[]): NextRewrite[];
46
+ /** Puts the Forkbook rewrites first in `beforeFiles`, before the rewrites of the app. */
47
+ declare function mergeRewrites(existing: NextRewritesResult | undefined, forkbook: NextRewrite[]): NextRewriteGroups;
48
+ /**
49
+ * The host names for `allowedDevOrigins`: the given hosts, the host of `PORTLESS_URL` and local
50
+ * names. Next.js wants host names without a port.
51
+ */
52
+ declare function getSiteHosts(extraHosts?: string[], env?: Record<string, string | undefined>): string[];
53
+ interface ForkbookDevConfigOptions {
54
+ basePath: string;
55
+ /** The origin of the Forkbook server, for example `http://127.0.0.1:6006`. */
56
+ destination: string;
57
+ siteHosts?: string[];
58
+ /** See `getForkbookRewrites`. */
59
+ excludeFromRewrites?: string[];
60
+ }
61
+ /**
62
+ * Adds the dev settings to a Next.js config: the rewrites to the Forkbook server,
63
+ * `skipTrailingSlashRedirect: true` (Next.js otherwise redirects `<base>/` and WebSocket paths in
64
+ * a loop) and the site hosts in `allowedDevOrigins`. The input is not changed.
65
+ */
66
+ declare function applyForkbookDevConfig(config: NextConfigObject, {
67
+ basePath,
68
+ destination,
69
+ siteHosts,
70
+ excludeFromRewrites
71
+ }: ForkbookDevConfigOptions): NextConfigObject;
72
+ /** Gives the config object from a Next.js config object or config function. */
73
+ declare function resolveNextConfig(input: NextConfigInput, phase: string, context: Parameters<NextConfigFunction>[1]): Promise<NextConfigObject>;
74
+ //#endregion
75
+ //#region .dts-emit/code/core/src/next/server.d.ts
76
+ interface ForkbookLock {
77
+ /** The pid of the Forkbook child, or of the process that is starting it. */
78
+ pid: number;
79
+ /** The pid of the process that started the child. */
80
+ ownerPid: number;
81
+ port: number;
82
+ basePath: string;
83
+ configDir: string;
84
+ startedAt: string;
85
+ }
86
+ declare function getLockPath(cwd: string): string;
87
+ declare function readLock(lockPath: string): ForkbookLock | undefined;
88
+ /** True when a process with this pid runs. A process that we may not signal also counts. */
89
+ declare function isProcessAlive(pid: number): boolean;
90
+ /** Gives a free TCP port on 127.0.0.1. `avoid` lists ports not to use (for example `PORT`). */
91
+ declare function findFreePort(avoid?: number[]): Promise<number>;
92
+ /** The path of the `forkbook` CLI that the project resolves. */
93
+ declare function resolveForkbookBin(cwd: string): string;
94
+ interface ForkbookServerOptions {
95
+ cwd: string;
96
+ basePath: string;
97
+ configDir: string;
98
+ /** A port to use. Default: `FORKBOOK_PORT`, else a free port that is not `PORT`. */
99
+ port?: number;
100
+ /** More arguments for `forkbook dev`. */
101
+ args?: string[];
102
+ /** Starts the child. Tests replace it. Default: `node <forkbook bin> dev ...`. */
103
+ spawnServer?: (args: string[], env: NodeJS.ProcessEnv, cwd: string) => ChildProcess;
104
+ env?: NodeJS.ProcessEnv;
105
+ }
106
+ interface ForkbookServerHandle {
107
+ port: number;
108
+ pid: number;
109
+ /** True when a child that runs already is used. */
110
+ reused: boolean;
111
+ /** The origin for the rewrites, for example `http://127.0.0.1:6006`. */
112
+ origin: string;
113
+ child?: ChildProcess;
114
+ }
115
+ /** The `forkbook dev` arguments for a child of `next dev`. */
116
+ declare function getForkbookDevArgs({
117
+ port,
118
+ basePath,
119
+ configDir,
120
+ args
121
+ }: {
122
+ port: number;
123
+ basePath: string;
124
+ configDir: string;
125
+ args?: string[];
126
+ }): string[];
127
+ /**
128
+ * Starts Forkbook for `next dev`, or reuses the child in the lock file when it runs with the same
129
+ * base path and config folder. The child gets `FORKBOOK_PARENT_PID`, so it stops when this
130
+ * process is gone, also after a hard kill.
131
+ */
132
+ declare function ensureForkbookServer(options: ForkbookServerOptions): Promise<ForkbookServerHandle>;
133
+ //#endregion
134
+ //#region .dts-emit/code/core/src/next/index.d.ts
135
+ interface WithForkbookOptions {
136
+ /** The URL path of Forkbook. Default: `/_forkbook`. */
137
+ basePath?: string;
138
+ /** The Forkbook config folder, from the project root. Default: `.forkbook`. */
139
+ configDir?: string;
140
+ /** The Forkbook project root (where `configDir` is). Default: `process.cwd()`. The preview route always goes in the Next.js project (`process.cwd()`). */
141
+ cwd?: string;
142
+ /** The port of the Forkbook server. Default: `FORKBOOK_PORT`, else a free port that is not `PORT`. */
143
+ port?: number;
144
+ /** More host names for `allowedDevOrigins`. The host of `PORTLESS_URL` is added by itself. */
145
+ siteHosts?: string[];
146
+ /** More arguments for `forkbook dev`. */
147
+ args?: string[];
148
+ /**
149
+ * When false, no child is started. The rewrites go to `port` (which must then be set), for a
150
+ * Forkbook that runs on its own.
151
+ */
152
+ startServer?: boolean;
153
+ /**
154
+ * builder-next: Next.js serves the story preview at `<basePath>/iframe`. `withForkbook` writes
155
+ * the route to `<app>/(forkbook)` (ignored through `.git/info/exclude`) and removes it when
156
+ * `next dev` stops. The Forkbook server must use builder-next
157
+ * (`core.builder: '@aussieljk/forkbook/builder-next'`).
158
+ */
159
+ enablePreviewRoute?: boolean;
160
+ /**
161
+ * The seam for `next/*` mocks of the preview route (phase 3). `resolveAlias` entries are added
162
+ * to `turbopack.resolveAlias`. Only used with `enablePreviewRoute`.
163
+ */
164
+ previewMocks?: PreviewRouteMocks;
165
+ /**
166
+ * Changes the dev config after Forkbook has added its settings, for example to add the preview
167
+ * route or `turbopack.resolveAlias` entries.
168
+ */
169
+ extendConfig?: (config: NextConfigObject, context: ForkbookNextContext) => NextConfigObject | Promise<NextConfigObject>;
170
+ /** Replaces the start of the child. Tests use it. */
171
+ spawnServer?: Parameters<typeof ensureForkbookServer>[0]['spawnServer'];
172
+ }
173
+ interface ForkbookNextContext {
174
+ phase: string;
175
+ basePath: string;
176
+ /** The origin of the Forkbook server, for example `http://127.0.0.1:6006`. */
177
+ destination: string;
178
+ server?: ForkbookServerHandle;
179
+ /** The preview route folders, when `enablePreviewRoute` is set. */
180
+ previewRoute?: PreviewRoute;
181
+ options: WithForkbookOptions;
182
+ }
183
+ /**
184
+ * Wraps a Next.js config (object or function). Only `next dev` (phase
185
+ * `phase-development-server`) changes. Other phases get the config as it is.
186
+ */
187
+ declare function withForkbook(nextConfig?: NextConfigInput, options?: WithForkbookOptions): NextConfigFunction;
188
+ //#endregion
189
+ export { DEFAULT_BASE_PATH, ForkbookDevConfigOptions, type ForkbookLock, ForkbookNextContext, type ForkbookServerHandle, type ForkbookServerOptions, NextConfigFunction, NextConfigInput, NextConfigObject, NextRewrite, NextRewriteGroups, NextRewritesResult, PHASE_DEVELOPMENT_SERVER, type PreviewAlias, type PreviewRoute, type PreviewRouteMocks, WithForkbookOptions, applyForkbookDevConfig, withForkbook as default, withForkbook, ensureForkbookServer, findFreePort, getForkbookDevArgs, getForkbookRewrites, getLockPath, getSiteHosts, isProcessAlive, mergeRewrites, normalizeNextBasePath, readLock, resolveForkbookBin, resolveNextConfig };
@@ -0,0 +1,289 @@
1
+ import CJS_COMPAT_NODE_URL_of2djqq8j1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_of2djqq8j1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_of2djqq8j1 from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_of2djqq8j1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_of2djqq8j1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_of2djqq8j1.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Forkbook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ PREVIEW_ROUTE_SEGMENT,
14
+ applyPreviewRouteMocks,
15
+ removePreviewRoute,
16
+ writePreviewRoute
17
+ } from "../_node-chunks/chunk-XWO2VFNK.js";
18
+ import {
19
+ DEFAULT_BASE_PATH,
20
+ joinBasePath,
21
+ normalizeBasePath
22
+ } from "../_node-chunks/chunk-F5JV3P2K.js";
23
+ import "../_node-chunks/chunk-IPIEE34R.js";
24
+
25
+ // src/next/config.ts
26
+ var PHASE_DEVELOPMENT_SERVER = "phase-development-server";
27
+ function normalizeNextBasePath(basePath) {
28
+ let base = normalizeBasePath(basePath);
29
+ if (!base)
30
+ throw new Error('withForkbook: basePath must not be "/". Use a path such as "/_forkbook".');
31
+ return base;
32
+ }
33
+ function getForkbookRewrites(basePath, destination, exclude = []) {
34
+ let base = normalizeNextBasePath(basePath), origin = destination.replace(/\/+$/, "");
35
+ if (exclude.length === 0)
36
+ return [
37
+ { source: base, destination: `${origin}${joinBasePath(base)}` },
38
+ { source: `${base}/:path*`, destination: `${origin}${base}/:path*` }
39
+ ];
40
+ let names = exclude.map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
41
+ return [
42
+ { source: base, destination: `${origin}${joinBasePath(base)}` },
43
+ {
44
+ // path-to-regexp: a parameter with a pattern. The lookahead skips the excluded segments.
45
+ source: `${base}/:path((?!(?:${names})(?:/|$)).*)`,
46
+ destination: `${origin}${base}/:path`
47
+ }
48
+ ];
49
+ }
50
+ function mergeRewrites(existing, forkbook) {
51
+ return Array.isArray(existing) ? { beforeFiles: [...forkbook], afterFiles: existing, fallback: [] } : {
52
+ beforeFiles: [...forkbook, ...existing?.beforeFiles ?? []],
53
+ afterFiles: existing?.afterFiles ?? [],
54
+ fallback: existing?.fallback ?? []
55
+ };
56
+ }
57
+ function getSiteHosts(extraHosts = [], env = process.env) {
58
+ let hosts = /* @__PURE__ */ new Set(), add = (value) => {
59
+ if (value)
60
+ try {
61
+ hosts.add(value.includes("://") ? new URL(value).hostname : value.split(":")[0]);
62
+ } catch {
63
+ }
64
+ };
65
+ return extraHosts.forEach(add), add(env.PORTLESS_URL), add("localhost"), add("127.0.0.1"), add("*.localhost"), [...hosts];
66
+ }
67
+ function applyForkbookDevConfig(config, { basePath, destination, siteHosts, excludeFromRewrites }) {
68
+ let rewrites = getForkbookRewrites(basePath, destination, excludeFromRewrites), userRewrites = config.rewrites, allowedDevOrigins = [
69
+ .../* @__PURE__ */ new Set([...config.allowedDevOrigins ?? [], ...getSiteHosts(siteHosts)])
70
+ ];
71
+ return {
72
+ ...config,
73
+ skipTrailingSlashRedirect: !0,
74
+ allowedDevOrigins,
75
+ rewrites: async () => mergeRewrites(await userRewrites?.(), rewrites)
76
+ };
77
+ }
78
+ async function resolveNextConfig(input, phase, context) {
79
+ return typeof input == "function" ? await input(phase, context) : input;
80
+ }
81
+
82
+ // src/next/server.ts
83
+ import { spawn } from "node:child_process";
84
+ import { closeSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync } from "node:fs";
85
+ import { createRequire } from "node:module";
86
+ import net from "node:net";
87
+ import { dirname, join, resolve } from "node:path";
88
+ function getLockPath(cwd) {
89
+ return join(cwd, "node_modules", ".cache", "forkbook", "next-dev.lock.json");
90
+ }
91
+ function readLock(lockPath) {
92
+ try {
93
+ let lock = JSON.parse(readFileSync(lockPath, "utf8"));
94
+ return typeof lock.pid == "number" && typeof lock.port == "number" ? lock : void 0;
95
+ } catch {
96
+ return;
97
+ }
98
+ }
99
+ function isProcessAlive(pid) {
100
+ try {
101
+ return process.kill(pid, 0), !0;
102
+ } catch (error) {
103
+ return error.code === "EPERM";
104
+ }
105
+ }
106
+ async function findFreePort(avoid = []) {
107
+ for (let attempt = 0; attempt < 10; attempt++) {
108
+ let port = await new Promise((resolvePort, reject) => {
109
+ let server = net.createServer();
110
+ server.unref(), server.once("error", reject), server.listen({ port: 0, host: "127.0.0.1" }, () => {
111
+ let { port: freePort } = server.address();
112
+ server.close(() => resolvePort(freePort));
113
+ });
114
+ });
115
+ if (!avoid.includes(port))
116
+ return port;
117
+ }
118
+ throw new Error("withForkbook: could not find a free port");
119
+ }
120
+ function resolveForkbookBin(cwd) {
121
+ let packageJson = createRequire(join(cwd, "package.json")).resolve("@aussieljk/forkbook/package.json");
122
+ return join(dirname(packageJson), "dist", "bin", "dispatcher.js");
123
+ }
124
+ function getForkbookDevArgs({
125
+ port,
126
+ basePath,
127
+ configDir,
128
+ args = []
129
+ }) {
130
+ return [
131
+ "dev",
132
+ "--port",
133
+ String(port),
134
+ "--exact-port",
135
+ "--base-path",
136
+ basePath,
137
+ "--config-dir",
138
+ configDir,
139
+ "--ci",
140
+ "--no-open",
141
+ "--no-version-updates",
142
+ ...args
143
+ ];
144
+ }
145
+ var defaultSpawn = (args, env, cwd) => spawn(process.execPath, [resolveForkbookBin(cwd), ...args], { cwd, env, stdio: "inherit" }), ownChildren = /* @__PURE__ */ new Set(), exitHookInstalled = !1;
146
+ function installExitHook(lockPath) {
147
+ exitHookInstalled || (exitHookInstalled = !0, process.once("exit", () => {
148
+ for (let child of ownChildren)
149
+ child.kill("SIGTERM");
150
+ readLock(lockPath)?.ownerPid === process.pid && rmSync(lockPath, { force: !0 });
151
+ }));
152
+ }
153
+ var sleep = (ms) => new Promise((done) => setTimeout(done, ms));
154
+ async function ensureForkbookServer(options) {
155
+ let env = options.env ?? process.env, cwd = resolve(options.cwd), lockPath = getLockPath(cwd), configDir = resolve(cwd, options.configDir);
156
+ mkdirSync(dirname(lockPath), { recursive: !0 });
157
+ for (let attempt = 0; attempt < 20; attempt++) {
158
+ let lock = readLock(lockPath);
159
+ if (lock && isProcessAlive(lock.pid)) {
160
+ if (lock.basePath === options.basePath && lock.configDir === configDir)
161
+ return {
162
+ port: lock.port,
163
+ pid: lock.pid,
164
+ reused: !0,
165
+ origin: `http://127.0.0.1:${lock.port}`
166
+ };
167
+ try {
168
+ process.kill(lock.pid, "SIGTERM");
169
+ } catch {
170
+ }
171
+ }
172
+ rmSync(lockPath, { force: !0 });
173
+ let avoid = [Number(env.PORT)].filter((port2) => Number.isInteger(port2) && port2 > 0), port = options.port ?? (env.FORKBOOK_PORT ? Number(env.FORKBOOK_PORT) : void 0) ?? await findFreePort(avoid), fd;
174
+ try {
175
+ fd = openSync(lockPath, "wx");
176
+ } catch (error) {
177
+ if (error.code === "EEXIST") {
178
+ await sleep(100);
179
+ continue;
180
+ }
181
+ throw error;
182
+ }
183
+ let base = {
184
+ ownerPid: process.pid,
185
+ port,
186
+ basePath: options.basePath,
187
+ configDir,
188
+ startedAt: (/* @__PURE__ */ new Date()).toISOString()
189
+ };
190
+ writeFileSync(fd, JSON.stringify({ ...base, pid: process.pid })), closeSync(fd);
191
+ let childEnv = {
192
+ ...env,
193
+ FORKBOOK_PARENT_PID: String(process.pid)
194
+ };
195
+ delete childEnv.PORT, delete childEnv.HOST;
196
+ let args = getForkbookDevArgs({
197
+ port,
198
+ basePath: options.basePath,
199
+ configDir,
200
+ args: options.args
201
+ }), child = (options.spawnServer ?? defaultSpawn)(args, childEnv, cwd);
202
+ return ownChildren.add(child), installExitHook(lockPath), child.once("exit", () => {
203
+ ownChildren.delete(child), readLock(lockPath)?.pid === child.pid && rmSync(lockPath, { force: !0 });
204
+ }), child.pid !== void 0 && writeFileSync(lockPath, JSON.stringify({ ...base, pid: child.pid })), {
205
+ port,
206
+ pid: child.pid ?? process.pid,
207
+ reused: !1,
208
+ origin: `http://127.0.0.1:${port}`,
209
+ child
210
+ };
211
+ }
212
+ throw new Error(`withForkbook: could not take the lock file ${lockPath}`);
213
+ }
214
+
215
+ // src/next/index.ts
216
+ var removeOnExit;
217
+ function removeRouteOnExit(route) {
218
+ if (!removeOnExit) {
219
+ let remove = () => removeOnExit && removePreviewRoute(removeOnExit);
220
+ process.once("exit", remove);
221
+ for (let signal of ["SIGINT", "SIGTERM", "SIGHUP"])
222
+ process.once(signal, () => {
223
+ remove(), process.exit(128 + (signal === "SIGINT" ? 2 : signal === "SIGTERM" ? 15 : 1));
224
+ });
225
+ }
226
+ removeOnExit = route;
227
+ }
228
+ function withForkbook(nextConfig = {}, options = {}) {
229
+ return async (phase, context) => {
230
+ let config = await resolveNextConfig(nextConfig, phase, context);
231
+ if (phase !== PHASE_DEVELOPMENT_SERVER || process.env.FORKBOOK_PARENT_PID)
232
+ return config;
233
+ let basePath = normalizeNextBasePath(options.basePath ?? DEFAULT_BASE_PATH), cwd = options.cwd ?? process.cwd(), previewRoute;
234
+ options.enablePreviewRoute && (previewRoute = writePreviewRoute({ projectDir: process.cwd(), basePath }), removeRouteOnExit(previewRoute));
235
+ let server, destination;
236
+ if (options.startServer === !1) {
237
+ if (!options.port)
238
+ throw new Error("withForkbook: set `port` when `startServer` is false.");
239
+ destination = `http://127.0.0.1:${options.port}`;
240
+ } else
241
+ server = await ensureForkbookServer({
242
+ cwd,
243
+ basePath,
244
+ configDir: options.configDir ?? ".forkbook",
245
+ port: options.port,
246
+ args: options.args,
247
+ spawnServer: options.spawnServer,
248
+ env: previewRoute ? {
249
+ ...process.env,
250
+ FORKBOOK_NEXT_PROJECT_DIR: process.cwd(),
251
+ FORKBOOK_NEXT_APP_DIR: previewRoute.appDir
252
+ } : void 0
253
+ }), destination = server.origin;
254
+ let devConfig = applyForkbookDevConfig(config, {
255
+ basePath,
256
+ destination,
257
+ siteHosts: options.siteHosts,
258
+ excludeFromRewrites: previewRoute ? [PREVIEW_ROUTE_SEGMENT] : void 0
259
+ });
260
+ return previewRoute && options.previewMocks && (devConfig = applyPreviewRouteMocks(devConfig, options.previewMocks, process.cwd())), options.extendConfig ? options.extendConfig(devConfig, {
261
+ phase,
262
+ basePath,
263
+ destination,
264
+ server,
265
+ previewRoute,
266
+ options
267
+ }) : devConfig;
268
+ };
269
+ }
270
+ var next_default = withForkbook;
271
+ export {
272
+ DEFAULT_BASE_PATH,
273
+ PHASE_DEVELOPMENT_SERVER,
274
+ applyForkbookDevConfig,
275
+ next_default as default,
276
+ ensureForkbookServer,
277
+ findFreePort,
278
+ getForkbookDevArgs,
279
+ getForkbookRewrites,
280
+ getLockPath,
281
+ getSiteHosts,
282
+ isProcessAlive,
283
+ mergeRewrites,
284
+ normalizeNextBasePath,
285
+ readLock,
286
+ resolveForkbookBin,
287
+ resolveNextConfig,
288
+ withForkbook
289
+ };
@@ -1,15 +1,15 @@
1
- import CJS_COMPAT_NODE_URL_mavmgxtxjxo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_mavmgxtxjxo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_mavmgxtxjxo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_of2djqq8j1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_of2djqq8j1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_of2djqq8j1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_mavmgxtxjxo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_mavmgxtxjxo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_of2djqq8j1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_of2djqq8j1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_of2djqq8j1.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Forkbook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import "../../_node-chunks/chunk-GDWG7F53.js";
12
+ import "../../_node-chunks/chunk-IPIEE34R.js";
13
13
 
14
14
  // src/nextjs-vite/node/index.ts
15
15
  function defineMain(config) {
@@ -1,26 +1,26 @@
1
- import CJS_COMPAT_NODE_URL_mavmgxtxjxo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_mavmgxtxjxo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_mavmgxtxjxo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_of2djqq8j1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_of2djqq8j1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_of2djqq8j1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_mavmgxtxjxo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_mavmgxtxjxo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_of2djqq8j1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_of2djqq8j1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_of2djqq8j1.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
  tailwindRefreshPlugin
14
- } from "../_node-chunks/chunk-PLQUKACJ.js";
14
+ } from "../_node-chunks/chunk-3IAEGPC6.js";
15
15
  import {
16
16
  resolvePackageDir
17
- } from "../_node-chunks/chunk-WB6KEM5Y.js";
18
- import "../_node-chunks/chunk-VXTAQURA.js";
17
+ } from "../_node-chunks/chunk-SI3EDPTV.js";
18
+ import "../_node-chunks/chunk-TG4TFBAD.js";
19
19
  import {
20
20
  __commonJS,
21
21
  __require,
22
22
  __toESM
23
- } from "../_node-chunks/chunk-GDWG7F53.js";
23
+ } from "../_node-chunks/chunk-IPIEE34R.js";
24
24
 
25
25
  // ../../node_modules/lilconfig/src/index.js
26
26
  var require_src = __commonJS({
@@ -461,7 +461,7 @@ var require_src2 = __commonJS({
461
461
  async function yamlLoader(_, content) {
462
462
  if (!yaml)
463
463
  try {
464
- yaml = await import("../_node-chunks/dist-5M4OQEOE.js");
464
+ yaml = await import("../_node-chunks/dist-S4XHG4S5.js");
465
465
  } catch (e) {
466
466
  throw new Error(
467
467
  `'yaml' is required for the YAML configuration files. Make sure it is installed
@@ -1,15 +1,15 @@
1
- import CJS_COMPAT_NODE_URL_mavmgxtxjxo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_mavmgxtxjxo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_mavmgxtxjxo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_of2djqq8j1 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_of2djqq8j1 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_of2djqq8j1 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_mavmgxtxjxo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_mavmgxtxjxo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_of2djqq8j1.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_of2djqq8j1.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_of2djqq8j1.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Forkbook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import "../../_node-chunks/chunk-GDWG7F53.js";
12
+ import "../../_node-chunks/chunk-IPIEE34R.js";
13
13
 
14
14
  // src/nextjs-vite/vite-plugin/index.ts
15
15
  import vitePluginForkbookNextjs from "@aussieljk/forkbook/internal/nextjs-vite-plugin";