@aussieljk/forkbook 0.0.0-stage → 0.0.1-2
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/LICENSE +22 -0
- package/README.md +77 -2
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
- package/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -0
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/assets/builder-vite/iframe.html +99 -0
- package/assets/create/rendererAssets/.eslintrc.json +16 -0
- package/assets/create/rendererAssets/common/Configure.mdx +388 -0
- package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
- package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
- package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
- package/assets/create/rendererAssets/common/assets/assets.png +0 -0
- package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/assets/create/rendererAssets/common/assets/context.png +0 -0
- package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
- package/assets/create/rendererAssets/common/assets/docs.png +0 -0
- package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/assets/create/rendererAssets/common/assets/github.svg +1 -0
- package/assets/create/rendererAssets/common/assets/share.png +0 -0
- package/assets/create/rendererAssets/common/assets/styling.png +0 -0
- package/assets/create/rendererAssets/common/assets/testing.png +0 -0
- package/assets/create/rendererAssets/common/assets/theming.png +0 -0
- package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
- package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
- package/assets/create/rendererAssets/common/button.css +30 -0
- package/assets/create/rendererAssets/common/header.css +32 -0
- package/assets/create/rendererAssets/common/page.css +68 -0
- package/assets/create/templates/react-native/index.expo.js +20 -0
- package/assets/create/templates/react-native/index.js +25 -0
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/react-native/metro-env.d.ts +69 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +116 -0
- package/assets/server/base-preview-head.html +494 -0
- package/assets/server/openBrowser.applescript +94 -0
- package/assets/server/template.ejs +87 -0
- package/dist/.build-stamp +0 -0
- package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
- package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
- package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
- package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
- package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
- package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
- package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
- package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
- package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
- package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
- package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
- package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
- package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
- package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
- package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
- package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
- package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
- package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
- package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
- package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
- package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
- package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
- package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
- package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
- package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
- package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
- package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
- package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
- package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
- package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
- package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
- package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
- package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
- package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
- package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
- package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
- package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
- package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
- package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
- package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
- package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
- package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
- package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
- package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
- package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
- package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
- package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
- package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
- package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
- package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
- package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
- package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
- package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
- package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
- package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
- package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
- package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
- package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
- package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
- package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
- package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
- package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
- package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
- package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
- package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
- package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
- package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
- package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
- package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
- package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
- package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
- package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
- package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
- package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
- package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
- package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
- package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
- package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
- package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
- package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
- package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
- package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
- package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
- package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
- package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
- package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
- package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
- package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
- package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
- package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
- package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
- package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
- package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
- package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
- package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
- package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
- package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
- package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
- package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
- package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
- package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
- package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
- package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
- package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
- package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
- package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
- package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
- package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
- package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
- package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
- package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
- package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
- package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
- package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
- package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
- package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
- package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
- package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
- package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
- package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
- package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
- package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
- package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
- package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
- package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
- package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
- package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
- package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
- package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
- package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
- package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
- package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
- package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
- package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
- package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
- package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
- package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
- package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
- package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
- package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
- package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
- package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
- package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
- package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
- package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
- package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
- package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
- package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
- package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
- package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
- package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
- package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
- package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
- package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
- package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
- package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
- package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
- package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
- package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
- package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
- package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
- package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
- package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
- package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
- package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
- package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
- package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
- package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
- package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
- package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
- package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
- package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
- package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
- package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
- package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
- package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
- package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
- package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
- package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
- package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
- package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
- package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
- package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
- package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
- package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
- package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
- package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
- package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
- package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
- package/dist/actions/decorator.d.ts +7 -0
- package/dist/actions/decorator.js +43 -0
- package/dist/actions/index.d.ts +67 -0
- package/dist/actions/index.js +28 -0
- package/dist/addon-a11y/index.d.ts +52 -0
- package/dist/addon-a11y/index.js +16 -0
- package/dist/addon-a11y/manager.js +1429 -0
- package/dist/addon-a11y/preset.js +18 -0
- package/dist/addon-a11y/preview.d.ts +17 -0
- package/dist/addon-a11y/preview.js +15 -0
- package/dist/addon-docs/blocks.d.ts +1061 -0
- package/dist/addon-docs/blocks.js +2461 -0
- package/dist/addon-docs/index.d.ts +236 -0
- package/dist/addon-docs/index.js +16 -0
- package/dist/addon-docs/manager.js +90 -0
- package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
- package/dist/addon-docs/mdx-react-shim.js +2 -0
- package/dist/addon-docs/preset.js +378 -0
- package/dist/addon-docs/preview.d.ts +4 -0
- package/dist/addon-docs/preview.js +7 -0
- package/dist/addon-links/index.d.ts +22 -0
- package/dist/addon-links/index.js +20 -0
- package/dist/addon-links/manager.js +14 -0
- package/dist/addon-links/preview.d.ts +6 -0
- package/dist/addon-links/preview.js +9 -0
- package/dist/addon-links/react/index.d.ts +25 -0
- package/dist/addon-links/react/index.js +52 -0
- package/dist/addon-mcp/preset.js +1345 -0
- package/dist/addon-mcp/preview.js +29 -0
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
- package/dist/addon-ondevice-actions/index.d.ts +4 -0
- package/dist/addon-ondevice-actions/index.js +7 -0
- package/dist/addon-ondevice-actions/register.js +7 -0
- package/dist/addon-ondevice-controls/index.d.ts +6 -0
- package/dist/addon-ondevice-controls/index.js +14 -0
- package/dist/addon-ondevice-controls/register.js +10 -0
- package/dist/addon-pseudo-states/index.d.ts +35 -0
- package/dist/addon-pseudo-states/index.js +15 -0
- package/dist/addon-pseudo-states/manager.js +53 -0
- package/dist/addon-pseudo-states/preview.d.ts +9 -0
- package/dist/addon-pseudo-states/preview.js +10 -0
- package/dist/addon-themes/index.d.ts +80 -0
- package/dist/addon-themes/index.js +104 -0
- package/dist/addon-themes/manager.js +97 -0
- package/dist/addon-themes/postinstall.js +33 -0
- package/dist/addon-themes/preview.d.ts +6 -0
- package/dist/addon-themes/preview.js +8 -0
- package/dist/addon-vitest/constants.d.ts +132 -0
- package/dist/addon-vitest/constants.js +66 -0
- package/dist/addon-vitest/index.d.ts +4 -0
- package/dist/addon-vitest/index.js +8 -0
- package/dist/addon-vitest/manager.js +665 -0
- package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
- package/dist/addon-vitest/node/vitest.js +674 -0
- package/dist/addon-vitest/postinstall.js +24 -0
- package/dist/addon-vitest/preset.js +943 -0
- package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
- package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
- package/dist/addon-vitest/vitest-plugin/index.js +463 -0
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
- package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
- package/dist/babel/index.d.ts +2301 -0
- package/dist/babel/index.js +61 -0
- package/dist/backgrounds/index.d.ts +6 -0
- package/dist/backgrounds/index.js +15 -0
- package/dist/bin/core.js +1705 -0
- package/dist/bin/dispatcher.js +43 -0
- package/dist/bin/loader.js +115 -0
- package/dist/builder-vite/index.d.ts +50 -0
- package/dist/builder-vite/index.js +245 -0
- package/dist/builder-vite/preset.js +27 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +352 -0
- package/dist/chunk-B2t1tGRh.d.ts +284 -0
- package/dist/chunk-BCoJQE-f.d.ts +602 -0
- package/dist/chunk-BGkgZp-H.d.ts +214 -0
- package/dist/chunk-BTVrWliM.d.ts +115 -0
- package/dist/chunk-BXLImeLy.d.ts +197 -0
- package/dist/chunk-BfBzpgct.d.ts +916 -0
- package/dist/chunk-Bpi2tz-6.d.ts +511 -0
- package/dist/chunk-BxWufQms.d.ts +142 -0
- package/dist/chunk-C-bavsOH.d.ts +34 -0
- package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
- package/dist/chunk-C6PAgHLT.d.ts +12 -0
- package/dist/chunk-CMeX4WRe.d.ts +179 -0
- package/dist/chunk-Ct9xd6IM.d.ts +65 -0
- package/dist/chunk-CwQKNaYL.d.ts +15 -0
- package/dist/chunk-D7DwV41f.d.ts +3622 -0
- package/dist/chunk-DEVFdzxR.d.ts +253 -0
- package/dist/chunk-DaVb55-_.d.ts +124 -0
- package/dist/chunk-DgRNfmj_.d.ts +40 -0
- package/dist/chunk-DoIGKY33.d.ts +666 -0
- package/dist/chunk-Dr3R0DXk.d.ts +40 -0
- package/dist/chunk-DtHByo32.d.ts +55 -0
- package/dist/chunk-Dw1z1Pki.d.ts +933 -0
- package/dist/chunk-DzuY9DXg.d.ts +79 -0
- package/dist/chunk-FjDVzZTj.d.ts +62 -0
- package/dist/chunk-Kt1tW-D1.d.ts +59 -0
- package/dist/chunk-XP8oHzpE.d.ts +6 -0
- package/dist/chunk-gCX81nOr.d.ts +61 -0
- package/dist/chunk-pcFXCimE.d.ts +741 -0
- package/dist/cli/index.d.ts +1174 -0
- package/dist/cli/index.js +5613 -0
- package/dist/cli/skills/content/index.d.ts +72 -0
- package/dist/cli/skills/content/index.js +335 -0
- package/dist/cli/tools/sdk/child-host.d.ts +61 -0
- package/dist/cli/tools/sdk/child-host.js +131 -0
- package/dist/cli/tools/sdk/index.d.ts +137 -0
- package/dist/cli/tools/sdk/index.js +44 -0
- package/dist/cli-commands/bin/index.js +25 -0
- package/dist/client-logger/index.d.ts +31 -0
- package/dist/client-logger/index.js +63 -0
- package/dist/common/index.d.ts +1103 -0
- package/dist/common/index.js +364 -0
- package/dist/components/index.d.ts +1924 -0
- package/dist/components/index.js +13759 -0
- package/dist/core-events/index.d.ts +155 -0
- package/dist/core-events/index.js +136 -0
- package/dist/core-server/index.d.ts +2200 -0
- package/dist/core-server/index.js +4165 -0
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +4168 -0
- package/dist/core-server/presets/common-override-preset.js +81 -0
- package/dist/core-server/presets/common-preset.js +2187 -0
- package/dist/create/bin/index.js +23 -0
- package/dist/create/index.js +25 -0
- package/dist/csf/csf-utils.d.ts +2 -0
- package/dist/csf/csf-utils.js +19 -0
- package/dist/csf/index.d.ts +7 -0
- package/dist/csf/index.js +2142 -0
- package/dist/csf-tools/index.d.ts +1157 -0
- package/dist/csf-tools/index.js +736 -0
- package/dist/docs-tools/index.d.ts +197 -0
- package/dist/docs-tools/index.js +61 -0
- package/dist/highlight/index.d.ts +10 -0
- package/dist/highlight/index.js +15 -0
- package/dist/instrumenter/index.d.ts +113 -0
- package/dist/instrumenter/index.js +2595 -0
- package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
- package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
- package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
- package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
- package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
- package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
- package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
- package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
- package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
- package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
- package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
- package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
- package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
- package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
- package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
- package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
- package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
- package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
- package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
- package/dist/manager/globals-runtime.js +2 -0
- package/dist/manager/globals.d.ts +23 -0
- package/dist/manager/globals.js +26 -0
- package/dist/manager/manager-stores.d.ts +2 -0
- package/dist/manager/manager-stores.js +19 -0
- package/dist/manager/runtime.js +2 -0
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +3257 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +20 -0
- package/dist/mcp/index.d.ts +270 -0
- package/dist/mcp/index.js +305 -0
- package/dist/mocking-utils/index.d.ts +689 -0
- package/dist/mocking-utils/index.js +521 -0
- package/dist/mocking-utils/mocker-runtime.js +1254 -0
- package/dist/nextjs-vite/config/preview.js +3 -0
- package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
- package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
- package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
- package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
- package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
- package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
- package/dist/nextjs-vite/index.d.ts +92 -0
- package/dist/nextjs-vite/index.js +58 -0
- package/dist/nextjs-vite/node/index.d.ts +6 -0
- package/dist/nextjs-vite/node/index.js +20 -0
- package/dist/nextjs-vite/preset.js +648 -0
- package/dist/nextjs-vite/preview.d.ts +20 -0
- package/dist/nextjs-vite/preview.js +11 -0
- package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
- package/dist/nextjs-vite/vite-plugin/index.js +19 -0
- package/dist/nextjs-vite-plugin/index.d.ts +28 -0
- package/dist/nextjs-vite-plugin/index.js +923 -0
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
- package/dist/node-logger/index.d.ts +495 -0
- package/dist/node-logger/index.js +42 -0
- package/dist/oxc-parser/index.d.ts +99 -0
- package/dist/oxc-parser/index.js +275 -0
- package/dist/oxc-parser/worker.js +37 -0
- package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
- package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
- package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
- package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
- package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
- package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
- package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
- package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
- package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
- package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
- package/dist/preview/globals.d.ts +16 -0
- package/dist/preview/globals.js +20 -0
- package/dist/preview/runtime.js +6 -0
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +147 -0
- package/dist/preview-errors.d.ts +186 -0
- package/dist/preview-errors.js +56 -0
- package/dist/react/docgen/docgen-worker.js +38 -0
- package/dist/react/entry-preview-argtypes.js +9 -0
- package/dist/react/entry-preview-docs.js +12 -0
- package/dist/react/entry-preview-rsc.js +11 -0
- package/dist/react/entry-preview.js +21 -0
- package/dist/react/index.d.ts +119 -0
- package/dist/react/index.js +26 -0
- package/dist/react/preset.js +301 -0
- package/dist/react/preview.d.ts +2 -0
- package/dist/react/preview.js +11 -0
- package/dist/react-native/bin/get-stories.js +34 -0
- package/dist/react-native/index.d.ts +160 -0
- package/dist/react-native/index.js +1547 -0
- package/dist/react-native/metro/node.d.ts +83 -0
- package/dist/react-native/metro/node.js +21 -0
- package/dist/react-native/metro/withStorybook.d.ts +2269 -0
- package/dist/react-native/metro/withStorybook.js +138 -0
- package/dist/react-native/preview.d.ts +6 -0
- package/dist/react-native/preview.js +20 -0
- package/dist/react-native/scripts/generate.d.ts +22 -0
- package/dist/react-native/scripts/generate.js +18 -0
- package/dist/react-native/stub.js +20 -0
- package/dist/react-native-theming/index.d.ts +175 -0
- package/dist/react-native-theming/index.js +2591 -0
- package/dist/react-native-ui/index.d.ts +130 -0
- package/dist/react-native-ui/index.js +1448 -0
- package/dist/react-native-ui-common/index.d.ts +230 -0
- package/dist/react-native-ui-common/index.js +514 -0
- package/dist/react-vite/index.d.ts +4 -0
- package/dist/react-vite/index.js +8 -0
- package/dist/react-vite/node/index.d.ts +6 -0
- package/dist/react-vite/node/index.js +20 -0
- package/dist/react-vite/preset.d.ts +6 -0
- package/dist/react-vite/preset.js +21 -0
- package/dist/router/index.d.ts +141 -0
- package/dist/router/index.js +1217 -0
- package/dist/server-errors.d.ts +2 -0
- package/dist/server-errors.js +149 -0
- package/dist/shared/open-service/index.d.ts +3 -0
- package/dist/shared/open-service/index.js +115 -0
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
- package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
- package/dist/shared/open-service/toolsets/docs/public.js +991 -0
- package/dist/telemetry/index.d.ts +314 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/test/index.d.ts +158 -0
- package/dist/test/index.js +19421 -0
- package/dist/theming/create.d.ts +15 -0
- package/dist/theming/create.js +11 -0
- package/dist/theming/index.d.ts +54 -0
- package/dist/theming/index.js +511 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +48 -0
- package/dist/viewport/index.d.ts +275 -0
- package/dist/viewport/index.js +21 -0
- package/package.json +1054 -4
- package/template/nextjs-vite/cli/.eslintrc.json +6 -0
- package/template/nextjs-vite/cli/js/Button.jsx +42 -0
- package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
- package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
- package/template/nextjs-vite/cli/js/Header.jsx +58 -0
- package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
- package/template/nextjs-vite/cli/js/Page.jsx +68 -0
- package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
- package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
- package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
- package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
- package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
- package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
- package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
- package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
- package/template/react/cli/.eslintrc.json +5 -0
- package/template/react/cli/js/Button.jsx +39 -0
- package/template/react/cli/js/Button.stories.js +49 -0
- package/template/react/cli/js/Header.jsx +56 -0
- package/template/react/cli/js/Header.stories.js +29 -0
- package/template/react/cli/js/Page.jsx +69 -0
- package/template/react/cli/js/Page.stories.js +28 -0
- package/template/react/cli/ts/Button.stories.ts +54 -0
- package/template/react/cli/ts/Button.tsx +37 -0
- package/template/react/cli/ts/Header.stories.ts +34 -0
- package/template/react/cli/ts/Header.tsx +56 -0
- package/template/react/cli/ts/Page.stories.ts +33 -0
- package/template/react/cli/ts/Page.tsx +73 -0
- package/template/react-vite/cli/.eslintrc.json +5 -0
- package/template/react-vite/cli/js/Button.jsx +39 -0
- package/template/react-vite/cli/js/Button.stories.js +49 -0
- package/template/react-vite/cli/js/Header.jsx +56 -0
- package/template/react-vite/cli/js/Header.stories.js +29 -0
- package/template/react-vite/cli/js/Page.jsx +69 -0
- package/template/react-vite/cli/js/Page.stories.js +28 -0
- package/template/react-vite/cli/ts/Button.stories.ts +54 -0
- package/template/react-vite/cli/ts/Button.tsx +37 -0
- package/template/react-vite/cli/ts/Header.stories.ts +34 -0
- package/template/react-vite/cli/ts/Header.tsx +56 -0
- package/template/react-vite/cli/ts/Page.stories.ts +33 -0
- package/template/react-vite/cli/ts/Page.tsx +73 -0
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_ro17f80mg6k from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ro17f80mg6k from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ro17f80mg6k from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ro17f80mg6k.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ro17f80mg6k.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ro17f80mg6k.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
jsModuleExtensions
|
|
14
|
+
} from "./chunk-TNJIXE37.js";
|
|
15
|
+
|
|
16
|
+
// ../../node_modules/exsolve/dist/index.mjs
|
|
17
|
+
import fs, { lstatSync, realpathSync, statSync } from "node:fs";
|
|
18
|
+
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
19
|
+
import path, { isAbsolute } from "node:path";
|
|
20
|
+
import assert from "node:assert";
|
|
21
|
+
import process$1 from "node:process";
|
|
22
|
+
import { format, inspect } from "node:util";
|
|
23
|
+
var nodeBuiltins = [
|
|
24
|
+
"_http_agent",
|
|
25
|
+
"_http_client",
|
|
26
|
+
"_http_common",
|
|
27
|
+
"_http_incoming",
|
|
28
|
+
"_http_outgoing",
|
|
29
|
+
"_http_server",
|
|
30
|
+
"_stream_duplex",
|
|
31
|
+
"_stream_passthrough",
|
|
32
|
+
"_stream_readable",
|
|
33
|
+
"_stream_transform",
|
|
34
|
+
"_stream_wrap",
|
|
35
|
+
"_stream_writable",
|
|
36
|
+
"_tls_common",
|
|
37
|
+
"_tls_wrap",
|
|
38
|
+
"assert",
|
|
39
|
+
"assert/strict",
|
|
40
|
+
"async_hooks",
|
|
41
|
+
"buffer",
|
|
42
|
+
"child_process",
|
|
43
|
+
"cluster",
|
|
44
|
+
"console",
|
|
45
|
+
"constants",
|
|
46
|
+
"crypto",
|
|
47
|
+
"dgram",
|
|
48
|
+
"diagnostics_channel",
|
|
49
|
+
"dns",
|
|
50
|
+
"dns/promises",
|
|
51
|
+
"domain",
|
|
52
|
+
"events",
|
|
53
|
+
"fs",
|
|
54
|
+
"fs/promises",
|
|
55
|
+
"http",
|
|
56
|
+
"http2",
|
|
57
|
+
"https",
|
|
58
|
+
"inspector",
|
|
59
|
+
"inspector/promises",
|
|
60
|
+
"module",
|
|
61
|
+
"net",
|
|
62
|
+
"os",
|
|
63
|
+
"path",
|
|
64
|
+
"path/posix",
|
|
65
|
+
"path/win32",
|
|
66
|
+
"perf_hooks",
|
|
67
|
+
"process",
|
|
68
|
+
"punycode",
|
|
69
|
+
"querystring",
|
|
70
|
+
"readline",
|
|
71
|
+
"readline/promises",
|
|
72
|
+
"repl",
|
|
73
|
+
"stream",
|
|
74
|
+
"stream/consumers",
|
|
75
|
+
"stream/promises",
|
|
76
|
+
"stream/web",
|
|
77
|
+
"string_decoder",
|
|
78
|
+
"sys",
|
|
79
|
+
"timers",
|
|
80
|
+
"timers/promises",
|
|
81
|
+
"tls",
|
|
82
|
+
"trace_events",
|
|
83
|
+
"tty",
|
|
84
|
+
"url",
|
|
85
|
+
"util",
|
|
86
|
+
"util/types",
|
|
87
|
+
"v8",
|
|
88
|
+
"vm",
|
|
89
|
+
"wasi",
|
|
90
|
+
"worker_threads",
|
|
91
|
+
"zlib"
|
|
92
|
+
], classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
|
|
93
|
+
"string",
|
|
94
|
+
"function",
|
|
95
|
+
"number",
|
|
96
|
+
"object",
|
|
97
|
+
"Function",
|
|
98
|
+
"Object",
|
|
99
|
+
"boolean",
|
|
100
|
+
"bigint",
|
|
101
|
+
"symbol"
|
|
102
|
+
]), messages = /* @__PURE__ */ new Map();
|
|
103
|
+
function formatList(array, type = "and") {
|
|
104
|
+
switch (array.length) {
|
|
105
|
+
case 0:
|
|
106
|
+
return "";
|
|
107
|
+
case 1:
|
|
108
|
+
return `${array[0]}`;
|
|
109
|
+
case 2:
|
|
110
|
+
return `${array[0]} ${type} ${array[1]}`;
|
|
111
|
+
case 3:
|
|
112
|
+
return `${array[0]}, ${array[1]}, ${type} ${array[2]}`;
|
|
113
|
+
default:
|
|
114
|
+
return `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function getExpectedArgumentLength(message) {
|
|
118
|
+
let expectedLength = 0, regex = /%[dfijoOs]/g;
|
|
119
|
+
for (; regex.exec(message) !== null; ) expectedLength++;
|
|
120
|
+
return expectedLength;
|
|
121
|
+
}
|
|
122
|
+
function createError(sym, value, constructor) {
|
|
123
|
+
return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
|
|
124
|
+
}
|
|
125
|
+
var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError");
|
|
126
|
+
function makeNodeErrorWithCode(Base, key) {
|
|
127
|
+
let message = messages.get(key), expectedLength = typeof message == "string" ? getExpectedArgumentLength(message) : -1;
|
|
128
|
+
switch (expectedLength) {
|
|
129
|
+
case 0: {
|
|
130
|
+
class NodeError extends Base {
|
|
131
|
+
code = key;
|
|
132
|
+
constructor(...args) {
|
|
133
|
+
assert.ok(args.length === 0, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), super(message);
|
|
134
|
+
}
|
|
135
|
+
get ["constructor"]() {
|
|
136
|
+
return Base;
|
|
137
|
+
}
|
|
138
|
+
get [kIsNodeError]() {
|
|
139
|
+
return !0;
|
|
140
|
+
}
|
|
141
|
+
toString() {
|
|
142
|
+
return `${this.name} [${key}]: ${this.message}`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return NodeError;
|
|
146
|
+
}
|
|
147
|
+
case -1: {
|
|
148
|
+
class NodeError extends Base {
|
|
149
|
+
code = key;
|
|
150
|
+
constructor(...args) {
|
|
151
|
+
super(), Object.defineProperty(this, "message", {
|
|
152
|
+
value: getMessage(key, args, this),
|
|
153
|
+
enumerable: !1,
|
|
154
|
+
writable: !0,
|
|
155
|
+
configurable: !0
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
get ["constructor"]() {
|
|
159
|
+
return Base;
|
|
160
|
+
}
|
|
161
|
+
get [kIsNodeError]() {
|
|
162
|
+
return !0;
|
|
163
|
+
}
|
|
164
|
+
toString() {
|
|
165
|
+
return `${this.name} [${key}]: ${this.message}`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return NodeError;
|
|
169
|
+
}
|
|
170
|
+
default: {
|
|
171
|
+
class NodeError extends Base {
|
|
172
|
+
code = key;
|
|
173
|
+
constructor(...args) {
|
|
174
|
+
assert.ok(args.length === expectedLength, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`), args.unshift(message), super(Reflect.apply(format, null, args));
|
|
175
|
+
}
|
|
176
|
+
get ["constructor"]() {
|
|
177
|
+
return Base;
|
|
178
|
+
}
|
|
179
|
+
get [kIsNodeError]() {
|
|
180
|
+
return !0;
|
|
181
|
+
}
|
|
182
|
+
toString() {
|
|
183
|
+
return `${this.name} [${key}]: ${this.message}`;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return NodeError;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function getMessage(key, parameters, self) {
|
|
191
|
+
let message = messages.get(key);
|
|
192
|
+
if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
|
|
193
|
+
return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
|
|
194
|
+
let expectedLength = getExpectedArgumentLength(message);
|
|
195
|
+
return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
|
|
196
|
+
}
|
|
197
|
+
function determineSpecificType(value) {
|
|
198
|
+
if (value === null) return "null";
|
|
199
|
+
if (value === void 0) return "undefined";
|
|
200
|
+
let type = typeof value;
|
|
201
|
+
switch (type) {
|
|
202
|
+
case "bigint":
|
|
203
|
+
return `type bigint (${value}n)`;
|
|
204
|
+
case "number":
|
|
205
|
+
return value === 0 ? 1 / value === Number.NEGATIVE_INFINITY ? "type number (-0)" : "type number (0)" : Number.isNaN(value) ? "type number (NaN)" : value === Number.POSITIVE_INFINITY ? "type number (Infinity)" : value === Number.NEGATIVE_INFINITY ? "type number (-Infinity)" : `type number (${value})`;
|
|
206
|
+
case "boolean":
|
|
207
|
+
return value ? "type boolean (true)" : "type boolean (false)";
|
|
208
|
+
case "symbol":
|
|
209
|
+
return `type symbol (${String(value)})`;
|
|
210
|
+
case "function":
|
|
211
|
+
return `function ${value.name}`;
|
|
212
|
+
case "object":
|
|
213
|
+
return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
|
|
214
|
+
case "string": {
|
|
215
|
+
let string = value;
|
|
216
|
+
return string.length > 28 && (string = `${string.slice(0, 25)}...`), string.includes("'") ? `type string (${JSON.stringify(string)})` : `type string ('${string}')`;
|
|
217
|
+
}
|
|
218
|
+
default: {
|
|
219
|
+
let inspected = inspect(value, { colors: !1 });
|
|
220
|
+
return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${type} (${inspected})`;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
225
|
+
assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
|
|
226
|
+
let message = "The ";
|
|
227
|
+
if (name.endsWith(" argument")) message += `${name} `;
|
|
228
|
+
else {
|
|
229
|
+
let type = name.includes(".") ? "property" : "argument";
|
|
230
|
+
message += `"${name}" ${type} `;
|
|
231
|
+
}
|
|
232
|
+
message += "must be ";
|
|
233
|
+
let types = [], instances = [], other = [];
|
|
234
|
+
for (let value of expected)
|
|
235
|
+
assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
|
|
236
|
+
if (instances.length > 0) {
|
|
237
|
+
let pos = types.indexOf("object");
|
|
238
|
+
pos !== -1 && (types.splice(pos, 1), instances.push("Object"));
|
|
239
|
+
}
|
|
240
|
+
return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
|
|
241
|
+
}, TypeError);
|
|
242
|
+
var ERR_INVALID_MODULE_SPECIFIER = createError("ERR_INVALID_MODULE_SPECIFIER", (request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`, TypeError), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path2, base, message) => `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
|
|
243
|
+
let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
244
|
+
return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
245
|
+
}, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", function(path2, base, exactUrl = !1) {
|
|
246
|
+
return exactUrl && typeof exactUrl == "string" && (this.url = `${exactUrl}`), `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
|
|
247
|
+
}, Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError("ERR_PACKAGE_PATH_NOT_EXPORTED", (packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`, Error), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", function(path2, base, exactUrl = void 0) {
|
|
248
|
+
return this.url = exactUrl, `Directory import '${path2}' is not supported resolving ES modules imported from ${base}`;
|
|
249
|
+
}, Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path2) => `Unknown file extension "${extension}" for ${path2}`, TypeError);
|
|
250
|
+
createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
251
|
+
let inspected = inspect(value);
|
|
252
|
+
return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
253
|
+
}, TypeError);
|
|
254
|
+
var hasOwnProperty$1 = {}.hasOwnProperty, cache = /* @__PURE__ */ new Map();
|
|
255
|
+
function read(jsonPath, { base, specifier }) {
|
|
256
|
+
let existing = cache.get(jsonPath);
|
|
257
|
+
if (existing) return existing;
|
|
258
|
+
let string;
|
|
259
|
+
try {
|
|
260
|
+
string = fs.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
|
261
|
+
} catch (error) {
|
|
262
|
+
let exception = error;
|
|
263
|
+
if (exception.code !== "ENOENT") throw exception;
|
|
264
|
+
}
|
|
265
|
+
let result = {
|
|
266
|
+
exists: !1,
|
|
267
|
+
pjsonPath: jsonPath,
|
|
268
|
+
main: void 0,
|
|
269
|
+
name: void 0,
|
|
270
|
+
type: "none",
|
|
271
|
+
exports: void 0,
|
|
272
|
+
imports: void 0
|
|
273
|
+
};
|
|
274
|
+
if (string !== void 0) {
|
|
275
|
+
let parsed;
|
|
276
|
+
try {
|
|
277
|
+
parsed = JSON.parse(string);
|
|
278
|
+
} catch (error_) {
|
|
279
|
+
let error = new ERR_INVALID_PACKAGE_CONFIG(jsonPath, (base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier), error_.message);
|
|
280
|
+
throw error.cause = error_, error;
|
|
281
|
+
}
|
|
282
|
+
result.exists = !0, hasOwnProperty$1.call(parsed, "name") && typeof parsed.name == "string" && (result.name = parsed.name), hasOwnProperty$1.call(parsed, "main") && typeof parsed.main == "string" && (result.main = parsed.main), hasOwnProperty$1.call(parsed, "exports") && (result.exports = parsed.exports), hasOwnProperty$1.call(parsed, "imports") && (result.imports = parsed.imports), hasOwnProperty$1.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module") && (result.type = parsed.type);
|
|
283
|
+
}
|
|
284
|
+
return cache.set(jsonPath, result), result;
|
|
285
|
+
}
|
|
286
|
+
function getPackageScopeConfig(resolved) {
|
|
287
|
+
let packageJSONUrl = new URL("package.json", resolved);
|
|
288
|
+
for (; !packageJSONUrl.pathname.endsWith("node_modules/package.json"); ) {
|
|
289
|
+
let packageConfig = read(fileURLToPath(packageJSONUrl), { specifier: resolved });
|
|
290
|
+
if (packageConfig.exists) return packageConfig;
|
|
291
|
+
let lastPackageJSONUrl = packageJSONUrl;
|
|
292
|
+
if (packageJSONUrl = new URL("../package.json", packageJSONUrl), packageJSONUrl.pathname === lastPackageJSONUrl.pathname) break;
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
pjsonPath: fileURLToPath(packageJSONUrl),
|
|
296
|
+
exists: !1,
|
|
297
|
+
type: "none"
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
var hasOwnProperty = {}.hasOwnProperty, extensionFormatMap = {
|
|
301
|
+
__proto__: null,
|
|
302
|
+
".json": "json",
|
|
303
|
+
".cjs": "commonjs",
|
|
304
|
+
".cts": "commonjs",
|
|
305
|
+
".js": "module",
|
|
306
|
+
".ts": "module",
|
|
307
|
+
".mts": "module",
|
|
308
|
+
".mjs": "module"
|
|
309
|
+
}, protocolHandlers = {
|
|
310
|
+
__proto__: null,
|
|
311
|
+
"data:": getDataProtocolModuleFormat,
|
|
312
|
+
"file:": getFileProtocolModuleFormat,
|
|
313
|
+
"node:": () => "builtin"
|
|
314
|
+
};
|
|
315
|
+
function mimeToFormat(mime) {
|
|
316
|
+
return mime && /^\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?$/i.test(mime) ? "module" : mime === "application/json" ? "json" : null;
|
|
317
|
+
}
|
|
318
|
+
function getDataProtocolModuleFormat(parsed) {
|
|
319
|
+
let { 1: mime } = /^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/.exec(parsed.pathname) || [
|
|
320
|
+
null,
|
|
321
|
+
null,
|
|
322
|
+
null
|
|
323
|
+
];
|
|
324
|
+
return mimeToFormat(mime);
|
|
325
|
+
}
|
|
326
|
+
var DOT_CODE = 46, SLASH_CODE = 47;
|
|
327
|
+
function extname(url) {
|
|
328
|
+
let pathname = url.pathname;
|
|
329
|
+
for (let i = pathname.length - 1; i > 0; i--) switch (pathname.charCodeAt(i)) {
|
|
330
|
+
case SLASH_CODE:
|
|
331
|
+
return "";
|
|
332
|
+
case DOT_CODE:
|
|
333
|
+
return pathname.charCodeAt(i - 1) === SLASH_CODE ? "" : pathname.slice(i);
|
|
334
|
+
}
|
|
335
|
+
return "";
|
|
336
|
+
}
|
|
337
|
+
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
338
|
+
let ext = extname(url);
|
|
339
|
+
if (ext === ".js") {
|
|
340
|
+
let { type: packageType } = getPackageScopeConfig(url);
|
|
341
|
+
return packageType !== "none" ? packageType : "commonjs";
|
|
342
|
+
}
|
|
343
|
+
if (ext === "") {
|
|
344
|
+
let { type: packageType } = getPackageScopeConfig(url);
|
|
345
|
+
return packageType === "module" ? "module" : packageType !== "none" ? packageType : "commonjs";
|
|
346
|
+
}
|
|
347
|
+
let format2 = extensionFormatMap[ext];
|
|
348
|
+
if (format2) return format2;
|
|
349
|
+
if (!ignoreErrors)
|
|
350
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url));
|
|
351
|
+
}
|
|
352
|
+
function defaultGetFormatWithoutErrors(url, context) {
|
|
353
|
+
let protocol = url.protocol;
|
|
354
|
+
return hasOwnProperty.call(protocolHandlers, protocol) && protocolHandlers[protocol](url, context, !0) || null;
|
|
355
|
+
}
|
|
356
|
+
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty, invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i, deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i, invalidPackageNameRegEx = /^\.|%|\\/, patternRegEx = /\*/g, encodedSeparatorRegEx = /%2f|%5c/i, emittedPackageWarnings = /* @__PURE__ */ new Set(), doubleSlashRegEx = /[/\\]{2}/;
|
|
357
|
+
function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
|
|
358
|
+
if (process$1.noDeprecation) return;
|
|
359
|
+
let pjsonPath = fileURLToPath(packageJsonUrl), double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
|
|
360
|
+
process$1.emitWarning(`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
361
|
+
}
|
|
362
|
+
function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
363
|
+
if (process$1.noDeprecation || defaultGetFormatWithoutErrors(url, { parentURL: base.href }) !== "module") return;
|
|
364
|
+
let urlPath = fileURLToPath(url.href), packagePath = fileURLToPath(new URL$1(".", packageJsonUrl)), basePath = fileURLToPath(base);
|
|
365
|
+
main ? path.resolve(packagePath, main) !== urlPath && process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
|
|
366
|
+
Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151") : process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
|
|
367
|
+
Default "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
368
|
+
}
|
|
369
|
+
function tryStatSync(path2) {
|
|
370
|
+
try {
|
|
371
|
+
return statSync(path2);
|
|
372
|
+
} catch {
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function fileExists(url) {
|
|
376
|
+
let stats = statSync(url, { throwIfNoEntry: !1 }), isFile = stats ? stats.isFile() : void 0;
|
|
377
|
+
return isFile ?? !1;
|
|
378
|
+
}
|
|
379
|
+
function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
380
|
+
let guess;
|
|
381
|
+
if (packageConfig.main !== void 0) {
|
|
382
|
+
if (guess = new URL$1(packageConfig.main, packageJsonUrl), fileExists(guess)) return guess;
|
|
383
|
+
let tries2 = [
|
|
384
|
+
`./${packageConfig.main}.js`,
|
|
385
|
+
`./${packageConfig.main}.json`,
|
|
386
|
+
`./${packageConfig.main}.node`,
|
|
387
|
+
`./${packageConfig.main}/index.js`,
|
|
388
|
+
`./${packageConfig.main}/index.json`,
|
|
389
|
+
`./${packageConfig.main}/index.node`
|
|
390
|
+
], i2 = -1;
|
|
391
|
+
for (; ++i2 < tries2.length && (guess = new URL$1(tries2[i2], packageJsonUrl), !fileExists(guess)); )
|
|
392
|
+
guess = void 0;
|
|
393
|
+
if (guess)
|
|
394
|
+
return emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main), guess;
|
|
395
|
+
}
|
|
396
|
+
let tries = [
|
|
397
|
+
"./index.js",
|
|
398
|
+
"./index.json",
|
|
399
|
+
"./index.node"
|
|
400
|
+
], i = -1;
|
|
401
|
+
for (; ++i < tries.length && (guess = new URL$1(tries[i], packageJsonUrl), !fileExists(guess)); )
|
|
402
|
+
guess = void 0;
|
|
403
|
+
if (guess)
|
|
404
|
+
return emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main), guess;
|
|
405
|
+
throw new ERR_MODULE_NOT_FOUND(fileURLToPath(new URL$1(".", packageJsonUrl)), fileURLToPath(base));
|
|
406
|
+
}
|
|
407
|
+
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
408
|
+
if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, String.raw`must not include encoded "/" or "\" characters`, fileURLToPath(base));
|
|
409
|
+
let filePath;
|
|
410
|
+
try {
|
|
411
|
+
filePath = fileURLToPath(resolved);
|
|
412
|
+
} catch (error) {
|
|
413
|
+
throw Object.defineProperty(error, "input", { value: String(resolved) }), Object.defineProperty(error, "module", { value: String(base) }), error;
|
|
414
|
+
}
|
|
415
|
+
let stats = tryStatSync(filePath.endsWith("/") ? filePath.slice(-1) : filePath);
|
|
416
|
+
if (stats && stats.isDirectory()) {
|
|
417
|
+
let error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath(base));
|
|
418
|
+
throw error.url = String(resolved), error;
|
|
419
|
+
}
|
|
420
|
+
if (!stats || !stats.isFile()) {
|
|
421
|
+
let error = new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && fileURLToPath(base), !0);
|
|
422
|
+
throw error.url = String(resolved), error;
|
|
423
|
+
}
|
|
424
|
+
if (!preserveSymlinks) {
|
|
425
|
+
let real = realpathSync(filePath), { search, hash } = resolved;
|
|
426
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : "")), resolved.search = search, resolved.hash = hash;
|
|
427
|
+
}
|
|
428
|
+
return resolved;
|
|
429
|
+
}
|
|
430
|
+
function importNotDefined(specifier, packageJsonUrl, base) {
|
|
431
|
+
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(specifier, packageJsonUrl && fileURLToPath(new URL$1(".", packageJsonUrl)), fileURLToPath(base));
|
|
432
|
+
}
|
|
433
|
+
function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
434
|
+
return new ERR_PACKAGE_PATH_NOT_EXPORTED(fileURLToPath(new URL$1(".", packageJsonUrl)), subpath, base && fileURLToPath(base));
|
|
435
|
+
}
|
|
436
|
+
function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
|
|
437
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(request, `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath(packageJsonUrl)}`, base && fileURLToPath(base));
|
|
438
|
+
}
|
|
439
|
+
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
440
|
+
return target = typeof target == "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`, new ERR_INVALID_PACKAGE_TARGET(fileURLToPath(new URL$1(".", packageJsonUrl)), subpath, target, internal, base && fileURLToPath(base));
|
|
441
|
+
}
|
|
442
|
+
function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
|
|
443
|
+
if (subpath !== "" && !pattern && target.at(-1) !== "/") throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
444
|
+
if (!target.startsWith("./")) {
|
|
445
|
+
if (internal && !target.startsWith("../") && !target.startsWith("/")) {
|
|
446
|
+
let isURL = !1;
|
|
447
|
+
try {
|
|
448
|
+
new URL$1(target), isURL = !0;
|
|
449
|
+
} catch {
|
|
450
|
+
}
|
|
451
|
+
if (!isURL) return packageResolve(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath, packageJsonUrl, conditions);
|
|
452
|
+
}
|
|
453
|
+
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
454
|
+
}
|
|
455
|
+
if (invalidSegmentRegEx.exec(target.slice(2)) !== null) if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
|
|
456
|
+
if (!isPathMap) {
|
|
457
|
+
let request = pattern ? match.replace("*", () => subpath) : match + subpath;
|
|
458
|
+
emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, !0);
|
|
459
|
+
}
|
|
460
|
+
} else throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
461
|
+
let resolved = new URL$1(target, packageJsonUrl), resolvedPath = resolved.pathname, packagePath = new URL$1(".", packageJsonUrl).pathname;
|
|
462
|
+
if (!resolvedPath.startsWith(packagePath)) throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
463
|
+
if (subpath === "") return resolved;
|
|
464
|
+
if (invalidSegmentRegEx.exec(subpath) !== null) {
|
|
465
|
+
let request = pattern ? match.replace("*", () => subpath) : match + subpath;
|
|
466
|
+
deprecatedInvalidSegmentRegEx.exec(subpath) === null ? isPathMap || emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, !1) : throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
|
|
467
|
+
}
|
|
468
|
+
return pattern ? new URL$1(RegExpPrototypeSymbolReplace.call(patternRegEx, resolved.href, () => subpath)) : new URL$1(subpath, resolved);
|
|
469
|
+
}
|
|
470
|
+
function isArrayIndex(key) {
|
|
471
|
+
let keyNumber = Number(key);
|
|
472
|
+
return `${keyNumber}` !== key ? !1 : keyNumber >= 0 && keyNumber < 4294967295;
|
|
473
|
+
}
|
|
474
|
+
function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) {
|
|
475
|
+
if (typeof target == "string") return resolvePackageTargetString(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap, conditions);
|
|
476
|
+
if (Array.isArray(target)) {
|
|
477
|
+
let targetList = target;
|
|
478
|
+
if (targetList.length === 0) return null;
|
|
479
|
+
let lastException, i = -1;
|
|
480
|
+
for (; ++i < targetList.length; ) {
|
|
481
|
+
let targetItem = targetList[i], resolveResult;
|
|
482
|
+
try {
|
|
483
|
+
resolveResult = resolvePackageTarget(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
|
|
484
|
+
} catch (error) {
|
|
485
|
+
let exception = error;
|
|
486
|
+
if (lastException = exception, exception.code === "ERR_INVALID_PACKAGE_TARGET") continue;
|
|
487
|
+
throw error;
|
|
488
|
+
}
|
|
489
|
+
if (resolveResult !== void 0) {
|
|
490
|
+
if (resolveResult === null) {
|
|
491
|
+
lastException = null;
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
return resolveResult;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (lastException == null) return lastException;
|
|
498
|
+
throw lastException;
|
|
499
|
+
}
|
|
500
|
+
if (typeof target == "object" && target !== null) {
|
|
501
|
+
let keys = Object.getOwnPropertyNames(target), i = -1;
|
|
502
|
+
for (; ++i < keys.length; ) {
|
|
503
|
+
let key = keys[i];
|
|
504
|
+
if (isArrayIndex(key)) throw new ERR_INVALID_PACKAGE_CONFIG(fileURLToPath(packageJsonUrl), fileURLToPath(base), '"exports" cannot contain numeric property keys.');
|
|
505
|
+
}
|
|
506
|
+
for (i = -1; ++i < keys.length; ) {
|
|
507
|
+
let key = keys[i];
|
|
508
|
+
if (key === "default" || conditions && conditions.has(key)) {
|
|
509
|
+
let conditionalTarget = target[key], resolveResult = resolvePackageTarget(packageJsonUrl, conditionalTarget, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
|
|
510
|
+
if (resolveResult === void 0) continue;
|
|
511
|
+
return resolveResult;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (target === null) return null;
|
|
517
|
+
throw invalidPackageTarget(packageSubpath, target, packageJsonUrl, internal, base);
|
|
518
|
+
}
|
|
519
|
+
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
520
|
+
if (typeof exports == "string" || Array.isArray(exports)) return !0;
|
|
521
|
+
if (typeof exports != "object" || exports === null) return !1;
|
|
522
|
+
let keys = Object.getOwnPropertyNames(exports), isConditionalSugar = !1, i = 0, keyIndex = -1;
|
|
523
|
+
for (; ++keyIndex < keys.length; ) {
|
|
524
|
+
let key = keys[keyIndex], currentIsConditionalSugar = key === "" || key[0] !== ".";
|
|
525
|
+
if (i++ === 0) isConditionalSugar = currentIsConditionalSugar;
|
|
526
|
+
else if (isConditionalSugar !== currentIsConditionalSugar) throw new ERR_INVALID_PACKAGE_CONFIG(fileURLToPath(packageJsonUrl), fileURLToPath(base), `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`);
|
|
527
|
+
}
|
|
528
|
+
return isConditionalSugar;
|
|
529
|
+
}
|
|
530
|
+
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
531
|
+
if (process$1.noDeprecation) return;
|
|
532
|
+
let pjsonPath = fileURLToPath(pjsonUrl);
|
|
533
|
+
emittedPackageWarnings.has(pjsonPath + "|" + match) || (emittedPackageWarnings.add(pjsonPath + "|" + match), process$1.emitWarning(`Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155"));
|
|
534
|
+
}
|
|
535
|
+
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
|
|
536
|
+
let exports = packageConfig.exports;
|
|
537
|
+
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base) && (exports = { ".": exports }), own.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
538
|
+
let target = exports[packageSubpath], resolveResult = resolvePackageTarget(packageJsonUrl, target, "", packageSubpath, base, !1, !1, !1, conditions);
|
|
539
|
+
if (resolveResult == null) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
540
|
+
return resolveResult;
|
|
541
|
+
}
|
|
542
|
+
let bestMatch = "", bestMatchSubpath = "", keys = Object.getOwnPropertyNames(exports), i = -1;
|
|
543
|
+
for (; ++i < keys.length; ) {
|
|
544
|
+
let key = keys[i], patternIndex = key.indexOf("*");
|
|
545
|
+
if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) {
|
|
546
|
+
packageSubpath.endsWith("/") && emitTrailingSlashPatternDeprecation(packageSubpath, packageJsonUrl, base);
|
|
547
|
+
let patternTrailer = key.slice(patternIndex + 1);
|
|
548
|
+
packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex && (bestMatch = key, bestMatchSubpath = packageSubpath.slice(patternIndex, packageSubpath.length - patternTrailer.length));
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
if (bestMatch) {
|
|
552
|
+
let target = exports[bestMatch], resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, !0, !1, packageSubpath.endsWith("/"), conditions);
|
|
553
|
+
if (resolveResult == null) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
554
|
+
return resolveResult;
|
|
555
|
+
}
|
|
556
|
+
throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
557
|
+
}
|
|
558
|
+
function patternKeyCompare(a, b) {
|
|
559
|
+
let aPatternIndex = a.indexOf("*"), bPatternIndex = b.indexOf("*"), baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1, baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
560
|
+
return baseLengthA > baseLengthB ? -1 : baseLengthB > baseLengthA || aPatternIndex === -1 ? 1 : bPatternIndex === -1 || a.length > b.length ? -1 : b.length > a.length ? 1 : 0;
|
|
561
|
+
}
|
|
562
|
+
function packageImportsResolve(name, base, conditions) {
|
|
563
|
+
if (name === "#" || name.endsWith("/")) throw new ERR_INVALID_MODULE_SPECIFIER(name, "is not a valid internal imports specifier name", fileURLToPath(base));
|
|
564
|
+
let packageJsonUrl, packageConfig = getPackageScopeConfig(base);
|
|
565
|
+
if (packageConfig.exists) {
|
|
566
|
+
packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);
|
|
567
|
+
let imports = packageConfig.imports;
|
|
568
|
+
if (imports) if (own.call(imports, name) && !name.includes("*")) {
|
|
569
|
+
let resolveResult = resolvePackageTarget(packageJsonUrl, imports[name], "", name, base, !1, !0, !1, conditions);
|
|
570
|
+
if (resolveResult != null) return resolveResult;
|
|
571
|
+
} else {
|
|
572
|
+
let bestMatch = "", bestMatchSubpath = "", keys = Object.getOwnPropertyNames(imports), i = -1;
|
|
573
|
+
for (; ++i < keys.length; ) {
|
|
574
|
+
let key = keys[i], patternIndex = key.indexOf("*");
|
|
575
|
+
if (patternIndex !== -1 && name.startsWith(key.slice(0, patternIndex))) {
|
|
576
|
+
let patternTrailer = key.slice(patternIndex + 1);
|
|
577
|
+
name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex && (bestMatch = key, bestMatchSubpath = name.slice(patternIndex, name.length - patternTrailer.length));
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
if (bestMatch) {
|
|
581
|
+
let target = imports[bestMatch], resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, !0, !0, !1, conditions);
|
|
582
|
+
if (resolveResult != null) return resolveResult;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
throw importNotDefined(name, packageJsonUrl, base);
|
|
587
|
+
}
|
|
588
|
+
function parsePackageName(specifier, base) {
|
|
589
|
+
let separatorIndex = specifier.indexOf("/"), validPackageName = !0, isScoped = !1;
|
|
590
|
+
specifier[0] === "@" && (isScoped = !0, separatorIndex === -1 || specifier.length === 0 ? validPackageName = !1 : separatorIndex = specifier.indexOf("/", separatorIndex + 1));
|
|
591
|
+
let packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
|
|
592
|
+
if (invalidPackageNameRegEx.exec(packageName) !== null && (validPackageName = !1), !validPackageName) throw new ERR_INVALID_MODULE_SPECIFIER(specifier, "is not a valid package name", fileURLToPath(base));
|
|
593
|
+
return {
|
|
594
|
+
packageName,
|
|
595
|
+
packageSubpath: "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)),
|
|
596
|
+
isScoped
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function packageResolve(specifier, base, conditions) {
|
|
600
|
+
if (nodeBuiltins.includes(specifier)) return new URL$1("node:" + specifier);
|
|
601
|
+
let { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base), packageConfig = getPackageScopeConfig(base);
|
|
602
|
+
if (packageConfig.exists && packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(pathToFileURL(packageConfig.pjsonPath), packageSubpath, packageConfig, base, conditions);
|
|
603
|
+
let packageJsonUrl = new URL$1("./node_modules/" + packageName + "/package.json", base), packageJsonPath = fileURLToPath(packageJsonUrl), lastPath;
|
|
604
|
+
do {
|
|
605
|
+
let stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
606
|
+
if (!stat || !stat.isDirectory()) {
|
|
607
|
+
lastPath = packageJsonPath, packageJsonUrl = new URL$1((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl), packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
let packageConfig2 = read(packageJsonPath, {
|
|
611
|
+
base,
|
|
612
|
+
specifier
|
|
613
|
+
});
|
|
614
|
+
return packageConfig2.exports !== void 0 && packageConfig2.exports !== null ? packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig2, base, conditions) : packageSubpath === "." ? legacyMainResolve(packageJsonUrl, packageConfig2, base) : new URL$1(packageSubpath, packageJsonUrl);
|
|
615
|
+
} while (packageJsonPath.length !== lastPath.length);
|
|
616
|
+
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), !1);
|
|
617
|
+
}
|
|
618
|
+
function isRelativeSpecifier(specifier) {
|
|
619
|
+
return specifier[0] === "." && (specifier.length === 1 || specifier[1] === "/" || specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/"));
|
|
620
|
+
}
|
|
621
|
+
function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
622
|
+
return specifier === "" ? !1 : specifier[0] === "/" ? !0 : isRelativeSpecifier(specifier);
|
|
623
|
+
}
|
|
624
|
+
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
625
|
+
let protocol = base.protocol, isData = protocol === "data:", resolved;
|
|
626
|
+
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) try {
|
|
627
|
+
resolved = new URL$1(specifier, base);
|
|
628
|
+
} catch (error_) {
|
|
629
|
+
let error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
630
|
+
throw error.cause = error_, error;
|
|
631
|
+
}
|
|
632
|
+
else if (protocol === "file:" && specifier[0] === "#") resolved = packageImportsResolve(specifier, base, conditions);
|
|
633
|
+
else try {
|
|
634
|
+
resolved = new URL$1(specifier);
|
|
635
|
+
} catch (error_) {
|
|
636
|
+
if (isData && !nodeBuiltins.includes(specifier)) {
|
|
637
|
+
let error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
638
|
+
throw error.cause = error_, error;
|
|
639
|
+
}
|
|
640
|
+
resolved = packageResolve(specifier, base, conditions);
|
|
641
|
+
}
|
|
642
|
+
return assert.ok(resolved !== void 0, "expected to be defined"), resolved.protocol !== "file:" ? resolved : finalizeResolution(resolved, base, preserveSymlinks);
|
|
643
|
+
}
|
|
644
|
+
var DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]), DEFAULT_CONDITIONS_KEY = "2:6:import4:node", isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
645
|
+
function resolveModuleURL(input, options) {
|
|
646
|
+
let parsedInput = _parseInput(input);
|
|
647
|
+
if ("external" in parsedInput) return parsedInput.external;
|
|
648
|
+
let specifier = parsedInput.specifier, url = parsedInput.url, absolutePath = parsedInput.absolutePath, cacheKey, cacheObj;
|
|
649
|
+
if (options?.cache !== !1 && (cacheKey = _cacheKey(absolutePath || specifier, options), cacheObj = options?.cache && typeof options?.cache == "object" ? options.cache : globalCache), cacheObj) {
|
|
650
|
+
let cached = cacheObj.get(cacheKey);
|
|
651
|
+
if (typeof cached == "string") return cached;
|
|
652
|
+
if (cached instanceof Error) {
|
|
653
|
+
if (options?.try) return;
|
|
654
|
+
throw cached;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
if (absolutePath) try {
|
|
658
|
+
let stat = lstatSync(absolutePath);
|
|
659
|
+
if (stat.isSymbolicLink() && (absolutePath = realpathSync(absolutePath), url = pathToFileURL(absolutePath)), stat.isFile())
|
|
660
|
+
return cacheObj && cacheObj.set(cacheKey, url.href), url.href;
|
|
661
|
+
} catch (error) {
|
|
662
|
+
if (error?.code !== "ENOENT")
|
|
663
|
+
throw cacheObj && _cacheError(cacheObj, cacheKey, error), error;
|
|
664
|
+
}
|
|
665
|
+
let conditionsSet = options?.conditions ? new Set(options.conditions) : DEFAULT_CONDITIONS_SET, target = specifier || url.href, bases = _normalizeBases(options?.from), suffixes = options?.suffixes || [""], extensions = options?.extensions ? ["", ...options.extensions] : [""], resolved;
|
|
666
|
+
for (let base of bases) {
|
|
667
|
+
for (let suffix of suffixes) {
|
|
668
|
+
let name = _join(target, suffix);
|
|
669
|
+
name === "." && (name += "/.");
|
|
670
|
+
for (let extension of extensions)
|
|
671
|
+
if (resolved = _tryModuleResolve(name + extension, base, conditionsSet), resolved) break;
|
|
672
|
+
if (resolved) break;
|
|
673
|
+
}
|
|
674
|
+
if (resolved) break;
|
|
675
|
+
}
|
|
676
|
+
if (!resolved) {
|
|
677
|
+
let error = new Error(`Cannot resolve module "${input}" (from: ${bases.map((u) => _fmtPath(u)).join(", ")})`);
|
|
678
|
+
if (error.code = "ERR_MODULE_NOT_FOUND", cacheObj && _cacheError(cacheObj, cacheKey, error), options?.try) return;
|
|
679
|
+
throw error;
|
|
680
|
+
}
|
|
681
|
+
return cacheObj && cacheObj.set(cacheKey, resolved.href), resolved.href;
|
|
682
|
+
}
|
|
683
|
+
function resolveModulePath(id, options) {
|
|
684
|
+
let resolved = resolveModuleURL(id, options);
|
|
685
|
+
if (!resolved || !resolved.startsWith("file://") && options?.try) return;
|
|
686
|
+
let absolutePath = fileURLToPath(resolved);
|
|
687
|
+
return isWindows ? _normalizeWinPath(absolutePath) : absolutePath;
|
|
688
|
+
}
|
|
689
|
+
function _tryModuleResolve(specifier, base, conditions) {
|
|
690
|
+
try {
|
|
691
|
+
return moduleResolve(specifier, base, conditions);
|
|
692
|
+
} catch {
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
function _normalizeBases(inputs) {
|
|
696
|
+
let urls = (Array.isArray(inputs) ? inputs : [inputs]).flatMap((input) => _normalizeBase(input));
|
|
697
|
+
return urls.length === 0 ? [pathToFileURL("./")] : urls;
|
|
698
|
+
}
|
|
699
|
+
function _normalizeBase(input) {
|
|
700
|
+
if (!input) return [];
|
|
701
|
+
if (_isURL(input)) return [input];
|
|
702
|
+
if (typeof input != "string") return [];
|
|
703
|
+
if (/^(?:node|data|http|https|file):/.test(input)) return new URL(input);
|
|
704
|
+
try {
|
|
705
|
+
return input.endsWith("/") || statSync(input).isDirectory() ? pathToFileURL(input + "/") : pathToFileURL(input);
|
|
706
|
+
} catch {
|
|
707
|
+
return [pathToFileURL(input + "/"), pathToFileURL(input)];
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
function _fmtPath(input) {
|
|
711
|
+
try {
|
|
712
|
+
return fileURLToPath(input);
|
|
713
|
+
} catch {
|
|
714
|
+
return input;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
function _cacheError(cache2, key, error) {
|
|
718
|
+
error.stack, cache2.set(key, error);
|
|
719
|
+
}
|
|
720
|
+
function _cacheKey(id, options) {
|
|
721
|
+
let from;
|
|
722
|
+
return Array.isArray(options?.from) ? from = options.from : options?.from && (from = [options.from]), _cacheKeyValues([id]) + _conditionsKey(options?.conditions) + _cacheKeyValues(options?.extensions) + _cacheKeyValues(from) + _cacheKeyValues(options?.suffixes);
|
|
723
|
+
}
|
|
724
|
+
function _conditionsKey(conditions) {
|
|
725
|
+
return conditions ? _cacheKeyValues([...new Set(conditions)].sort()) : DEFAULT_CONDITIONS_KEY;
|
|
726
|
+
}
|
|
727
|
+
function _cacheKeyValues(values) {
|
|
728
|
+
if (!values) return "-";
|
|
729
|
+
let key = `${values.length}:`;
|
|
730
|
+
for (let value of values) {
|
|
731
|
+
let stringValue = String(value);
|
|
732
|
+
key += `${stringValue.length}:${stringValue}`;
|
|
733
|
+
}
|
|
734
|
+
return key;
|
|
735
|
+
}
|
|
736
|
+
function _join(a, b) {
|
|
737
|
+
return !a || !b || b === "/" ? a : (a.endsWith("/") ? a : a + "/") + (b.startsWith("/") ? b.slice(1) : b);
|
|
738
|
+
}
|
|
739
|
+
function _normalizeWinPath(path2) {
|
|
740
|
+
return path2.replace(/\\/g, "/").replace(/^[a-z]:\//, (r) => r.toUpperCase());
|
|
741
|
+
}
|
|
742
|
+
function _isURL(input) {
|
|
743
|
+
return input instanceof URL || input?.constructor?.name === "URL";
|
|
744
|
+
}
|
|
745
|
+
function _parseInput(input) {
|
|
746
|
+
if (typeof input == "string") {
|
|
747
|
+
if (input.startsWith("file:")) {
|
|
748
|
+
let url = new URL(input);
|
|
749
|
+
return {
|
|
750
|
+
url,
|
|
751
|
+
absolutePath: fileURLToPath(url)
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
return isAbsolute(input) ? {
|
|
755
|
+
url: pathToFileURL(input),
|
|
756
|
+
absolutePath: input
|
|
757
|
+
} : /^(?:node|data|http|https):/.test(input) ? { external: input } : nodeBuiltins.includes(input) && !input.includes(":") ? { external: `node:${input}` } : { specifier: input };
|
|
758
|
+
}
|
|
759
|
+
if (_isURL(input))
|
|
760
|
+
return input.protocol === "file:" ? {
|
|
761
|
+
url: input,
|
|
762
|
+
absolutePath: fileURLToPath(input)
|
|
763
|
+
} : { external: input.href };
|
|
764
|
+
throw new TypeError("id must be a `string` or `URL`");
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// src/shared/utils/module.ts
|
|
768
|
+
import { statSync as statSync2 } from "node:fs";
|
|
769
|
+
import nodeModule, { createRequire } from "node:module";
|
|
770
|
+
import { win32 } from "node:path/win32";
|
|
771
|
+
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
772
|
+
import semver from "semver";
|
|
773
|
+
import { dirname, join } from "pathe";
|
|
774
|
+
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
775
|
+
"importMetaResolve from within Forkbook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
776
|
+
), pathToFileURL2(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
|
|
777
|
+
try {
|
|
778
|
+
return dirname(fileURLToPath2(importMetaResolve(join(pkg, "package.json"), parent)));
|
|
779
|
+
} catch {
|
|
780
|
+
try {
|
|
781
|
+
return dirname(fileURLToPath2(importMetaResolve(join(pkg, "package.json"))));
|
|
782
|
+
} catch {
|
|
783
|
+
let req = createRequire(parent ?? import.meta.url);
|
|
784
|
+
return dirname(req.resolve(join(pkg, "package.json")));
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}, typescriptLoaderRegistration = null;
|
|
788
|
+
function registerTypescriptLoader() {
|
|
789
|
+
return typescriptLoaderRegistration || (typescriptLoaderRegistration = (async () => {
|
|
790
|
+
if (semver.gte(process.versions.node, "26.0.0"))
|
|
791
|
+
try {
|
|
792
|
+
let { load } = await import("@aussieljk/forkbook/internal/bin/loader");
|
|
793
|
+
nodeModule.registerHooks({ load });
|
|
794
|
+
} catch {
|
|
795
|
+
let typescriptLoaderUrl = importMetaResolve("@aussieljk/forkbook/internal/bin/loader");
|
|
796
|
+
nodeModule.register(typescriptLoaderUrl, import.meta.url);
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
let typescriptLoaderUrl = importMetaResolve("@aussieljk/forkbook/internal/bin/loader");
|
|
800
|
+
nodeModule.register(typescriptLoaderUrl, import.meta.url);
|
|
801
|
+
}
|
|
802
|
+
})().catch((e) => {
|
|
803
|
+
throw typescriptLoaderRegistration = null, e;
|
|
804
|
+
})), typescriptLoaderRegistration;
|
|
805
|
+
}
|
|
806
|
+
async function importModule(path2, { skipCache = !1 } = {}) {
|
|
807
|
+
await registerTypescriptLoader();
|
|
808
|
+
let mod;
|
|
809
|
+
try {
|
|
810
|
+
let resolvedPath = win32.isAbsolute(path2) ? pathToFileURL2(path2).href : path2;
|
|
811
|
+
mod = await import(skipCache ? `${resolvedPath}?${Date.now()}` : resolvedPath);
|
|
812
|
+
} catch (importError) {
|
|
813
|
+
try {
|
|
814
|
+
let require2 = createRequire(import.meta.url);
|
|
815
|
+
skipCache && delete require2.cache[require2.resolve(path2)], mod = require2(path2);
|
|
816
|
+
} catch {
|
|
817
|
+
throw importError;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return mod.default ?? mod;
|
|
821
|
+
}
|
|
822
|
+
var safeResolveModule = ({
|
|
823
|
+
specifier,
|
|
824
|
+
parent,
|
|
825
|
+
extensions = [...jsModuleExtensions]
|
|
826
|
+
}) => {
|
|
827
|
+
try {
|
|
828
|
+
let resolvedPath = resolveModulePath(specifier, {
|
|
829
|
+
from: parent,
|
|
830
|
+
extensions: [""].concat(extensions)
|
|
831
|
+
});
|
|
832
|
+
if (statSync2(resolvedPath).isFile())
|
|
833
|
+
return resolvedPath;
|
|
834
|
+
} catch {
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
export {
|
|
839
|
+
resolveModulePath,
|
|
840
|
+
importMetaResolve,
|
|
841
|
+
resolvePackageDir,
|
|
842
|
+
importModule,
|
|
843
|
+
safeResolveModule
|
|
844
|
+
};
|