@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
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
|
|
13
|
+
// src/channels/base-path.ts
|
|
14
|
+
var DEFAULT_BASE_PATH = "/_forkbook", CHANNEL_PATH_SEGMENT = "/fb-channel";
|
|
15
|
+
function normalizeBasePath(basePath) {
|
|
16
|
+
if (basePath == null)
|
|
17
|
+
return DEFAULT_BASE_PATH;
|
|
18
|
+
let trimmed = basePath.trim().split(/[?#]/)[0].replace(/\/{2,}/g, "/").replace(/\/+$/, "");
|
|
19
|
+
return trimmed === "" ? "" : trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
20
|
+
}
|
|
21
|
+
function joinBasePath(basePath, path = "") {
|
|
22
|
+
let base = normalizeBasePath(basePath), rest = path.replace(/^\/+/, "");
|
|
23
|
+
return rest ? `${base}/${rest}` : base || "/";
|
|
24
|
+
}
|
|
25
|
+
function stripBasePath(basePath, url) {
|
|
26
|
+
let base = normalizeBasePath(basePath);
|
|
27
|
+
if (!base)
|
|
28
|
+
return url.startsWith("/") ? url : `/${url}`;
|
|
29
|
+
if (!url.startsWith(base))
|
|
30
|
+
return;
|
|
31
|
+
let rest = url.slice(base.length);
|
|
32
|
+
if (rest === "")
|
|
33
|
+
return "/";
|
|
34
|
+
if (rest[0] === "/")
|
|
35
|
+
return rest;
|
|
36
|
+
if (rest[0] === "?" || rest[0] === "#")
|
|
37
|
+
return `/${rest}`;
|
|
38
|
+
}
|
|
39
|
+
function getChannelPath(basePath) {
|
|
40
|
+
return joinBasePath(basePath, CHANNEL_PATH_SEGMENT);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
DEFAULT_BASE_PATH,
|
|
45
|
+
normalizeBasePath,
|
|
46
|
+
joinBasePath,
|
|
47
|
+
stripBasePath,
|
|
48
|
+
getChannelPath
|
|
49
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
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
|
require_picocolors
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZWUV3LPT.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__export,
|
|
18
18
|
__toESM
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-35OISTYM.js";
|
|
20
20
|
|
|
21
21
|
// ../../node_modules/sisteransi/src/index.js
|
|
22
22
|
var require_src = __commonJS({
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -1,20 +1,20 @@
|
|
|
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
|
Tag
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YOGHVKVE.js";
|
|
15
15
|
import {
|
|
16
16
|
jsTsSourceExtensions
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-X2ND43GY.js";
|
|
18
18
|
|
|
19
19
|
// src/common/utils/module-resolver.ts
|
|
20
20
|
import { ResolverFactory } from "oxc-resolver";
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
importModule
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MEKYIRUI.js";
|
|
15
15
|
|
|
16
16
|
// src/cli-commands/postinstallAddon.ts
|
|
17
17
|
import { spawnSync } from "node:child_process";
|
|
@@ -0,0 +1,298 @@
|
|
|
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
|
+
|
|
13
|
+
// src/builder-next/route.ts
|
|
14
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
15
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
16
|
+
var PREVIEW_ROUTE_GROUP = "(forkbook)", PREVIEW_ROUTE_SEGMENT = "iframe", PREVIEW_GLOBALS_PATH = "/iframe-globals.json", PREVIEW_ROUTE_FILES = {
|
|
17
|
+
page: "page.tsx",
|
|
18
|
+
client: "forkbook-client.tsx",
|
|
19
|
+
runtime: "forkbook-runtime.tsx",
|
|
20
|
+
stories: "forkbook-stories.js",
|
|
21
|
+
annotations: "forkbook-annotations.js"
|
|
22
|
+
}, GENERATED_HEADER = "// Generated by Forkbook (builder-next). Do not edit. It is removed when `next dev` stops.\n";
|
|
23
|
+
function findAppDir(projectDir) {
|
|
24
|
+
for (let candidate of [join(projectDir, "app"), join(projectDir, "src", "app")])
|
|
25
|
+
if (existsSync(candidate))
|
|
26
|
+
return candidate;
|
|
27
|
+
}
|
|
28
|
+
function getRouteSegments(basePath) {
|
|
29
|
+
return basePath.split("/").filter(Boolean).map((segment) => segment.startsWith("_") ? `%5F${segment.slice(1)}` : segment);
|
|
30
|
+
}
|
|
31
|
+
function getRouteGroupDir(appDir) {
|
|
32
|
+
return join(appDir, PREVIEW_ROUTE_GROUP);
|
|
33
|
+
}
|
|
34
|
+
function getPreviewRouteDir(appDir, basePath) {
|
|
35
|
+
return join(getRouteGroupDir(appDir), ...getRouteSegments(basePath), PREVIEW_ROUTE_SEGMENT);
|
|
36
|
+
}
|
|
37
|
+
function toImportSpecifier(fromDir, target) {
|
|
38
|
+
if (!isAbsolute(target))
|
|
39
|
+
return target;
|
|
40
|
+
let path = relative(fromDir, target).split(sep).join("/");
|
|
41
|
+
return path.startsWith(".") ? path : `./${path}`;
|
|
42
|
+
}
|
|
43
|
+
function getStoryImportPaths(entries) {
|
|
44
|
+
return [...new Set(Object.values(entries).map((entry) => entry.importPath))].sort();
|
|
45
|
+
}
|
|
46
|
+
function generateStoryLoaderCode(entries, { workingDir, routeDir }) {
|
|
47
|
+
let lines = getStoryImportPaths(entries).map((importPath) => {
|
|
48
|
+
let specifier = importPath.startsWith("virtual:") ? importPath : toImportSpecifier(routeDir, resolve(workingDir, importPath));
|
|
49
|
+
return ` ${JSON.stringify(importPath)}: () => import(${JSON.stringify(specifier)}),`;
|
|
50
|
+
});
|
|
51
|
+
return `${GENERATED_HEADER}
|
|
52
|
+
const importers = {
|
|
53
|
+
${lines.join(`
|
|
54
|
+
`)}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export async function importFn(path) {
|
|
58
|
+
const importer = importers[path];
|
|
59
|
+
if (!importer) {
|
|
60
|
+
throw new Error(\`Forkbook: no story file for "\${path}". Restart next dev if it is new.\`);
|
|
61
|
+
}
|
|
62
|
+
return importer();
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
function generateAnnotationsCode(annotationPaths, routeDir) {
|
|
67
|
+
let specifiers = annotationPaths.map((path) => toImportSpecifier(routeDir, path)), imports = specifiers.map(
|
|
68
|
+
(specifier, index) => `import * as annotations${index} from ${JSON.stringify(specifier)};`
|
|
69
|
+
), names = specifiers.map((_, index) => `annotations${index}`);
|
|
70
|
+
return `${GENERATED_HEADER}
|
|
71
|
+
import { composeConfigs } from '@aussieljk/forkbook/preview-api';
|
|
72
|
+
${imports.join(`
|
|
73
|
+
`)}
|
|
74
|
+
|
|
75
|
+
const modules = [${names.join(", ")}];
|
|
76
|
+
|
|
77
|
+
export function getProjectAnnotations() {
|
|
78
|
+
const preview = modules[modules.length - 1];
|
|
79
|
+
if (preview?.default?.composed) {
|
|
80
|
+
return preview.default.composed;
|
|
81
|
+
}
|
|
82
|
+
return composeConfigs(modules);
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
function generatePageCode() {
|
|
87
|
+
return `${GENERATED_HEADER}
|
|
88
|
+
import ForkbookClient from './${PREVIEW_ROUTE_FILES.client.replace(/\.tsx$/, "")}';
|
|
89
|
+
|
|
90
|
+
export const metadata = { title: 'Forkbook', robots: { index: false, follow: false } };
|
|
91
|
+
|
|
92
|
+
export default function ForkbookPreviewPage() {
|
|
93
|
+
return <ForkbookClient />;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
97
|
+
function generateClientCode() {
|
|
98
|
+
return `${GENERATED_HEADER}
|
|
99
|
+
'use client';
|
|
100
|
+
|
|
101
|
+
import dynamic from 'next/dynamic';
|
|
102
|
+
|
|
103
|
+
const ForkbookRuntime = dynamic(() => import('./${PREVIEW_ROUTE_FILES.runtime.replace(/\.tsx$/, "")}'), {
|
|
104
|
+
ssr: false,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export default function ForkbookClient() {
|
|
108
|
+
return <ForkbookRuntime />;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
function generateRuntimeCode({ basePath }) {
|
|
113
|
+
let globalsUrl = `${basePath}${PREVIEW_GLOBALS_PATH}`;
|
|
114
|
+
return `${GENERATED_HEADER}
|
|
115
|
+
'use client';
|
|
116
|
+
|
|
117
|
+
import { useEffect } from 'react';
|
|
118
|
+
import { setup } from '@aussieljk/forkbook/internal/preview/runtime';
|
|
119
|
+
import { createBrowserChannel } from '@aussieljk/forkbook/internal/channels';
|
|
120
|
+
import { addons, PreviewWeb } from '@aussieljk/forkbook/preview-api';
|
|
121
|
+
import { importFn } from './${PREVIEW_ROUTE_FILES.stories}';
|
|
122
|
+
import { getProjectAnnotations } from './${PREVIEW_ROUTE_FILES.annotations}';
|
|
123
|
+
|
|
124
|
+
const w = window;
|
|
125
|
+
|
|
126
|
+
async function loadGlobals() {
|
|
127
|
+
const response = await fetch(${JSON.stringify(globalsUrl)});
|
|
128
|
+
if (!response.ok) {
|
|
129
|
+
throw new Error('Forkbook: could not load the preview globals (' + response.status + ').');
|
|
130
|
+
}
|
|
131
|
+
Object.assign(w, await response.json());
|
|
132
|
+
w.global = w;
|
|
133
|
+
w.module = undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async function start() {
|
|
137
|
+
if (!w.__FORKBOOK_PREVIEW_STARTING__) {
|
|
138
|
+
w.__FORKBOOK_PREVIEW_STARTING__ = (async () => {
|
|
139
|
+
await loadGlobals();
|
|
140
|
+
setup();
|
|
141
|
+
const channel = createBrowserChannel({ page: 'preview' });
|
|
142
|
+
addons.setChannel(channel);
|
|
143
|
+
if (w.CONFIG_TYPE === 'DEVELOPMENT') {
|
|
144
|
+
w.__FORKBOOK_SERVER_CHANNEL__ = channel;
|
|
145
|
+
}
|
|
146
|
+
w.__FORKBOOK_PREVIEW__ = new PreviewWeb(importFn, getProjectAnnotations);
|
|
147
|
+
w.__FORKBOOK_STORY_STORE__ = w.__FORKBOOK_PREVIEW__.storyStore;
|
|
148
|
+
})();
|
|
149
|
+
return w.__FORKBOOK_PREVIEW_STARTING__;
|
|
150
|
+
}
|
|
151
|
+
// A hot update ran this module again. Give the new modules to the running preview.
|
|
152
|
+
await w.__FORKBOOK_PREVIEW_STARTING__;
|
|
153
|
+
const preview = w.__FORKBOOK_PREVIEW__;
|
|
154
|
+
await preview.onGetProjectAnnotationsChanged({ getProjectAnnotations });
|
|
155
|
+
await preview.onStoriesChanged({ importFn });
|
|
156
|
+
w.__FORKBOOK_SERVER_CHANNEL__?.emit('storyHotUpdated');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const started = start().catch((error) => {
|
|
160
|
+
console.error(error);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export default function ForkbookRuntime() {
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
void started;
|
|
166
|
+
}, []);
|
|
167
|
+
return (
|
|
168
|
+
<>
|
|
169
|
+
<div id="storybook-root" />
|
|
170
|
+
<div id="storybook-docs" />
|
|
171
|
+
</>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
function writeIfChanged(path, content) {
|
|
177
|
+
return existsSync(path) && readFileSync(path, "utf8") === content ? !1 : (mkdirSync(dirname(path), { recursive: !0 }), writeFileSync(path, content), !0);
|
|
178
|
+
}
|
|
179
|
+
function resolvePreviewRoute({
|
|
180
|
+
projectDir,
|
|
181
|
+
basePath,
|
|
182
|
+
appDir
|
|
183
|
+
}) {
|
|
184
|
+
let app = appDir ?? findAppDir(projectDir);
|
|
185
|
+
if (!app)
|
|
186
|
+
throw new Error(
|
|
187
|
+
`Forkbook (builder-next): no "app" or "src/app" folder in ${projectDir}. builder-next needs the App Router.`
|
|
188
|
+
);
|
|
189
|
+
return {
|
|
190
|
+
appDir: app,
|
|
191
|
+
groupDir: getRouteGroupDir(app),
|
|
192
|
+
routeDir: getPreviewRouteDir(app, basePath)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function writePreviewRoute(options) {
|
|
196
|
+
let route = resolvePreviewRoute(options), { routeDir } = route;
|
|
197
|
+
writeIfChanged(join(routeDir, PREVIEW_ROUTE_FILES.page), generatePageCode()), writeIfChanged(join(routeDir, PREVIEW_ROUTE_FILES.client), generateClientCode()), writeIfChanged(
|
|
198
|
+
join(routeDir, PREVIEW_ROUTE_FILES.runtime),
|
|
199
|
+
generateRuntimeCode({ basePath: options.basePath })
|
|
200
|
+
);
|
|
201
|
+
let stories = join(routeDir, PREVIEW_ROUTE_FILES.stories);
|
|
202
|
+
existsSync(stories) || writeIfChanged(stories, generateStoryLoaderCode({}, { workingDir: routeDir, routeDir }));
|
|
203
|
+
let annotations = join(routeDir, PREVIEW_ROUTE_FILES.annotations);
|
|
204
|
+
return existsSync(annotations) || writeIfChanged(annotations, generateAnnotationsCode([], routeDir)), ignoreInGit(route.groupDir), route;
|
|
205
|
+
}
|
|
206
|
+
function removePreviewRoute(route) {
|
|
207
|
+
rmSync(route.groupDir, { recursive: !0, force: !0 });
|
|
208
|
+
}
|
|
209
|
+
function findGitDir(dir) {
|
|
210
|
+
let current = resolve(dir);
|
|
211
|
+
for (; ; ) {
|
|
212
|
+
let candidate = join(current, ".git");
|
|
213
|
+
if (existsSync(candidate)) {
|
|
214
|
+
try {
|
|
215
|
+
let text = readFileSync(candidate, "utf8"), match = /^gitdir:\s*(.+)$/m.exec(text);
|
|
216
|
+
if (match) {
|
|
217
|
+
let gitDir = resolve(current, match[1].trim()), common = join(gitDir, "commondir");
|
|
218
|
+
return existsSync(common) ? resolve(gitDir, readFileSync(common, "utf8").trim()) : gitDir;
|
|
219
|
+
}
|
|
220
|
+
} catch {
|
|
221
|
+
}
|
|
222
|
+
return candidate;
|
|
223
|
+
}
|
|
224
|
+
let parent = dirname(current);
|
|
225
|
+
if (parent === current)
|
|
226
|
+
return;
|
|
227
|
+
current = parent;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function ignoreInGit(groupDir) {
|
|
231
|
+
let gitDir = findGitDir(dirname(groupDir));
|
|
232
|
+
if (!gitDir)
|
|
233
|
+
return !1;
|
|
234
|
+
let pattern = `${PREVIEW_ROUTE_GROUP}/`, excludePath = join(gitDir, "info", "exclude"), existing = existsSync(excludePath) ? readFileSync(excludePath, "utf8") : "";
|
|
235
|
+
if (existing.split(/\r?\n/).includes(pattern))
|
|
236
|
+
return !0;
|
|
237
|
+
mkdirSync(dirname(excludePath), { recursive: !0 });
|
|
238
|
+
let prefix = existing && !existing.endsWith(`
|
|
239
|
+
`) ? `
|
|
240
|
+
` : "";
|
|
241
|
+
return writeFileSync(
|
|
242
|
+
excludePath,
|
|
243
|
+
`${existing}${prefix}# Forkbook builder-next preview route (generated)
|
|
244
|
+
${pattern}
|
|
245
|
+
`
|
|
246
|
+
), !0;
|
|
247
|
+
}
|
|
248
|
+
function toProjectRelativeAlias(alias, projectDir) {
|
|
249
|
+
return typeof alias == "string" ? isAbsolute(alias) ? toImportSpecifier(projectDir, alias) : alias : Object.fromEntries(
|
|
250
|
+
Object.entries(alias).map(([condition, target]) => [
|
|
251
|
+
condition,
|
|
252
|
+
toProjectRelativeAlias(target, projectDir)
|
|
253
|
+
])
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
function applyPreviewRouteMocks(config, { resolveAlias = {} }, projectDir = process.cwd()) {
|
|
257
|
+
if (Object.keys(resolveAlias).length === 0)
|
|
258
|
+
return config;
|
|
259
|
+
let aliases = Object.fromEntries(
|
|
260
|
+
Object.entries(resolveAlias).map(([name, alias]) => [
|
|
261
|
+
name,
|
|
262
|
+
toProjectRelativeAlias(alias, projectDir)
|
|
263
|
+
])
|
|
264
|
+
);
|
|
265
|
+
return {
|
|
266
|
+
...config,
|
|
267
|
+
turbopack: {
|
|
268
|
+
...config.turbopack,
|
|
269
|
+
resolveAlias: { ...aliases, ...config.turbopack?.resolveAlias }
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export {
|
|
275
|
+
PREVIEW_ROUTE_GROUP,
|
|
276
|
+
PREVIEW_ROUTE_SEGMENT,
|
|
277
|
+
PREVIEW_GLOBALS_PATH,
|
|
278
|
+
PREVIEW_ROUTE_FILES,
|
|
279
|
+
findAppDir,
|
|
280
|
+
getRouteSegments,
|
|
281
|
+
getRouteGroupDir,
|
|
282
|
+
getPreviewRouteDir,
|
|
283
|
+
toImportSpecifier,
|
|
284
|
+
getStoryImportPaths,
|
|
285
|
+
generateStoryLoaderCode,
|
|
286
|
+
generateAnnotationsCode,
|
|
287
|
+
generatePageCode,
|
|
288
|
+
generateClientCode,
|
|
289
|
+
generateRuntimeCode,
|
|
290
|
+
writeIfChanged,
|
|
291
|
+
resolvePreviewRoute,
|
|
292
|
+
writePreviewRoute,
|
|
293
|
+
removePreviewRoute,
|
|
294
|
+
findGitDir,
|
|
295
|
+
ignoreInGit,
|
|
296
|
+
toProjectRelativeAlias,
|
|
297
|
+
applyPreviewRouteMocks
|
|
298
|
+
};
|
|
@@ -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
|
|
@@ -1,21 +1,21 @@
|
|
|
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
|
isEqual
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KXKTY4VF.js";
|
|
15
15
|
import {
|
|
16
16
|
deserializeError,
|
|
17
17
|
serializeError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JGHJUGTC.js";
|
|
19
19
|
import {
|
|
20
20
|
OpenServiceAsyncRecipeError,
|
|
21
21
|
OpenServiceAsyncSchemaError,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
OpenServiceRemoteCommandUnhandledError,
|
|
32
32
|
OpenServiceUnimplementedOperationError,
|
|
33
33
|
OpenServiceValidationError
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EKFEF7FU.js";
|
|
35
35
|
|
|
36
36
|
// src/channels/main.ts
|
|
37
37
|
var isMulti = (args) => "transports" in args && args.transports !== void 0, generateRandomId = () => Math.random().toString(16).slice(2), Channel = class {
|
|
@@ -1,24 +1,24 @@
|
|
|
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
|
require_src
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6OTSKKBF.js";
|
|
15
15
|
import {
|
|
16
16
|
require_picocolors
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZWUV3LPT.js";
|
|
18
18
|
import {
|
|
19
19
|
__commonJS,
|
|
20
20
|
__toESM
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-35OISTYM.js";
|
|
22
22
|
|
|
23
23
|
// ../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
|
|
24
24
|
var require_sourcemap_codec_umd = __commonJS({
|
|
@@ -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
|
|
@@ -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,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_mavmgxtxjxo.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-35OISTYM.js";
|
|
16
16
|
|
|
17
17
|
// ../../node_modules/tsconfig-paths/lib/filesystem.js
|
|
18
18
|
var require_filesystem = __commonJS({
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
up2 as up
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GW7BXWTM.js";
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/empathic/package.mjs
|
|
17
17
|
import { env } from "node:process";
|