@aussieljk/forkbook 0.0.1-16 → 0.0.1-17
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 +5 -1
- package/dist/_browser-chunks/{Color-CSCUIZNV.js → Color-NKLLBRKK.js} +1 -1
- package/dist/_browser-chunks/{WithTooltip-QCFTNB6P.js → WithTooltip-GRPTCOVV.js} +1 -1
- package/dist/_browser-chunks/{chunk-Z4YTPAKR.js → chunk-56NKJ4MR.js} +12 -12
- package/dist/_browser-chunks/{chunk-RSK2QATC.js → chunk-5N7RXR3D.js} +1 -1
- package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
- package/dist/_node-chunks/{attached-runtime-M3LR7CRL.js → attached-runtime-BODU5N5Q.js} +32 -29
- package/dist/_node-chunks/{builder-manager-S5R76DLZ.js → builder-manager-SNVBXDAZ.js} +41 -20
- package/dist/_node-chunks/{chunk-IJYTDXUI.js → chunk-2B6V6AVR.js} +8 -8
- package/dist/_node-chunks/{chunk-N5DU4RGS.js → chunk-2O2A5PZP.js} +7 -7
- package/dist/_node-chunks/{chunk-S5AP3365.js → chunk-2VWQ57G2.js} +19 -19
- package/dist/_node-chunks/chunk-32N6R2A6.js +11 -0
- package/dist/_node-chunks/{chunk-GDWG7F53.js → chunk-35OISTYM.js} +6 -6
- package/dist/_node-chunks/{chunk-JT7FTSPB.js → chunk-3GMDBVCD.js} +7 -7
- package/dist/_node-chunks/{chunk-72BCEHLN.js → chunk-3QV4EUKS.js} +9 -9
- package/dist/_node-chunks/{chunk-RWKRFANH.js → chunk-3Z6X5O4S.js} +6 -6
- package/dist/_node-chunks/{chunk-7N4FSYG5.js → chunk-424GG5ZE.js} +26 -26
- package/dist/_node-chunks/{chunk-IHOUXOSK.js → chunk-4CZH3XG3.js} +8 -8
- package/dist/_node-chunks/{chunk-IW4JU27L.js → chunk-4NOVPVLF.js} +7 -7
- package/dist/_node-chunks/{chunk-XLLJO7QN.js → chunk-4XKI5NKZ.js} +8 -8
- package/dist/_node-chunks/{chunk-PK7PIHFX.js → chunk-54RJVFEQ.js} +6 -6
- package/dist/_node-chunks/{chunk-C3NHS7JV.js → chunk-66DGG2O7.js} +17 -7
- package/dist/_node-chunks/{chunk-54Q363BU.js → chunk-66TAMNHV.js} +10 -10
- package/dist/_node-chunks/{chunk-KQZVI6MC.js → chunk-6N23OB4T.js} +6 -6
- package/dist/_node-chunks/{chunk-K6GKT7RR.js → chunk-6OTSKKBF.js} +8 -8
- package/dist/_node-chunks/{chunk-4NF4B5VC.js → chunk-7FREACY6.js} +7 -7
- package/dist/_node-chunks/chunk-7KKA3Q43.js +19 -0
- package/dist/_node-chunks/{chunk-QDBA3OPO.js → chunk-7QYZ55PS.js} +6 -6
- package/dist/_node-chunks/{chunk-A2PJPFXZ.js → chunk-A3FYJ5M4.js} +6 -6
- package/dist/_node-chunks/{chunk-F6IRDFGE.js → chunk-A5RYL7EU.js} +8 -8
- package/dist/_node-chunks/{chunk-2GKDQBC6.js → chunk-AIEYQ7PU.js} +11 -10
- package/dist/_node-chunks/{chunk-ZTZCXWZV.js → chunk-AUQEZWHV.js} +6 -6
- package/dist/_node-chunks/{chunk-SZC3BDMK.js → chunk-B6SDV62R.js} +23 -23
- package/dist/_node-chunks/{chunk-BLNJ2DX2.js → chunk-BGNW6SMB.js} +7 -7
- package/dist/_node-chunks/{chunk-JX2FN4Q3.js → chunk-BMQAU7WB.js} +6 -6
- package/dist/_node-chunks/{chunk-FJWE2TBB.js → chunk-BVDH3UV6.js} +14 -14
- package/dist/_node-chunks/{chunk-UFZDQ6B2.js → chunk-BZ42MRKX.js} +7 -7
- package/dist/_node-chunks/{chunk-CNIGCMVT.js → chunk-C6UTUPHF.js} +6 -6
- package/dist/_node-chunks/{chunk-NMJ6S2BO.js → chunk-CENSJBOG.js} +9 -9
- package/dist/_node-chunks/{chunk-E5PKDO5S.js → chunk-CFB6WTNU.js} +6 -6
- package/dist/_node-chunks/{chunk-NT2NODZ6.js → chunk-CKBFZLYD.js} +6 -6
- package/dist/_node-chunks/{chunk-S6KVMMG5.js → chunk-D4Z4SESM.js} +6 -6
- package/dist/_node-chunks/{chunk-5OFZSOQT.js → chunk-E2L2KQAK.js} +8 -8
- package/dist/_node-chunks/{chunk-AYBIJKYK.js → chunk-EBK2BTNM.js} +8 -8
- package/dist/_node-chunks/{chunk-JP6U6V57.js → chunk-EKFEF7FU.js} +8 -8
- package/dist/_node-chunks/{chunk-YBAT4RJ7.js → chunk-F2TYHA27.js} +6 -6
- package/dist/_node-chunks/{chunk-XY5DZDIL.js → chunk-F6BIOW6V.js} +10 -10
- package/dist/_node-chunks/{chunk-BNBWGBBX.js → chunk-FDERIYTI.js} +7 -7
- package/dist/_node-chunks/{chunk-Y2FHDZ2F.js → chunk-FLKOMVEA.js} +9 -9
- package/dist/_node-chunks/chunk-G3RUMVD7.js +49 -0
- package/dist/_node-chunks/{chunk-PYLGT7HR.js → chunk-GHG2TM7A.js} +8 -8
- package/dist/_node-chunks/{chunk-EB7VOG5E.js → chunk-GUOELDLF.js} +6 -6
- package/dist/_node-chunks/{chunk-VL5IW2LC.js → chunk-GW7BXWTM.js} +6 -6
- package/dist/_node-chunks/{chunk-T5ZUNH6T.js → chunk-H6RFOVN4.js} +6 -6
- package/dist/_node-chunks/{chunk-EYI7KYY6.js → chunk-H6TYPSV2.js} +8 -8
- package/dist/_node-chunks/{chunk-UW6HXL4F.js → chunk-H7U6SEHI.js} +7 -7
- package/dist/_node-chunks/chunk-HAVDCVZW.js +298 -0
- package/dist/_node-chunks/{chunk-LYDJ7XSD.js → chunk-HEB7LVZV.js} +6 -6
- package/dist/_node-chunks/{chunk-IA5HRJZF.js → chunk-HRF77FGL.js} +9 -9
- package/dist/_node-chunks/{chunk-3RIDLOKA.js → chunk-IXVQUJAU.js} +9 -9
- package/dist/_node-chunks/{chunk-76ZAQTUI.js → chunk-JGHJUGTC.js} +6 -6
- package/dist/_node-chunks/{chunk-47RQBQRS.js → chunk-JSULSBPW.js} +7 -7
- package/dist/_node-chunks/{chunk-RY5SXMMS.js → chunk-KPDGGNTL.js} +7 -7
- package/dist/_node-chunks/chunk-KSQYJW2B.js +20 -0
- package/dist/_node-chunks/{chunk-4GBTYHEQ.js → chunk-KXKTY4VF.js} +7 -7
- package/dist/_node-chunks/{chunk-5CTBWF65.js → chunk-KXRGXTG7.js} +7 -7
- package/dist/_node-chunks/{chunk-LZR5V6AC.js → chunk-LTODR44X.js} +8 -8
- package/dist/_node-chunks/{chunk-WB6KEM5Y.js → chunk-MEKYIRUI.js} +7 -7
- package/dist/_node-chunks/{chunk-PAPQY3TW.js → chunk-MXNR25VV.js} +8 -8
- package/dist/_node-chunks/{chunk-OGBMQXAL.js → chunk-NDIG5KJO.js} +8 -8
- package/dist/_node-chunks/{chunk-2J7TLO3T.js → chunk-NDM35KTJ.js} +7 -7
- package/dist/_node-chunks/{chunk-C7LQKP5N.js → chunk-NNJBBU37.js} +6 -6
- package/dist/_node-chunks/{chunk-PLQUKACJ.js → chunk-OIEYSJZQ.js} +6 -6
- package/dist/_node-chunks/{chunk-TTT6HKCH.js → chunk-PAGKAN2S.js} +6 -6
- package/dist/_node-chunks/{chunk-HBGFSTD5.js → chunk-PNPIWEJR.js} +6 -6
- package/dist/_node-chunks/chunk-PNPMBU3R.js +20 -0
- package/dist/_node-chunks/{chunk-GDBK4HY3.js → chunk-QM5TMDR6.js} +12 -12
- package/dist/_node-chunks/{chunk-PH4DKJCF.js → chunk-SS2FGO4S.js} +6 -6
- package/dist/_node-chunks/{chunk-JQYFHZ7Z.js → chunk-T4YGYZRD.js} +6 -6
- package/dist/_node-chunks/chunk-T7BUIVKR.js +52 -0
- package/dist/_node-chunks/{chunk-V5UORMCO.js → chunk-TRQQTMVB.js} +7 -7
- package/dist/_node-chunks/{chunk-K5XZRTQZ.js → chunk-TZUO3OXE.js} +7 -7
- package/dist/_node-chunks/{chunk-WKOD2VTN.js → chunk-U37YCQDK.js} +6 -6
- package/dist/_node-chunks/{chunk-3VMGUWTV.js → chunk-UMFUS7PF.js} +6 -6
- package/dist/_node-chunks/{chunk-XWNZORKV.js → chunk-V4JLDWO6.js} +7 -7
- package/dist/_node-chunks/{chunk-PMYTZ2QW.js → chunk-V7SAH2IU.js} +6 -6
- package/dist/_node-chunks/{chunk-OKAP7V5Y.js → chunk-VUFKOINV.js} +7 -7
- package/dist/_node-chunks/{chunk-SUWLYB5G.js → chunk-WFD3QAD2.js} +6 -6
- package/dist/_node-chunks/{chunk-VXTAQURA.js → chunk-X2ND43GY.js} +6 -6
- package/dist/_node-chunks/chunk-X37GVICO.js +18 -0
- package/dist/_node-chunks/{chunk-XXDUSVOM.js → chunk-XHD5J6RT.js} +8 -8
- package/dist/_node-chunks/{chunk-BMBHJB46.js → chunk-XTDK7QBA.js} +6 -6
- package/dist/_node-chunks/{chunk-7SQTDU62.js → chunk-Y6EAOBYH.js} +7 -7
- package/dist/_node-chunks/{chunk-I5YT3ZVT.js → chunk-YEV5SVMM.js} +6 -6
- package/dist/_node-chunks/{chunk-7HEDXUYY.js → chunk-YOGHVKVE.js} +6 -6
- package/dist/_node-chunks/{chunk-GG57O5WL.js → chunk-YQMENGBH.js} +7 -7
- package/dist/_node-chunks/{chunk-5U6PJ5YZ.js → chunk-YXLQJR3R.js} +6 -6
- package/dist/_node-chunks/{chunk-RCJSAGZJ.js → chunk-Z37X3NOU.js} +15 -11
- package/dist/_node-chunks/{chunk-DNZAIWOF.js → chunk-ZNJQ4JAS.js} +10 -10
- package/dist/_node-chunks/{chunk-5H64FI2Q.js → chunk-ZWUV3LPT.js} +7 -7
- package/dist/_node-chunks/chunk-ZYMT2Z74.js +25 -0
- package/dist/_node-chunks/dist-55GVJVDF.js +27 -0
- package/dist/_node-chunks/dist-YETMXINZ.js +16 -0
- package/dist/_node-chunks/{local-runtime-HTS37XDN.js → local-runtime-RWMEFVQR.js} +19 -19
- package/dist/_node-chunks/{mdx-plugin-IUQIVM3G.js → mdx-plugin-ARMGGEAR.js} +13 -13
- package/dist/_node-chunks/{monorepo-SYIDMETZ.js → monorepo-A4YCSFR6.js} +11 -11
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-5OYJKBOA.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-3XAIWI64.js} +11 -11
- package/dist/_node-chunks/optimized-tests-R4YZ6KJA.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-74TXIEUZ.js → pattern-copy-play-K4XLDCUI.js} +9 -9
- package/dist/_node-chunks/postinstallAddon-EI4PJBGN.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-DWA5SPB5.js → rehype-external-links-HMX6LC4S.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-KAFPVNH4.js → rehype-slug-7C3BVKEP.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-6EIL2N6I.js → relaxed-limits-YOIAJJY5.js} +11 -11
- package/dist/_node-chunks/{run-C7CGXC2E.js → run-IXH6ZYK4.js} +17 -17
- package/dist/_node-chunks/{run-6W2ISL24.js → run-KAOS4DDE.js} +15 -15
- package/dist/_node-chunks/{setup-3LVKWS2Y.js → setup-VNUO347Q.js} +8 -8
- package/dist/_node-chunks/{vitest.config.4.template-EXNOA6EO.js → vitest.config.4.template-NE4Y4M3P.js} +7 -7
- package/dist/addon-a11y/manager.js +4 -4
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-comments/manager.js +10 -3
- package/dist/addon-comments/preset.js +8 -8
- package/dist/addon-docs/blocks.js +9 -9
- package/dist/addon-docs/manager.js +2 -2
- package/dist/addon-docs/preset.js +10 -10
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-mcp/preset.js +23 -12
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +11 -1
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +2 -2
- 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 +12 -12
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +60 -59
- package/dist/bin/dispatcher.js +10 -10
- package/dist/bin/loader.js +8 -8
- package/dist/builder-next/index.d.ts +59 -0
- package/dist/builder-next/index.js +185 -0
- package/dist/builder-vite/index.d.ts +7 -2
- package/dist/builder-vite/index.js +23 -16
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +25 -3
- package/dist/{chunk-C4-cnJ1R.d.ts → chunk-BsO65uOb.d.ts} +1 -1
- package/dist/{chunk-CV4-Z2pn.d.ts → chunk-CDMZhRke.d.ts} +1 -1
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-BNRZY6Jq.d.ts → chunk-D2CQlXaR.d.ts} +1 -1
- package/dist/chunk-DtFyKAil.d.ts +142 -0
- package/dist/{chunk-s5Ka0eSs.d.ts → chunk-OksNJcvJ.d.ts} +1 -1
- package/dist/{chunk-BRMwIGWt.d.ts → chunk-ge-rSPy0.d.ts} +33 -14
- package/dist/{chunk-QtkUsZCs.d.ts → chunk-r-Vjut9o.d.ts} +2 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +21 -21
- 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 +2 -2
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/common/index.d.ts +4 -4
- package/dist/common/index.js +34 -34
- package/dist/components/index.js +26 -26
- package/dist/core-server/index.d.ts +19 -4
- package/dist/core-server/index.js +166 -107
- package/dist/core-server/presets/common-manager.js +9 -9
- package/dist/core-server/presets/common-override-preset.js +10 -10
- package/dist/core-server/presets/common-preset.js +42 -39
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf-tools/index.js +12 -12
- package/dist/manager/_manager-chunks/{globals-runtime-BWRrfZHd.js → globals-runtime-B57gPuuh.js} +159 -95
- package/dist/manager/_manager-chunks/{globals-runtime-BimU8G7b.js → globals-runtime-Barb--td.js} +2 -2
- package/dist/manager/_manager-chunks/{globals-runtime-BshBawD_.js → globals-runtime-BdquQI3D.js} +4 -4
- package/dist/manager/_manager-chunks/{globals-runtime-Ct6r_VIk.js → globals-runtime-Cq3M4fmR.js} +2 -2
- package/dist/manager/_manager-chunks/{globals-runtime-C-EipbnO.js → globals-runtime-DdOE9xHG.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-BGys8g47.js → globals-runtime-QogXhBot.js} +2 -2
- package/dist/manager/_manager-chunks/{runtime-ByNphI7g.js → runtime-B-zsavHW.js} +2 -2
- package/dist/manager/_manager-chunks/{runtime-DJCouYTq.js → runtime-B1aqoFKC.js} +3 -3
- package/dist/manager/_manager-chunks/{runtime-TSEq5lJd.js → runtime-B3sVeEUb.js} +1 -1
- package/dist/manager/_manager-chunks/{runtime-BhqfjXNm.js → runtime-B5U9ifKl.js} +2 -2
- package/dist/manager/_manager-chunks/{runtime-7sf36XMA.js → runtime-BnJTmihE.js} +4 -4
- package/dist/manager/_manager-chunks/{runtime-C6l5GIW9.js → runtime-CSyYERXx.js} +19 -19
- package/dist/manager/_manager-chunks/{runtime-CBJsfhjk.js → runtime-Ccj5SxBg.js} +8 -8
- package/dist/manager/_manager-chunks/{runtime-BMoEpoix.js → runtime-DPTwiG8p.js} +7 -0
- package/dist/manager/_manager-chunks/{runtime-DnHl3vQZ.js → runtime-DaCr0frF.js} +3 -3
- package/dist/manager/_manager-chunks/{runtime-DJfG4OGP.js → runtime-ruwLauiW.js} +144 -144
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- 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/next/index.d.ts +189 -0
- package/dist/next/index.js +289 -0
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/preset.js +11 -11
- 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.d.ts +1 -1
- 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/_chunks/{runtime-YJlypwja.js → runtime-BiYuZt-X.js} +3 -3
- package/dist/preview/_chunks/{runtime-CrKf1OM4.js → runtime-C88AzFBv.js} +2 -2
- package/dist/preview/_chunks/{runtime-COMyPEkR.js → runtime-Cpzxe5eK.js} +73 -9
- package/dist/preview/_chunks/{runtime-CqTqsVg2.js → runtime-MYVHRAoo.js} +2 -2
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/react-native/metro/withForkbook.js +13 -13
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.js +8 -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 +11 -11
- package/dist/types/index.d.ts +1 -1
- package/package.json +11 -1
- package/dist/_node-chunks/chunk-CN26V2O6.js +0 -19
- package/dist/_node-chunks/chunk-NHIONGG3.js +0 -11
- package/dist/_node-chunks/chunk-QXQQQC3B.js +0 -20
- package/dist/_node-chunks/chunk-RR6N4UDR.js +0 -25
- package/dist/_node-chunks/chunk-VAU4QOZO.js +0 -20
- package/dist/_node-chunks/chunk-YZ5HE6CE.js +0 -18
- package/dist/_node-chunks/dist-5M4OQEOE.js +0 -16
- package/dist/_node-chunks/dist-DNAZ454H.js +0 -27
- package/dist/_node-chunks/optimized-tests-LAR2SZGJ.js +0 -22
- package/dist/_node-chunks/postinstallAddon-5GFBQQOP.js +0 -20
package/dist/bin/core.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yrthiesbig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yrthiesbig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yrthiesbig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yrthiesbig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yrthiesbig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yrthiesbig.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
@@ -12,96 +12,96 @@ var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
readRegistry,
|
|
14
14
|
selectInstances
|
|
15
|
-
} from "../_node-chunks/chunk-
|
|
15
|
+
} from "../_node-chunks/chunk-4XKI5NKZ.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveStorybookConfigDir
|
|
18
|
-
} from "../_node-chunks/chunk-
|
|
18
|
+
} from "../_node-chunks/chunk-V7SAH2IU.js";
|
|
19
19
|
import {
|
|
20
20
|
instructions
|
|
21
|
-
} from "../_node-chunks/chunk-
|
|
21
|
+
} from "../_node-chunks/chunk-2B6V6AVR.js";
|
|
22
22
|
import {
|
|
23
23
|
isReactProject
|
|
24
|
-
} from "../_node-chunks/chunk-
|
|
25
|
-
import "../_node-chunks/chunk-
|
|
26
|
-
import "../_node-chunks/chunk-
|
|
27
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-XHD5J6RT.js";
|
|
25
|
+
import "../_node-chunks/chunk-XTDK7QBA.js";
|
|
26
|
+
import "../_node-chunks/chunk-CKBFZLYD.js";
|
|
27
|
+
import "../_node-chunks/chunk-32N6R2A6.js";
|
|
28
28
|
import {
|
|
29
29
|
createTools,
|
|
30
30
|
reportToolsCommandEvent,
|
|
31
31
|
sanitizeNamePart,
|
|
32
32
|
toCatalogEntry
|
|
33
|
-
} from "../_node-chunks/chunk-
|
|
33
|
+
} from "../_node-chunks/chunk-BVDH3UV6.js";
|
|
34
34
|
import {
|
|
35
35
|
formatMultiInstanceNotice
|
|
36
|
-
} from "../_node-chunks/chunk-
|
|
36
|
+
} from "../_node-chunks/chunk-T4YGYZRD.js";
|
|
37
37
|
import {
|
|
38
38
|
ToolsRuntimeError,
|
|
39
39
|
attachGateReasonFromError,
|
|
40
40
|
isAttachGateError
|
|
41
|
-
} from "../_node-chunks/chunk-
|
|
41
|
+
} from "../_node-chunks/chunk-YQMENGBH.js";
|
|
42
42
|
import {
|
|
43
43
|
detectLanguage,
|
|
44
44
|
getStorybookData,
|
|
45
45
|
globalSettings
|
|
46
|
-
} from "../_node-chunks/chunk-
|
|
46
|
+
} from "../_node-chunks/chunk-TRQQTMVB.js";
|
|
47
47
|
import {
|
|
48
48
|
isClaudePreviewLaunch,
|
|
49
49
|
resolveSkillInputs
|
|
50
|
-
} from "../_node-chunks/chunk-
|
|
51
|
-
import "../_node-chunks/chunk-
|
|
50
|
+
} from "../_node-chunks/chunk-F6BIOW6V.js";
|
|
51
|
+
import "../_node-chunks/chunk-7KKA3Q43.js";
|
|
52
52
|
import {
|
|
53
53
|
frameworkToRendererMap
|
|
54
|
-
} from "../_node-chunks/chunk-
|
|
54
|
+
} from "../_node-chunks/chunk-HEB7LVZV.js";
|
|
55
55
|
import {
|
|
56
56
|
version
|
|
57
|
-
} from "../_node-chunks/chunk-
|
|
57
|
+
} from "../_node-chunks/chunk-X37GVICO.js";
|
|
58
58
|
import {
|
|
59
59
|
detectAgent
|
|
60
|
-
} from "../_node-chunks/chunk-
|
|
61
|
-
import "../_node-chunks/chunk-
|
|
62
|
-
import "../_node-chunks/chunk-
|
|
63
|
-
import "../_node-chunks/chunk-
|
|
64
|
-
import "../_node-chunks/chunk-
|
|
65
|
-
import "../_node-chunks/chunk-
|
|
66
|
-
import "../_node-chunks/chunk-
|
|
60
|
+
} from "../_node-chunks/chunk-ZYMT2Z74.js";
|
|
61
|
+
import "../_node-chunks/chunk-54RJVFEQ.js";
|
|
62
|
+
import "../_node-chunks/chunk-LTODR44X.js";
|
|
63
|
+
import "../_node-chunks/chunk-2VWQ57G2.js";
|
|
64
|
+
import "../_node-chunks/chunk-C6UTUPHF.js";
|
|
65
|
+
import "../_node-chunks/chunk-H6TYPSV2.js";
|
|
66
|
+
import "../_node-chunks/chunk-SS2FGO4S.js";
|
|
67
67
|
import {
|
|
68
68
|
leven
|
|
69
|
-
} from "../_node-chunks/chunk-
|
|
69
|
+
} from "../_node-chunks/chunk-CFB6WTNU.js";
|
|
70
70
|
import {
|
|
71
71
|
getRegisteredToolsets
|
|
72
|
-
} from "../_node-chunks/chunk-
|
|
73
|
-
import "../_node-chunks/chunk-
|
|
72
|
+
} from "../_node-chunks/chunk-EBK2BTNM.js";
|
|
73
|
+
import "../_node-chunks/chunk-2O2A5PZP.js";
|
|
74
74
|
import {
|
|
75
75
|
getToolName,
|
|
76
76
|
parseToolsetMethodId,
|
|
77
77
|
toCliMethodName
|
|
78
|
-
} from "../_node-chunks/chunk-
|
|
78
|
+
} from "../_node-chunks/chunk-V4JLDWO6.js";
|
|
79
79
|
import {
|
|
80
80
|
escapeRegExp
|
|
81
|
-
} from "../_node-chunks/chunk-
|
|
81
|
+
} from "../_node-chunks/chunk-PNPMBU3R.js";
|
|
82
82
|
import {
|
|
83
83
|
getService
|
|
84
|
-
} from "../_node-chunks/chunk-
|
|
85
|
-
import "../_node-chunks/chunk-
|
|
86
|
-
import "../_node-chunks/chunk-
|
|
87
|
-
import "../_node-chunks/chunk-
|
|
88
|
-
import "../_node-chunks/chunk-
|
|
89
|
-
import "../_node-chunks/chunk-
|
|
90
|
-
import "../_node-chunks/chunk-
|
|
91
|
-
import "../_node-chunks/chunk-
|
|
92
|
-
import "../_node-chunks/chunk-
|
|
93
|
-
import "../_node-chunks/chunk-
|
|
94
|
-
import "../_node-chunks/chunk-
|
|
95
|
-
import "../_node-chunks/chunk-
|
|
84
|
+
} from "../_node-chunks/chunk-66TAMNHV.js";
|
|
85
|
+
import "../_node-chunks/chunk-HRF77FGL.js";
|
|
86
|
+
import "../_node-chunks/chunk-KXKTY4VF.js";
|
|
87
|
+
import "../_node-chunks/chunk-3Z6X5O4S.js";
|
|
88
|
+
import "../_node-chunks/chunk-JGHJUGTC.js";
|
|
89
|
+
import "../_node-chunks/chunk-6N23OB4T.js";
|
|
90
|
+
import "../_node-chunks/chunk-YOGHVKVE.js";
|
|
91
|
+
import "../_node-chunks/chunk-GW7BXWTM.js";
|
|
92
|
+
import "../_node-chunks/chunk-YEV5SVMM.js";
|
|
93
|
+
import "../_node-chunks/chunk-MEKYIRUI.js";
|
|
94
|
+
import "../_node-chunks/chunk-X2ND43GY.js";
|
|
95
|
+
import "../_node-chunks/chunk-EKFEF7FU.js";
|
|
96
96
|
import {
|
|
97
97
|
require_picocolors
|
|
98
|
-
} from "../_node-chunks/chunk-
|
|
99
|
-
import "../_node-chunks/chunk-
|
|
100
|
-
import "../_node-chunks/chunk-
|
|
101
|
-
import "../_node-chunks/chunk-
|
|
98
|
+
} from "../_node-chunks/chunk-ZWUV3LPT.js";
|
|
99
|
+
import "../_node-chunks/chunk-KSQYJW2B.js";
|
|
100
|
+
import "../_node-chunks/chunk-4CZH3XG3.js";
|
|
101
|
+
import "../_node-chunks/chunk-3GMDBVCD.js";
|
|
102
102
|
import {
|
|
103
103
|
__toESM
|
|
104
|
-
} from "../_node-chunks/chunk-
|
|
104
|
+
} from "../_node-chunks/chunk-35OISTYM.js";
|
|
105
105
|
|
|
106
106
|
// src/bin/core.ts
|
|
107
107
|
import {
|
|
@@ -146,12 +146,12 @@ function getProjectOverview(projectInfo) {
|
|
|
146
146
|
var DEFAULT_PROMPT_NAME = "optimized-tests", CURRENTLY_USED_PROMPT = {
|
|
147
147
|
[DEFAULT_PROMPT_NAME]: instructions
|
|
148
148
|
}, FORMERLY_USED_PROMPTS = {
|
|
149
|
-
monorepo: async () => (await import("../_node-chunks/monorepo-
|
|
150
|
-
"optimized-tests": async () => (await import("../_node-chunks/optimized-tests-
|
|
151
|
-
"relaxed-limits": async () => (await import("../_node-chunks/relaxed-limits-
|
|
152
|
-
setup: async () => (await import("../_node-chunks/setup-
|
|
153
|
-
"pattern-copy-play": async () => (await import("../_node-chunks/pattern-copy-play-
|
|
154
|
-
"monorepo-optimized-tests-relaxed-limits-no-story-deletion": async () => (await import("../_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-
|
|
149
|
+
monorepo: async () => (await import("../_node-chunks/monorepo-A4YCSFR6.js")).instructions,
|
|
150
|
+
"optimized-tests": async () => (await import("../_node-chunks/optimized-tests-R4YZ6KJA.js")).instructions,
|
|
151
|
+
"relaxed-limits": async () => (await import("../_node-chunks/relaxed-limits-YOIAJJY5.js")).instructions,
|
|
152
|
+
setup: async () => (await import("../_node-chunks/setup-VNUO347Q.js")).instructions,
|
|
153
|
+
"pattern-copy-play": async () => (await import("../_node-chunks/pattern-copy-play-K4XLDCUI.js")).instructions,
|
|
154
|
+
"monorepo-optimized-tests-relaxed-limits-no-story-deletion": async () => (await import("../_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-3XAIWI64.js")).instructions
|
|
155
155
|
}, PROMPT_NAMES = [
|
|
156
156
|
...Object.keys(CURRENTLY_USED_PROMPT),
|
|
157
157
|
...Object.keys(FORMERLY_USED_PROMPTS)
|
|
@@ -1513,7 +1513,8 @@ var build = async (cliOptions) => {
|
|
|
1513
1513
|
let { default: packageJson } = await import("@aussieljk/forkbook/package.json", { with: { type: "json" } }), options = {
|
|
1514
1514
|
...cliOptions,
|
|
1515
1515
|
configDir: cliOptions.configDir || defaultConfigDir(),
|
|
1516
|
-
|
|
1516
|
+
// Without --output-dir, the build picks `forkbook-static` or `public<basePath>`.
|
|
1517
|
+
outputDir: cliOptions.outputDir || void 0,
|
|
1517
1518
|
configType: "PRODUCTION",
|
|
1518
1519
|
cache: cache2,
|
|
1519
1520
|
packageJson
|
|
@@ -1668,7 +1669,7 @@ command("dev").option("-p, --port <number>", "Port to run Forkbook").option("-h,
|
|
|
1668
1669
|
).option("--ssl-cert <cert>", "Provide an SSL certificate. (Required with --https)").option("--ssl-key <key>", "Provide an SSL key. (Required with --https)").option("--smoke-test", "Exit after successful start").option("--ci", "CI mode (skip interactive prompts, don't open browser)").option("--open", "Open Forkbook automatically in the browser", !1).option("--no-open", "Do not open Forkbook in the browser (the default)").option("--quiet", "Suppress verbose build output").option("--no-version-updates", "Suppress update check", !0).option("--debug-webpack", "Display final webpack configurations for debugging purposes").option("--stats-json [directory]", "Write stats JSON to disk").option("--docs", "Build a documentation-only site using addon-docs").option("--exact-port", "Exit early if the desired port is not available").option(
|
|
1669
1670
|
"--initial-path [path]",
|
|
1670
1671
|
"URL path to be appended when visiting Forkbook for the first time"
|
|
1671
|
-
).option("--preview-only", "Use the preview without the manager UI").action(async (options) => {
|
|
1672
|
+
).option("--preview-only", "Use the preview without the manager UI").option("--base-path <path>", "URL path to mount Forkbook under (default: /_forkbook)").action(async (options) => {
|
|
1672
1673
|
let { default: packageJson } = await import("@aussieljk/forkbook/package.json", { with: { type: "json" } });
|
|
1673
1674
|
logger3.intro(`${packageJson.name} v${packageJson.version}`);
|
|
1674
1675
|
let resolvedOptions;
|
|
@@ -1681,7 +1682,7 @@ command("dev").option("-p, --port <number>", "Port to run Forkbook").option("-h,
|
|
|
1681
1682
|
handleCommandFailure(options.logfile);
|
|
1682
1683
|
});
|
|
1683
1684
|
});
|
|
1684
|
-
command("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory where to load Forkbook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final webpack configurations for debugging purposes").option("--stats-json [directory]", "Write stats JSON to disk").option("--docs", "Build a documentation-only site using addon-docs").option("--test", "Build stories optimized for testing purposes.").option("--preview-only", "Use the preview without the manager UI").action(async (options) => {
|
|
1685
|
+
command("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory where to load Forkbook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final webpack configurations for debugging purposes").option("--stats-json [directory]", "Write stats JSON to disk").option("--docs", "Build a documentation-only site using addon-docs").option("--test", "Build stories optimized for testing purposes.").option("--preview-only", "Use the preview without the manager UI").option("--base-path <path>", "URL path the build is served under (default: /_forkbook)").option("--build-to-public", "Write the build to public/<base path> (when no --output-dir)").action(async (options) => {
|
|
1685
1686
|
let { env } = process;
|
|
1686
1687
|
env.NODE_ENV = env.NODE_ENV || "production";
|
|
1687
1688
|
let { default: packageJson } = await import("@aussieljk/forkbook/package.json", { with: { type: "json" } });
|
package/dist/bin/dispatcher.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import CJS_COMPAT_NODE_URL_yrthiesbig from 'node:url';
|
|
3
|
+
import CJS_COMPAT_NODE_PATH_yrthiesbig from 'node:path';
|
|
4
|
+
import CJS_COMPAT_NODE_MODULE_yrthiesbig from "node:module";
|
|
5
5
|
|
|
6
|
-
var __filename =
|
|
7
|
-
var __dirname =
|
|
8
|
-
var require =
|
|
6
|
+
var __filename = CJS_COMPAT_NODE_URL_yrthiesbig.fileURLToPath(import.meta.url);
|
|
7
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yrthiesbig.dirname(__filename);
|
|
8
|
+
var require = CJS_COMPAT_NODE_MODULE_yrthiesbig.createRequire(import.meta.url);
|
|
9
9
|
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
@@ -13,12 +13,12 @@ var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
|
|
|
13
13
|
import {
|
|
14
14
|
MIN_SUPPORTED_NODE_DESCRIPTION,
|
|
15
15
|
isNodeVersionSupported
|
|
16
|
-
} from "../_node-chunks/chunk-
|
|
16
|
+
} from "../_node-chunks/chunk-GUOELDLF.js";
|
|
17
17
|
import {
|
|
18
18
|
resolvePackageDir
|
|
19
|
-
} from "../_node-chunks/chunk-
|
|
20
|
-
import "../_node-chunks/chunk-
|
|
21
|
-
import "../_node-chunks/chunk-
|
|
19
|
+
} from "../_node-chunks/chunk-MEKYIRUI.js";
|
|
20
|
+
import "../_node-chunks/chunk-X2ND43GY.js";
|
|
21
|
+
import "../_node-chunks/chunk-35OISTYM.js";
|
|
22
22
|
|
|
23
23
|
// src/bin/dispatcher.ts
|
|
24
24
|
import Module from "node:module";
|
package/dist/bin/loader.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yrthiesbig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yrthiesbig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yrthiesbig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yrthiesbig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yrthiesbig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yrthiesbig.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
|
NODE_TARGET
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
15
|
-
import "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-7QYZ55PS.js";
|
|
15
|
+
import "../_node-chunks/chunk-35OISTYM.js";
|
|
16
16
|
|
|
17
17
|
// src/bin/loader.ts
|
|
18
18
|
import { readFileSync, readdirSync } from "node:fs";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { A as writeIfChanged, C as getRouteSegments, D as resolvePreviewRoute, E as removePreviewRoute, O as toImportSpecifier, S as getRouteGroupDir, T as ignoreInGit, _ as generateClientCode, a as PreviewAlias, b as generateStoryLoaderCode, c as PreviewRouteOptions, d as StoryLoaderOptions, f as TurbopackConfigLike, g as generateAnnotationsCode, h as findGitDir, i as PREVIEW_ROUTE_SEGMENT, j as writePreviewRoute, k as toProjectRelativeAlias, l as RuntimeCodeOptions, m as findAppDir, n as PREVIEW_ROUTE_FILES, o as PreviewRoute, p as applyPreviewRouteMocks, r as PREVIEW_ROUTE_GROUP, s as PreviewRouteMocks, t as PREVIEW_GLOBALS_PATH, u as StoryLoaderEntry, v as generatePageCode, w as getStoryImportPaths, x as getPreviewRouteDir, y as generateRuntimeCode } from "../chunk-DtFyKAil.js";
|
|
2
|
+
import { Builder, Options, StoryIndex } from "@aussieljk/forkbook/internal/types";
|
|
3
|
+
|
|
4
|
+
//#region .dts-emit/code/core/src/builder-next/index.d.ts
|
|
5
|
+
/** The environment variables that `withForkbook` gives to the Forkbook child. */
|
|
6
|
+
declare const BUILDER_NEXT_ENV: {
|
|
7
|
+
/** The Next.js project folder. Default: the working folder of the Forkbook server. */readonly projectDir: 'FORKBOOK_NEXT_PROJECT_DIR'; /** The app folder of the Next.js project. Default: found from the project folder. */
|
|
8
|
+
readonly appDir: 'FORKBOOK_NEXT_APP_DIR';
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The seam for `next/*` mocks (phase 3). A mocks approach adds preview annotation files (for
|
|
12
|
+
* example a decorator that wraps each story in Next.js context providers). Module aliases go in
|
|
13
|
+
* `turbopack.resolveAlias` on the Next.js side (see `getPreviewRouteNextConfig` in
|
|
14
|
+
* `@aussieljk/forkbook/next`).
|
|
15
|
+
*/
|
|
16
|
+
interface BuilderNextMocks {
|
|
17
|
+
/** Absolute paths or package names, added after the framework annotations. */
|
|
18
|
+
previewAnnotations?: string[];
|
|
19
|
+
}
|
|
20
|
+
interface BuilderNextOptions {
|
|
21
|
+
mocks?: BuilderNextMocks;
|
|
22
|
+
}
|
|
23
|
+
/** The globals that `iframe.html` of builder-vite sets, as one object. */
|
|
24
|
+
declare function getPreviewGlobals(options: Options): Promise<Record<string, unknown>>;
|
|
25
|
+
/**
|
|
26
|
+
* The preview of the `nextjs-vite` framework needs the Vite aliases of `nextjs-vite-plugin`
|
|
27
|
+
* (`fb-original/*`, `next/*` mocks). Next.js does not have them, so builder-next leaves it out.
|
|
28
|
+
* Phase 3 gives the `next/*` mocks back through `BuilderNextMocks`.
|
|
29
|
+
*/
|
|
30
|
+
declare function isViteOnlyAnnotation(path: string): boolean;
|
|
31
|
+
/** The preview annotation files as absolute paths or package names, project preview last. */
|
|
32
|
+
declare function getPreviewAnnotationPaths(options: Options, mocks?: BuilderNextMocks): Promise<string[]>;
|
|
33
|
+
/** Redirects `<base>/iframe.html?…` to `<base>/iframe?…`, the route that Next.js serves. */
|
|
34
|
+
declare function getIframeRedirectUrl(basePath: string, url: string | undefined): string;
|
|
35
|
+
interface StoryLoaderWriter {
|
|
36
|
+
route: PreviewRoute;
|
|
37
|
+
/** Writes the loader module from the index. Returns true when the file changed. */
|
|
38
|
+
writeStories(index: Pick<StoryIndex, 'entries'>): boolean;
|
|
39
|
+
/** Writes the annotations module. Returns true when the file changed. */
|
|
40
|
+
writeAnnotations(paths: string[]): boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Writes the generated loader modules of the preview route. */
|
|
43
|
+
declare function createStoryLoaderWriter({
|
|
44
|
+
projectDir,
|
|
45
|
+
appDir,
|
|
46
|
+
basePath,
|
|
47
|
+
workingDir
|
|
48
|
+
}: {
|
|
49
|
+
projectDir: string;
|
|
50
|
+
appDir?: string;
|
|
51
|
+
basePath: string;
|
|
52
|
+
workingDir: string;
|
|
53
|
+
}): StoryLoaderWriter;
|
|
54
|
+
declare const bail: Builder<unknown>['bail'];
|
|
55
|
+
declare const getConfig: Builder<unknown>['getConfig'];
|
|
56
|
+
declare const start: Builder<unknown>['start'];
|
|
57
|
+
declare const build: Builder<unknown>['build'];
|
|
58
|
+
//#endregion
|
|
59
|
+
export { BUILDER_NEXT_ENV, BuilderNextMocks, BuilderNextOptions, PREVIEW_GLOBALS_PATH, PREVIEW_ROUTE_FILES, PREVIEW_ROUTE_GROUP, PREVIEW_ROUTE_SEGMENT, PreviewAlias, PreviewRoute, PreviewRouteMocks, PreviewRouteOptions, RuntimeCodeOptions, StoryLoaderEntry, StoryLoaderOptions, StoryLoaderWriter, TurbopackConfigLike, applyPreviewRouteMocks, bail, build, createStoryLoaderWriter, findAppDir, findGitDir, generateAnnotationsCode, generateClientCode, generatePageCode, generateRuntimeCode, generateStoryLoaderCode, getConfig, getIframeRedirectUrl, getPreviewAnnotationPaths, getPreviewGlobals, getPreviewRouteDir, getRouteGroupDir, getRouteSegments, getStoryImportPaths, ignoreInGit, isViteOnlyAnnotation, removePreviewRoute, resolvePreviewRoute, start, toImportSpecifier, toProjectRelativeAlias, writeIfChanged, writePreviewRoute };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yrthiesbig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yrthiesbig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yrthiesbig from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yrthiesbig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yrthiesbig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yrthiesbig.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
PREVIEW_GLOBALS_PATH,
|
|
14
|
+
PREVIEW_ROUTE_FILES,
|
|
15
|
+
PREVIEW_ROUTE_GROUP,
|
|
16
|
+
PREVIEW_ROUTE_SEGMENT,
|
|
17
|
+
applyPreviewRouteMocks,
|
|
18
|
+
findAppDir,
|
|
19
|
+
findGitDir,
|
|
20
|
+
generateAnnotationsCode,
|
|
21
|
+
generateClientCode,
|
|
22
|
+
generatePageCode,
|
|
23
|
+
generateRuntimeCode,
|
|
24
|
+
generateStoryLoaderCode,
|
|
25
|
+
getPreviewRouteDir,
|
|
26
|
+
getRouteGroupDir,
|
|
27
|
+
getRouteSegments,
|
|
28
|
+
getStoryImportPaths,
|
|
29
|
+
ignoreInGit,
|
|
30
|
+
removePreviewRoute,
|
|
31
|
+
resolvePreviewRoute,
|
|
32
|
+
toImportSpecifier,
|
|
33
|
+
toProjectRelativeAlias,
|
|
34
|
+
writeIfChanged,
|
|
35
|
+
writePreviewRoute
|
|
36
|
+
} from "../_node-chunks/chunk-HAVDCVZW.js";
|
|
37
|
+
import {
|
|
38
|
+
joinBasePath,
|
|
39
|
+
normalizeBasePath
|
|
40
|
+
} from "../_node-chunks/chunk-G3RUMVD7.js";
|
|
41
|
+
import "../_node-chunks/chunk-35OISTYM.js";
|
|
42
|
+
|
|
43
|
+
// src/builder-next/index.ts
|
|
44
|
+
import { join } from "node:path";
|
|
45
|
+
import { loadPreviewOrConfigFile, normalizeStories } from "@aussieljk/forkbook/internal/common";
|
|
46
|
+
var BUILDER_NEXT_ENV = {
|
|
47
|
+
/** The Next.js project folder. Default: the working folder of the Forkbook server. */
|
|
48
|
+
projectDir: "FORKBOOK_NEXT_PROJECT_DIR",
|
|
49
|
+
/** The app folder of the Next.js project. Default: found from the project folder. */
|
|
50
|
+
appDir: "FORKBOOK_NEXT_APP_DIR"
|
|
51
|
+
};
|
|
52
|
+
async function getPreviewGlobals(options) {
|
|
53
|
+
let { configType, features, presets } = options, [build2, frameworkOptions, logLevel, docsOptions, tagsOptions, security, coreOptions] = await Promise.all([
|
|
54
|
+
presets.apply("build"),
|
|
55
|
+
presets.apply("frameworkOptions"),
|
|
56
|
+
presets.apply("logLevel", void 0),
|
|
57
|
+
presets.apply("docs"),
|
|
58
|
+
presets.apply("tags"),
|
|
59
|
+
presets.apply("security"),
|
|
60
|
+
presets.apply("core")
|
|
61
|
+
]), stories = normalizeStories(await presets.apply("stories", [], options), {
|
|
62
|
+
configDir: options.configDir,
|
|
63
|
+
workingDir: process.cwd()
|
|
64
|
+
}).map((specifier) => ({
|
|
65
|
+
...specifier,
|
|
66
|
+
importPathMatcher: specifier.importPathMatcher.source
|
|
67
|
+
}));
|
|
68
|
+
return {
|
|
69
|
+
CONFIG_TYPE: configType ?? "",
|
|
70
|
+
LOGLEVEL: logLevel ?? "",
|
|
71
|
+
FRAMEWORK_OPTIONS: frameworkOptions ?? null,
|
|
72
|
+
CHANNEL_OPTIONS: coreOptions?.channelOptions ?? {},
|
|
73
|
+
FEATURES: features ?? {},
|
|
74
|
+
STORIES: stories,
|
|
75
|
+
DOCS_OPTIONS: docsOptions ?? {},
|
|
76
|
+
TAGS_OPTIONS: tagsOptions ?? {},
|
|
77
|
+
...build2?.test?.disableBlocks ? { __FORKBOOK_BLOCKS_EMPTY_MODULE__: {} } : {},
|
|
78
|
+
...security?.insecureIframeMessaging ? { INSECURE_IFRAME_MESSAGING: !0 } : {}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function isViteOnlyAnnotation(path) {
|
|
82
|
+
return /[\\/]nextjs-vite[\\/]preview\.(?:js|mjs|tsx?)$/.test(path) || path === "@aussieljk/forkbook/nextjs-vite/preview";
|
|
83
|
+
}
|
|
84
|
+
async function getPreviewAnnotationPaths(options, mocks = {}) {
|
|
85
|
+
let annotations = await options.presets.apply(
|
|
86
|
+
"previewAnnotations",
|
|
87
|
+
[],
|
|
88
|
+
options
|
|
89
|
+
), previewFile = loadPreviewOrConfigFile({ configDir: options.configDir });
|
|
90
|
+
return [...annotations.map((annotation) => typeof annotation == "object" ? annotation.absolute : annotation).filter((path) => !isViteOnlyAnnotation(path)), ...mocks.previewAnnotations ?? [], ...previewFile ? [previewFile] : []];
|
|
91
|
+
}
|
|
92
|
+
function getIframeRedirectUrl(basePath, url) {
|
|
93
|
+
let query = url?.includes("?") ? url.slice(url.indexOf("?")) : "";
|
|
94
|
+
return `${joinBasePath(basePath, PREVIEW_ROUTE_SEGMENT)}${query}`;
|
|
95
|
+
}
|
|
96
|
+
var unsubscribe;
|
|
97
|
+
function createStoryLoaderWriter({
|
|
98
|
+
projectDir,
|
|
99
|
+
appDir,
|
|
100
|
+
basePath,
|
|
101
|
+
workingDir
|
|
102
|
+
}) {
|
|
103
|
+
let route = resolvePreviewRoute({ projectDir, appDir, basePath });
|
|
104
|
+
return {
|
|
105
|
+
route,
|
|
106
|
+
writeStories: (index) => writeIfChanged(
|
|
107
|
+
join(route.routeDir, PREVIEW_ROUTE_FILES.stories),
|
|
108
|
+
generateStoryLoaderCode(index.entries, { workingDir, routeDir: route.routeDir })
|
|
109
|
+
),
|
|
110
|
+
writeAnnotations: (paths) => writeIfChanged(
|
|
111
|
+
join(route.routeDir, PREVIEW_ROUTE_FILES.annotations),
|
|
112
|
+
generateAnnotationsCode(paths, route.routeDir)
|
|
113
|
+
)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function registerRoutes(router, basePath, options) {
|
|
117
|
+
router.get("/iframe.html", (req, res) => {
|
|
118
|
+
res.statusCode = 302, res.setHeader("Location", getIframeRedirectUrl(basePath, req.url)), res.end();
|
|
119
|
+
}), router.get(PREVIEW_GLOBALS_PATH, async (_req, res) => {
|
|
120
|
+
try {
|
|
121
|
+
let globals = await getPreviewGlobals(options);
|
|
122
|
+
res.setHeader("Content-Type", "application/json"), res.setHeader("Cache-Control", "no-store"), res.end(JSON.stringify(globals));
|
|
123
|
+
} catch (error) {
|
|
124
|
+
res.statusCode = 500, res.end(String(error));
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
var bail = async () => {
|
|
129
|
+
unsubscribe?.(), unsubscribe = void 0;
|
|
130
|
+
}, getConfig = async () => ({}), start = async ({ startTime, options, router }) => {
|
|
131
|
+
let basePath = normalizeBasePath(options.basePath) || "/_forkbook", workingDir = process.cwd(), projectDir = process.env[BUILDER_NEXT_ENV.projectDir] || workingDir, appDir = process.env[BUILDER_NEXT_ENV.appDir] || void 0, mocks = (await options.presets.apply(
|
|
132
|
+
"frameworkOptions"
|
|
133
|
+
))?.builderNext?.mocks;
|
|
134
|
+
writePreviewRoute({ projectDir, appDir, basePath });
|
|
135
|
+
let writer = createStoryLoaderWriter({ projectDir, appDir, basePath, workingDir });
|
|
136
|
+
registerRoutes(router, basePath, options), writer.writeAnnotations(await getPreviewAnnotationPaths(options, mocks));
|
|
137
|
+
let generator = await options.presets.apply("storyIndexGenerator"), writeIndex = async () => {
|
|
138
|
+
try {
|
|
139
|
+
writer.writeStories(await generator.getIndex());
|
|
140
|
+
} catch {
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
return await writeIndex(), unsubscribe?.(), unsubscribe = generator.onInvalidated((event) => {
|
|
144
|
+
event && !event.added && !event.removed || writeIndex();
|
|
145
|
+
}), { bail, totalTime: process.hrtime(startTime) };
|
|
146
|
+
}, build = async () => {
|
|
147
|
+
throw new Error(
|
|
148
|
+
"builder-next only runs `forkbook dev`. `forkbook build` uses builder-vite (@aussieljk/forkbook/builder-vite)."
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
BUILDER_NEXT_ENV,
|
|
153
|
+
PREVIEW_GLOBALS_PATH,
|
|
154
|
+
PREVIEW_ROUTE_FILES,
|
|
155
|
+
PREVIEW_ROUTE_GROUP,
|
|
156
|
+
PREVIEW_ROUTE_SEGMENT,
|
|
157
|
+
applyPreviewRouteMocks,
|
|
158
|
+
bail,
|
|
159
|
+
build,
|
|
160
|
+
createStoryLoaderWriter,
|
|
161
|
+
findAppDir,
|
|
162
|
+
findGitDir,
|
|
163
|
+
generateAnnotationsCode,
|
|
164
|
+
generateClientCode,
|
|
165
|
+
generatePageCode,
|
|
166
|
+
generateRuntimeCode,
|
|
167
|
+
generateStoryLoaderCode,
|
|
168
|
+
getConfig,
|
|
169
|
+
getIframeRedirectUrl,
|
|
170
|
+
getPreviewAnnotationPaths,
|
|
171
|
+
getPreviewGlobals,
|
|
172
|
+
getPreviewRouteDir,
|
|
173
|
+
getRouteGroupDir,
|
|
174
|
+
getRouteSegments,
|
|
175
|
+
getStoryImportPaths,
|
|
176
|
+
ignoreInGit,
|
|
177
|
+
isViteOnlyAnnotation,
|
|
178
|
+
removePreviewRoute,
|
|
179
|
+
resolvePreviewRoute,
|
|
180
|
+
start,
|
|
181
|
+
toImportSpecifier,
|
|
182
|
+
toProjectRelativeAlias,
|
|
183
|
+
writeIfChanged,
|
|
184
|
+
writePreviewRoute
|
|
185
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Builder, Options } from "@aussieljk/forkbook/internal/types";
|
|
1
|
+
import { Builder, Middleware, Options } from "@aussieljk/forkbook/internal/types";
|
|
2
2
|
import { InlineConfig, PluginOption, UserConfig } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region .dts-emit/code/core/src/builder-vite/types.d.ts
|
|
@@ -33,6 +33,11 @@ declare const withoutVitePlugins: <TPlugin>(plugins: TPlugin[] | undefined, name
|
|
|
33
33
|
declare function hasVitePlugins(plugins: PluginOption[], names: string[]): Promise<boolean>;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region .dts-emit/code/core/src/builder-vite/index.d.ts
|
|
36
|
+
/**
|
|
37
|
+
* The Forkbook server removes the base path from each request before routing. Vite uses the base
|
|
38
|
+
* path as its `base`, so add the prefix again for requests that came in under it.
|
|
39
|
+
*/
|
|
40
|
+
declare function withBasePrefix(middlewares: Middleware): Middleware;
|
|
36
41
|
declare function bail(): Promise<void>;
|
|
37
42
|
/**
|
|
38
43
|
* Returns a {@link ChangeDetectionAdapter} bound to the Vite dev server created by `start()`, or —
|
|
@@ -47,4 +52,4 @@ declare const start: ViteBuilder['start'];
|
|
|
47
52
|
declare const build: ViteBuilder['build'];
|
|
48
53
|
declare const corePresets: string[];
|
|
49
54
|
//#endregion
|
|
50
|
-
export { BuilderOptions, StorybookConfigVite, ViteBuilder, ViteFinal, bail, build, changeDetectionAdapter, corePresets, hasVitePlugins, start, withoutVitePlugins };
|
|
55
|
+
export { BuilderOptions, StorybookConfigVite, ViteBuilder, ViteFinal, bail, build, changeDetectionAdapter, corePresets, hasVitePlugins, start, withBasePrefix, withoutVitePlugins };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yrthiesbig from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yrthiesbig from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yrthiesbig from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yrthiesbig.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yrthiesbig.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yrthiesbig.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
|
withoutVitePlugins
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-YXLQJR3R.js";
|
|
15
15
|
import {
|
|
16
16
|
commonConfig
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
18
|
-
import "../_node-chunks/chunk-
|
|
19
|
-
import "../_node-chunks/chunk-
|
|
20
|
-
import "../_node-chunks/chunk-
|
|
21
|
-
import "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-Z37X3NOU.js";
|
|
18
|
+
import "../_node-chunks/chunk-KPDGGNTL.js";
|
|
19
|
+
import "../_node-chunks/chunk-GW7BXWTM.js";
|
|
20
|
+
import "../_node-chunks/chunk-MEKYIRUI.js";
|
|
21
|
+
import "../_node-chunks/chunk-X2ND43GY.js";
|
|
22
22
|
import {
|
|
23
23
|
require_picocolors
|
|
24
|
-
} from "../_node-chunks/chunk-
|
|
25
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-ZWUV3LPT.js";
|
|
25
|
+
import "../_node-chunks/chunk-KSQYJW2B.js";
|
|
26
26
|
import {
|
|
27
27
|
__toESM
|
|
28
|
-
} from "../_node-chunks/chunk-
|
|
28
|
+
} from "../_node-chunks/chunk-35OISTYM.js";
|
|
29
29
|
|
|
30
30
|
// src/builder-vite/index.ts
|
|
31
31
|
import { readFile } from "node:fs/promises";
|
|
@@ -208,6 +208,12 @@ function iframeHandler(options, server2) {
|
|
|
208
208
|
res.setHeader("Content-Type", "text/html"), res.statusCode = 200, res.write(transformed), res.end();
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
+
function withBasePrefix(middlewares) {
|
|
212
|
+
return (req, res, next) => {
|
|
213
|
+
let basePath = req.forkbookBasePath;
|
|
214
|
+
return basePath && req.url && !req.url.startsWith(`${basePath}/`) && (req.url = `${basePath}${req.url}`), middlewares(req, res, next);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
211
217
|
var server;
|
|
212
218
|
async function bail() {
|
|
213
219
|
return server?.close();
|
|
@@ -225,7 +231,7 @@ var changeDetectionAdapter = (options) => {
|
|
|
225
231
|
options,
|
|
226
232
|
router,
|
|
227
233
|
server: devServer
|
|
228
|
-
}) => (server = await createViteServer(options, devServer), router.get("/iframe.html", iframeHandler(options, server)), router.use(server.middlewares), {
|
|
234
|
+
}) => (server = await createViteServer(options, devServer), router.get("/iframe.html", iframeHandler(options, server)), router.use(withBasePrefix(server.middlewares)), {
|
|
229
235
|
bail,
|
|
230
236
|
stats: {
|
|
231
237
|
toJson: () => {
|
|
@@ -241,5 +247,6 @@ export {
|
|
|
241
247
|
corePresets,
|
|
242
248
|
hasVitePlugins,
|
|
243
249
|
start,
|
|
250
|
+
withBasePrefix,
|
|
244
251
|
withoutVitePlugins
|
|
245
252
|
};
|