@aussieljk/forkbook 0.0.1-8 → 0.0.1-9
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.
- package/assets/server/template.ejs +13 -0
- package/dist/_browser-chunks/{Color-ZG7LKYDZ.js → Color-GEC6HRBY.js} +2 -2
- package/dist/_browser-chunks/{WithTooltip-YZ36EZ4X.js → WithTooltip-CS3HPMGA.js} +6 -4
- package/dist/_browser-chunks/{chunk-MZVQEZOB.js → chunk-6QEYM2YW.js} +24 -24
- package/dist/_browser-chunks/chunk-C5TKXHTM.js +82 -0
- package/dist/_browser-chunks/{chunk-WVF42CP2.js → chunk-DNJ3OSLB.js} +46 -52
- package/dist/_browser-chunks/{chunk-E47B5255.js → chunk-IFADVEQE.js} +63 -543
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-YYWKZ7O3.js → chunk-NTUHL5NS.js} +5 -2
- package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
- package/dist/_browser-chunks/{chunk-SK6S7ZXD.js → chunk-PFCGVFP6.js} +3 -3
- package/dist/_browser-chunks/{chunk-H4ZHAXN3.js → chunk-V5U45XXZ.js} +1 -1
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/{chunk-DAUHYZUB.js → chunk-XTQCLWVH.js} +255 -494
- package/dist/_browser-chunks/{chunk-SFMQDIN2.js → chunk-ZHKZKFY4.js} +1 -1
- package/dist/_node-chunks/{attached-runtime-SRP2RPCT.js → attached-runtime-OI5IEIR7.js} +29 -29
- package/dist/_node-chunks/builder-manager-JEIVVV43.js +1139 -0
- package/dist/_node-chunks/{chunk-A73YRJPA.js → chunk-2FWH7OUZ.js} +6 -6
- package/dist/_node-chunks/{chunk-DGA2Q7TE.js → chunk-2QPSOAHI.js} +6 -6
- package/dist/_node-chunks/{chunk-QQKVXB5Q.js → chunk-2T2S3YYS.js} +6 -6
- package/dist/_node-chunks/{chunk-7GLNBVQO.js → chunk-35JF5BS4.js} +6 -6
- package/dist/_node-chunks/{chunk-JB5Q4WGX.js → chunk-3I43FMZC.js} +7 -7
- package/dist/_node-chunks/{chunk-WF7RDUU7.js → chunk-3R57KO3F.js} +10 -10
- package/dist/_node-chunks/chunk-4CWEAS2M.js +11 -0
- package/dist/_node-chunks/{chunk-TLB2LNUO.js → chunk-4HYKKRBM.js} +8 -8
- package/dist/_node-chunks/{chunk-YBRV5FIK.js → chunk-4W6HJYYC.js} +7 -7
- package/dist/_node-chunks/{chunk-VV6CPF3T.js → chunk-57BBVTHQ.js} +6 -6
- package/dist/_node-chunks/{chunk-MGFH4KGP.js → chunk-5MDE2KCS.js} +6 -6
- package/dist/_node-chunks/{chunk-TBLZESXE.js → chunk-5NCRCPYK.js} +6 -6
- package/dist/_node-chunks/{chunk-QEDRYWP7.js → chunk-6O6BHNDO.js} +6 -6
- package/dist/_node-chunks/chunk-7PZDRNVT.js +19 -0
- package/dist/_node-chunks/{chunk-M74NU6PU.js → chunk-7X5WP3UJ.js} +6 -6
- package/dist/_node-chunks/{chunk-DSWCMXKR.js → chunk-7XYURNT2.js} +10 -10
- package/dist/_node-chunks/{chunk-SNQKCFKN.js → chunk-AONRQAQP.js} +6 -6
- package/dist/_node-chunks/chunk-ASFRQHZH.js +20 -0
- package/dist/_node-chunks/{chunk-54WGE5OK.js → chunk-AUY6EZPA.js} +8 -8
- package/dist/_node-chunks/{chunk-I5Y7NDAM.js → chunk-BCFTMBAH.js} +7 -7
- package/dist/_node-chunks/{chunk-6GBMB2E4.js → chunk-BEHNZYWF.js} +8 -8
- package/dist/_node-chunks/chunk-BZNVRJ6H.js +25 -0
- package/dist/_node-chunks/chunk-CHLWJ5F5.js +20 -0
- package/dist/_node-chunks/{chunk-D4IL5V6A.js → chunk-CMDR42D7.js} +6 -6
- package/dist/_node-chunks/{chunk-LF7EC235.js → chunk-CP646EXE.js} +8 -8
- package/dist/_node-chunks/chunk-DDRGY4RJ.js +57 -0
- package/dist/_node-chunks/{chunk-UCBUYT7S.js → chunk-DMDIIGJ4.js} +7 -7
- package/dist/_node-chunks/{chunk-DADJTKJT.js → chunk-DTZELAXT.js} +7 -7
- package/dist/_node-chunks/{chunk-6YDXCU32.js → chunk-ELMANXC3.js} +6 -6
- package/dist/_node-chunks/{chunk-VTLGMRU5.js → chunk-ELXK72IJ.js} +6 -6
- package/dist/_node-chunks/{chunk-GXSB54NU.js → chunk-F6RXCQF6.js} +6 -6
- package/dist/_node-chunks/{chunk-4T3WPVSQ.js → chunk-FKQHIPUA.js} +6 -6
- package/dist/_node-chunks/{chunk-2WPUJ7UM.js → chunk-FPWDVE2V.js} +7 -7
- package/dist/_node-chunks/{chunk-HNMHTOKI.js → chunk-FVJLKXNS.js} +23 -23
- package/dist/_node-chunks/{chunk-ICGRYYV7.js → chunk-GABGLW7D.js} +7 -7
- package/dist/_node-chunks/{chunk-BPMXWGDX.js → chunk-GOZDHTIK.js} +6 -6
- package/dist/_node-chunks/{chunk-3NXJBXBF.js → chunk-GPSR4MZL.js} +14 -14
- package/dist/_node-chunks/{chunk-T62LXT34.js → chunk-GZ2YC6US.js} +6 -6
- package/dist/_node-chunks/chunk-H5HD6EW2.js +28 -0
- package/dist/_node-chunks/{chunk-3KY2GA5X.js → chunk-I6ANUF4J.js} +7 -7
- package/dist/_node-chunks/{chunk-CZDEJ7DD.js → chunk-ICIP5FB5.js} +9 -9
- package/dist/_node-chunks/{chunk-CL4T6DGA.js → chunk-IK35TZRH.js} +7 -7
- package/dist/_node-chunks/{chunk-CHPKBTH7.js → chunk-IOJ6NYLD.js} +7 -7
- package/dist/_node-chunks/{chunk-77YIWZPS.js → chunk-IWEZ5KSJ.js} +7 -7
- package/dist/_node-chunks/{chunk-UBEILYLL.js → chunk-JOOZKSBS.js} +7 -7
- package/dist/_node-chunks/{chunk-I26RWAW3.js → chunk-JXVJAA3U.js} +6 -6
- package/dist/_node-chunks/{chunk-GUKZDREX.js → chunk-K6VX4GUH.js} +8 -8
- package/dist/_node-chunks/{chunk-VPGX2PAB.js → chunk-L7US6VLX.js} +6 -6
- package/dist/_node-chunks/{chunk-JCLP42A7.js → chunk-LKMHU2P3.js} +7 -7
- package/dist/_node-chunks/{chunk-IVU4D6LF.js → chunk-LMWS7NDR.js} +7 -7
- package/dist/_node-chunks/{chunk-M3F5R2JO.js → chunk-LPDII6WJ.js} +6 -6
- package/dist/_node-chunks/{chunk-RR3WLRNQ.js → chunk-MBJ2CUVU.js} +7 -7
- package/dist/_node-chunks/{chunk-KQBTXUT5.js → chunk-MGXABKCL.js} +6 -6
- package/dist/_node-chunks/{chunk-BY65FGKD.js → chunk-MHLTWQGQ.js} +8 -8
- package/dist/_node-chunks/{chunk-7YBOQWWR.js → chunk-MMMKY3DA.js} +8 -8
- package/dist/_node-chunks/{chunk-NV6HM53D.js → chunk-MXNT3HBF.js} +6 -6
- package/dist/_node-chunks/{chunk-LPLXO4HE.js → chunk-O7WMRMVJ.js} +6 -6
- package/dist/_node-chunks/{chunk-BLAPFOIX.js → chunk-OPLD7FOE.js} +6 -6
- package/dist/_node-chunks/{chunk-XTCOGCTP.js → chunk-P4CWOISW.js} +7 -7
- package/dist/_node-chunks/{chunk-IFF53QVX.js → chunk-POXIO453.js} +7 -7
- package/dist/_node-chunks/{chunk-4U5ZQZJ4.js → chunk-PRTTCG3N.js} +6 -6
- package/dist/_node-chunks/{chunk-27R37QFW.js → chunk-QE3NKWUX.js} +7 -7
- package/dist/_node-chunks/{chunk-LYMYDMEK.js → chunk-QMERCCIQ.js} +6 -6
- package/dist/_node-chunks/{chunk-4CPTSXU6.js → chunk-QVF2NJK4.js} +10 -10
- package/dist/_node-chunks/{chunk-Y2HWZ262.js → chunk-R33EXC6B.js} +12 -12
- package/dist/_node-chunks/{chunk-ZKS2H56J.js → chunk-R3BJJGEG.js} +6 -6
- package/dist/_node-chunks/chunk-REDMAZRP.js +18 -0
- package/dist/_node-chunks/{chunk-DVSKRIH3.js → chunk-RJV4QWRP.js} +7 -7
- package/dist/_node-chunks/{chunk-3KKSPEAE.js → chunk-RXEMA2TT.js} +6 -6
- package/dist/_node-chunks/{chunk-XGMO4SW2.js → chunk-TKOUTJWX.js} +6 -6
- package/dist/_node-chunks/{chunk-LSKOVF6F.js → chunk-TRZWEDUE.js} +6 -6
- package/dist/_node-chunks/{chunk-2ZB3ZVDY.js → chunk-U3BEYEZ5.js} +8 -8
- package/dist/_node-chunks/{chunk-HF6FRLS6.js → chunk-UI6NW64P.js} +19 -19
- package/dist/_node-chunks/chunk-UK2NKD4E.js +532 -0
- package/dist/_node-chunks/{chunk-II4SIIJW.js → chunk-VF6725VX.js} +7 -7
- package/dist/_node-chunks/{chunk-YMVL55QY.js → chunk-VJJTMS2R.js} +9 -9
- package/dist/_node-chunks/{chunk-62PEOH4P.js → chunk-VQBXHU2T.js} +8 -8
- package/dist/_node-chunks/{chunk-5BQKMZYJ.js → chunk-VZ3PQJKF.js} +23 -23
- package/dist/_node-chunks/{chunk-G6UTEYYQ.js → chunk-WI6FDUOM.js} +8 -8
- package/dist/_node-chunks/{chunk-4QYNOSOA.js → chunk-WTS7HYGM.js} +7 -7
- package/dist/_node-chunks/{chunk-VQ2NW4OR.js → chunk-WXMIR2F2.js} +8 -8
- package/dist/_node-chunks/{chunk-G3J2VAY4.js → chunk-XA2UQNP3.js} +10 -10
- package/dist/_node-chunks/{chunk-VTVQ5TKB.js → chunk-Y2FWEOIW.js} +8 -8
- package/dist/_node-chunks/{chunk-526SOV2Y.js → chunk-Y5JLYH6J.js} +6 -6
- package/dist/_node-chunks/{chunk-X5IJ42Q2.js → chunk-YELBVH4K.js} +7 -7
- package/dist/_node-chunks/{chunk-QQ7GEJNY.js → chunk-YK5N35SR.js} +9 -9
- package/dist/_node-chunks/{chunk-UEWCGYSE.js → chunk-YLXOGJX6.js} +21 -9
- package/dist/_node-chunks/{chunk-OZBNKCKM.js → chunk-YSVJU5VZ.js} +6 -6
- package/dist/_node-chunks/{chunk-F2XPZVCK.js → chunk-ZFTEHWNT.js} +8 -8
- package/dist/_node-chunks/{chunk-6DZY675E.js → chunk-ZLBDSC7U.js} +9 -9
- package/dist/_node-chunks/{chunk-6DCYMQX2.js → chunk-ZMI35R7E.js} +45 -34
- package/dist/_node-chunks/{chunk-QVIC3UDL.js → chunk-ZOE2QQSS.js} +8 -8
- package/dist/_node-chunks/{chunk-OFZX45ZR.js → chunk-ZST2SPBX.js} +6 -6
- package/dist/_node-chunks/{chunk-IAYHJZOR.js → chunk-ZUYRTHXN.js} +6 -6
- package/dist/_node-chunks/dist-FABQFQ76.js +27 -0
- package/dist/_node-chunks/dist-ZUXZVI3A.js +16 -0
- package/dist/_node-chunks/{local-runtime-Y6OH2SFM.js → local-runtime-LKT5I6NG.js} +20 -20
- package/dist/_node-chunks/{mdx-plugin-R6GNGQP2.js → mdx-plugin-2YIBFVCV.js} +13 -13
- package/dist/_node-chunks/{monorepo-R2CLQIWG.js → monorepo-HROZW452.js} +11 -11
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-PTWFSPXD.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-MUIOTVJR.js} +11 -11
- package/dist/_node-chunks/optimized-tests-EK5H7MUQ.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-5VCD6ED3.js → pattern-copy-play-VQNMME5S.js} +9 -9
- package/dist/_node-chunks/postinstallAddon-T4RENREB.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-SKSQEDUP.js → rehype-external-links-WXD3NVWK.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-27WNXM7U.js → rehype-slug-LWBEJBWR.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-PDGCGDW4.js → relaxed-limits-MKV6OE3S.js} +11 -11
- package/dist/_node-chunks/{run-BD52SWQC.js → run-A4A2HQDT.js} +17 -17
- package/dist/_node-chunks/{run-IKBDOUY2.js → run-UBPF7ZUG.js} +15 -15
- package/dist/_node-chunks/session-id-YZZIHNID.js +23 -0
- package/dist/_node-chunks/{setup-7ECNMG4A.js → setup-SMMCS2Q5.js} +8 -8
- package/dist/_node-chunks/{vitest.config.4.template-J4YODMMP.js → vitest.config.4.template-PYSDGPB4.js} +7 -7
- package/dist/addon-a11y/index.js +1 -1
- package/dist/addon-a11y/manager.js +20 -24
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.js +1 -1
- package/dist/addon-docs/blocks.js +20 -26
- package/dist/addon-docs/manager.js +1 -1
- package/dist/addon-docs/preset.js +10 -10
- package/dist/addon-links/index.js +4 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +4 -2
- package/dist/addon-links/react/index.js +3 -1
- package/dist/addon-mcp/preset.js +8 -8
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +3 -3
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-themes/manager.js +3 -3
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +9 -9
- package/dist/addon-vitest/node/coverage-reporter.js +8 -8
- package/dist/addon-vitest/node/vitest.js +16 -16
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +14 -14
- package/dist/addon-vitest/vitest-plugin/global-setup.js +7 -7
- package/dist/addon-vitest/vitest-plugin/index.js +13 -13
- package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +59 -59
- package/dist/bin/dispatcher.js +10 -10
- package/dist/bin/loader.js +8 -8
- package/dist/builder-vite/index.js +15 -15
- package/dist/builder-vite/preset.js +13 -13
- package/dist/{chunk-CJY2njs4.d.ts → chunk-BhAPwdVB.d.ts} +1 -1
- package/dist/{chunk-pFH9P91a.d.ts → chunk-DXsI731B.d.ts} +1 -1
- package/dist/{chunk-DktrsDd6.d.ts → chunk-PdOIKm0H.d.ts} +35 -2
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +22 -22
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +1 -1
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/common/index.d.ts +2 -2
- package/dist/common/index.js +35 -35
- package/dist/components/index.d.ts +38 -1
- package/dist/components/index.js +593 -518
- package/dist/core-server/index.d.ts +2 -2
- package/dist/core-server/index.js +282 -173
- package/dist/core-server/presets/common-manager.js +491 -117
- package/dist/core-server/presets/common-override-preset.js +10 -10
- package/dist/core-server/presets/common-preset.js +51 -43
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf-tools/index.d.ts +3 -1
- package/dist/csf-tools/index.js +14 -12
- package/dist/manager/_manager-chunks/{globals-runtime-z143vedu.js → globals-runtime-B1q30If4.js} +4 -4
- package/dist/manager/_manager-chunks/{globals-runtime-4fCHtNC6.js → globals-runtime-BY3epqww.js} +413 -2
- package/dist/manager/_manager-chunks/globals-runtime-Bj5KDUJi.js +8935 -0
- package/dist/manager/_manager-chunks/{globals-runtime-Bpc_ftuT.js → globals-runtime-Bs75QQ_I.js} +3 -1192
- package/dist/manager/_manager-chunks/{globals-runtime-D82vqOGq.js → globals-runtime-BweHuXkK.js} +2 -2
- package/dist/manager/_manager-chunks/{globals-runtime-BKW-4ztO.js → globals-runtime-C4GdZS7_.js} +4 -4
- package/dist/manager/_manager-chunks/{globals-runtime-DB8fVA5g.js → globals-runtime-CA8AuIRT.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DZN_3ZLm.js → globals-runtime-CnfHMZV0.js} +153 -27
- package/dist/manager/_manager-chunks/{globals-runtime-WhJXr5R1.js → globals-runtime-DgHSAUIB.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-kmPSyf3j.js → globals-runtime-DvV_TF3-.js} +2 -2
- package/dist/manager/_manager-chunks/{globals-runtime-DgUeynuu.js → globals-runtime-FcobHVj9.js} +475 -370
- package/dist/manager/_manager-chunks/{globals-runtime-CoCzM1V_.js → globals-runtime-WZKaeKm9.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-CIcNS9TG.js → globals-runtime-dh5vgpgm.js} +238 -232
- package/dist/manager/_manager-chunks/{globals-runtime-DOPUchia.js → globals-runtime-wjkxyMn0.js} +4 -3
- package/dist/manager/_manager-chunks/{runtime-DEHcqyTM.js → runtime-BSkBrZa7.js} +3 -3
- package/dist/manager/_manager-chunks/{runtime-C-s1miBr.js → runtime-Bdda1ODD.js} +1 -1
- package/dist/manager/_manager-chunks/{runtime-DuptfEhw.js → runtime-Bp_XtatN.js} +2 -2
- package/dist/manager/_manager-chunks/{runtime-BrwmuSZ1.js → runtime-D-bkVc6v.js} +31 -30
- package/dist/manager/_manager-chunks/{runtime-CHQZzIX6.js → runtime-DP_7wWTN.js} +2 -2
- package/dist/manager/_manager-chunks/{runtime-Dtpc5s3G.js → runtime-DlX-MKi1.js} +335 -327
- package/dist/manager/_manager-chunks/{runtime-B_U-7omv.js → runtime-TytMkKcC.js} +340 -241
- package/dist/manager/_manager-chunks/{runtime-BrlctLSK.js → runtime-jOBCBZ66.js} +100 -63
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +1 -1
- package/dist/manager/globals.js +1 -1
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +34 -9
- package/dist/manager-errors.d.ts +1 -1
- package/dist/mcp/index.js +8 -8
- package/dist/mocking-utils/index.js +9 -9
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/preset.js +10 -10
- package/dist/nextjs-vite/vite-plugin/index.js +7 -7
- package/dist/nextjs-vite-plugin/index.js +8 -8
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/node-logger/index.js +9 -9
- package/dist/oxc-parser/index.js +10 -10
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-errors.d.ts +1 -1
- package/dist/react/docgen/docgen-worker.js +11 -11
- package/dist/react/preset.js +13 -13
- package/dist/react-native/bin/get-stories.js +8 -8
- package/dist/react-native/metro/node.js +10 -10
- package/dist/react-native/metro/withForkbook.js +11 -11
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.js +7 -7
- package/dist/router/index.d.ts +69 -1
- package/dist/router/index.js +48 -8
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +1 -1
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/telemetry/index.js +43 -43
- package/dist/theming/index.js +13 -9
- package/dist/types/index.d.ts +2 -2
- package/package.json +2 -2
- package/dist/_node-chunks/builder-manager-V7M6SFEM.js +0 -1623
- package/dist/_node-chunks/chunk-27KT3BJI.js +0 -25
- package/dist/_node-chunks/chunk-4XNKH2BY.js +0 -18
- package/dist/_node-chunks/chunk-CT3L2NXZ.js +0 -20
- package/dist/_node-chunks/chunk-NORBEBNM.js +0 -19
- package/dist/_node-chunks/chunk-SBNQ6YGM.js +0 -11
- package/dist/_node-chunks/chunk-YHWOGAFM.js +0 -20
- package/dist/_node-chunks/dist-GJ53PFWF.js +0 -27
- package/dist/_node-chunks/dist-TLMACGH6.js +0 -16
- package/dist/_node-chunks/optimized-tests-DIPB4OM6.js +0 -22
- package/dist/_node-chunks/postinstallAddon-PSN7XRSV.js +0 -20
- package/dist/_node-chunks/session-id-K7PM5ZGL.js +0 -23
- package/dist/manager/_manager-chunks/globals-runtime-BMCaBukU.js +0 -413
- package/dist/manager/_manager-chunks/globals-runtime-BO0pfoqL.js +0 -3414
- package/dist/manager/_manager-chunks/globals-runtime-BZKYJxYC.js +0 -2093
- package/dist/manager/_manager-chunks/globals-runtime-CTyYXvUm.js +0 -41
- package/dist/manager/_manager-chunks/globals-runtime-Dbt08xWQ.js +0 -1960
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_jjck69g4sd from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_jjck69g4sd from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_jjck69g4sd from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_jjck69g4sd.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_jjck69g4sd.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_jjck69g4sd.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-
|
|
14
|
+
} from "../_node-chunks/chunk-K6VX4GUH.js";
|
|
15
15
|
import {
|
|
16
16
|
BananaSlug
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-TRZWEDUE.js";
|
|
18
18
|
import {
|
|
19
19
|
fromMarkdown,
|
|
20
20
|
mdxFromMarkdown,
|
|
21
21
|
mdxjs
|
|
22
|
-
} from "../_node-chunks/chunk-
|
|
22
|
+
} from "../_node-chunks/chunk-Y2FWEOIW.js";
|
|
23
|
+
import {
|
|
24
|
+
withRouteDepth
|
|
25
|
+
} from "../_node-chunks/chunk-UK2NKD4E.js";
|
|
23
26
|
import {
|
|
24
27
|
debounce
|
|
25
|
-
} from "../_node-chunks/chunk-
|
|
28
|
+
} from "../_node-chunks/chunk-YELBVH4K.js";
|
|
26
29
|
import {
|
|
27
30
|
require_lib
|
|
28
|
-
} from "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-3I43FMZC.js";
|
|
29
32
|
import {
|
|
30
33
|
Parser,
|
|
31
34
|
init_acorn,
|
|
32
35
|
require_acorn_jsx
|
|
33
|
-
} from "../_node-chunks/chunk-
|
|
36
|
+
} from "../_node-chunks/chunk-WTS7HYGM.js";
|
|
34
37
|
import {
|
|
35
38
|
isTelemetryModuleEnabled,
|
|
36
39
|
telemetry,
|
|
37
40
|
withSpan
|
|
38
|
-
} from "../_node-chunks/chunk-
|
|
39
|
-
import "../_node-chunks/chunk-
|
|
41
|
+
} from "../_node-chunks/chunk-FVJLKXNS.js";
|
|
42
|
+
import "../_node-chunks/chunk-MBJ2CUVU.js";
|
|
40
43
|
import {
|
|
41
44
|
getEffectiveToolAvailability,
|
|
42
45
|
getManifestStatus,
|
|
@@ -46,39 +49,39 @@ import {
|
|
|
46
49
|
isClaudePreviewLaunch,
|
|
47
50
|
isModuleGraphSupported,
|
|
48
51
|
resolveSkillInputs
|
|
49
|
-
} from "../_node-chunks/chunk-
|
|
52
|
+
} from "../_node-chunks/chunk-XA2UQNP3.js";
|
|
50
53
|
import {
|
|
51
54
|
CLAUDE_PREVIEW_AGENT_NAME
|
|
52
|
-
} from "../_node-chunks/chunk-
|
|
53
|
-
import "../_node-chunks/chunk-
|
|
54
|
-
import "../_node-chunks/chunk-
|
|
55
|
-
import "../_node-chunks/chunk-
|
|
55
|
+
} from "../_node-chunks/chunk-7PZDRNVT.js";
|
|
56
|
+
import "../_node-chunks/chunk-AONRQAQP.js";
|
|
57
|
+
import "../_node-chunks/chunk-ZST2SPBX.js";
|
|
58
|
+
import "../_node-chunks/chunk-REDMAZRP.js";
|
|
56
59
|
import {
|
|
57
60
|
detectAgent
|
|
58
|
-
} from "../_node-chunks/chunk-
|
|
59
|
-
import "../_node-chunks/chunk-
|
|
60
|
-
import "../_node-chunks/chunk-
|
|
61
|
+
} from "../_node-chunks/chunk-BZNVRJ6H.js";
|
|
62
|
+
import "../_node-chunks/chunk-Y5JLYH6J.js";
|
|
63
|
+
import "../_node-chunks/chunk-VQBXHU2T.js";
|
|
61
64
|
import {
|
|
62
65
|
userOrAutoTitleFromSpecifier
|
|
63
|
-
} from "../_node-chunks/chunk-
|
|
64
|
-
import "../_node-chunks/chunk-
|
|
65
|
-
import "../_node-chunks/chunk-
|
|
66
|
-
import "../_node-chunks/chunk-
|
|
66
|
+
} from "../_node-chunks/chunk-VZ3PQJKF.js";
|
|
67
|
+
import "../_node-chunks/chunk-RJV4QWRP.js";
|
|
68
|
+
import "../_node-chunks/chunk-IK35TZRH.js";
|
|
69
|
+
import "../_node-chunks/chunk-L7US6VLX.js";
|
|
67
70
|
import {
|
|
68
71
|
resolveImport,
|
|
69
72
|
supportedExtensions
|
|
70
|
-
} from "../_node-chunks/chunk-
|
|
71
|
-
import "../_node-chunks/chunk-
|
|
72
|
-
import "../_node-chunks/chunk-
|
|
73
|
+
} from "../_node-chunks/chunk-UI6NW64P.js";
|
|
74
|
+
import "../_node-chunks/chunk-6O6BHNDO.js";
|
|
75
|
+
import "../_node-chunks/chunk-YLXOGJX6.js";
|
|
73
76
|
import {
|
|
74
77
|
require_src
|
|
75
|
-
} from "../_node-chunks/chunk-
|
|
76
|
-
import "../_node-chunks/chunk-
|
|
77
|
-
import "../_node-chunks/chunk-
|
|
78
|
-
import "../_node-chunks/chunk-
|
|
78
|
+
} from "../_node-chunks/chunk-ZFTEHWNT.js";
|
|
79
|
+
import "../_node-chunks/chunk-FPWDVE2V.js";
|
|
80
|
+
import "../_node-chunks/chunk-LKMHU2P3.js";
|
|
81
|
+
import "../_node-chunks/chunk-5NCRCPYK.js";
|
|
79
82
|
import {
|
|
80
83
|
logger
|
|
81
|
-
} from "../_node-chunks/chunk-
|
|
84
|
+
} from "../_node-chunks/chunk-U3BEYEZ5.js";
|
|
82
85
|
import {
|
|
83
86
|
ChangeDetectionFailureError,
|
|
84
87
|
ChangeDetectionUnavailableError,
|
|
@@ -128,80 +131,84 @@ import {
|
|
|
128
131
|
useStatics,
|
|
129
132
|
withTelemetry,
|
|
130
133
|
writeManifests
|
|
131
|
-
} from "../_node-chunks/chunk-
|
|
134
|
+
} from "../_node-chunks/chunk-ZMI35R7E.js";
|
|
132
135
|
import {
|
|
133
136
|
UniversalStore
|
|
134
|
-
} from "../_node-chunks/chunk-
|
|
137
|
+
} from "../_node-chunks/chunk-IOJ6NYLD.js";
|
|
138
|
+
import {
|
|
139
|
+
buildStoryPathMap,
|
|
140
|
+
urlPathDepth
|
|
141
|
+
} from "../_node-chunks/chunk-DDRGY4RJ.js";
|
|
135
142
|
import {
|
|
136
143
|
init_build,
|
|
137
144
|
parse
|
|
138
|
-
} from "../_node-chunks/chunk-
|
|
139
|
-
import "../_node-chunks/chunk-
|
|
140
|
-
import "../_node-chunks/chunk-
|
|
145
|
+
} from "../_node-chunks/chunk-I6ANUF4J.js";
|
|
146
|
+
import "../_node-chunks/chunk-OPLD7FOE.js";
|
|
147
|
+
import "../_node-chunks/chunk-7X5WP3UJ.js";
|
|
141
148
|
import {
|
|
142
149
|
registerToolset
|
|
143
|
-
} from "../_node-chunks/chunk-
|
|
144
|
-
import "../_node-chunks/chunk-
|
|
145
|
-
import "../_node-chunks/chunk-
|
|
146
|
-
import "../_node-chunks/chunk-
|
|
150
|
+
} from "../_node-chunks/chunk-MMMKY3DA.js";
|
|
151
|
+
import "../_node-chunks/chunk-VF6725VX.js";
|
|
152
|
+
import "../_node-chunks/chunk-GABGLW7D.js";
|
|
153
|
+
import "../_node-chunks/chunk-ASFRQHZH.js";
|
|
147
154
|
import {
|
|
148
155
|
STORY_FILE_TEST_REGEXP,
|
|
149
156
|
getStoryImportPathFromEntry
|
|
150
|
-
} from "../_node-chunks/chunk-
|
|
157
|
+
} from "../_node-chunks/chunk-WI6FDUOM.js";
|
|
151
158
|
import {
|
|
152
159
|
getService,
|
|
153
160
|
registerService,
|
|
154
161
|
writeOpenServiceStaticFiles
|
|
155
|
-
} from "../_node-chunks/chunk-
|
|
162
|
+
} from "../_node-chunks/chunk-3R57KO3F.js";
|
|
156
163
|
import {
|
|
157
164
|
Channel,
|
|
158
165
|
describeService,
|
|
159
166
|
getRegisteredServices,
|
|
160
167
|
listServices
|
|
161
|
-
} from "../_node-chunks/chunk-
|
|
162
|
-
import "../_node-chunks/chunk-
|
|
168
|
+
} from "../_node-chunks/chunk-QVF2NJK4.js";
|
|
169
|
+
import "../_node-chunks/chunk-35JF5BS4.js";
|
|
163
170
|
import {
|
|
164
171
|
isEqual
|
|
165
|
-
} from "../_node-chunks/chunk-
|
|
166
|
-
import "../_node-chunks/chunk-
|
|
167
|
-
import "../_node-chunks/chunk-
|
|
168
|
-
import "../_node-chunks/chunk-
|
|
172
|
+
} from "../_node-chunks/chunk-4W6HJYYC.js";
|
|
173
|
+
import "../_node-chunks/chunk-57BBVTHQ.js";
|
|
174
|
+
import "../_node-chunks/chunk-ELMANXC3.js";
|
|
175
|
+
import "../_node-chunks/chunk-F6RXCQF6.js";
|
|
169
176
|
import {
|
|
170
177
|
Tag
|
|
171
|
-
} from "../_node-chunks/chunk-
|
|
172
|
-
import "../_node-chunks/chunk-
|
|
173
|
-
import "../_node-chunks/chunk-
|
|
178
|
+
} from "../_node-chunks/chunk-R3BJJGEG.js";
|
|
179
|
+
import "../_node-chunks/chunk-BEHNZYWF.js";
|
|
180
|
+
import "../_node-chunks/chunk-POXIO453.js";
|
|
174
181
|
import {
|
|
175
182
|
up2 as up
|
|
176
|
-
} from "../_node-chunks/chunk-
|
|
183
|
+
} from "../_node-chunks/chunk-PRTTCG3N.js";
|
|
177
184
|
import {
|
|
178
185
|
invariant
|
|
179
|
-
} from "../_node-chunks/chunk-
|
|
186
|
+
} from "../_node-chunks/chunk-FKQHIPUA.js";
|
|
180
187
|
import {
|
|
181
188
|
resolvePackageDir,
|
|
182
189
|
safeResolveModule
|
|
183
|
-
} from "../_node-chunks/chunk-
|
|
184
|
-
import "../_node-chunks/chunk-
|
|
190
|
+
} from "../_node-chunks/chunk-JOOZKSBS.js";
|
|
191
|
+
import "../_node-chunks/chunk-RXEMA2TT.js";
|
|
185
192
|
import {
|
|
186
193
|
StorybookError
|
|
187
|
-
} from "../_node-chunks/chunk-
|
|
194
|
+
} from "../_node-chunks/chunk-WXMIR2F2.js";
|
|
188
195
|
import {
|
|
189
196
|
require_picocolors
|
|
190
|
-
} from "../_node-chunks/chunk-
|
|
197
|
+
} from "../_node-chunks/chunk-QE3NKWUX.js";
|
|
191
198
|
import {
|
|
192
199
|
storyIndexPathToAbsolutePath
|
|
193
|
-
} from "../_node-chunks/chunk-
|
|
194
|
-
import "../_node-chunks/chunk-
|
|
200
|
+
} from "../_node-chunks/chunk-BCFTMBAH.js";
|
|
201
|
+
import "../_node-chunks/chunk-GZ2YC6US.js";
|
|
195
202
|
import {
|
|
196
203
|
slash
|
|
197
|
-
} from "../_node-chunks/chunk-
|
|
198
|
-
import "../_node-chunks/chunk-
|
|
199
|
-
import "../_node-chunks/chunk-
|
|
204
|
+
} from "../_node-chunks/chunk-CHLWJ5F5.js";
|
|
205
|
+
import "../_node-chunks/chunk-ZOE2QQSS.js";
|
|
206
|
+
import "../_node-chunks/chunk-LMWS7NDR.js";
|
|
200
207
|
import {
|
|
201
208
|
__commonJS,
|
|
202
209
|
__require,
|
|
203
210
|
__toESM
|
|
204
|
-
} from "../_node-chunks/chunk-
|
|
211
|
+
} from "../_node-chunks/chunk-YSVJU5VZ.js";
|
|
205
212
|
|
|
206
213
|
// ../../node_modules/@discoveryjs/json-ext/package.json
|
|
207
214
|
var require_package = __commonJS({
|
|
@@ -704,7 +711,7 @@ var require_parse_chunked = __commonJS({
|
|
|
704
711
|
module.exports = function(chunkEmitter) {
|
|
705
712
|
let parser = new ChunkParser();
|
|
706
713
|
if (isObject(chunkEmitter) && isReadableStream(chunkEmitter))
|
|
707
|
-
return new Promise((
|
|
714
|
+
return new Promise((resolve10, reject) => {
|
|
708
715
|
chunkEmitter.on("data", (chunk) => {
|
|
709
716
|
try {
|
|
710
717
|
parser.push(chunk);
|
|
@@ -715,7 +722,7 @@ var require_parse_chunked = __commonJS({
|
|
|
715
722
|
parser = null, reject(e);
|
|
716
723
|
}).on("end", () => {
|
|
717
724
|
try {
|
|
718
|
-
|
|
725
|
+
resolve10(parser.finish());
|
|
719
726
|
} catch (e) {
|
|
720
727
|
reject(adjustPosition(e, parser));
|
|
721
728
|
} finally {
|
|
@@ -726,11 +733,11 @@ var require_parse_chunked = __commonJS({
|
|
|
726
733
|
if (typeof chunkEmitter == "function") {
|
|
727
734
|
let iterator = chunkEmitter();
|
|
728
735
|
if (isObject(iterator) && (Symbol.iterator in iterator || Symbol.asyncIterator in iterator))
|
|
729
|
-
return new Promise(async (
|
|
736
|
+
return new Promise(async (resolve10, reject) => {
|
|
730
737
|
try {
|
|
731
738
|
for await (let chunk of iterator)
|
|
732
739
|
parser.push(chunk);
|
|
733
|
-
|
|
740
|
+
resolve10(parser.finish());
|
|
734
741
|
} catch (e) {
|
|
735
742
|
reject(adjustPosition(e, parser));
|
|
736
743
|
} finally {
|
|
@@ -944,9 +951,9 @@ var require_isexe = __commonJS({
|
|
|
944
951
|
if (typeof options == "function" && (cb = options, options = {}), !cb) {
|
|
945
952
|
if (typeof Promise != "function")
|
|
946
953
|
throw new TypeError("callback not provided");
|
|
947
|
-
return new Promise(function(
|
|
954
|
+
return new Promise(function(resolve10, reject) {
|
|
948
955
|
isexe(path, options || {}, function(er, is) {
|
|
949
|
-
er ? reject(er) :
|
|
956
|
+
er ? reject(er) : resolve10(is);
|
|
950
957
|
});
|
|
951
958
|
});
|
|
952
959
|
}
|
|
@@ -983,22 +990,22 @@ var require_which = __commonJS({
|
|
|
983
990
|
};
|
|
984
991
|
}, which = (cmd, opt, cb) => {
|
|
985
992
|
typeof opt == "function" && (cb = opt, opt = {}), opt || (opt = {});
|
|
986
|
-
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [], step = (i) => new Promise((
|
|
993
|
+
let { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt), found = [], step = (i) => new Promise((resolve10, reject) => {
|
|
987
994
|
if (i === pathEnv.length)
|
|
988
|
-
return opt.all && found.length ?
|
|
995
|
+
return opt.all && found.length ? resolve10(found) : reject(getNotFoundError(cmd));
|
|
989
996
|
let ppRaw = pathEnv[i], pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw, pCmd = path.join(pathPart, cmd), p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
990
|
-
|
|
991
|
-
}), subStep = (p, i, ii) => new Promise((
|
|
997
|
+
resolve10(subStep(p, i, 0));
|
|
998
|
+
}), subStep = (p, i, ii) => new Promise((resolve10, reject) => {
|
|
992
999
|
if (ii === pathExt.length)
|
|
993
|
-
return
|
|
1000
|
+
return resolve10(step(i + 1));
|
|
994
1001
|
let ext = pathExt[ii];
|
|
995
1002
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
996
1003
|
if (!er && is)
|
|
997
1004
|
if (opt.all)
|
|
998
1005
|
found.push(p + ext);
|
|
999
1006
|
else
|
|
1000
|
-
return
|
|
1001
|
-
return
|
|
1007
|
+
return resolve10(p + ext);
|
|
1008
|
+
return resolve10(subStep(p, i, ii + 1));
|
|
1002
1009
|
});
|
|
1003
1010
|
});
|
|
1004
1011
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -1351,9 +1358,9 @@ var require_detect_port = __commonJS({
|
|
|
1351
1358
|
let hostname = "";
|
|
1352
1359
|
typeof port == "object" && port ? (hostname = port.hostname, callback = port.callback, port = port.port) : typeof port == "function" && (callback = port, port = null), port = parseInt(port) || 0;
|
|
1353
1360
|
let maxPort = port + 10;
|
|
1354
|
-
return maxPort > 65535 && (maxPort = 65535), debug("detect free port between [%s, %s)", port, maxPort), typeof callback == "function" ? tryListen(port, maxPort, hostname, callback) : new Promise((
|
|
1361
|
+
return maxPort > 65535 && (maxPort = 65535), debug("detect free port between [%s, %s)", port, maxPort), typeof callback == "function" ? tryListen(port, maxPort, hostname, callback) : new Promise((resolve10) => {
|
|
1355
1362
|
tryListen(port, maxPort, hostname, (_, realPort) => {
|
|
1356
|
-
|
|
1363
|
+
resolve10(realPort);
|
|
1357
1364
|
});
|
|
1358
1365
|
});
|
|
1359
1366
|
};
|
|
@@ -1396,7 +1403,7 @@ var require_detect_port = __commonJS({
|
|
|
1396
1403
|
var require_wait_port = __commonJS({
|
|
1397
1404
|
"../../node_modules/detect-port/lib/wait-port.js"(exports, module) {
|
|
1398
1405
|
"use strict";
|
|
1399
|
-
var debug = require_src()("wait-port"), detect = require_detect_port(), sleep = (ms) => new Promise((
|
|
1406
|
+
var debug = require_src()("wait-port"), detect = require_detect_port(), sleep = (ms) => new Promise((resolve10) => setTimeout(resolve10, ms));
|
|
1400
1407
|
async function waitPort(port, options = {}) {
|
|
1401
1408
|
let { retryInterval = 1e3, retries = 1 / 0 } = options, count = 1;
|
|
1402
1409
|
async function loop() {
|
|
@@ -1428,7 +1435,7 @@ import {
|
|
|
1428
1435
|
} from "@aussieljk/forkbook/internal/common";
|
|
1429
1436
|
|
|
1430
1437
|
// src/core-server/build-static.ts
|
|
1431
|
-
import { cp as cp2, mkdir } from "node:fs/promises";
|
|
1438
|
+
import { cp as cp2, mkdir as mkdir3 } from "node:fs/promises";
|
|
1432
1439
|
import { rm } from "node:fs/promises";
|
|
1433
1440
|
import { Channel as Channel2 } from "@aussieljk/forkbook/internal/channels";
|
|
1434
1441
|
import {
|
|
@@ -1445,7 +1452,7 @@ var global2 = globalThis;
|
|
|
1445
1452
|
|
|
1446
1453
|
// src/core-server/build-static.ts
|
|
1447
1454
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
1448
|
-
import { join as
|
|
1455
|
+
import { join as join6, relative as relative4, resolve as resolve4 } from "pathe";
|
|
1449
1456
|
|
|
1450
1457
|
// src/core-server/utils/build-or-throw.ts
|
|
1451
1458
|
import { NoMatchingExportError } from "@aussieljk/forkbook/internal/server-errors";
|
|
@@ -1540,7 +1547,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
1540
1547
|
// files can be e.g. '**/foo/*/*.js' so we just want the last bit,
|
|
1541
1548
|
// because the directory could already be within the files part (e.g. './x/foo/bar')
|
|
1542
1549
|
basename(specifier.files)
|
|
1543
|
-
), { glob } = await import("../_node-chunks/dist-
|
|
1550
|
+
), { glob } = await import("../_node-chunks/dist-FABQFQ76.js");
|
|
1544
1551
|
(await glob(slash(dirGlob), {
|
|
1545
1552
|
...commonGlobOptions(dirGlob),
|
|
1546
1553
|
expandDirectories: !1
|
|
@@ -1607,12 +1614,104 @@ function registerIndexJsonRoute({
|
|
|
1607
1614
|
});
|
|
1608
1615
|
}
|
|
1609
1616
|
|
|
1617
|
+
// src/core-server/utils/thumbnails.ts
|
|
1618
|
+
import { copyFile, mkdir, readFile } from "node:fs/promises";
|
|
1619
|
+
import { dirname as dirname2, join as join3 } from "pathe";
|
|
1620
|
+
|
|
1621
|
+
// src/shared/thumbnails.ts
|
|
1622
|
+
import { dirname, isAbsolute, normalize, relative as relative3, resolve as resolve3 } from "pathe";
|
|
1623
|
+
var THUMBNAIL_ROUTE = "thumbnails", THUMBNAIL_TYPES = {
|
|
1624
|
+
avif: "image/avif",
|
|
1625
|
+
gif: "image/gif",
|
|
1626
|
+
jpeg: "image/jpeg",
|
|
1627
|
+
jpg: "image/jpeg",
|
|
1628
|
+
png: "image/png",
|
|
1629
|
+
svg: "image/svg+xml",
|
|
1630
|
+
webp: "image/webp"
|
|
1631
|
+
}, extension = (path) => path.split(".").pop()?.toLowerCase() ?? "", isThumbnailUrl = (value) => /^([a-z][a-z\d+.-]*:|\/\/|\/)/i.test(value), resolveThumbnail = (value, storyFile, workingDir) => {
|
|
1632
|
+
if (!value)
|
|
1633
|
+
return;
|
|
1634
|
+
if (isThumbnailUrl(value) && !isAbsolute(value))
|
|
1635
|
+
return value;
|
|
1636
|
+
let file = isAbsolute(value) ? value : resolve3(dirname(storyFile), value);
|
|
1637
|
+
if (isAbsolute(value) && !normalize(value).startsWith(normalize(workingDir)))
|
|
1638
|
+
return value;
|
|
1639
|
+
let path = relative3(workingDir, file);
|
|
1640
|
+
if (!(path.startsWith("..") || !THUMBNAIL_TYPES[extension(path)]))
|
|
1641
|
+
return `${THUMBNAIL_ROUTE}/${path}`;
|
|
1642
|
+
}, thumbnailFile = (urlPath, workingDir) => {
|
|
1643
|
+
let path = urlPath.replace(/^\/+/, "");
|
|
1644
|
+
try {
|
|
1645
|
+
path = decodeURIComponent(path);
|
|
1646
|
+
} catch {
|
|
1647
|
+
return;
|
|
1648
|
+
}
|
|
1649
|
+
if (!path.startsWith(`${THUMBNAIL_ROUTE}/`))
|
|
1650
|
+
return;
|
|
1651
|
+
let file = resolve3(workingDir, path.slice(THUMBNAIL_ROUTE.length + 1));
|
|
1652
|
+
if (!(relative3(workingDir, file).startsWith("..") || !THUMBNAIL_TYPES[extension(file)]))
|
|
1653
|
+
return file;
|
|
1654
|
+
}, thumbnailContentType = (file) => THUMBNAIL_TYPES[extension(file)] ?? "application/octet-stream";
|
|
1655
|
+
|
|
1656
|
+
// src/core-server/utils/thumbnails.ts
|
|
1657
|
+
function registerThumbnailRoute(app, workingDir) {
|
|
1658
|
+
app.use(`/${THUMBNAIL_ROUTE}`, async (req, res) => {
|
|
1659
|
+
let url = (req.originalUrl ?? req.url ?? "").split("?")[0], file = thumbnailFile(url, workingDir);
|
|
1660
|
+
try {
|
|
1661
|
+
if (!file)
|
|
1662
|
+
throw new Error("Not a thumbnail");
|
|
1663
|
+
let body = await readFile(file);
|
|
1664
|
+
res.setHeader("Content-Type", thumbnailContentType(file)), res.end(body);
|
|
1665
|
+
} catch {
|
|
1666
|
+
res.statusCode = 404, res.end("Not found");
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
async function copyThumbnails(outputDir, index, workingDir) {
|
|
1671
|
+
let paths = new Set(
|
|
1672
|
+
Object.values(index.entries).map((entry) => entry.thumbnail).filter((path) => !!path && path.startsWith(`${THUMBNAIL_ROUTE}/`))
|
|
1673
|
+
), count = 0;
|
|
1674
|
+
return await Promise.all(
|
|
1675
|
+
[...paths].map(async (path) => {
|
|
1676
|
+
let file = thumbnailFile(path, workingDir);
|
|
1677
|
+
if (!file)
|
|
1678
|
+
return;
|
|
1679
|
+
let target = join3(outputDir, path);
|
|
1680
|
+
await mkdir(dirname2(target), { recursive: !0 }), await copyFile(file, target).then(
|
|
1681
|
+
() => count++,
|
|
1682
|
+
() => {
|
|
1683
|
+
}
|
|
1684
|
+
);
|
|
1685
|
+
})
|
|
1686
|
+
), count;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
// src/core-server/utils/write-route-pages.ts
|
|
1690
|
+
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
|
|
1691
|
+
import { join as join4 } from "pathe";
|
|
1692
|
+
var STATIC_APP_ROUTES = [
|
|
1693
|
+
"/all",
|
|
1694
|
+
"/review",
|
|
1695
|
+
"/settings/about",
|
|
1696
|
+
"/settings/shortcuts",
|
|
1697
|
+
"/settings/whats-new"
|
|
1698
|
+
];
|
|
1699
|
+
async function writeRoutePages(outputDir, index) {
|
|
1700
|
+
let html = await readFile2(join4(outputDir, "index.html"), "utf8"), urlPaths = [...buildStoryPathMap(Object.values(index.entries)).byUrl.keys()], allPaths = [...STATIC_APP_ROUTES, ...urlPaths];
|
|
1701
|
+
return await Promise.all(
|
|
1702
|
+
allPaths.map(async (urlPath) => {
|
|
1703
|
+
let dir = join4(outputDir, urlPath);
|
|
1704
|
+
await mkdir2(dir, { recursive: !0 }), await writeFile2(join4(dir, "index.html"), withRouteDepth(html, urlPathDepth(urlPath)));
|
|
1705
|
+
})
|
|
1706
|
+
), allPaths.length;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1610
1709
|
// src/core-server/utils/metadata.ts
|
|
1611
|
-
import { writeFile as
|
|
1710
|
+
import { writeFile as writeFile3 } from "node:fs/promises";
|
|
1612
1711
|
import { getStorybookMetadata } from "@aussieljk/forkbook/internal/telemetry";
|
|
1613
1712
|
async function extractStorybookMetadata(outputFile, configDir) {
|
|
1614
1713
|
let storybookMetadata = await getStorybookMetadata(configDir);
|
|
1615
|
-
await
|
|
1714
|
+
await writeFile3(outputFile, JSON.stringify(storybookMetadata));
|
|
1616
1715
|
}
|
|
1617
1716
|
function useStorybookMetadata(app, configDir) {
|
|
1618
1717
|
app.use("/project.json", async (req, res) => {
|
|
@@ -1624,7 +1723,7 @@ function useStorybookMetadata(app, configDir) {
|
|
|
1624
1723
|
// src/core-server/utils/output-stats.ts
|
|
1625
1724
|
var import_json_ext = __toESM(require_src2(), 1), import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
1626
1725
|
import { createWriteStream } from "node:fs";
|
|
1627
|
-
import { join as
|
|
1726
|
+
import { join as join5 } from "node:path";
|
|
1628
1727
|
import { logger as logger3 } from "@aussieljk/forkbook/internal/node-logger";
|
|
1629
1728
|
async function outputStats(directory, previewStats, managerStats) {
|
|
1630
1729
|
if (previewStats) {
|
|
@@ -1637,9 +1736,9 @@ async function outputStats(directory, previewStats, managerStats) {
|
|
|
1637
1736
|
}
|
|
1638
1737
|
}
|
|
1639
1738
|
var writeStats = async (directory, name, stats) => {
|
|
1640
|
-
let filePath =
|
|
1641
|
-
return await new Promise((
|
|
1642
|
-
(0, import_json_ext.stringifyStream)(data, null, 2).on("error", reject).pipe(createWriteStream(filePath)).on("error", reject).on("finish",
|
|
1739
|
+
let filePath = join5(directory, `${name}-stats.json`), { chunks, ...data } = stats.toJson();
|
|
1740
|
+
return await new Promise((resolve10, reject) => {
|
|
1741
|
+
(0, import_json_ext.stringifyStream)(data, null, 2).on("error", reject).pipe(createWriteStream(filePath)).on("error", reject).on("finish", resolve10);
|
|
1643
1742
|
}), filePath;
|
|
1644
1743
|
};
|
|
1645
1744
|
|
|
@@ -1694,13 +1793,13 @@ function summarizeIndex(storyIndex) {
|
|
|
1694
1793
|
async function buildStaticStandalone(options) {
|
|
1695
1794
|
if (options.configType = "PRODUCTION", options.outputDir === "")
|
|
1696
1795
|
throw new Error("Won't remove current directory. Check your outputDir!");
|
|
1697
|
-
if (options.outputDir =
|
|
1796
|
+
if (options.outputDir = resolve4(options.outputDir), options.configDir = resolve4(options.configDir), logger4.step(`Cleaning outputDir: ${import_picocolors3.default.cyan(relative4(process.cwd(), options.outputDir))}`), options.outputDir === "/")
|
|
1698
1797
|
throw new Error("Won't remove directory '/'. Check your outputDir!");
|
|
1699
1798
|
await rm(options.outputDir, { recursive: !0, force: !0 }).catch(() => {
|
|
1700
|
-
}), await
|
|
1799
|
+
}), await mkdir3(options.outputDir, { recursive: !0 });
|
|
1701
1800
|
let config = await loadMainConfig(options), { framework } = config, corePresets = [], frameworkName = typeof framework == "string" ? framework : framework?.name;
|
|
1702
|
-
frameworkName ? corePresets.push(
|
|
1703
|
-
let commonPreset =
|
|
1801
|
+
frameworkName ? corePresets.push(join6(frameworkName, "preset")) : logger4.warn(`you have not specified a framework in your ${options.configDir}/main.js`);
|
|
1802
|
+
let commonPreset = join6(
|
|
1704
1803
|
resolvePackageDir("@aussieljk/forkbook"),
|
|
1705
1804
|
"dist/core-server/presets/common-preset.js"
|
|
1706
1805
|
), commonOverridePreset = import.meta.resolve("@aussieljk/forkbook/internal/core-server/presets/common-override-preset");
|
|
@@ -1748,7 +1847,7 @@ async function buildStaticStandalone(options) {
|
|
|
1748
1847
|
), staticDirs && effects.push(
|
|
1749
1848
|
copyAllStaticFilesRelativeToMain(staticDirs, options.outputDir, options.configDir)
|
|
1750
1849
|
);
|
|
1751
|
-
let coreServerPublicDir =
|
|
1850
|
+
let coreServerPublicDir = join6(resolvePackageDir("@aussieljk/forkbook"), "assets/browser");
|
|
1752
1851
|
effects.push(cp2(coreServerPublicDir, options.outputDir, { recursive: !0, force: !0 }));
|
|
1753
1852
|
let hasRegisteredServices = getRegisteredServices().length > 0, shouldWriteManifests = features?.componentsManifest;
|
|
1754
1853
|
(hasRegisteredServices || shouldWriteManifests) && effects.push(
|
|
@@ -1757,8 +1856,13 @@ async function buildStaticStandalone(options) {
|
|
|
1757
1856
|
})()
|
|
1758
1857
|
);
|
|
1759
1858
|
let storyIndexGeneratorPromise = presets.apply("storyIndexGenerator");
|
|
1760
|
-
effects.push(writeIndexJson(
|
|
1761
|
-
|
|
1859
|
+
effects.push(writeIndexJson(join6(options.outputDir, "index.json"), storyIndexGeneratorPromise)), options.previewOnly || effects.push(
|
|
1860
|
+
(async () => {
|
|
1861
|
+
let index = await (await storyIndexGeneratorPromise)?.getIndex();
|
|
1862
|
+
index && (await writeRoutePages(options.outputDir, index), await copyThumbnails(options.outputDir, index, process.cwd()));
|
|
1863
|
+
})()
|
|
1864
|
+
), core?.disableProjectJson || effects.push(
|
|
1865
|
+
extractStorybookMetadata(join6(options.outputDir, "project.json"), options.configDir)
|
|
1762
1866
|
), options.debugWebpack && logConfig("Preview webpack config", await previewBuilder.getConfig(fullOptions)), logger4.info("Building preview..");
|
|
1763
1867
|
let startTime = process.hrtime();
|
|
1764
1868
|
if (await Promise.all([
|
|
@@ -1791,7 +1895,7 @@ async function buildStaticStandalone(options) {
|
|
|
1791
1895
|
}
|
|
1792
1896
|
|
|
1793
1897
|
// src/core-server/build-dev.ts
|
|
1794
|
-
import { readFile as
|
|
1898
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
1795
1899
|
import {
|
|
1796
1900
|
JsPackageManagerFactory,
|
|
1797
1901
|
getInterpretedFile,
|
|
@@ -1811,7 +1915,7 @@ import {
|
|
|
1811
1915
|
NoStatsForViteDevError
|
|
1812
1916
|
} from "@aussieljk/forkbook/internal/server-errors";
|
|
1813
1917
|
import { oneWayHash, telemetry as telemetry4 } from "@aussieljk/forkbook/internal/telemetry";
|
|
1814
|
-
import { join as
|
|
1918
|
+
import { join as join10, relative as relative5, resolve as resolve7 } from "pathe";
|
|
1815
1919
|
import { dedent as dedent5 } from "ts-dedent";
|
|
1816
1920
|
|
|
1817
1921
|
// src/channels/postmessage/index.ts
|
|
@@ -1985,7 +2089,7 @@ function build_default2(opts) {
|
|
|
1985
2089
|
}
|
|
1986
2090
|
|
|
1987
2091
|
// src/core-server/change-detection/change-detection-service.ts
|
|
1988
|
-
import { join as
|
|
2092
|
+
import { join as join7, normalize as normalize2 } from "pathe";
|
|
1989
2093
|
import { logger as logger7 } from "@aussieljk/forkbook/internal/node-logger";
|
|
1990
2094
|
import { CHANGE_DETECTION_STATUS_TYPE_ID } from "@aussieljk/forkbook/internal/types";
|
|
1991
2095
|
|
|
@@ -2219,9 +2323,9 @@ var ChangeDetectionService = class {
|
|
|
2219
2323
|
this.options.storyIndexGeneratorPromise,
|
|
2220
2324
|
this.getIndexBaselineService().getBaselineEntryIds()
|
|
2221
2325
|
]), changedFiles = new Set(
|
|
2222
|
-
Array.from(changes.changed).map((path) =>
|
|
2326
|
+
Array.from(changes.changed).map((path) => normalize2(join7(repoRoot, path)))
|
|
2223
2327
|
), newFiles = new Set(
|
|
2224
|
-
Array.from(changes.new).map((path) =>
|
|
2328
|
+
Array.from(changes.new).map((path) => normalize2(join7(repoRoot, path)))
|
|
2225
2329
|
), scannedFiles = /* @__PURE__ */ new Set([...changedFiles, ...newFiles]), storyIndex = await storyIndexGenerator.getIndex(), baselineStatuses = buildIndexBaselineStatuses(storyIndex, baselineEntryIds), storyIdsByFile = getStoryIdsByAbsolutePath(storyIndex, this.workingDir), statuses = /* @__PURE__ */ new Map(), scannedFilesArray = [...scannedFiles], lookupResults = await this.getModuleGraphIndex().queries.storiesForFiles.loaded({
|
|
2226
2330
|
files: scannedFilesArray
|
|
2227
2331
|
});
|
|
@@ -2432,13 +2536,13 @@ function getSecurityHeadersMiddleware(security) {
|
|
|
2432
2536
|
|
|
2433
2537
|
// src/core-server/utils/middleware.ts
|
|
2434
2538
|
import { existsSync } from "node:fs";
|
|
2435
|
-
import { resolve as
|
|
2539
|
+
import { resolve as resolve5 } from "pathe";
|
|
2436
2540
|
var fileExists = (basename4) => [".js", ".mjs", ".cjs"].reduce((found, ext) => {
|
|
2437
2541
|
let filename = `${basename4}${ext}`;
|
|
2438
2542
|
return !found && existsSync(filename) ? filename : found;
|
|
2439
2543
|
}, "");
|
|
2440
2544
|
async function getMiddleware(configDir) {
|
|
2441
|
-
let middlewarePath = fileExists(
|
|
2545
|
+
let middlewarePath = fileExists(resolve5(configDir, "middleware"));
|
|
2442
2546
|
if (middlewarePath) {
|
|
2443
2547
|
let middlewareModule = await import("file://" + middlewarePath);
|
|
2444
2548
|
return middlewareModule.default ?? middlewareModule;
|
|
@@ -2455,7 +2559,7 @@ import { dedent } from "ts-dedent";
|
|
|
2455
2559
|
// src/core-server/utils/open-browser/opener.ts
|
|
2456
2560
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1), import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
2457
2561
|
import { execSync } from "node:child_process";
|
|
2458
|
-
import { join as
|
|
2562
|
+
import { join as join8 } from "node:path";
|
|
2459
2563
|
import { logger as logger8 } from "@aussieljk/forkbook/internal/node-logger";
|
|
2460
2564
|
import open from "open";
|
|
2461
2565
|
var OSX_CHROME = "google chrome";
|
|
@@ -2516,7 +2620,7 @@ function startBrowserProcess(browser, url, args) {
|
|
|
2516
2620
|
for (let chromiumBrowser of supportedChromiumBrowsers)
|
|
2517
2621
|
try {
|
|
2518
2622
|
execSync(`ps cax | grep "${chromiumBrowser}"`);
|
|
2519
|
-
let command = `osascript "${
|
|
2623
|
+
let command = `osascript "${join8(
|
|
2520
2624
|
resolvePackageDir("@aussieljk/forkbook"),
|
|
2521
2625
|
"assets",
|
|
2522
2626
|
"server",
|
|
@@ -2603,23 +2707,25 @@ var getListenHost = (host) => host || "127.0.0.1", COVERS_LOOPBACK = /* @__PURE_
|
|
|
2603
2707
|
if (COVERS_LOOPBACK.has(address))
|
|
2604
2708
|
return;
|
|
2605
2709
|
let loopback = net3.createServer((socket) => server.emit("connection", socket));
|
|
2606
|
-
return server.once("close", () => loopback.close()), await new Promise((
|
|
2607
|
-
loopback.once("error", reject), loopback.listen({ port, host: "127.0.0.1" },
|
|
2710
|
+
return server.once("close", () => loopback.close()), await new Promise((resolve10, reject) => {
|
|
2711
|
+
loopback.once("error", reject), loopback.listen({ port, host: "127.0.0.1" }, resolve10);
|
|
2608
2712
|
}), loopback;
|
|
2609
2713
|
};
|
|
2610
2714
|
function getServerAddresses(port, host, proto, initialPath) {
|
|
2611
2715
|
let address = new URL(`${proto}://127.0.0.1:${port}/`), networkAddress = new URL(`${proto}://${host || getLocalIp()}:${port}/`);
|
|
2612
|
-
if (initialPath) {
|
|
2613
|
-
let searchParams = `?path=${decodeURIComponent(
|
|
2614
|
-
initialPath.startsWith("/") ? initialPath : `/${initialPath}`
|
|
2615
|
-
)}`;
|
|
2616
|
-
address.search = searchParams, networkAddress.search = searchParams;
|
|
2617
|
-
}
|
|
2618
2716
|
return {
|
|
2619
|
-
address: address.href,
|
|
2620
|
-
networkAddress: networkAddress.href
|
|
2717
|
+
address: withInitialPath(address.href, initialPath),
|
|
2718
|
+
networkAddress: withInitialPath(networkAddress.href, initialPath)
|
|
2621
2719
|
};
|
|
2622
2720
|
}
|
|
2721
|
+
function withInitialPath(address, initialPath) {
|
|
2722
|
+
if (!initialPath)
|
|
2723
|
+
return address;
|
|
2724
|
+
let url = new URL(address);
|
|
2725
|
+
return url.pathname = decodeURIComponent(
|
|
2726
|
+
initialPath.startsWith("/") ? initialPath : `/${initialPath}`
|
|
2727
|
+
).replace(/^\/(story|docs)\//, "/_$1/"), url.href;
|
|
2728
|
+
}
|
|
2623
2729
|
var getServerPort = (port, { exactPort } = {}) => (0, import_detect_port.default)(port).catch((error) => {
|
|
2624
2730
|
logger10.error(error), process.exit(-1);
|
|
2625
2731
|
}).then((freePort) => {
|
|
@@ -2667,7 +2773,7 @@ async function storybookDevServer(options, server) {
|
|
|
2667
2773
|
channel: options.channel,
|
|
2668
2774
|
workingDir,
|
|
2669
2775
|
configDir
|
|
2670
|
-
}), (await getMiddleware(options.configDir))(app), await options.presets.apply("experimental_devServer", app), !core?.builder)
|
|
2776
|
+
}), registerThumbnailRoute(app, workingDir), (await getMiddleware(options.configDir))(app), await options.presets.apply("experimental_devServer", app), !core?.builder)
|
|
2671
2777
|
throw new MissingBuilderError();
|
|
2672
2778
|
let resolvedPreviewBuilder = typeof core?.builder == "string" ? core.builder : core?.builder?.name, [previewBuilder, managerBuilder] = await Promise.all([
|
|
2673
2779
|
getPreviewBuilder(resolvedPreviewBuilder),
|
|
@@ -2708,14 +2814,16 @@ async function storybookDevServer(options, server) {
|
|
|
2708
2814
|
logger11.warn("Change detection: adapter initialisation failed"), logger11.debug(err instanceof Error ? err.stack ?? err.message : String(err));
|
|
2709
2815
|
}
|
|
2710
2816
|
resolveChangeDetectionAdapter(adapter), changeDetectionService.start();
|
|
2711
|
-
let listening = new Promise((
|
|
2712
|
-
server.once("error", reject), app.listen({ port: options.port, host: getListenHost(options.host) },
|
|
2817
|
+
let listening = new Promise((resolve10, reject) => {
|
|
2818
|
+
server.once("error", reject), app.listen({ port: options.port, host: getListenHost(options.host) }, resolve10);
|
|
2713
2819
|
}).then(() => addLoopbackListener(server));
|
|
2714
2820
|
try {
|
|
2715
2821
|
let [indexGenerator] = await Promise.all([storyIndexGeneratorPromise, listening]);
|
|
2716
2822
|
if (indexGenerator && !options.ci && !options.smokeTest && options.open) {
|
|
2717
2823
|
let url = options.host && options.host !== "0.0.0.0" ? options.networkAddress : options.localAddress;
|
|
2718
|
-
openInBrowser(
|
|
2824
|
+
openInBrowser(
|
|
2825
|
+
options.previewOnly ? `${url}iframe.html?navigator=true` : withInitialPath(url, options.initialPath)
|
|
2826
|
+
).catch(() => {
|
|
2719
2827
|
});
|
|
2720
2828
|
}
|
|
2721
2829
|
} catch (e) {
|
|
@@ -3094,10 +3202,10 @@ ${updateMessage}` : ""}
|
|
|
3094
3202
|
import { execFile } from "node:child_process";
|
|
3095
3203
|
import { randomUUID } from "node:crypto";
|
|
3096
3204
|
import { existsSync as existsSync2, rmSync } from "node:fs";
|
|
3097
|
-
import { chmod, mkdir as
|
|
3205
|
+
import { chmod, mkdir as mkdir4, readFile as readFile3, readdir, rename, rm as rm2, stat, writeFile as writeFile4 } from "node:fs/promises";
|
|
3098
3206
|
import { homedir, userInfo } from "node:os";
|
|
3099
3207
|
import { findStorybookPackageRoot, normalizeAddonName } from "@aussieljk/forkbook/internal/common";
|
|
3100
|
-
import { join as
|
|
3208
|
+
import { join as join9, resolve as resolve6 } from "pathe";
|
|
3101
3209
|
var FORKBOOK_MCP_ADDON = "@aussieljk/forkbook/addon-mcp", DEFAULT_MCP_ENDPOINT = "/mcp", ONE_DAY_MS = 1440 * 60 * 1e3, SEVEN_DAYS_MS = 7 * ONE_DAY_MS, REGISTRY_DIR_MODE = 448, RECORD_FILE_MODE = 384;
|
|
3102
3210
|
function execFileAsync(file, args) {
|
|
3103
3211
|
return new Promise((resolveExec, rejectExec) => {
|
|
@@ -3124,7 +3232,7 @@ async function restrictOwnerAccess(targetPath, mode) {
|
|
|
3124
3232
|
}
|
|
3125
3233
|
}
|
|
3126
3234
|
function getDefaultRuntimeInstanceRegistryDir() {
|
|
3127
|
-
return
|
|
3235
|
+
return join9(homedir(), ".forkbook", "instances");
|
|
3128
3236
|
}
|
|
3129
3237
|
function getStorybookBaseUrl(address) {
|
|
3130
3238
|
let url = new URL(address);
|
|
@@ -3158,8 +3266,8 @@ function createRuntimeInstanceRecord({
|
|
|
3158
3266
|
schemaVersion: 1,
|
|
3159
3267
|
instanceId,
|
|
3160
3268
|
pid,
|
|
3161
|
-
cwd:
|
|
3162
|
-
...configDir ? { configDir:
|
|
3269
|
+
cwd: resolve6(cwd),
|
|
3270
|
+
...configDir ? { configDir: resolve6(cwd, configDir) } : {},
|
|
3163
3271
|
url: storybookBaseUrl,
|
|
3164
3272
|
port,
|
|
3165
3273
|
...token ? { token } : {},
|
|
@@ -3172,13 +3280,13 @@ function createRuntimeInstanceRecord({
|
|
|
3172
3280
|
};
|
|
3173
3281
|
}
|
|
3174
3282
|
async function writeRuntimeInstanceRecord(record, registryDir = getDefaultRuntimeInstanceRegistryDir()) {
|
|
3175
|
-
await
|
|
3176
|
-
let recordPath =
|
|
3283
|
+
await mkdir4(registryDir, { recursive: !0, mode: REGISTRY_DIR_MODE }), await restrictOwnerAccess(registryDir, REGISTRY_DIR_MODE), await cleanupRuntimeInstanceRegistry(registryDir);
|
|
3284
|
+
let recordPath = join9(registryDir, `${record.instanceId}.json`), tempPath = join9(
|
|
3177
3285
|
registryDir,
|
|
3178
3286
|
`${record.instanceId}.${record.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`
|
|
3179
3287
|
);
|
|
3180
3288
|
try {
|
|
3181
|
-
await
|
|
3289
|
+
await writeFile4(tempPath, `${JSON.stringify(record, null, 2)}
|
|
3182
3290
|
`, {
|
|
3183
3291
|
encoding: "utf-8",
|
|
3184
3292
|
mode: RECORD_FILE_MODE
|
|
@@ -3239,7 +3347,7 @@ async function cleanupRuntimeInstanceRegistry(registryDir) {
|
|
|
3239
3347
|
entries.map(async (entry) => {
|
|
3240
3348
|
if (!entry.isFile())
|
|
3241
3349
|
return;
|
|
3242
|
-
let recordPath =
|
|
3350
|
+
let recordPath = join9(registryDir, entry.name);
|
|
3243
3351
|
try {
|
|
3244
3352
|
let { mtimeMs } = await stat(recordPath);
|
|
3245
3353
|
if (entry.name.endsWith(".tmp")) {
|
|
@@ -3255,7 +3363,7 @@ async function cleanupRuntimeInstanceRegistry(registryDir) {
|
|
|
3255
3363
|
}
|
|
3256
3364
|
if (!entry.name.endsWith(".json"))
|
|
3257
3365
|
return;
|
|
3258
|
-
let content = await
|
|
3366
|
+
let content = await readFile3(recordPath, "utf-8"), record;
|
|
3259
3367
|
try {
|
|
3260
3368
|
record = JSON.parse(content);
|
|
3261
3369
|
} catch {
|
|
@@ -3327,7 +3435,7 @@ async function writeStorybookRuntimeInstanceRecord({
|
|
|
3327
3435
|
}
|
|
3328
3436
|
|
|
3329
3437
|
// src/core-server/utils/server-init.ts
|
|
3330
|
-
import { readFile as
|
|
3438
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
3331
3439
|
import { logger as logger14 } from "@aussieljk/forkbook/internal/node-logger";
|
|
3332
3440
|
import http2 from "http";
|
|
3333
3441
|
import https from "https";
|
|
@@ -3336,9 +3444,9 @@ async function getServer(options) {
|
|
|
3336
3444
|
return http2.createServer();
|
|
3337
3445
|
options.sslCert || (logger14.error("Error: --ssl-cert is required with --https"), process.exit(-1)), options.sslKey || (logger14.error("Error: --ssl-key is required with --https"), process.exit(-1));
|
|
3338
3446
|
let sslOptions = {
|
|
3339
|
-
ca: await Promise.all((options.sslCa || []).map((ca) =>
|
|
3340
|
-
cert: await
|
|
3341
|
-
key: await
|
|
3447
|
+
ca: await Promise.all((options.sslCa || []).map((ca) => readFile4(ca, { encoding: "utf8" }))),
|
|
3448
|
+
cert: await readFile4(options.sslCert, { encoding: "utf8" }),
|
|
3449
|
+
key: await readFile4(options.sslKey, { encoding: "utf8" })
|
|
3342
3450
|
};
|
|
3343
3451
|
return https.createServer(sslOptions);
|
|
3344
3452
|
}
|
|
@@ -3353,7 +3461,7 @@ function stripCommentsAndStrings(code) {
|
|
|
3353
3461
|
|
|
3354
3462
|
// src/core-server/build-dev.ts
|
|
3355
3463
|
async function buildDevStandalone(options) {
|
|
3356
|
-
let { packageJson, versionUpdates } = options, { storybookVersion } = options, configDir =
|
|
3464
|
+
let { packageJson, versionUpdates } = options, { storybookVersion } = options, configDir = resolve7(options.configDir);
|
|
3357
3465
|
packageJson ? (invariant(
|
|
3358
3466
|
packageJson.version !== void 0,
|
|
3359
3467
|
`Expected package.json#version to be defined in the "${packageJson.name}" package}`
|
|
@@ -3369,17 +3477,16 @@ async function buildDevStandalone(options) {
|
|
|
3369
3477
|
`,
|
|
3370
3478
|
initialValue: !0
|
|
3371
3479
|
}) || process.exit(1));
|
|
3372
|
-
let cacheKey = oneWayHash(
|
|
3480
|
+
let cacheKey = oneWayHash(relative5(getProjectRoot(), configDir));
|
|
3373
3481
|
invariant(port, "expected options to have a port");
|
|
3374
3482
|
let { address: localAddress, networkAddress } = getServerAddresses(
|
|
3375
3483
|
port,
|
|
3376
3484
|
options.host,
|
|
3377
|
-
options.https ? "https" : "http"
|
|
3378
|
-
|
|
3379
|
-
), cacheOutputDir = resolvePathInStorybookCache2("public", cacheKey), outputDir = resolve6(options.outputDir || cacheOutputDir);
|
|
3485
|
+
options.https ? "https" : "http"
|
|
3486
|
+
), cacheOutputDir = resolvePathInStorybookCache2("public", cacheKey), outputDir = resolve7(options.outputDir || cacheOutputDir);
|
|
3380
3487
|
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;
|
|
3381
3488
|
let config = await loadMainConfig2(options), { core, framework } = config, corePresets = [], frameworkName = typeof framework == "string" ? framework : framework?.name;
|
|
3382
|
-
validateFrameworkName(frameworkName), frameworkName && corePresets.push(
|
|
3489
|
+
validateFrameworkName(frameworkName), frameworkName && corePresets.push(join10(frameworkName, "preset")), frameworkName = frameworkName || "custom";
|
|
3383
3490
|
let packageManager = JsPackageManagerFactory.getPackageManager({
|
|
3384
3491
|
configDir: options.configDir
|
|
3385
3492
|
}), server = await getServer(options), presets = await loadAllPresets2({
|
|
@@ -3414,10 +3521,10 @@ async function buildDevStandalone(options) {
|
|
|
3414
3521
|
if (resolvedPreviewBuilder.includes("builder-vite")) {
|
|
3415
3522
|
let deprecationMessage = dedent5(`Using CommonJS in your main configuration file is deprecated with Vite.
|
|
3416
3523
|
- Refer to the migration guide at https://forkbook.ljk.dev/docs/migration#commonjs-with-vite-is-deprecated`), mainJsPath = getInterpretedFile(
|
|
3417
|
-
|
|
3524
|
+
resolve7(options.configDir || defaultConfigDir(), "main")
|
|
3418
3525
|
);
|
|
3419
3526
|
/\.c[jt]s$/.test(mainJsPath) && deprecate(deprecationMessage);
|
|
3420
|
-
let mainJsContent = await
|
|
3527
|
+
let mainJsContent = await readFile5(mainJsPath, { encoding: "utf8" }), CJS_CONTENT_REGEX = /\bmodule\.exports\b|\bexports[.[]|\brequire\s*\(|\bObject\.(?:defineProperty|defineProperties|assign)\s*\(\s*exports\b/, strippedContent = stripCommentsAndStrings(mainJsContent);
|
|
3421
3528
|
CJS_CONTENT_REGEX.test(strippedContent) && deprecate(deprecationMessage);
|
|
3422
3529
|
}
|
|
3423
3530
|
let resolvedRenderer = renderer && resolveAddonName2(options.configDir, renderer, options), channel = getServerChannel(server, {
|
|
@@ -3430,7 +3537,7 @@ async function buildDevStandalone(options) {
|
|
|
3430
3537
|
});
|
|
3431
3538
|
presets = await loadAllPresets2({
|
|
3432
3539
|
corePresets: [
|
|
3433
|
-
|
|
3540
|
+
join10(resolvePackageDir("@aussieljk/forkbook"), "dist/core-server/presets/common-preset.js"),
|
|
3434
3541
|
...managerBuilder.corePresets || [],
|
|
3435
3542
|
...previewBuilder.corePresets || [],
|
|
3436
3543
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
@@ -3488,9 +3595,9 @@ async function buildDevStandalone(options) {
|
|
|
3488
3595
|
updateInfo: versionCheck,
|
|
3489
3596
|
version: storybookVersion,
|
|
3490
3597
|
name,
|
|
3491
|
-
address: localAddress,
|
|
3598
|
+
address: withInitialPath(localAddress, options.initialPath),
|
|
3492
3599
|
host: options.host,
|
|
3493
|
-
networkAddress,
|
|
3600
|
+
networkAddress: withInitialPath(networkAddress, options.initialPath),
|
|
3494
3601
|
allowedHosts,
|
|
3495
3602
|
managerTotalTime,
|
|
3496
3603
|
previewTotalTime
|
|
@@ -3500,7 +3607,7 @@ async function buildDevStandalone(options) {
|
|
|
3500
3607
|
}
|
|
3501
3608
|
|
|
3502
3609
|
// src/core-server/build-index.ts
|
|
3503
|
-
import { writeFile as
|
|
3610
|
+
import { writeFile as writeFile5 } from "node:fs/promises";
|
|
3504
3611
|
import { normalizeStories as normalizeStories2 } from "@aussieljk/forkbook/internal/common";
|
|
3505
3612
|
import { logger as logger17 } from "@aussieljk/forkbook/internal/node-logger";
|
|
3506
3613
|
|
|
@@ -3515,14 +3622,14 @@ import {
|
|
|
3515
3622
|
validateFrameworkName as validateFrameworkName2
|
|
3516
3623
|
} from "@aussieljk/forkbook/internal/common";
|
|
3517
3624
|
import { oneWayHash as oneWayHash2 } from "@aussieljk/forkbook/internal/telemetry";
|
|
3518
|
-
import { dirname, isAbsolute, join as
|
|
3625
|
+
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join11, relative as relative6, resolve as resolve8 } from "pathe";
|
|
3519
3626
|
async function loadStorybook(options) {
|
|
3520
|
-
let configDir =
|
|
3627
|
+
let configDir = resolve8(options.configDir), cacheKey = oneWayHash2(relative6(getProjectRoot2(), configDir));
|
|
3521
3628
|
options.configType = "DEVELOPMENT", options.configDir = configDir, options.cacheKey = cacheKey;
|
|
3522
3629
|
let channel = options.channel ?? new Channel4({});
|
|
3523
3630
|
setChannel3(channel);
|
|
3524
3631
|
let config = await loadMainConfig3(options), { framework } = config, corePresets = [], frameworkName = typeof framework == "string" ? framework : framework?.name;
|
|
3525
|
-
validateFrameworkName2(frameworkName), frameworkName && corePresets.push(
|
|
3632
|
+
validateFrameworkName2(frameworkName), frameworkName && corePresets.push(join11(frameworkName, "preset")), frameworkName = frameworkName || "custom";
|
|
3526
3633
|
let presets = await loadAllPresets3({
|
|
3527
3634
|
corePresets,
|
|
3528
3635
|
overridePresets: [
|
|
@@ -3533,12 +3640,12 @@ async function loadStorybook(options) {
|
|
|
3533
3640
|
channel
|
|
3534
3641
|
}), { renderer, builder } = await presets.apply("core", {}), resolvedRenderer = renderer && resolveAddonName3(options.configDir, renderer, options), builderName = typeof builder == "string" ? builder : builder?.name;
|
|
3535
3642
|
if (builderName) {
|
|
3536
|
-
let builderEntry = builderName.startsWith("file:") ? fileURLToPath(builderName) : builderName, builderPresetDir =
|
|
3643
|
+
let builderEntry = builderName.startsWith("file:") ? fileURLToPath(builderName) : builderName, builderPresetDir = isAbsolute2(builderEntry) ? dirname3(builderEntry) : resolvePackageDir(builderEntry), builderPreset = safeResolveModule({ specifier: join11(builderPresetDir, "preset.js") });
|
|
3537
3644
|
builderPreset && corePresets.push(builderPreset);
|
|
3538
3645
|
}
|
|
3539
3646
|
presets = await loadAllPresets3({
|
|
3540
3647
|
corePresets: [
|
|
3541
|
-
|
|
3648
|
+
join11(resolvePackageDir("@aussieljk/forkbook"), "dist/core-server/presets/common-preset.js"),
|
|
3542
3649
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
3543
3650
|
...corePresets
|
|
3544
3651
|
],
|
|
@@ -3560,8 +3667,8 @@ async function loadStorybook(options) {
|
|
|
3560
3667
|
|
|
3561
3668
|
// src/core-server/utils/StoryIndexGenerator.ts
|
|
3562
3669
|
import { existsSync as existsSync3 } from "node:fs";
|
|
3563
|
-
import { readFile as
|
|
3564
|
-
import { dirname as
|
|
3670
|
+
import { readFile as readFile6 } from "node:fs/promises";
|
|
3671
|
+
import { dirname as dirname4, extname, join as join12, normalize as normalize3, relative as relative7, resolve as resolve9, sep as sep2 } from "node:path";
|
|
3565
3672
|
import {
|
|
3566
3673
|
commonGlobOptions as commonGlobOptions2,
|
|
3567
3674
|
getProjectRoot as getProjectRoot3,
|
|
@@ -3821,7 +3928,7 @@ var addStats = (stat2, acc) => {
|
|
|
3821
3928
|
};
|
|
3822
3929
|
|
|
3823
3930
|
// src/core-server/utils/StoryIndexGenerator.ts
|
|
3824
|
-
var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.startsWith(".") ? slash(
|
|
3931
|
+
var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.startsWith(".") ? slash(resolve9(workingDir, normalizeStoryPath(join12(dirname4(normalizedPath), otherImport)))) : otherImport, StoryIndexGenerator = class _StoryIndexGenerator {
|
|
3825
3932
|
constructor(specifiers, options) {
|
|
3826
3933
|
this.specifiers = specifiers;
|
|
3827
3934
|
this.options = options;
|
|
@@ -3849,7 +3956,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
3849
3956
|
let cacheKey = this.getFindMatchingFilesCacheKey(specifier, workingDir, ignoreWarnings), cached = this.findMatchingFilesCache.get(cacheKey);
|
|
3850
3957
|
if (cached)
|
|
3851
3958
|
return cached;
|
|
3852
|
-
let pathToSubIndex = {}, globCwd = slash(
|
|
3959
|
+
let pathToSubIndex = {}, globCwd = slash(resolve9(workingDir, specifier.directory)), globPattern = specifier.files.startsWith("!") ? `./${specifier.files}` : specifier.files, { glob } = await import("../_node-chunks/dist-FABQFQ76.js"), files = await glob(globPattern, {
|
|
3853
3960
|
absolute: !0,
|
|
3854
3961
|
expandDirectories: !1,
|
|
3855
3962
|
cwd: globCwd,
|
|
@@ -3858,12 +3965,12 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
3858
3965
|
});
|
|
3859
3966
|
return files.length === 0 && !ignoreWarnings && once.warn(
|
|
3860
3967
|
`No story files found for the specified pattern: ${import_picocolors7.default.blue(
|
|
3861
|
-
|
|
3968
|
+
join12(specifier.directory, specifier.files)
|
|
3862
3969
|
)}`
|
|
3863
3970
|
), files.sort().forEach((absolutePath) => {
|
|
3864
3971
|
let ext = extname(absolutePath);
|
|
3865
3972
|
if (ext === ".storyshot") {
|
|
3866
|
-
let relativePath =
|
|
3973
|
+
let relativePath = relative7(workingDir, absolutePath);
|
|
3867
3974
|
logger16.info(`Skipping ${ext} file ${relativePath}`);
|
|
3868
3975
|
return;
|
|
3869
3976
|
}
|
|
@@ -3908,7 +4015,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
3908
4015
|
try {
|
|
3909
4016
|
entry[absolutePath] = await updater(specifier, absolutePath, entry[absolutePath]);
|
|
3910
4017
|
} catch (err) {
|
|
3911
|
-
let relativePath = `.${sep2}${
|
|
4018
|
+
let relativePath = `.${sep2}${relative7(this.options.workingDir, absolutePath)}`;
|
|
3912
4019
|
entry[absolutePath] = {
|
|
3913
4020
|
type: "error",
|
|
3914
4021
|
err: new IndexingError(
|
|
@@ -3969,15 +4076,15 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
3969
4076
|
resolveComponentPath(rawComponentPath, absolutePath, matchPath) {
|
|
3970
4077
|
let matchedPath = matchPath?.(rawComponentPath, void 0, void 0, supportedExtensions) ?? rawComponentPath, resolved;
|
|
3971
4078
|
try {
|
|
3972
|
-
resolved = resolveImport(matchedPath, { basedir:
|
|
4079
|
+
resolved = resolveImport(matchedPath, { basedir: dirname4(absolutePath) });
|
|
3973
4080
|
} catch {
|
|
3974
4081
|
return matchedPath;
|
|
3975
4082
|
}
|
|
3976
|
-
let relativePath =
|
|
4083
|
+
let relativePath = relative7(this.options.workingDir, resolved);
|
|
3977
4084
|
return slash(normalizeStoryPath(relativePath));
|
|
3978
4085
|
}
|
|
3979
4086
|
async extractStories(specifier, absolutePath, projectTags = []) {
|
|
3980
|
-
let relativePath =
|
|
4087
|
+
let relativePath = relative7(this.options.workingDir, absolutePath), importPath = slash(normalizeStoryPath(relativePath)), defaultMakeTitle = (userTitle) => {
|
|
3981
4088
|
let title = userOrAutoTitleFromSpecifier(importPath, specifier, userTitle);
|
|
3982
4089
|
return invariant(
|
|
3983
4090
|
title,
|
|
@@ -3996,7 +4103,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
3996
4103
|
tsconfig.paths,
|
|
3997
4104
|
["browser", "module", "main"]
|
|
3998
4105
|
));
|
|
3999
|
-
let toImportPath = (path) => path ? path.startsWith("virtual:") ? path : slash(normalizeStoryPath(
|
|
4106
|
+
let toImportPath = (path) => path ? path.startsWith("virtual:") ? path : slash(normalizeStoryPath(relative7(this.options.workingDir, path))) : importPath, storyEntries = indexInputs.map((input) => {
|
|
4000
4107
|
let name = input.name ?? storyNameFromExport(input.exportName), componentPath = input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath, matchPath), title = input.title ?? defaultMakeTitle(), id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName)), tags = combineTags(...projectTags, ...input.tags ?? []), subtype = input.subtype ?? "story", entry = {
|
|
4001
4108
|
type: "story",
|
|
4002
4109
|
subtype,
|
|
@@ -4011,7 +4118,9 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
4011
4118
|
componentPath,
|
|
4012
4119
|
tags
|
|
4013
4120
|
};
|
|
4014
|
-
|
|
4121
|
+
subtype === "test" && (entry.parent = input.parent, entry.parentName = input.parentName), input.exportName && (entry.exportName = input.exportName);
|
|
4122
|
+
let thumbnail = resolveThumbnail(input.thumbnail, absolutePath, this.options.workingDir);
|
|
4123
|
+
return thumbnail && (entry.thumbnail = thumbnail), entry;
|
|
4015
4124
|
});
|
|
4016
4125
|
if (storyEntries.some((entry) => entry.tags.includes(Tag.AUTODOCS)) && !!this.options.docs && this.options.build?.test?.disableAutoDocs !== !0) {
|
|
4017
4126
|
let name = this.options.docs?.defaultName ?? "Docs", { metaId } = indexInputs[0], entry = storyEntries[0], id = toId(metaId ?? entry.title, name), tags = combineTags(...projectTags, ...indexInputs[0].tags ?? []);
|
|
@@ -4041,9 +4150,9 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
4041
4150
|
};
|
|
4042
4151
|
}
|
|
4043
4152
|
async extractDocs(specifier, absolutePath, projectTags = []) {
|
|
4044
|
-
let relativePath =
|
|
4153
|
+
let relativePath = relative7(this.options.workingDir, absolutePath);
|
|
4045
4154
|
try {
|
|
4046
|
-
let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await
|
|
4155
|
+
let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile6(absolutePath, { encoding: "utf8" }), result = await analyzeMdx(content);
|
|
4047
4156
|
if (result.isTemplate)
|
|
4048
4157
|
return !1;
|
|
4049
4158
|
let absoluteImports = result.imports.map(
|
|
@@ -4054,8 +4163,8 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
4054
4163
|
dependencies.forEach((dep) => {
|
|
4055
4164
|
if (dep.entries.length > 0) {
|
|
4056
4165
|
let first = dep.entries.find((e) => e.type !== "docs");
|
|
4057
|
-
|
|
4058
|
-
|
|
4166
|
+
normalize3(resolve9(this.options.workingDir, first.importPath)).startsWith(
|
|
4167
|
+
normalize3(absoluteOf)
|
|
4059
4168
|
) && (csfEntry = first, metaDependency = dep);
|
|
4060
4169
|
}
|
|
4061
4170
|
}), metaDependency && (sortedDependencies = [
|
|
@@ -4197,7 +4306,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
4197
4306
|
}), this.lastIndex = null, this.lastError = null, this.invalidationListeners.forEach((listener) => listener());
|
|
4198
4307
|
}
|
|
4199
4308
|
invalidate(importPath, removed) {
|
|
4200
|
-
let absolutePath = slash(
|
|
4309
|
+
let absolutePath = slash(resolve9(this.options.workingDir, importPath)), specifier = Array.from(this.specifierToCache.keys()).find(
|
|
4201
4310
|
(ns) => ns.importPathMatcher.exec(importPath)
|
|
4202
4311
|
);
|
|
4203
4312
|
if (!specifier)
|
|
@@ -4221,7 +4330,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
4221
4330
|
if (removed) {
|
|
4222
4331
|
if (cacheEntry && cacheEntry.type === "docs") {
|
|
4223
4332
|
let absoluteImports = cacheEntry.storiesImports.map(
|
|
4224
|
-
(p) =>
|
|
4333
|
+
(p) => resolve9(this.options.workingDir, p)
|
|
4225
4334
|
);
|
|
4226
4335
|
this.findDependencies(absoluteImports).forEach(
|
|
4227
4336
|
(dep) => dep.dependents.splice(dep.dependents.indexOf(absolutePath), 1)
|
|
@@ -4238,8 +4347,8 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
4238
4347
|
};
|
|
4239
4348
|
}
|
|
4240
4349
|
async getPreviewCode() {
|
|
4241
|
-
let previewFile = ["js", "jsx", "ts", "tsx", "mjs", "cjs", "mts"].map((ext) =>
|
|
4242
|
-
return previewFile && (await
|
|
4350
|
+
let previewFile = ["js", "jsx", "ts", "tsx", "mjs", "cjs", "mts"].map((ext) => join12(this.options.configDir, `preview.${ext}`)).find((fname) => existsSync3(fname));
|
|
4351
|
+
return previewFile && (await readFile6(previewFile, { encoding: "utf8" })).toString();
|
|
4243
4352
|
}
|
|
4244
4353
|
getProjectTags(previewCode) {
|
|
4245
4354
|
let projectTags = [], defaultTags = [Tag.DEV, Tag.TEST, Tag.MANIFEST];
|
|
@@ -4296,7 +4405,7 @@ var buildIndex = async (options) => {
|
|
|
4296
4405
|
return await generator.initialize(), generator.getIndex();
|
|
4297
4406
|
}, buildIndexStandalone = async (options) => {
|
|
4298
4407
|
let index = await buildIndex(options);
|
|
4299
|
-
logger17.info(`Writing index to ${options.outputFile}`), await
|
|
4408
|
+
logger17.info(`Writing index to ${options.outputFile}`), await writeFile5(options.outputFile, JSON.stringify(index));
|
|
4300
4409
|
};
|
|
4301
4410
|
|
|
4302
4411
|
// src/core-server/standalone.ts
|