@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,2269 @@
|
|
|
1
|
+
import { Readable } from "node:stream";
|
|
2
|
+
import { LoaderFunction } from "@aussieljk/forkbook/internal/types";
|
|
3
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
4
|
+
import { HandleFunction, IncomingMessage as IncomingMessage$1, Server } from "connect";
|
|
5
|
+
import EventEmitter from "node:events";
|
|
6
|
+
|
|
7
|
+
//#region ../../node_modules/metro-cache/src/types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*
|
|
14
|
+
* @noformat
|
|
15
|
+
* @oncall react_native
|
|
16
|
+
* @generated SignedSource<<c15ccefd8516ba2fd711d7e9469577a2>>
|
|
17
|
+
*
|
|
18
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
19
|
+
* Original file: packages/metro-cache/src/types.js
|
|
20
|
+
* To regenerate, run:
|
|
21
|
+
* js1 build metro-ts-defs (internal) OR
|
|
22
|
+
* yarn run build-ts-defs (OSS)
|
|
23
|
+
*/
|
|
24
|
+
interface CacheStore<T> {
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
get(key: Buffer): (null | undefined | T) | Promise<null | undefined | T>;
|
|
27
|
+
set(key: Buffer, value: T): void | Promise<void>;
|
|
28
|
+
clear(): void | Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../../node_modules/metro-cache/src/Cache.d.ts
|
|
32
|
+
/**
|
|
33
|
+
* Main cache class. Receives an array of cache instances, and sequentially
|
|
34
|
+
* traverses them to return a previously stored value. It also ensures setting
|
|
35
|
+
* the value in all instances.
|
|
36
|
+
*
|
|
37
|
+
* All get/set operations are logged via Metro's logger.
|
|
38
|
+
*/
|
|
39
|
+
declare class Cache<T> {
|
|
40
|
+
constructor(stores: ReadonlyArray<CacheStore<T>>);
|
|
41
|
+
get(key: Buffer): Promise<null | undefined | T>;
|
|
42
|
+
set(key: Buffer, value: T): Promise<void>;
|
|
43
|
+
get isDisabled(): boolean;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../../node_modules/metro-cache/src/stableHash.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the MIT license found in the
|
|
51
|
+
* LICENSE file in the root directory of this source tree.
|
|
52
|
+
*
|
|
53
|
+
* @noformat
|
|
54
|
+
* @oncall react_native
|
|
55
|
+
* @generated SignedSource<<36e0de65be0930a61b8ff46232052ea7>>
|
|
56
|
+
*
|
|
57
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
58
|
+
* Original file: packages/metro-cache/src/stableHash.js
|
|
59
|
+
* To regenerate, run:
|
|
60
|
+
* js1 build metro-ts-defs (internal) OR
|
|
61
|
+
* yarn run build-ts-defs (OSS)
|
|
62
|
+
*/
|
|
63
|
+
declare function stableHash(value: unknown): Buffer;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region ../../node_modules/metro-cache/src/stores/FileStore.d.ts
|
|
66
|
+
/**
|
|
67
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the MIT license found in the
|
|
70
|
+
* LICENSE file in the root directory of this source tree.
|
|
71
|
+
*
|
|
72
|
+
* @noformat
|
|
73
|
+
* @oncall react_native
|
|
74
|
+
* @generated SignedSource<<7de501c6653d300c594fcf37ce3b56f4>>
|
|
75
|
+
*
|
|
76
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
77
|
+
* Original file: packages/metro-cache/src/stores/FileStore.js
|
|
78
|
+
* To regenerate, run:
|
|
79
|
+
* js1 build metro-ts-defs (internal) OR
|
|
80
|
+
* yarn run build-ts-defs (OSS)
|
|
81
|
+
*/
|
|
82
|
+
type Options$4 = Readonly<{
|
|
83
|
+
root: string;
|
|
84
|
+
}>;
|
|
85
|
+
declare class FileStore<T> {
|
|
86
|
+
constructor(options: Options$4);
|
|
87
|
+
get(key: Buffer): Promise<null | undefined | T>;
|
|
88
|
+
set(key: Buffer, value: T): Promise<void>;
|
|
89
|
+
clear(): void;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region ../../node_modules/metro-cache/src/stores/AutoCleanFileStore.d.ts
|
|
93
|
+
type CleanOptions = Readonly<Omit<Options$4, 'intervalMs' | 'cleanupThresholdMs'> & {
|
|
94
|
+
intervalMs?: number | undefined;
|
|
95
|
+
cleanupThresholdMs?: number | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
/**
|
|
98
|
+
* A FileStore that, at a given interval, stats the content of the cache root
|
|
99
|
+
* and deletes any file last modified a set threshold in the past.
|
|
100
|
+
*
|
|
101
|
+
* @deprecated This is not efficiently implemented and may cause significant
|
|
102
|
+
* redundant I/O when caches are large. Prefer your own cleanup scripts, or a
|
|
103
|
+
* custom Metro cache that uses watches, hooks get/set, and/or implements LRU.
|
|
104
|
+
*/
|
|
105
|
+
declare class AutoCleanFileStore<T> extends FileStore<T> {
|
|
106
|
+
constructor(opts: CleanOptions);
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../../node_modules/metro-cache/src/stores/HttpError.d.ts
|
|
110
|
+
/**
|
|
111
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the MIT license found in the
|
|
114
|
+
* LICENSE file in the root directory of this source tree.
|
|
115
|
+
*
|
|
116
|
+
* @noformat
|
|
117
|
+
* @generated SignedSource<<7a0b4b83fb44651820333ade6a980ef7>>
|
|
118
|
+
*
|
|
119
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
120
|
+
* Original file: packages/metro-cache/src/stores/HttpError.js
|
|
121
|
+
* To regenerate, run:
|
|
122
|
+
* js1 build metro-ts-defs (internal) OR
|
|
123
|
+
* yarn run build-ts-defs (OSS)
|
|
124
|
+
*/
|
|
125
|
+
declare class HttpError extends Error {
|
|
126
|
+
code: number;
|
|
127
|
+
constructor(message: string, code: number);
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region ../../node_modules/metro-cache/src/stores/NetworkError.d.ts
|
|
131
|
+
/**
|
|
132
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the MIT license found in the
|
|
135
|
+
* LICENSE file in the root directory of this source tree.
|
|
136
|
+
*
|
|
137
|
+
* @noformat
|
|
138
|
+
* @generated SignedSource<<9a68fe7766e376b8525c589673853e54>>
|
|
139
|
+
*
|
|
140
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
141
|
+
* Original file: packages/metro-cache/src/stores/NetworkError.js
|
|
142
|
+
* To regenerate, run:
|
|
143
|
+
* js1 build metro-ts-defs (internal) OR
|
|
144
|
+
* yarn run build-ts-defs (OSS)
|
|
145
|
+
*/
|
|
146
|
+
declare class NetworkError extends Error {
|
|
147
|
+
code: string;
|
|
148
|
+
constructor(message: string, code: string);
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region ../../node_modules/metro-cache/src/stores/HttpStore.d.ts
|
|
152
|
+
type Options$3 = EndpointOptions | {
|
|
153
|
+
getOptions: EndpointOptions;
|
|
154
|
+
setOptions: EndpointOptions;
|
|
155
|
+
};
|
|
156
|
+
type EndpointOptions = {
|
|
157
|
+
endpoint: string;
|
|
158
|
+
family?: 4 | 6 | undefined;
|
|
159
|
+
timeout?: number | undefined;
|
|
160
|
+
key?: string | ReadonlyArray<string> | Buffer | ReadonlyArray<Buffer> | undefined;
|
|
161
|
+
cert?: string | ReadonlyArray<string> | Buffer | ReadonlyArray<Buffer> | undefined;
|
|
162
|
+
ca?: string | ReadonlyArray<string> | Buffer | ReadonlyArray<Buffer> | undefined;
|
|
163
|
+
params?: URLSearchParams | undefined;
|
|
164
|
+
headers?: {
|
|
165
|
+
[$$Key$$: string]: string;
|
|
166
|
+
} | undefined;
|
|
167
|
+
additionalSuccessStatuses?: ReadonlyArray<number> | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Whether to include additional debug information in error messages.
|
|
170
|
+
*/
|
|
171
|
+
debug?: boolean | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Retry configuration
|
|
174
|
+
*/
|
|
175
|
+
maxAttempts?: number | undefined;
|
|
176
|
+
retryNetworkErrors?: boolean | undefined;
|
|
177
|
+
retryStatuses?: ReadonlySet<number> | undefined;
|
|
178
|
+
socketPath?: string | undefined;
|
|
179
|
+
proxy?: string | undefined;
|
|
180
|
+
};
|
|
181
|
+
declare class HttpStore<T> {
|
|
182
|
+
static HttpError: typeof HttpError;
|
|
183
|
+
static NetworkError: typeof NetworkError;
|
|
184
|
+
constructor(options: Options$3);
|
|
185
|
+
get(key: Buffer): Promise<null | undefined | T>;
|
|
186
|
+
set(key: Buffer, value: T): Promise<void>;
|
|
187
|
+
clear(): void;
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region ../../node_modules/metro-cache/src/stores/HttpGetStore.d.ts
|
|
191
|
+
declare class HttpGetStore<T> extends HttpStore<T> {
|
|
192
|
+
constructor(options: Options$3);
|
|
193
|
+
get(key: Buffer): Promise<null | undefined | T>;
|
|
194
|
+
set(_key: Buffer, _value: T): Promise<void>;
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region ../../node_modules/metro-cache/src/index.d.ts
|
|
198
|
+
interface MetroCache {
|
|
199
|
+
readonly AutoCleanFileStore: typeof AutoCleanFileStore;
|
|
200
|
+
readonly Cache: typeof Cache;
|
|
201
|
+
readonly FileStore: typeof FileStore;
|
|
202
|
+
readonly HttpGetStore: typeof HttpGetStore;
|
|
203
|
+
readonly HttpStore: typeof HttpStore;
|
|
204
|
+
readonly stableHash: typeof stableHash;
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region ../../node_modules/metro-file-map/src/flow-types.d.ts
|
|
208
|
+
type BuildParameters = Readonly<{
|
|
209
|
+
computeSha1: boolean;
|
|
210
|
+
enableSymlinks: boolean;
|
|
211
|
+
extensions: ReadonlyArray<string>;
|
|
212
|
+
ignorePattern: RegExp;
|
|
213
|
+
plugins: ReadonlyArray<InputFileMapPlugin>;
|
|
214
|
+
retainAllFiles: boolean;
|
|
215
|
+
rootDir: string;
|
|
216
|
+
roots: ReadonlyArray<string>;
|
|
217
|
+
cacheBreaker: string;
|
|
218
|
+
}>;
|
|
219
|
+
type BuildResult = {
|
|
220
|
+
fileSystem: FileSystem;
|
|
221
|
+
};
|
|
222
|
+
type CacheData = Readonly<{
|
|
223
|
+
clocks: WatchmanClocks;
|
|
224
|
+
fileSystemData: unknown;
|
|
225
|
+
plugins: ReadonlyMap<string, void | V8Serializable>;
|
|
226
|
+
}>;
|
|
227
|
+
interface CacheManager {
|
|
228
|
+
/**
|
|
229
|
+
* Called during startup to load initial state, if available. Provided to
|
|
230
|
+
* a crawler, which will return the delta between the initial state and the
|
|
231
|
+
* current file system state.
|
|
232
|
+
*/
|
|
233
|
+
read(): Promise<null | undefined | CacheData>;
|
|
234
|
+
/**
|
|
235
|
+
* Called when metro-file-map `build()` has applied changes returned by the
|
|
236
|
+
* crawler - i.e. internal state reflects the current file system state.
|
|
237
|
+
*
|
|
238
|
+
* getSnapshot may be retained and called at any time before end(), such as
|
|
239
|
+
* in response to eventSource 'change' events.
|
|
240
|
+
*/
|
|
241
|
+
write(getSnapshot: () => CacheData, opts: CacheManagerWriteOptions): Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* The last call that will be made to this CacheManager. Any handles should
|
|
244
|
+
* be closed by the time this settles.
|
|
245
|
+
*/
|
|
246
|
+
end(): Promise<void>;
|
|
247
|
+
}
|
|
248
|
+
interface CacheManagerEventSource {
|
|
249
|
+
onChange(listener: () => void): () => void;
|
|
250
|
+
}
|
|
251
|
+
type CacheManagerFactory = (options: CacheManagerFactoryOptions) => CacheManager;
|
|
252
|
+
type CacheManagerFactoryOptions = Readonly<{
|
|
253
|
+
buildParameters: BuildParameters;
|
|
254
|
+
}>;
|
|
255
|
+
type CacheManagerWriteOptions = Readonly<{
|
|
256
|
+
changedSinceCacheRead: boolean;
|
|
257
|
+
eventSource: CacheManagerEventSource;
|
|
258
|
+
onWriteError: (error: Error) => void;
|
|
259
|
+
}>;
|
|
260
|
+
type CanonicalPath = string;
|
|
261
|
+
type ChangedFileMetadata = Readonly<{
|
|
262
|
+
isSymlink: boolean;
|
|
263
|
+
modifiedTime?: null | undefined | number;
|
|
264
|
+
}>;
|
|
265
|
+
type ChangeEvent = Readonly<{
|
|
266
|
+
logger?: null | undefined | RootPerfLogger;
|
|
267
|
+
changes: ReadonlyFileSystemChanges<Readonly<ChangedFileMetadata>>;
|
|
268
|
+
rootDir: string;
|
|
269
|
+
}>;
|
|
270
|
+
type Console = typeof global.console;
|
|
271
|
+
type CrawlerOptions = {
|
|
272
|
+
abortSignal?: null | undefined | AbortSignal;
|
|
273
|
+
computeSha1: boolean;
|
|
274
|
+
console: Console;
|
|
275
|
+
extensions: ReadonlyArray<string>;
|
|
276
|
+
ignore: IgnoreMatcher;
|
|
277
|
+
includeSymlinks: boolean;
|
|
278
|
+
perfLogger?: null | undefined | PerfLogger;
|
|
279
|
+
previousState: Readonly<{
|
|
280
|
+
clocks: ReadonlyMap<CanonicalPath, WatchmanClockSpec>;
|
|
281
|
+
fileSystem: FileSystem;
|
|
282
|
+
}>;
|
|
283
|
+
rootDir: string;
|
|
284
|
+
roots: ReadonlyArray<string>;
|
|
285
|
+
onStatus: (status: WatcherStatus) => void;
|
|
286
|
+
subpath?: string | undefined;
|
|
287
|
+
};
|
|
288
|
+
type CrawlResult = {
|
|
289
|
+
changedFiles: FileData;
|
|
290
|
+
removedFiles: Set<Path$1>;
|
|
291
|
+
clocks: WatchmanClocks;
|
|
292
|
+
} | {
|
|
293
|
+
changedFiles: FileData;
|
|
294
|
+
removedFiles: Set<Path$1>;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* Discovers files under `roots`, as a delta against `previousState`. This is
|
|
298
|
+
* the contract implemented by the built-in Watchman and node crawlers, and by
|
|
299
|
+
* any crawler supplied to `Watcher`.
|
|
300
|
+
*/
|
|
301
|
+
type Crawler = (options: CrawlerOptions) => Promise<CrawlResult>;
|
|
302
|
+
type CrawlerFactoryOptions = Readonly<{
|
|
303
|
+
buildParameters: BuildParameters;
|
|
304
|
+
/**
|
|
305
|
+
* Maps a plugin's `name` to the index within `FileMetadata` reserved for its
|
|
306
|
+
* per-file data. Plugins that declare no worker have no reserved slot and are
|
|
307
|
+
* absent from this map.
|
|
308
|
+
*
|
|
309
|
+
* A crawler that can supply plugin data itself - rather than leaving it to
|
|
310
|
+
* the plugin's worker - writes it at these indices.
|
|
311
|
+
*/
|
|
312
|
+
pluginDataIndices: ReadonlyMap<string, number>;
|
|
313
|
+
}>;
|
|
314
|
+
/**
|
|
315
|
+
* Replaces the built-in Watchman/node crawlers. Called once per `FileMap`,
|
|
316
|
+
* before the first crawl, with context that is fixed for that `FileMap`'s
|
|
317
|
+
* lifetime; the returned `Crawler` is called for the initial crawl and for any
|
|
318
|
+
* subsequent re-crawl.
|
|
319
|
+
*
|
|
320
|
+
* Only crawling is replaced. Watch mode, if enabled, still uses the built-in
|
|
321
|
+
* watcher backends.
|
|
322
|
+
*/
|
|
323
|
+
type CrawlerFactory = (options: CrawlerFactoryOptions) => Crawler;
|
|
324
|
+
type WatcherStatus = {
|
|
325
|
+
type: 'watchman_slow_command';
|
|
326
|
+
timeElapsed: number;
|
|
327
|
+
command: 'watch-project' | 'query';
|
|
328
|
+
} | {
|
|
329
|
+
type: 'watchman_slow_command_complete';
|
|
330
|
+
timeElapsed: number;
|
|
331
|
+
command: 'watch-project' | 'query';
|
|
332
|
+
} | {
|
|
333
|
+
type: 'watchman_warning';
|
|
334
|
+
warning: unknown;
|
|
335
|
+
command: 'watch-project' | 'query';
|
|
336
|
+
};
|
|
337
|
+
type FileMapPluginInitOptions<SerializableState, PerFileData = void> = Readonly<{
|
|
338
|
+
files: Readonly<{
|
|
339
|
+
fileIterator(opts: Readonly<{
|
|
340
|
+
includeNodeModules: boolean;
|
|
341
|
+
includeSymlinks: boolean;
|
|
342
|
+
}>): Iterable<{
|
|
343
|
+
baseName: string;
|
|
344
|
+
canonicalPath: string;
|
|
345
|
+
readonly pluginData: null | undefined | PerFileData;
|
|
346
|
+
}>;
|
|
347
|
+
lookup(mixedPath: string): {
|
|
348
|
+
exists: false;
|
|
349
|
+
} | {
|
|
350
|
+
exists: true;
|
|
351
|
+
type: 'f';
|
|
352
|
+
readonly pluginData: PerFileData;
|
|
353
|
+
} | {
|
|
354
|
+
exists: true;
|
|
355
|
+
type: 'd';
|
|
356
|
+
};
|
|
357
|
+
}>;
|
|
358
|
+
pluginState: null | undefined | SerializableState;
|
|
359
|
+
}>;
|
|
360
|
+
type FileMapPluginWorker = Readonly<{
|
|
361
|
+
worker: Readonly<{
|
|
362
|
+
modulePath: string;
|
|
363
|
+
setupArgs: JsonData;
|
|
364
|
+
}>;
|
|
365
|
+
filter: ($$PARAM_0$$: {
|
|
366
|
+
normalPath: string;
|
|
367
|
+
isNodeModules: boolean;
|
|
368
|
+
}) => boolean;
|
|
369
|
+
}>;
|
|
370
|
+
type V8SerializablePrimitive = string | number | boolean | null;
|
|
371
|
+
type V8SerializableCollection = ReadonlyArray<V8Serializable> | ReadonlySet<V8Serializable> | ReadonlyMap<string, V8Serializable> | Readonly<{
|
|
372
|
+
[key: string]: V8Serializable;
|
|
373
|
+
}>;
|
|
374
|
+
type V8Serializable = V8SerializablePrimitive | V8SerializableCollection;
|
|
375
|
+
interface FileMapPlugin<SerializableState extends void | V8Serializable = void | V8Serializable, PerFileData extends void | V8Serializable = void | V8Serializable> {
|
|
376
|
+
readonly name: string;
|
|
377
|
+
initialize(initOptions: FileMapPluginInitOptions<SerializableState, PerFileData>): Promise<void>;
|
|
378
|
+
assertValid(): void;
|
|
379
|
+
onChanged(changes: ReadonlyFileSystemChanges<null | undefined | PerFileData>): void;
|
|
380
|
+
getSerializableSnapshot(): void | V8Serializable;
|
|
381
|
+
getCacheKey(): string;
|
|
382
|
+
getWorker(): null | undefined | FileMapPluginWorker;
|
|
383
|
+
}
|
|
384
|
+
type InputFileMapPlugin = FileMapPlugin<
|
|
385
|
+
/**
|
|
386
|
+
* > 264 | export type InputFileMapPlugin = FileMapPlugin<empty, empty>;
|
|
387
|
+
* | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported.
|
|
388
|
+
**/
|
|
389
|
+
any,
|
|
390
|
+
/**
|
|
391
|
+
* > 264 | export type InputFileMapPlugin = FileMapPlugin<empty, empty>;
|
|
392
|
+
* | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported.
|
|
393
|
+
**/
|
|
394
|
+
any>;
|
|
395
|
+
type HType = {
|
|
396
|
+
MTIME: 0;
|
|
397
|
+
SIZE: 1;
|
|
398
|
+
VISITED: 2;
|
|
399
|
+
SHA1: 3;
|
|
400
|
+
SYMLINK: 4;
|
|
401
|
+
PLUGINDATA: number;
|
|
402
|
+
PATH: 0;
|
|
403
|
+
TYPE: 1;
|
|
404
|
+
MODULE: 0;
|
|
405
|
+
PACKAGE: 1;
|
|
406
|
+
GENERIC_PLATFORM: 'g';
|
|
407
|
+
NATIVE_PLATFORM: 'native';
|
|
408
|
+
};
|
|
409
|
+
type HTypeValue = HType[keyof HType];
|
|
410
|
+
type IgnoreMatcher = (item: string) => boolean;
|
|
411
|
+
type FileData = Map<CanonicalPath, FileMetadata>;
|
|
412
|
+
type FileMetadata = [null | undefined | number, number, 0 | 1, null | undefined | string, 0 | 1 | string, ...unknown[]];
|
|
413
|
+
type FileStats = Readonly<{
|
|
414
|
+
fileType: 'f' | 'l';
|
|
415
|
+
modifiedTime: null | undefined | number;
|
|
416
|
+
size: null | undefined | number;
|
|
417
|
+
}>;
|
|
418
|
+
interface FileSystem {
|
|
419
|
+
exists(file: Path$1): boolean;
|
|
420
|
+
getAllFiles(): Array<Path$1>;
|
|
421
|
+
/**
|
|
422
|
+
* Given a map of files, determine which of them are new or modified
|
|
423
|
+
* (changedFiles), and which of them are missing from the input
|
|
424
|
+
* (removedFiles), vs the current state of this instance of FileSystem.
|
|
425
|
+
*/
|
|
426
|
+
getDifference(files: FileData, options?: Readonly<{
|
|
427
|
+
/**
|
|
428
|
+
* Only consider files under this subpath (which should be a directory)
|
|
429
|
+
* when computing removedFiles. If not provided, all files in the file
|
|
430
|
+
* system are considered.
|
|
431
|
+
*/
|
|
432
|
+
subpath?: string | undefined;
|
|
433
|
+
}>): {
|
|
434
|
+
changedFiles: FileData;
|
|
435
|
+
removedFiles: Set<string>;
|
|
436
|
+
};
|
|
437
|
+
getSerializableSnapshot(): CacheData['fileSystemData'];
|
|
438
|
+
getSha1(file: Path$1): null | undefined | string;
|
|
439
|
+
getOrComputeSha1(file: Path$1): Promise<null | undefined | {
|
|
440
|
+
sha1: string;
|
|
441
|
+
content?: Buffer | undefined;
|
|
442
|
+
}>;
|
|
443
|
+
/**
|
|
444
|
+
* Given a start path (which need not exist), a subpath and type, and
|
|
445
|
+
* optionally a 'breakOnSegment', performs the following:
|
|
446
|
+
*
|
|
447
|
+
* X = mixedStartPath
|
|
448
|
+
* do
|
|
449
|
+
* if basename(X) === opts.breakOnSegment
|
|
450
|
+
* return null
|
|
451
|
+
* if X + subpath exists and has type opts.subpathType
|
|
452
|
+
* return {
|
|
453
|
+
* absolutePath: realpath(X + subpath)
|
|
454
|
+
* containerRelativePath: relative(mixedStartPath, X)
|
|
455
|
+
* }
|
|
456
|
+
* X = dirname(X)
|
|
457
|
+
* while X !== dirname(X)
|
|
458
|
+
*
|
|
459
|
+
* If opts.invalidatedBy is given, collects all absolute, real paths that if
|
|
460
|
+
* added or removed may invalidate this result.
|
|
461
|
+
*
|
|
462
|
+
* Useful for finding the closest package scope (subpath: package.json,
|
|
463
|
+
* type f, breakOnSegment: node_modules) or closest potential package root
|
|
464
|
+
* (subpath: node_modules/pkg, type: d) in Node.js resolution.
|
|
465
|
+
*/
|
|
466
|
+
hierarchicalLookup(mixedStartPath: string, subpath: string, opts: {
|
|
467
|
+
breakOnSegment?: null | undefined | string;
|
|
468
|
+
invalidatedBy?: null | undefined | Set<string>;
|
|
469
|
+
subpathType: 'f' | 'd';
|
|
470
|
+
}): null | undefined | {
|
|
471
|
+
absolutePath: string;
|
|
472
|
+
containerRelativePath: string;
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* Analogous to posix lstat. If the file at `file` is a symlink, return
|
|
476
|
+
* information about the symlink without following it.
|
|
477
|
+
*/
|
|
478
|
+
linkStats(file: Path$1): null | undefined | FileStats;
|
|
479
|
+
/**
|
|
480
|
+
* Return information about the given path, whether a directory or file.
|
|
481
|
+
* Always follow symlinks, and return a real path if it exists.
|
|
482
|
+
*/
|
|
483
|
+
lookup(mixedPath: Path$1): LookupResult;
|
|
484
|
+
matchFiles(opts: {
|
|
485
|
+
filter?: RegExp | null | undefined;
|
|
486
|
+
filterCompareAbsolute?: boolean | undefined;
|
|
487
|
+
filterComparePosix?: boolean | undefined;
|
|
488
|
+
follow?: boolean | undefined;
|
|
489
|
+
recursive?: boolean | undefined;
|
|
490
|
+
rootDir?: Path$1 | null | undefined;
|
|
491
|
+
}): Iterable<Path$1>;
|
|
492
|
+
}
|
|
493
|
+
type JsonData = string | number | boolean | null | Array<JsonData> | {
|
|
494
|
+
[key: string]: JsonData;
|
|
495
|
+
};
|
|
496
|
+
type LookupResult = {
|
|
497
|
+
exists: false;
|
|
498
|
+
links: ReadonlySet<string>;
|
|
499
|
+
missing: string;
|
|
500
|
+
} | {
|
|
501
|
+
exists: true;
|
|
502
|
+
links: ReadonlySet<string>;
|
|
503
|
+
realPath: string;
|
|
504
|
+
type: 'd';
|
|
505
|
+
} | {
|
|
506
|
+
exists: true;
|
|
507
|
+
links: ReadonlySet<string>;
|
|
508
|
+
realPath: string;
|
|
509
|
+
type: 'f';
|
|
510
|
+
metadata: FileMetadata;
|
|
511
|
+
};
|
|
512
|
+
type HasteConflict = {
|
|
513
|
+
id: string;
|
|
514
|
+
platform: string | null;
|
|
515
|
+
absolutePaths: Array<string>;
|
|
516
|
+
type: 'duplicate' | 'shadowing';
|
|
517
|
+
};
|
|
518
|
+
interface HasteMap {
|
|
519
|
+
getModule(name: string, platform?: null | undefined | string, supportsNativePlatform?: null | undefined | boolean, type?: null | undefined | HTypeValue): null | undefined | Path$1;
|
|
520
|
+
getModuleNameByPath(file: Path$1): null | undefined | string;
|
|
521
|
+
getPackage(name: string, platform: null | undefined | string, _supportsNativePlatform: null | undefined | boolean): null | undefined | Path$1;
|
|
522
|
+
computeConflicts(): Array<HasteConflict>;
|
|
523
|
+
}
|
|
524
|
+
interface ReadonlyFileSystemChanges<T = FileMetadata> {
|
|
525
|
+
readonly addedDirectories: Iterable<CanonicalPath>;
|
|
526
|
+
readonly removedDirectories: Iterable<CanonicalPath>;
|
|
527
|
+
readonly addedFiles: Iterable<Readonly<[CanonicalPath, T]>>;
|
|
528
|
+
readonly modifiedFiles: Iterable<Readonly<[CanonicalPath, T]>>;
|
|
529
|
+
readonly removedFiles: Iterable<Readonly<[CanonicalPath, T]>>;
|
|
530
|
+
}
|
|
531
|
+
type Path$1 = string;
|
|
532
|
+
type WatchmanClockSpec = string | Readonly<{
|
|
533
|
+
scm: Readonly<{
|
|
534
|
+
'mergebase-with': string;
|
|
535
|
+
}>;
|
|
536
|
+
}>;
|
|
537
|
+
type WatchmanClocks = Map<Path$1, WatchmanClockSpec>;
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region ../../node_modules/metro-file-map/src/Watcher.d.ts
|
|
540
|
+
type HealthCheckResult = {
|
|
541
|
+
type: 'error';
|
|
542
|
+
timeout: number;
|
|
543
|
+
error: Error;
|
|
544
|
+
watcher: null | undefined | string;
|
|
545
|
+
} | {
|
|
546
|
+
type: 'success';
|
|
547
|
+
timeout: number;
|
|
548
|
+
timeElapsed: number;
|
|
549
|
+
watcher: null | undefined | string;
|
|
550
|
+
} | {
|
|
551
|
+
type: 'timeout';
|
|
552
|
+
timeout: number;
|
|
553
|
+
watcher: null | undefined | string;
|
|
554
|
+
pauseReason: null | undefined | string;
|
|
555
|
+
};
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region ../../node_modules/metro-file-map/src/index.d.ts
|
|
558
|
+
type InputOptions = Readonly<{
|
|
559
|
+
computeSha1?: null | undefined | boolean;
|
|
560
|
+
enableSymlinks?: null | undefined | boolean;
|
|
561
|
+
extensions: ReadonlyArray<string>;
|
|
562
|
+
ignorePattern?: null | undefined | RegExp;
|
|
563
|
+
plugins?: ReadonlyArray<InputFileMapPlugin> | undefined;
|
|
564
|
+
retainAllFiles: boolean;
|
|
565
|
+
rootDir: string;
|
|
566
|
+
roots: ReadonlyArray<string>;
|
|
567
|
+
cacheManagerFactory?: null | undefined | CacheManagerFactory;
|
|
568
|
+
console?: Console | undefined;
|
|
569
|
+
/**
|
|
570
|
+
* Replaces the built-in Watchman/node crawlers. Watch mode, if enabled, still
|
|
571
|
+
* uses the built-in watcher backends.
|
|
572
|
+
*/
|
|
573
|
+
crawlerFactory?: null | undefined | CrawlerFactory;
|
|
574
|
+
healthCheck: HealthCheckOptions;
|
|
575
|
+
maxFilesPerWorker?: null | undefined | number;
|
|
576
|
+
maxWorkers: number;
|
|
577
|
+
perfLoggerFactory?: null | undefined | PerfLoggerFactory;
|
|
578
|
+
resetCache?: null | undefined | boolean;
|
|
579
|
+
useWatchman?: null | undefined | boolean;
|
|
580
|
+
watch?: null | undefined | boolean;
|
|
581
|
+
watchmanDeferStates?: ReadonlyArray<string> | undefined;
|
|
582
|
+
}>;
|
|
583
|
+
type HealthCheckOptions = Readonly<{
|
|
584
|
+
enabled: boolean;
|
|
585
|
+
interval: number;
|
|
586
|
+
timeout: number;
|
|
587
|
+
filePrefix: string;
|
|
588
|
+
}>;
|
|
589
|
+
/**
|
|
590
|
+
* FileMap includes a JavaScript implementation of Facebook's haste module system.
|
|
591
|
+
*
|
|
592
|
+
* This implementation is inspired by https://github.com/facebook/node-haste
|
|
593
|
+
* and was built with for high-performance in large code repositories with
|
|
594
|
+
* hundreds of thousands of files. This implementation is scalable and provides
|
|
595
|
+
* predictable performance.
|
|
596
|
+
*
|
|
597
|
+
* Because the file map creation and synchronization is critical to startup
|
|
598
|
+
* performance and most tasks are blocked by I/O this class makes heavy use of
|
|
599
|
+
* synchronous operations. It uses worker processes for parallelizing file
|
|
600
|
+
* access and metadata extraction.
|
|
601
|
+
*
|
|
602
|
+
* The data structures created by `metro-file-map` can be used directly from the
|
|
603
|
+
* cache without further processing. The metadata objects in the `files` and
|
|
604
|
+
* `map` objects contain cross-references: a metadata object from one can look
|
|
605
|
+
* up the corresponding metadata object in the other map. Note that in most
|
|
606
|
+
* projects, the number of files will be greater than the number of haste
|
|
607
|
+
* modules one module can refer to many files based on platform extensions.
|
|
608
|
+
*
|
|
609
|
+
* type CacheData = {
|
|
610
|
+
* clocks: WatchmanClocks,
|
|
611
|
+
* files: {[filepath: string]: FileMetadata},
|
|
612
|
+
* map: {[id: string]: HasteMapItem},
|
|
613
|
+
* mocks: {[id: string]: string},
|
|
614
|
+
* }
|
|
615
|
+
*
|
|
616
|
+
* // Watchman clocks are used for query synchronization and file system deltas.
|
|
617
|
+
* type WatchmanClocks = {[filepath: string]: string};
|
|
618
|
+
*
|
|
619
|
+
* type FileMetadata = {
|
|
620
|
+
* id: ?string, // used to look up module metadata objects in `map`.
|
|
621
|
+
* mtime: number, // check for outdated files.
|
|
622
|
+
* size: number, // size of the file in bytes.
|
|
623
|
+
* visited: boolean, // whether the file has been parsed or not.
|
|
624
|
+
* dependencies: Array<string>, // all relative dependencies of this file.
|
|
625
|
+
* sha1: ?string, // SHA-1 of the file, if requested via options.
|
|
626
|
+
* symlink: ?(1 | 0 | string), // Truthy if symlink, string is target
|
|
627
|
+
* };
|
|
628
|
+
*
|
|
629
|
+
* // Modules can be targeted to a specific platform based on the file name.
|
|
630
|
+
* // Example: platform.ios.js and Platform.android.js will both map to the same
|
|
631
|
+
* // `Platform` module. The platform should be specified during resolution.
|
|
632
|
+
* type HasteMapItem = {[platform: string]: ModuleMetadata};
|
|
633
|
+
*
|
|
634
|
+
* //
|
|
635
|
+
* type ModuleMetadata = {
|
|
636
|
+
* path: string, // the path to look up the file object in `files`.
|
|
637
|
+
* type: string, // the module type (either `package` or `module`).
|
|
638
|
+
* };
|
|
639
|
+
*
|
|
640
|
+
* Note that the data structures described above are conceptual only. The actual
|
|
641
|
+
* implementation uses arrays and constant keys for metadata storage. Instead of
|
|
642
|
+
* `{id: 'flatMap', mtime: 3421, size: 42, visited: true, dependencies: []}` the real
|
|
643
|
+
* representation is similar to `['flatMap', 3421, 42, 1, []]` to save storage space
|
|
644
|
+
* and reduce parse and write time of a big JSON blob.
|
|
645
|
+
*
|
|
646
|
+
* The FileMap is created as follows:
|
|
647
|
+
* 1. read data from the cache or create an empty structure.
|
|
648
|
+
*
|
|
649
|
+
* 2. crawl the file system.
|
|
650
|
+
* * empty cache: crawl the entire file system.
|
|
651
|
+
* * cache available:
|
|
652
|
+
* * if watchman is available: get file system delta changes.
|
|
653
|
+
* * if watchman is unavailable: crawl the entire file system.
|
|
654
|
+
* * build metadata objects for every file. This builds the `files` part of
|
|
655
|
+
* the `FileMap`.
|
|
656
|
+
*
|
|
657
|
+
* 3. visit and extract metadata from changed files, including sha1,
|
|
658
|
+
* depedendencies, and any plugins.
|
|
659
|
+
* * this is done in parallel over worker processes to improve performance.
|
|
660
|
+
* * the worst case is to visit all files.
|
|
661
|
+
* * the best case is no file system access and retrieving all data from
|
|
662
|
+
* the cache.
|
|
663
|
+
* * the average case is a small number of changed files.
|
|
664
|
+
*
|
|
665
|
+
* 4. serialize the new `FileMap` in a cache file.
|
|
666
|
+
*
|
|
667
|
+
*/
|
|
668
|
+
declare class FileMap extends EventEmitter {
|
|
669
|
+
static create(options: InputOptions): FileMap;
|
|
670
|
+
constructor(options: InputOptions);
|
|
671
|
+
build(): Promise<BuildResult>;
|
|
672
|
+
/**
|
|
673
|
+
* 1. read data from the cache or create an empty structure.
|
|
674
|
+
*/
|
|
675
|
+
read(): Promise<null | undefined | CacheData>;
|
|
676
|
+
end(): Promise<void>;
|
|
677
|
+
static H: HType;
|
|
678
|
+
}
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region ../../node_modules/metro-babel-transformer/src/index.d.ts
|
|
681
|
+
type CustomTransformOptions = {
|
|
682
|
+
[key: string]: unknown;
|
|
683
|
+
};
|
|
684
|
+
type TransformProfile = 'default' | 'hermes-stable' | 'hermes-canary';
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region ../../node_modules/metro-source-map/src/source-map.d.ts
|
|
687
|
+
type GeneratedCodeMapping = [number, number];
|
|
688
|
+
type SourceMapping = [number, number, number, number];
|
|
689
|
+
type SourceMappingWithName = [number, number, number, number, string];
|
|
690
|
+
type MetroSourceMapSegmentTuple = SourceMappingWithName | SourceMapping | GeneratedCodeMapping;
|
|
691
|
+
type VlqMap = {
|
|
692
|
+
readonly mappings: string;
|
|
693
|
+
readonly names: ReadonlyArray<string>;
|
|
694
|
+
};
|
|
695
|
+
type HermesFunctionOffsets = {
|
|
696
|
+
[functionId: number]: ReadonlyArray<number>;
|
|
697
|
+
};
|
|
698
|
+
type FBSourcesArray = ReadonlyArray<null | undefined | FBSourceMetadata>;
|
|
699
|
+
type FBSourceMetadata = [null | undefined | FBSourceFunctionMap];
|
|
700
|
+
type FBSourceFunctionMap = {
|
|
701
|
+
readonly names: ReadonlyArray<string>;
|
|
702
|
+
readonly mappings: string;
|
|
703
|
+
};
|
|
704
|
+
type FBSegmentMap = {
|
|
705
|
+
[id: string]: MixedSourceMap;
|
|
706
|
+
};
|
|
707
|
+
type BasicSourceMap = {
|
|
708
|
+
readonly file?: string | undefined;
|
|
709
|
+
readonly mappings: string;
|
|
710
|
+
readonly names: Array<string>;
|
|
711
|
+
readonly sourceRoot?: string | undefined;
|
|
712
|
+
readonly sources: Array<string>;
|
|
713
|
+
readonly sourcesContent?: Array<null | undefined | string> | undefined;
|
|
714
|
+
readonly version: number;
|
|
715
|
+
readonly x_facebook_offsets?: Array<number> | undefined;
|
|
716
|
+
readonly x_metro_module_paths?: Array<string> | undefined;
|
|
717
|
+
readonly x_facebook_sources?: FBSourcesArray | undefined;
|
|
718
|
+
readonly x_facebook_segments?: FBSegmentMap | undefined;
|
|
719
|
+
readonly x_hermes_function_offsets?: HermesFunctionOffsets | undefined;
|
|
720
|
+
readonly x_google_ignoreList?: Array<number> | undefined;
|
|
721
|
+
};
|
|
722
|
+
type IndexMapSection = {
|
|
723
|
+
map: IndexMap | BasicSourceMap;
|
|
724
|
+
offset: {
|
|
725
|
+
line: number;
|
|
726
|
+
column: number;
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
type IndexMap = {
|
|
730
|
+
readonly file?: string | undefined;
|
|
731
|
+
readonly mappings?: void | undefined;
|
|
732
|
+
readonly sourcesContent?: void | undefined;
|
|
733
|
+
readonly sections: Array<IndexMapSection>;
|
|
734
|
+
readonly version: number;
|
|
735
|
+
readonly x_facebook_offsets?: Array<number> | undefined;
|
|
736
|
+
readonly x_metro_module_paths?: Array<string> | undefined;
|
|
737
|
+
readonly x_facebook_sources?: void | undefined;
|
|
738
|
+
readonly x_facebook_segments?: FBSegmentMap | undefined;
|
|
739
|
+
readonly x_hermes_function_offsets?: HermesFunctionOffsets | undefined;
|
|
740
|
+
readonly x_google_ignoreList?: void | undefined;
|
|
741
|
+
};
|
|
742
|
+
type MixedSourceMap = IndexMap | BasicSourceMap;
|
|
743
|
+
//#endregion
|
|
744
|
+
//#region ../../node_modules/metro/src/lib/CountingSet.d.ts
|
|
745
|
+
/**
|
|
746
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
747
|
+
*
|
|
748
|
+
* This source code is licensed under the MIT license found in the
|
|
749
|
+
* LICENSE file in the root directory of this source tree.
|
|
750
|
+
*
|
|
751
|
+
* @noformat
|
|
752
|
+
* @oncall react_native
|
|
753
|
+
* @generated SignedSource<<1577f522f8120f35ec9ced81388166fe>>
|
|
754
|
+
*
|
|
755
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
756
|
+
* Original file: packages/metro/src/lib/CountingSet.js
|
|
757
|
+
* To regenerate, run:
|
|
758
|
+
* js1 build metro-ts-defs (internal) OR
|
|
759
|
+
* yarn run build-ts-defs (OSS)
|
|
760
|
+
*/
|
|
761
|
+
interface ReadOnlyCountingSet<T> extends Iterable<T> {
|
|
762
|
+
has(item: T): boolean;
|
|
763
|
+
readonly size: number;
|
|
764
|
+
count(item: T): number;
|
|
765
|
+
forEach<ThisT>(callbackFn: (this: ThisT, value: T, key: T, set: ReadOnlyCountingSet<T>) => unknown, thisArg: ThisT): void;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* A Set that only deletes a given item when the number of delete(item) calls
|
|
769
|
+
* matches the number of add(item) calls. Iteration and `size` are in terms of
|
|
770
|
+
* *unique* items.
|
|
771
|
+
*/
|
|
772
|
+
declare class CountingSet<T> implements ReadOnlyCountingSet<T> {
|
|
773
|
+
constructor(items?: Iterable<T>);
|
|
774
|
+
has(item: T): boolean;
|
|
775
|
+
add(item: T): void;
|
|
776
|
+
delete(item: T): void;
|
|
777
|
+
keys(): Iterator<T>;
|
|
778
|
+
values(): Iterator<T>;
|
|
779
|
+
entries(): Iterator<[T, T]>;
|
|
780
|
+
[Symbol.iterator](): Iterator<T>;
|
|
781
|
+
get size(): number;
|
|
782
|
+
count(item: T): number;
|
|
783
|
+
clear(): void;
|
|
784
|
+
forEach<ThisT>(callbackFn: (this: ThisT, value: T, key: T, set: CountingSet<T>) => unknown, thisArg: ThisT): void;
|
|
785
|
+
toJSON(): unknown;
|
|
786
|
+
}
|
|
787
|
+
//#endregion
|
|
788
|
+
//#region ../../node_modules/metro/src/DeltaBundler/Graph.d.ts
|
|
789
|
+
type Result<T> = {
|
|
790
|
+
added: Map<string, Module<T>>;
|
|
791
|
+
modified: Map<string, Module<T>>;
|
|
792
|
+
deleted: Set<string>;
|
|
793
|
+
};
|
|
794
|
+
type Delta<T> = Readonly<{
|
|
795
|
+
added: Set<string>;
|
|
796
|
+
touched: Set<string>;
|
|
797
|
+
deleted: Set<string>;
|
|
798
|
+
updatedModuleData: ReadonlyMap<string, ModuleData<T>>;
|
|
799
|
+
baseModuleData: Map<string, ModuleData<T>>;
|
|
800
|
+
errors: ReadonlyMap<string, Error>;
|
|
801
|
+
}>;
|
|
802
|
+
type InternalOptions<T> = Readonly<{
|
|
803
|
+
lazy: boolean;
|
|
804
|
+
onDependencyAdd: () => unknown;
|
|
805
|
+
onDependencyAdded: () => unknown;
|
|
806
|
+
resolve: Options$2<T>['resolve'];
|
|
807
|
+
transform: Options$2<T>['transform'];
|
|
808
|
+
shallow: boolean;
|
|
809
|
+
}>;
|
|
810
|
+
declare class Graph<T = MixedOutput> {
|
|
811
|
+
readonly entryPoints: ReadonlySet<string>;
|
|
812
|
+
readonly transformOptions: TransformInputOptions;
|
|
813
|
+
readonly dependencies: Dependencies<T>;
|
|
814
|
+
constructor(options: GraphInputOptions);
|
|
815
|
+
/**
|
|
816
|
+
* Dependency Traversal logic for the Delta Bundler. This method calculates
|
|
817
|
+
* the modules that should be included in the bundle by traversing the
|
|
818
|
+
* dependency graph.
|
|
819
|
+
* Instead of traversing the whole graph each time, it just calculates the
|
|
820
|
+
* difference between runs by only traversing the added/removed dependencies.
|
|
821
|
+
* To do so, it uses the passed graph dependencies and it mutates it.
|
|
822
|
+
* The paths parameter contains the absolute paths of the root files that the
|
|
823
|
+
* method should traverse. Normally, these paths should be the modified files
|
|
824
|
+
* since the last traversal.
|
|
825
|
+
*/
|
|
826
|
+
traverseDependencies(paths: ReadonlyArray<string>, options: Options$2<T>): Promise<Result<T>>;
|
|
827
|
+
initialTraverseDependencies(options: Options$2<T>): Promise<Result<T>>;
|
|
828
|
+
_buildDelta(pathsToVisit: ReadonlySet<string>, options: InternalOptions<T>, moduleFilter?: (path: string) => boolean): Promise<Delta<T>>;
|
|
829
|
+
_recursivelyCommitModule(path: string, delta: Delta<T>, options: InternalOptions<T>, commitOptions?: Readonly<{
|
|
830
|
+
onlyRemove: boolean;
|
|
831
|
+
}>): Module<T>;
|
|
832
|
+
_addDependency(parentModule: Module<T>, key: string, dependency: Dependency, requireContext: null | undefined | RequireContext, delta: Delta<T>, options: InternalOptions<T>): void;
|
|
833
|
+
_removeDependency(parentModule: Module<T>, key: string, dependency: Dependency, delta: Delta<T>, options: InternalOptions<T>): void;
|
|
834
|
+
/**
|
|
835
|
+
* Collect a list of context modules which include a given file.
|
|
836
|
+
*/
|
|
837
|
+
markModifiedContextModules(filePath: string, modifiedPaths: Set<string> | CountingSet<string>): void;
|
|
838
|
+
/**
|
|
839
|
+
* Gets the list of modules affected by the deletion of a given file. The
|
|
840
|
+
* caller is expected to mark these modules as modified in the next call to
|
|
841
|
+
* traverseDependencies. Note that the list may contain duplicates.
|
|
842
|
+
*/
|
|
843
|
+
getModifiedModulesForDeletedPath(filePath: string): Iterable<string>;
|
|
844
|
+
/**
|
|
845
|
+
* Re-traverse the dependency graph in DFS order to reorder the modules and
|
|
846
|
+
* guarantee the same order between runs. This method mutates the passed graph.
|
|
847
|
+
*/
|
|
848
|
+
reorderGraph(options: {
|
|
849
|
+
shallow: boolean;
|
|
850
|
+
}): void;
|
|
851
|
+
_reorderDependencies(module: Module<T>, orderedDependencies: Map<string, Module<T>>, options: {
|
|
852
|
+
shallow: boolean;
|
|
853
|
+
}): void;
|
|
854
|
+
/** Garbage collection functions */
|
|
855
|
+
_incrementImportBundleReference(dependency: ResolvedDependency, parentModule: Module<T>): void;
|
|
856
|
+
_decrementImportBundleReference(dependency: ResolvedDependency, parentModule: Module<T>): void;
|
|
857
|
+
_markModuleInUse(module: Module<T>): void;
|
|
858
|
+
_children(module: Module<T>, options: InternalOptions<T>): Iterator<Module<T>>;
|
|
859
|
+
_moduleSnapshot(module: Module<T>): ModuleData<T>;
|
|
860
|
+
_releaseModule(module: Module<T>, delta: Delta<T>, options: InternalOptions<T>): void;
|
|
861
|
+
_freeModule(module: Module<T>, delta: Delta<T>): void;
|
|
862
|
+
_markAsPossibleCycleRoot(module: Module<T>): void;
|
|
863
|
+
_collectCycles(delta: Delta<T>, options: InternalOptions<T>): void;
|
|
864
|
+
_markGray(module: Module<T>, options: InternalOptions<T>): void;
|
|
865
|
+
_scan(module: Module<T>, options: InternalOptions<T>): void;
|
|
866
|
+
_scanBlack(module: Module<T>, options: InternalOptions<T>): void;
|
|
867
|
+
_collectWhite(module: Module<T>, delta: Delta<T>): void;
|
|
868
|
+
/** End of garbage collection functions */
|
|
869
|
+
}
|
|
870
|
+
//#endregion
|
|
871
|
+
//#region ../../node_modules/metro/src/DeltaBundler/DeltaCalculator.d.ts
|
|
872
|
+
/**
|
|
873
|
+
* This class is in charge of calculating the delta of changed modules that
|
|
874
|
+
* happen between calls. To do so, it subscribes to file changes, so it can
|
|
875
|
+
* traverse the files that have been changed between calls and avoid having to
|
|
876
|
+
* traverse the whole dependency tree for trivial small changes.
|
|
877
|
+
*/
|
|
878
|
+
declare class DeltaCalculator<T> extends EventEmitter {
|
|
879
|
+
_changeEventSource: EventEmitter;
|
|
880
|
+
_options: Options$2<T>;
|
|
881
|
+
_currentBuildPromise: null | undefined | Promise<DeltaResult<T>>;
|
|
882
|
+
_deletedFiles: Set<string>;
|
|
883
|
+
_modifiedFiles: Set<string>;
|
|
884
|
+
_addedFiles: Set<string>;
|
|
885
|
+
_requiresReset: boolean;
|
|
886
|
+
_graph: Graph<T>;
|
|
887
|
+
constructor(entryPoints: ReadonlySet<string>, changeEventSource: EventEmitter, options: Options$2<T>);
|
|
888
|
+
/**
|
|
889
|
+
* Stops listening for file changes and clears all the caches.
|
|
890
|
+
*/
|
|
891
|
+
end(): void;
|
|
892
|
+
/**
|
|
893
|
+
* Main method to calculate the delta of modules. It returns a DeltaResult,
|
|
894
|
+
* which contain the modified/added modules and the removed modules.
|
|
895
|
+
*/
|
|
896
|
+
getDelta($$PARAM_0$$: {
|
|
897
|
+
reset: boolean;
|
|
898
|
+
shallow: boolean;
|
|
899
|
+
}): Promise<DeltaResult<T>>;
|
|
900
|
+
/**
|
|
901
|
+
* Returns the graph with all the dependencies. Each module contains the
|
|
902
|
+
* needed information to do the traversing (dependencies, inverseDependencies)
|
|
903
|
+
* plus some metadata.
|
|
904
|
+
*/
|
|
905
|
+
getGraph(): Graph<T>;
|
|
906
|
+
_handleMultipleFileChanges: (changeEvent: ChangeEvent) => void;
|
|
907
|
+
_getChangedDependencies(modifiedFiles: Set<string>, deletedFiles: Set<string>, addedFiles: Set<string>): Promise<DeltaResult<T>>;
|
|
908
|
+
}
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region ../../node_modules/metro/src/DeltaBundler.d.ts
|
|
911
|
+
/**
|
|
912
|
+
* `DeltaBundler` uses the `DeltaTransformer` to build bundle deltas. This
|
|
913
|
+
* module handles all the transformer instances so it can support multiple
|
|
914
|
+
* concurrent clients requesting their own deltas. This is done through the
|
|
915
|
+
* `clientId` param (which maps a client to a specific delta transformer).
|
|
916
|
+
*/
|
|
917
|
+
declare class DeltaBundler<T = MixedOutput> {
|
|
918
|
+
_changeEventSource: EventEmitter;
|
|
919
|
+
_deltaCalculators: Map<Graph<T>, DeltaCalculator<T>>;
|
|
920
|
+
constructor(changeEventSource: EventEmitter);
|
|
921
|
+
end(): void;
|
|
922
|
+
getDependencies(entryPoints: ReadonlyArray<string>, options: Options$2<T>): Promise<ReadOnlyGraph<T>['dependencies']>;
|
|
923
|
+
buildGraph(entryPoints: ReadonlyArray<string>, options: Options$2<T>): Promise<Graph<T>>;
|
|
924
|
+
getDelta(graph: Graph<T>, $$PARAM_1$$: {
|
|
925
|
+
reset: boolean;
|
|
926
|
+
shallow: boolean;
|
|
927
|
+
}): Promise<DeltaResult<T>>;
|
|
928
|
+
listen(graph: Graph<T>, callback: () => Promise<void>): () => void;
|
|
929
|
+
endGraph(graph: Graph<T>): void;
|
|
930
|
+
}
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region ../../node_modules/metro-transform-worker/src/index.d.ts
|
|
933
|
+
type MinifierConfig = Readonly<{
|
|
934
|
+
[key: string]: unknown;
|
|
935
|
+
}>;
|
|
936
|
+
type Type = 'script' | 'module' | 'asset';
|
|
937
|
+
type JsTransformerConfig = Readonly<{
|
|
938
|
+
assetPlugins: ReadonlyArray<string>;
|
|
939
|
+
assetRegistryPath: string;
|
|
940
|
+
asyncRequireModulePath: string;
|
|
941
|
+
babelTransformerPath: string;
|
|
942
|
+
dynamicDepsInPackages: DynamicRequiresBehavior;
|
|
943
|
+
enableBabelRCLookup: boolean;
|
|
944
|
+
enableBabelRuntime: boolean | string;
|
|
945
|
+
globalPrefix: string;
|
|
946
|
+
hermesParser: boolean;
|
|
947
|
+
minifierConfig: MinifierConfig;
|
|
948
|
+
minifierPath: string;
|
|
949
|
+
optimizationSizeLimit: number;
|
|
950
|
+
publicPath: string;
|
|
951
|
+
allowOptionalDependencies: AllowOptionalDependencies;
|
|
952
|
+
unstable_dependencyMapReservedName: null | undefined | string;
|
|
953
|
+
unstable_disableModuleWrapping: boolean;
|
|
954
|
+
unstable_disableNormalizePseudoGlobals: boolean;
|
|
955
|
+
unstable_compactOutput: boolean; /** Enable `require.context` statements which can be used to import multiple files in a directory. */
|
|
956
|
+
unstable_allowRequireContext: boolean; /** With inlineRequires, enable a module-scope memo var and inline as (v || v=require('foo')) */
|
|
957
|
+
unstable_memoizeInlineRequires?: boolean | undefined; /** With inlineRequires, do not memoize these module specifiers */
|
|
958
|
+
unstable_nonMemoizedInlineRequires?: ReadonlyArray<string> | undefined;
|
|
959
|
+
}>;
|
|
960
|
+
type JsTransformOptions = Readonly<{
|
|
961
|
+
customTransformOptions?: CustomTransformOptions | undefined;
|
|
962
|
+
dev: boolean;
|
|
963
|
+
experimentalImportSupport?: boolean | undefined;
|
|
964
|
+
inlinePlatform: boolean;
|
|
965
|
+
inlineRequires: boolean;
|
|
966
|
+
minify: boolean;
|
|
967
|
+
nonInlinedRequires?: ReadonlyArray<string> | undefined;
|
|
968
|
+
platform: null | undefined | string;
|
|
969
|
+
type: Type;
|
|
970
|
+
unstable_memoizeInlineRequires?: boolean | undefined;
|
|
971
|
+
unstable_nonMemoizedInlineRequires?: ReadonlyArray<string> | undefined;
|
|
972
|
+
unstable_staticHermesOptimizedRequire?: boolean | undefined;
|
|
973
|
+
unstable_transformProfile: TransformProfile;
|
|
974
|
+
}>;
|
|
975
|
+
//#endregion
|
|
976
|
+
//#region ../../node_modules/metro/src/shared/types.d.ts
|
|
977
|
+
type MetroSourceMapOrMappings = MixedSourceMap | Array<MetroSourceMapSegmentTuple>;
|
|
978
|
+
declare enum SourcePathsMode {
|
|
979
|
+
Absolute = 'absolute',
|
|
980
|
+
ServerUrl = 'url-server'
|
|
981
|
+
}
|
|
982
|
+
declare namespace SourcePathsMode {
|
|
983
|
+
export function cast(value: string | null | undefined): SourcePathsMode;
|
|
984
|
+
export function isValid(value: string | null | undefined): value is SourcePathsMode;
|
|
985
|
+
export function members(): IterableIterator<SourcePathsMode>;
|
|
986
|
+
export function getName(value: SourcePathsMode): string;
|
|
987
|
+
}
|
|
988
|
+
type ReadonlySourceLocation = Readonly<{
|
|
989
|
+
start: Readonly<{
|
|
990
|
+
line: number;
|
|
991
|
+
column: number;
|
|
992
|
+
}>;
|
|
993
|
+
end: Readonly<{
|
|
994
|
+
line: number;
|
|
995
|
+
column: number;
|
|
996
|
+
}>;
|
|
997
|
+
}>;
|
|
998
|
+
type BundleOptions = {
|
|
999
|
+
readonly customResolverOptions: CustomResolverOptions;
|
|
1000
|
+
customTransformOptions: CustomTransformOptions;
|
|
1001
|
+
dev: boolean;
|
|
1002
|
+
entryFile: string;
|
|
1003
|
+
readonly excludeSource: boolean;
|
|
1004
|
+
readonly inlineSourceMap: boolean;
|
|
1005
|
+
readonly lazy: boolean;
|
|
1006
|
+
minify: boolean;
|
|
1007
|
+
readonly modulesOnly: boolean;
|
|
1008
|
+
onProgress: null | undefined | ((doneCont: number, totalCount: number) => unknown);
|
|
1009
|
+
readonly platform: null | undefined | string;
|
|
1010
|
+
readonly runModule: boolean;
|
|
1011
|
+
readonly shallow: boolean;
|
|
1012
|
+
sourceMapUrl: null | undefined | string;
|
|
1013
|
+
sourceUrl: null | undefined | string;
|
|
1014
|
+
createModuleIdFactory?: (() => (path: string) => number) | undefined;
|
|
1015
|
+
readonly unstable_transformProfile: TransformProfile;
|
|
1016
|
+
readonly sourcePaths: SourcePathsMode;
|
|
1017
|
+
};
|
|
1018
|
+
type BuildOptions = Readonly<{
|
|
1019
|
+
withAssets?: boolean | undefined;
|
|
1020
|
+
}>;
|
|
1021
|
+
type ResolverInputOptions = Readonly<{
|
|
1022
|
+
customResolverOptions?: CustomResolverOptions | undefined;
|
|
1023
|
+
dev: boolean;
|
|
1024
|
+
}>;
|
|
1025
|
+
type SerializerOptions$1 = {
|
|
1026
|
+
readonly sourceMapUrl: null | undefined | string;
|
|
1027
|
+
readonly sourceUrl: null | undefined | string;
|
|
1028
|
+
readonly runModule: boolean;
|
|
1029
|
+
readonly excludeSource: boolean;
|
|
1030
|
+
readonly inlineSourceMap: boolean;
|
|
1031
|
+
readonly modulesOnly: boolean;
|
|
1032
|
+
readonly sourcePaths: SourcePathsMode;
|
|
1033
|
+
};
|
|
1034
|
+
type GraphOptions = {
|
|
1035
|
+
readonly lazy: boolean;
|
|
1036
|
+
readonly shallow: boolean;
|
|
1037
|
+
};
|
|
1038
|
+
type SplitBundleOptions = Readonly<{
|
|
1039
|
+
entryFile: string;
|
|
1040
|
+
resolverOptions: ResolverInputOptions;
|
|
1041
|
+
transformOptions: TransformInputOptions;
|
|
1042
|
+
serializerOptions: SerializerOptions$1;
|
|
1043
|
+
graphOptions: GraphOptions;
|
|
1044
|
+
onProgress: Options$2['onProgress'];
|
|
1045
|
+
}>;
|
|
1046
|
+
type ModuleTransportLike = {
|
|
1047
|
+
readonly code: string;
|
|
1048
|
+
readonly id: number;
|
|
1049
|
+
readonly map: null | undefined | MetroSourceMapOrMappings;
|
|
1050
|
+
readonly name?: string | undefined;
|
|
1051
|
+
readonly sourcePath: string;
|
|
1052
|
+
};
|
|
1053
|
+
//#endregion
|
|
1054
|
+
//#region ../../node_modules/metro/src/ModuleGraph/worker/collectDependencies.d.ts
|
|
1055
|
+
type ContextMode = 'sync' | 'eager' | 'lazy' | 'lazy-once';
|
|
1056
|
+
type ContextFilter = Readonly<{
|
|
1057
|
+
pattern: string;
|
|
1058
|
+
flags: string;
|
|
1059
|
+
}>;
|
|
1060
|
+
type RequireContextParams = Readonly<{
|
|
1061
|
+
recursive: boolean;
|
|
1062
|
+
filter: Readonly<ContextFilter>; /** Mode for resolving dynamic dependencies. Defaults to `sync` */
|
|
1063
|
+
mode: ContextMode;
|
|
1064
|
+
}>;
|
|
1065
|
+
type DynamicRequiresBehavior = 'throwAtRuntime' | 'reject';
|
|
1066
|
+
//#endregion
|
|
1067
|
+
//#region ../../node_modules/metro/src/lib/contextModule.d.ts
|
|
1068
|
+
type RequireContext = Readonly<{
|
|
1069
|
+
recursive: boolean;
|
|
1070
|
+
filter: RegExp; /** Mode for resolving dynamic dependencies. Defaults to `sync` */
|
|
1071
|
+
mode: ContextMode; /** Absolute path of the directory to search in */
|
|
1072
|
+
from: string;
|
|
1073
|
+
}>;
|
|
1074
|
+
//#endregion
|
|
1075
|
+
//#region ../../node_modules/metro/src/DeltaBundler/types.d.ts
|
|
1076
|
+
type ReadonlyJsonData = null | boolean | number | string | ReadonlyArray<null | undefined | ReadonlyJsonData> | Readonly<{
|
|
1077
|
+
[$$Key$$: string]: null | undefined | ReadonlyJsonData;
|
|
1078
|
+
}>;
|
|
1079
|
+
type MixedOutput = {
|
|
1080
|
+
readonly data: unknown;
|
|
1081
|
+
readonly type: string;
|
|
1082
|
+
};
|
|
1083
|
+
type AsyncDependencyType = 'async' | 'maybeSync' | 'prefetch' | 'weak';
|
|
1084
|
+
type TransformResultDependency = Readonly<{
|
|
1085
|
+
/**
|
|
1086
|
+
* The literal name provided to a require or import call. For example 'foo' in
|
|
1087
|
+
* case of `require('foo')`.
|
|
1088
|
+
*/
|
|
1089
|
+
name: string;
|
|
1090
|
+
/**
|
|
1091
|
+
* Extra data returned by the dependency extractor.
|
|
1092
|
+
*/
|
|
1093
|
+
data: Readonly<{
|
|
1094
|
+
/**
|
|
1095
|
+
* A locally unique key for this dependency within the current module.
|
|
1096
|
+
*/
|
|
1097
|
+
key: string;
|
|
1098
|
+
/**
|
|
1099
|
+
* If not null, this dependency is due to a dynamic `import()` or `__prefetchImport()` call.
|
|
1100
|
+
*/
|
|
1101
|
+
asyncType: AsyncDependencyType | null;
|
|
1102
|
+
/**
|
|
1103
|
+
* True if the dependency is declared with a static "import x from 'y'" or
|
|
1104
|
+
* an import() call.
|
|
1105
|
+
*/
|
|
1106
|
+
isESMImport: boolean;
|
|
1107
|
+
/**
|
|
1108
|
+
* The dependency is enclosed in a try/catch block.
|
|
1109
|
+
*/
|
|
1110
|
+
isOptional?: boolean | undefined;
|
|
1111
|
+
locs: ReadonlyArray<ReadonlySourceLocation>; /** Context for requiring a collection of modules. */
|
|
1112
|
+
contextParams?: RequireContextParams | undefined;
|
|
1113
|
+
}>;
|
|
1114
|
+
}>;
|
|
1115
|
+
type ResolvedDependency = Readonly<{
|
|
1116
|
+
absolutePath: string;
|
|
1117
|
+
data: TransformResultDependency;
|
|
1118
|
+
}>;
|
|
1119
|
+
type Dependency = ResolvedDependency | Readonly<{
|
|
1120
|
+
data: TransformResultDependency;
|
|
1121
|
+
}>;
|
|
1122
|
+
type Module<T = MixedOutput> = Readonly<{
|
|
1123
|
+
dependencies: Map<string, Dependency>;
|
|
1124
|
+
inverseDependencies: CountingSet<string>;
|
|
1125
|
+
output: ReadonlyArray<T>;
|
|
1126
|
+
path: string;
|
|
1127
|
+
getSource: () => Buffer;
|
|
1128
|
+
unstable_transformResultKey?: null | undefined | string;
|
|
1129
|
+
}>;
|
|
1130
|
+
type ModuleData<T = MixedOutput> = Readonly<{
|
|
1131
|
+
dependencies: ReadonlyMap<string, Dependency>;
|
|
1132
|
+
resolvedContexts: ReadonlyMap<string, RequireContext>;
|
|
1133
|
+
output: ReadonlyArray<T>;
|
|
1134
|
+
getSource: () => Buffer;
|
|
1135
|
+
unstable_transformResultKey?: null | undefined | string;
|
|
1136
|
+
}>;
|
|
1137
|
+
type Dependencies<T = MixedOutput> = Map<string, Module<T>>;
|
|
1138
|
+
type ReadOnlyDependencies<T = MixedOutput> = ReadonlyMap<string, Module<T>>;
|
|
1139
|
+
type TransformInputOptions = Omit<JsTransformOptions, 'inlinePlatform' | 'inlineRequires'>;
|
|
1140
|
+
type GraphInputOptions = Readonly<{
|
|
1141
|
+
entryPoints: ReadonlySet<string>;
|
|
1142
|
+
transformOptions: TransformInputOptions;
|
|
1143
|
+
}>;
|
|
1144
|
+
interface ReadOnlyGraph<T = MixedOutput> {
|
|
1145
|
+
readonly entryPoints: ReadonlySet<string>;
|
|
1146
|
+
readonly transformOptions: Readonly<TransformInputOptions>;
|
|
1147
|
+
readonly dependencies: ReadOnlyDependencies<T>;
|
|
1148
|
+
}
|
|
1149
|
+
type TransformResult<T = MixedOutput> = Readonly<{
|
|
1150
|
+
dependencies: ReadonlyArray<TransformResultDependency>;
|
|
1151
|
+
output: ReadonlyArray<T>;
|
|
1152
|
+
unstable_transformResultKey?: null | undefined | string;
|
|
1153
|
+
}>;
|
|
1154
|
+
type TransformResultWithSource<T = MixedOutput> = Readonly<Omit<TransformResult<T>, 'getSource'> & {
|
|
1155
|
+
getSource: () => Buffer;
|
|
1156
|
+
}>;
|
|
1157
|
+
type TransformFn<T = MixedOutput> = ($$PARAM_0$$: string, $$PARAM_1$$: null | undefined | RequireContext) => Promise<TransformResultWithSource<T>>;
|
|
1158
|
+
type ResolveFn = (from: string, dependency: TransformResultDependency) => BundlerResolution;
|
|
1159
|
+
type AllowOptionalDependenciesWithOptions = {
|
|
1160
|
+
readonly exclude: Array<string>;
|
|
1161
|
+
};
|
|
1162
|
+
type AllowOptionalDependencies = boolean | AllowOptionalDependenciesWithOptions;
|
|
1163
|
+
type BundlerResolution = Readonly<{
|
|
1164
|
+
type: 'sourceFile';
|
|
1165
|
+
filePath: string;
|
|
1166
|
+
}>;
|
|
1167
|
+
type Options$2<T = MixedOutput> = Readonly<{
|
|
1168
|
+
resolve: ResolveFn;
|
|
1169
|
+
transform: TransformFn<T>;
|
|
1170
|
+
transformOptions: TransformInputOptions;
|
|
1171
|
+
onProgress: null | undefined | ((numProcessed: number, total: number) => unknown);
|
|
1172
|
+
lazy: boolean;
|
|
1173
|
+
unstable_allowRequireContext: boolean;
|
|
1174
|
+
unstable_enablePackageExports: boolean;
|
|
1175
|
+
unstable_incrementalResolution: boolean;
|
|
1176
|
+
shallow: boolean;
|
|
1177
|
+
}>;
|
|
1178
|
+
type DeltaResult<T = MixedOutput> = {
|
|
1179
|
+
readonly added: Map<string, Module<T>>;
|
|
1180
|
+
readonly modified: Map<string, Module<T>>;
|
|
1181
|
+
readonly deleted: Set<string>;
|
|
1182
|
+
readonly reset: boolean;
|
|
1183
|
+
};
|
|
1184
|
+
type SerializerOptions = Readonly<{
|
|
1185
|
+
asyncRequireModulePath: string;
|
|
1186
|
+
createModuleId: (absolutePath: string) => number;
|
|
1187
|
+
dependencyMapReservedName?: null | undefined | string;
|
|
1188
|
+
dev: boolean;
|
|
1189
|
+
getRunModuleStatement: (moduleId: number | string, globalPrefix: string) => string;
|
|
1190
|
+
globalPrefix: string;
|
|
1191
|
+
includeAsyncPaths: boolean;
|
|
1192
|
+
inlineSourceMap?: null | undefined | boolean;
|
|
1193
|
+
modulesOnly: boolean;
|
|
1194
|
+
processModuleFilter: (module: Module) => boolean;
|
|
1195
|
+
projectRoot: string;
|
|
1196
|
+
runBeforeMainModule: ReadonlyArray<string>;
|
|
1197
|
+
runModule: boolean;
|
|
1198
|
+
serverRoot: string;
|
|
1199
|
+
shouldAddToIgnoreList: (module: Module) => boolean;
|
|
1200
|
+
sourceMapUrl?: null | undefined | string;
|
|
1201
|
+
sourceUrl?: null | undefined | string;
|
|
1202
|
+
getSourceUrl?: null | undefined | ((module: Module) => string);
|
|
1203
|
+
unstable_inlineDependencyMap?: boolean | undefined;
|
|
1204
|
+
unstable_getAsyncDependencyPath?: ((dependency: ResolvedDependency, options: unknown) => null | undefined | ReadonlyJsonData) | undefined;
|
|
1205
|
+
}>;
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region ../../node_modules/metro-resolver/src/types.d.ts
|
|
1208
|
+
type Resolution = FileResolution | VirtualResolution | {
|
|
1209
|
+
readonly type: 'empty';
|
|
1210
|
+
};
|
|
1211
|
+
type SourceFileResolution = Readonly<{
|
|
1212
|
+
type: 'sourceFile';
|
|
1213
|
+
filePath: string;
|
|
1214
|
+
}>;
|
|
1215
|
+
type AssetFileResolution = ReadonlyArray<string>;
|
|
1216
|
+
type AssetResolution = Readonly<{
|
|
1217
|
+
type: 'assetFiles';
|
|
1218
|
+
filePaths: AssetFileResolution;
|
|
1219
|
+
}>;
|
|
1220
|
+
type FileResolution = AssetResolution | SourceFileResolution;
|
|
1221
|
+
/**
|
|
1222
|
+
* A JS module whose contents are provided out-of-band rather than read from a file
|
|
1223
|
+
* on disk.
|
|
1224
|
+
*
|
|
1225
|
+
* NOTE: Resolving to a virtual module is not yet implemented. This is a reservation.
|
|
1226
|
+
*/
|
|
1227
|
+
type VirtualResolution = Readonly<{
|
|
1228
|
+
type: 'virtualModule';
|
|
1229
|
+
}>;
|
|
1230
|
+
/**
|
|
1231
|
+
* This is a way to describe what files we tried to look for when resolving
|
|
1232
|
+
* a module name as file. This is mainly used for error reporting, so that
|
|
1233
|
+
* we can explain why we cannot resolve a module.
|
|
1234
|
+
*/
|
|
1235
|
+
type FileCandidates = {
|
|
1236
|
+
readonly type: 'asset';
|
|
1237
|
+
readonly name: string;
|
|
1238
|
+
} | {
|
|
1239
|
+
readonly type: 'sourceFile';
|
|
1240
|
+
filePathPrefix: string;
|
|
1241
|
+
readonly candidateExts: ReadonlyArray<string>;
|
|
1242
|
+
};
|
|
1243
|
+
type ExportsLikeMap = Readonly<{
|
|
1244
|
+
[subpathOrCondition: string]: string | ExportsLikeMap | null;
|
|
1245
|
+
}>;
|
|
1246
|
+
/** "exports" mapping where values may be legacy Node.js <13.7 array format. */
|
|
1247
|
+
type ExportMapWithFallbacks = Readonly<{
|
|
1248
|
+
[subpath: string]: ExportsLikeMap[keyof ExportsLikeMap] | ExportValueWithFallback;
|
|
1249
|
+
}>;
|
|
1250
|
+
/** "exports" subpath value when in legacy Node.js <13.7 array format. */
|
|
1251
|
+
type ExportValueWithFallback = ReadonlyArray<ExportsLikeMap | string> | ReadonlyArray<ReadonlyArray<unknown>>;
|
|
1252
|
+
type ExportsField = string | ReadonlyArray<string> | ExportValueWithFallback | ExportsLikeMap | ExportMapWithFallbacks;
|
|
1253
|
+
type PackageJson$1 = Readonly<{
|
|
1254
|
+
name?: string | undefined;
|
|
1255
|
+
main?: string | undefined;
|
|
1256
|
+
exports?: ExportsField | undefined;
|
|
1257
|
+
imports?: ExportsLikeMap | undefined;
|
|
1258
|
+
}>;
|
|
1259
|
+
type PackageInfo = Readonly<{
|
|
1260
|
+
packageJson: PackageJson$1;
|
|
1261
|
+
rootPath: string;
|
|
1262
|
+
}>;
|
|
1263
|
+
type PackageForModule = Readonly<Omit<PackageInfo, 'packageRelativePath'> & {
|
|
1264
|
+
packageRelativePath: string;
|
|
1265
|
+
}>;
|
|
1266
|
+
/**
|
|
1267
|
+
* Check existence of a single file.
|
|
1268
|
+
*/
|
|
1269
|
+
type DoesFileExist = (filePath: string) => boolean;
|
|
1270
|
+
/**
|
|
1271
|
+
* Performs a lookup against an absolute or project-relative path to determine
|
|
1272
|
+
* whether it exists as a file or directory. Follows any symlinks, and returns
|
|
1273
|
+
* a real absolute path on existence.
|
|
1274
|
+
*/
|
|
1275
|
+
type FileSystemLookup = (absoluteOrProjectRelativePath: string) => {
|
|
1276
|
+
exists: false;
|
|
1277
|
+
} | {
|
|
1278
|
+
exists: true;
|
|
1279
|
+
type: 'f' | 'd';
|
|
1280
|
+
realPath: string;
|
|
1281
|
+
};
|
|
1282
|
+
/**
|
|
1283
|
+
* Given a directory path and the base asset name, return a list of all the
|
|
1284
|
+
* asset file names that match the given base name in that directory. Return
|
|
1285
|
+
* null if there's no such named asset. `platform` is used to identify
|
|
1286
|
+
* platform-specific assets, ex. `foo.ios.js` instead of a generic `foo.js`.
|
|
1287
|
+
*/
|
|
1288
|
+
type ResolveAsset = (dirPath: string, assetName: string, extension: string) => null | undefined | ReadonlyArray<string>;
|
|
1289
|
+
type ResolutionContext = Readonly<{
|
|
1290
|
+
allowHaste: boolean;
|
|
1291
|
+
assetExts: ReadonlySet<string>;
|
|
1292
|
+
customResolverOptions: CustomResolverOptions;
|
|
1293
|
+
disableHierarchicalLookup: boolean;
|
|
1294
|
+
/**
|
|
1295
|
+
* Determine whether a regular file exists at the given path.
|
|
1296
|
+
*
|
|
1297
|
+
* @deprecated, prefer `fileSystemLookup`
|
|
1298
|
+
*/
|
|
1299
|
+
doesFileExist: DoesFileExist;
|
|
1300
|
+
extraNodeModules: null | undefined | {
|
|
1301
|
+
[packageName: string]: string;
|
|
1302
|
+
}; /** Is resolving for a development bundle. */
|
|
1303
|
+
dev: boolean;
|
|
1304
|
+
/**
|
|
1305
|
+
* Get the parsed contents of the specified `package.json` file.
|
|
1306
|
+
*/
|
|
1307
|
+
getPackage: (packageJsonPath: string) => null | undefined | PackageJson$1;
|
|
1308
|
+
/**
|
|
1309
|
+
* Get the closest package scope, parsed `package.json` and relative subpath
|
|
1310
|
+
* for a given absolute candidate path (which need not exist), or null if
|
|
1311
|
+
* there is no package.json closer than the nearest node_modules directory.
|
|
1312
|
+
*
|
|
1313
|
+
* @deprecated See https://github.com/react/metro/commit/29c77bff31e2475a086bc3f04073f485da8f9ff0
|
|
1314
|
+
*/
|
|
1315
|
+
getPackageForModule: (absoluteModulePath: string) => null | undefined | PackageForModule;
|
|
1316
|
+
/**
|
|
1317
|
+
* The dependency descriptor, within the origin module, corresponding to the
|
|
1318
|
+
* current resolution request. This is provided for diagnostic purposes ONLY
|
|
1319
|
+
* and may not be used for resolution purposes.
|
|
1320
|
+
*/
|
|
1321
|
+
dependency?: TransformResultDependency | undefined;
|
|
1322
|
+
/**
|
|
1323
|
+
* Whether the dependency to be resolved was declared with an ESM import,
|
|
1324
|
+
* ("import x from 'y'" or "await import('z')"), or a CommonJS "require".
|
|
1325
|
+
* Corresponds to the criteria Node.js uses to assert an "import"
|
|
1326
|
+
* resolution condition, vs "require".
|
|
1327
|
+
*
|
|
1328
|
+
* Always equal to dependency.data.isESMImport where dependency is provided,
|
|
1329
|
+
* but may be used for resolution.
|
|
1330
|
+
*/
|
|
1331
|
+
isESMImport?: boolean | undefined;
|
|
1332
|
+
/**
|
|
1333
|
+
* Synchonously returns information about a given absolute path, including
|
|
1334
|
+
* whether it exists, whether it is a file or directory, and its absolute
|
|
1335
|
+
* real path.
|
|
1336
|
+
*/
|
|
1337
|
+
fileSystemLookup: FileSystemLookup;
|
|
1338
|
+
/**
|
|
1339
|
+
* The ordered list of fields to read in `package.json` to resolve a main
|
|
1340
|
+
* entry point based on the "browser" field spec.
|
|
1341
|
+
*/
|
|
1342
|
+
mainFields: ReadonlyArray<string>;
|
|
1343
|
+
/**
|
|
1344
|
+
* Full path of the module that is requiring or importing the module to be
|
|
1345
|
+
* resolved. This may not be the only place this dependency was found,
|
|
1346
|
+
* as resolutions can be cached.
|
|
1347
|
+
*/
|
|
1348
|
+
originModulePath: string;
|
|
1349
|
+
nodeModulesPaths: ReadonlyArray<string>;
|
|
1350
|
+
preferNativePlatform: boolean;
|
|
1351
|
+
resolveAsset: ResolveAsset;
|
|
1352
|
+
redirectModulePath: (modulePath: string) => string | false;
|
|
1353
|
+
/**
|
|
1354
|
+
* Given a name, this should return the full path to the file that provides
|
|
1355
|
+
* a Haste module of that name. Ex. for `Foo` it may return `/smth/Foo.js`.
|
|
1356
|
+
*/
|
|
1357
|
+
resolveHasteModule: (name: string) => null | undefined | string;
|
|
1358
|
+
/**
|
|
1359
|
+
* Given a name, this should return the full path to the package manifest that
|
|
1360
|
+
* provides a Haste package of that name. Ex. for `Foo` it may return
|
|
1361
|
+
* `/smth/Foo/package.json`.
|
|
1362
|
+
*/
|
|
1363
|
+
resolveHastePackage: (name: string) => null | undefined | string;
|
|
1364
|
+
resolveRequest?: null | undefined | CustomResolver;
|
|
1365
|
+
/**
|
|
1366
|
+
* Resolvers for specifiers prefixed with a URI scheme, keyed by the
|
|
1367
|
+
* lowercased scheme (the part before the first ':', without the colon). The
|
|
1368
|
+
* scheme parsed from a specifier is lowercased before lookup, so keys must be
|
|
1369
|
+
* lowercase (both `Foo:` and `foo:` match the `'foo'` key). When a
|
|
1370
|
+
* specifier's scheme matches a key, the corresponding resolver is invoked
|
|
1371
|
+
* instead of the default algorithm, receiving the full specifier and a
|
|
1372
|
+
* context whose `resolveRequest` delegates to default resolution.
|
|
1373
|
+
*/
|
|
1374
|
+
schemeResolvers?: Readonly<{
|
|
1375
|
+
[scheme: string]: CustomResolver;
|
|
1376
|
+
}> | undefined;
|
|
1377
|
+
sourceExts: ReadonlyArray<string>;
|
|
1378
|
+
unstable_conditionNames: ReadonlyArray<string>;
|
|
1379
|
+
unstable_conditionsByPlatform: Readonly<{
|
|
1380
|
+
[platform: string]: ReadonlyArray<string>;
|
|
1381
|
+
}>;
|
|
1382
|
+
unstable_enablePackageExports: boolean;
|
|
1383
|
+
unstable_incrementalResolution: boolean;
|
|
1384
|
+
unstable_logWarning: (message: string) => void;
|
|
1385
|
+
}>;
|
|
1386
|
+
type CustomResolutionContext = Readonly<Omit<ResolutionContext, 'resolveRequest'> & {
|
|
1387
|
+
resolveRequest: CustomResolver;
|
|
1388
|
+
}>;
|
|
1389
|
+
type CustomResolver = (context: CustomResolutionContext, moduleName: string, platform: string | null) => Resolution;
|
|
1390
|
+
type CustomResolverOptions = {
|
|
1391
|
+
readonly [key: string]: unknown;
|
|
1392
|
+
};
|
|
1393
|
+
declare namespace Logger_d_exports {
|
|
1394
|
+
export { ActionLogEntryData, ActionStartLogEntry, LogEntry, createActionEndEntry, createActionStartEntry, createEntry, log, on };
|
|
1395
|
+
}
|
|
1396
|
+
type ActionLogEntryData = {
|
|
1397
|
+
action_name: string;
|
|
1398
|
+
log_entry_label?: string | undefined;
|
|
1399
|
+
};
|
|
1400
|
+
type ActionStartLogEntry = {
|
|
1401
|
+
action_name?: string | undefined;
|
|
1402
|
+
action_phase?: string | undefined;
|
|
1403
|
+
log_entry_label: string;
|
|
1404
|
+
log_session?: string | undefined;
|
|
1405
|
+
start_timestamp?: [number, number] | undefined;
|
|
1406
|
+
};
|
|
1407
|
+
type LogEntry = {
|
|
1408
|
+
action_name?: string | undefined;
|
|
1409
|
+
action_phase?: string | undefined;
|
|
1410
|
+
action_result?: string | undefined;
|
|
1411
|
+
duration_ms?: number | undefined;
|
|
1412
|
+
entry_point?: string | undefined;
|
|
1413
|
+
file_name?: string | undefined;
|
|
1414
|
+
log_entry_label: string;
|
|
1415
|
+
log_session?: string | undefined;
|
|
1416
|
+
start_timestamp?: [number, number] | undefined;
|
|
1417
|
+
outdated_modules?: number | undefined;
|
|
1418
|
+
bundle_size?: number | undefined;
|
|
1419
|
+
bundle_options?: BundleOptions | undefined;
|
|
1420
|
+
bundle_hash?: string | undefined;
|
|
1421
|
+
build_id?: string | undefined;
|
|
1422
|
+
error_message?: string | undefined;
|
|
1423
|
+
error_stack?: string | undefined;
|
|
1424
|
+
};
|
|
1425
|
+
declare function on(event: string, handler: (logEntry: LogEntry) => void): void;
|
|
1426
|
+
declare function createEntry(data: LogEntry | string): LogEntry;
|
|
1427
|
+
declare function createActionStartEntry(data: ActionLogEntryData | string): LogEntry;
|
|
1428
|
+
declare function createActionEndEntry(logEntry: ActionStartLogEntry, error?: null | undefined | Error): LogEntry;
|
|
1429
|
+
declare function log(logEntry: LogEntry): LogEntry;
|
|
1430
|
+
//#endregion
|
|
1431
|
+
//#region ../../node_modules/metro/src/lib/reporting.d.ts
|
|
1432
|
+
type BundleDetails = {
|
|
1433
|
+
bundleType: string;
|
|
1434
|
+
customResolverOptions: CustomResolverOptions;
|
|
1435
|
+
customTransformOptions: CustomTransformOptions;
|
|
1436
|
+
dev: boolean;
|
|
1437
|
+
entryFile: string;
|
|
1438
|
+
minify: boolean;
|
|
1439
|
+
platform: null | undefined | string;
|
|
1440
|
+
};
|
|
1441
|
+
/**
|
|
1442
|
+
* A tagged union of all the actions that may happen and we may want to
|
|
1443
|
+
* report to the tool user.
|
|
1444
|
+
*/
|
|
1445
|
+
type ReportableEvent = {
|
|
1446
|
+
port: number;
|
|
1447
|
+
hasReducedPerformance: boolean;
|
|
1448
|
+
type: 'initialize_started';
|
|
1449
|
+
} | {
|
|
1450
|
+
type: 'initialize_failed';
|
|
1451
|
+
port: number;
|
|
1452
|
+
error: Error;
|
|
1453
|
+
} | {
|
|
1454
|
+
type: 'initialize_done';
|
|
1455
|
+
port: number;
|
|
1456
|
+
} | {
|
|
1457
|
+
buildID: string;
|
|
1458
|
+
type: 'bundle_build_done';
|
|
1459
|
+
} | {
|
|
1460
|
+
buildID: string;
|
|
1461
|
+
type: 'bundle_build_failed';
|
|
1462
|
+
} | {
|
|
1463
|
+
type: 'bundle_save_log';
|
|
1464
|
+
message: string;
|
|
1465
|
+
} | {
|
|
1466
|
+
buildID: string;
|
|
1467
|
+
bundleDetails: BundleDetails;
|
|
1468
|
+
isPrefetch?: boolean | undefined;
|
|
1469
|
+
type: 'bundle_build_started';
|
|
1470
|
+
} | {
|
|
1471
|
+
error: Error;
|
|
1472
|
+
type: 'bundling_error';
|
|
1473
|
+
} | {
|
|
1474
|
+
type: 'dep_graph_loading';
|
|
1475
|
+
hasReducedPerformance: boolean;
|
|
1476
|
+
} | {
|
|
1477
|
+
type: 'dep_graph_loaded';
|
|
1478
|
+
} | {
|
|
1479
|
+
buildID: string;
|
|
1480
|
+
type: 'bundle_transform_progressed';
|
|
1481
|
+
transformedFileCount: number;
|
|
1482
|
+
totalFileCount: number;
|
|
1483
|
+
} | {
|
|
1484
|
+
type: 'cache_read_error';
|
|
1485
|
+
error: Error;
|
|
1486
|
+
} | {
|
|
1487
|
+
type: 'cache_write_error';
|
|
1488
|
+
error: Error;
|
|
1489
|
+
} | {
|
|
1490
|
+
type: 'transform_cache_reset';
|
|
1491
|
+
} | {
|
|
1492
|
+
type: 'worker_stdout_chunk';
|
|
1493
|
+
chunk: string;
|
|
1494
|
+
} | {
|
|
1495
|
+
type: 'worker_stderr_chunk';
|
|
1496
|
+
chunk: string;
|
|
1497
|
+
} | {
|
|
1498
|
+
type: 'hmr_client_error';
|
|
1499
|
+
error: Error;
|
|
1500
|
+
} | {
|
|
1501
|
+
type: 'client_log';
|
|
1502
|
+
level: 'trace' | 'info' | 'warn' | 'log' | 'group' | 'groupCollapsed' | 'groupEnd' | 'debug';
|
|
1503
|
+
data: Array<unknown>;
|
|
1504
|
+
} | {
|
|
1505
|
+
type: 'resolver_warning';
|
|
1506
|
+
message: string;
|
|
1507
|
+
} | {
|
|
1508
|
+
type: 'server_listening';
|
|
1509
|
+
port: number;
|
|
1510
|
+
address: string;
|
|
1511
|
+
family: string;
|
|
1512
|
+
} | {
|
|
1513
|
+
type: 'transformer_load_started';
|
|
1514
|
+
} | {
|
|
1515
|
+
type: 'transformer_load_done';
|
|
1516
|
+
} | {
|
|
1517
|
+
type: 'transformer_load_failed';
|
|
1518
|
+
error: Error;
|
|
1519
|
+
} | {
|
|
1520
|
+
type: 'watcher_health_check_result';
|
|
1521
|
+
result: HealthCheckResult;
|
|
1522
|
+
} | {
|
|
1523
|
+
type: 'watcher_status';
|
|
1524
|
+
status: WatcherStatus;
|
|
1525
|
+
};
|
|
1526
|
+
/**
|
|
1527
|
+
* Code across the application takes a reporter as an option and calls the
|
|
1528
|
+
* update whenever one of the ReportableEvent happens. Code does not directly
|
|
1529
|
+
* write to the standard output, because a build would be:
|
|
1530
|
+
*
|
|
1531
|
+
* 1. ad-hoc, embedded into another tool, in which case we do not want to
|
|
1532
|
+
* pollute that tool's own output. The tool is free to present the
|
|
1533
|
+
* warnings/progress we generate any way they want, by specifing a custom
|
|
1534
|
+
* reporter.
|
|
1535
|
+
* 2. run as a background process from another tool, in which case we want
|
|
1536
|
+
* to expose updates in a way that is easily machine-readable, for example
|
|
1537
|
+
* a JSON-stream. We don't want to pollute it with textual messages.
|
|
1538
|
+
*
|
|
1539
|
+
* We centralize terminal reporting into a single place because we want the
|
|
1540
|
+
* output to be robust and consistent. The most common reporter is
|
|
1541
|
+
* TerminalReporter, that should be the only place in the application should
|
|
1542
|
+
* access the `terminal` module (nor the `console`).
|
|
1543
|
+
*/
|
|
1544
|
+
type Reporter = {
|
|
1545
|
+
update(event: ReportableEvent): void;
|
|
1546
|
+
};
|
|
1547
|
+
//#endregion
|
|
1548
|
+
//#region ../../node_modules/metro/src/Assets.d.ts
|
|
1549
|
+
type AssetDataWithoutFiles = {
|
|
1550
|
+
readonly __packager_asset: boolean;
|
|
1551
|
+
readonly fileSystemLocation: string;
|
|
1552
|
+
readonly hash: string;
|
|
1553
|
+
readonly height: null | undefined | number;
|
|
1554
|
+
readonly httpServerLocation: string;
|
|
1555
|
+
readonly name: string;
|
|
1556
|
+
readonly scales: Array<number>;
|
|
1557
|
+
readonly type: string;
|
|
1558
|
+
readonly width: null | undefined | number;
|
|
1559
|
+
};
|
|
1560
|
+
type AssetData = AssetDataWithoutFiles & {
|
|
1561
|
+
readonly files: Array<string>;
|
|
1562
|
+
};
|
|
1563
|
+
//#endregion
|
|
1564
|
+
//#region ../../node_modules/metro/src/DeltaBundler/Serializers/getExplodedSourceMap.d.ts
|
|
1565
|
+
type ExplodedSourceMap = ReadonlyArray<{
|
|
1566
|
+
readonly map: Array<MetroSourceMapSegmentTuple> | VlqMap;
|
|
1567
|
+
readonly firstLine1Based: number;
|
|
1568
|
+
readonly functionMap: null | undefined | FBSourceFunctionMap;
|
|
1569
|
+
readonly path: string;
|
|
1570
|
+
}>;
|
|
1571
|
+
//#endregion
|
|
1572
|
+
//#region ../../node_modules/metro/src/DeltaBundler/Serializers/getRamBundleInfo.d.ts
|
|
1573
|
+
type RamBundleInfo = {
|
|
1574
|
+
getDependencies: ($$PARAM_0$$: string) => Set<string>;
|
|
1575
|
+
startupModules: ReadonlyArray<ModuleTransportLike>;
|
|
1576
|
+
lazyModules: ReadonlyArray<ModuleTransportLike>;
|
|
1577
|
+
groups: Map<number, Set<number>>;
|
|
1578
|
+
};
|
|
1579
|
+
//#endregion
|
|
1580
|
+
//#region ../../node_modules/metro/src/lib/getGraphId.d.ts
|
|
1581
|
+
declare type GraphId = string;
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region ../../node_modules/metro/src/DeltaBundler/Worker.d.ts
|
|
1584
|
+
type TransformerConfig = {
|
|
1585
|
+
transformerPath: string;
|
|
1586
|
+
transformerConfig: JsTransformerConfig;
|
|
1587
|
+
};
|
|
1588
|
+
type Data$1 = Readonly<{
|
|
1589
|
+
result: TransformResult;
|
|
1590
|
+
sha1: string;
|
|
1591
|
+
transformFileStartLogEntry: LogEntry;
|
|
1592
|
+
transformFileEndLogEntry: LogEntry;
|
|
1593
|
+
}>;
|
|
1594
|
+
declare const transform: (filename: string, transformOptions: JsTransformOptions, projectRoot: string, transformerConfig: TransformerConfig, fileBuffer?: Buffer) => Promise<Data$1>;
|
|
1595
|
+
declare type transform = typeof transform;
|
|
1596
|
+
type Worker = {
|
|
1597
|
+
readonly transform: typeof transform;
|
|
1598
|
+
};
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region ../../node_modules/metro/src/DeltaBundler/WorkerFarm.d.ts
|
|
1601
|
+
type WorkerInterface = Readonly<Omit<Worker, 'end' | 'getStdout' | 'getStderr'> & {
|
|
1602
|
+
end(): void | Promise<void>;
|
|
1603
|
+
getStdout(): Readable;
|
|
1604
|
+
getStderr(): Readable;
|
|
1605
|
+
}>;
|
|
1606
|
+
type TransformerResult = Readonly<{
|
|
1607
|
+
result: TransformResult;
|
|
1608
|
+
sha1: string;
|
|
1609
|
+
}>;
|
|
1610
|
+
declare class WorkerFarm {
|
|
1611
|
+
_config: ConfigT;
|
|
1612
|
+
_transformerConfig: TransformerConfig;
|
|
1613
|
+
_worker: WorkerInterface | Worker;
|
|
1614
|
+
constructor(config: ConfigT, transformerConfig: TransformerConfig);
|
|
1615
|
+
kill(): Promise<void>;
|
|
1616
|
+
transform(filename: string, options: JsTransformOptions, fileBuffer?: Buffer): Promise<TransformerResult>;
|
|
1617
|
+
_makeFarm(absoluteWorkerPath: string, exposedMethods: ReadonlyArray<string>, numWorkers: number): WorkerInterface;
|
|
1618
|
+
_computeWorkerKey(method: string, filename: string): null | undefined | string;
|
|
1619
|
+
_formatGenericError(err: Readonly<{
|
|
1620
|
+
message: string;
|
|
1621
|
+
stack?: string | undefined;
|
|
1622
|
+
}>, filename: string): TransformError;
|
|
1623
|
+
_formatBabelError(err: Readonly<{
|
|
1624
|
+
message: string;
|
|
1625
|
+
stack?: string | undefined;
|
|
1626
|
+
type?: string | undefined;
|
|
1627
|
+
codeFrame?: unknown | undefined;
|
|
1628
|
+
loc: {
|
|
1629
|
+
line?: number | undefined;
|
|
1630
|
+
column?: number | undefined;
|
|
1631
|
+
};
|
|
1632
|
+
}>, filename: string): TransformError;
|
|
1633
|
+
}
|
|
1634
|
+
declare class TransformError extends SyntaxError {
|
|
1635
|
+
type: string;
|
|
1636
|
+
constructor(message: string);
|
|
1637
|
+
}
|
|
1638
|
+
//#endregion
|
|
1639
|
+
//#region ../../node_modules/metro/src/DeltaBundler/Transformer.d.ts
|
|
1640
|
+
type GetOrComputeSha1Fn = ($$PARAM_0$$: string) => Promise<Readonly<{
|
|
1641
|
+
content?: Buffer | undefined;
|
|
1642
|
+
sha1: string;
|
|
1643
|
+
}>>;
|
|
1644
|
+
declare class Transformer {
|
|
1645
|
+
_config: ConfigT;
|
|
1646
|
+
_cache: Cache<TransformResult>;
|
|
1647
|
+
_baseHash: string;
|
|
1648
|
+
_getSha1: GetOrComputeSha1Fn;
|
|
1649
|
+
_workerFarm: WorkerFarm;
|
|
1650
|
+
constructor(config: ConfigT, opts: Readonly<{
|
|
1651
|
+
getOrComputeSha1: GetOrComputeSha1Fn;
|
|
1652
|
+
}>);
|
|
1653
|
+
transformFile(filePath: string, transformerOptions: JsTransformOptions, fileBuffer?: Buffer): Promise<TransformResultWithSource>;
|
|
1654
|
+
end(): Promise<void>;
|
|
1655
|
+
}
|
|
1656
|
+
//#endregion
|
|
1657
|
+
//#region ../../node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.d.ts
|
|
1658
|
+
type Options$1 = Readonly<{
|
|
1659
|
+
assetExts: ReadonlySet<string>;
|
|
1660
|
+
disableHierarchicalLookup: boolean;
|
|
1661
|
+
doesFileExist: DoesFileExist;
|
|
1662
|
+
emptyModulePath: string;
|
|
1663
|
+
extraNodeModules: null | undefined | object;
|
|
1664
|
+
fileSystemLookup: FileSystemLookup;
|
|
1665
|
+
getHasteModulePath: (name: string, platform: null | undefined | string) => null | undefined | string;
|
|
1666
|
+
getHastePackagePath: (name: string, platform: null | undefined | string) => null | undefined | string;
|
|
1667
|
+
mainFields: ReadonlyArray<string>;
|
|
1668
|
+
getPackage: (packageJsonPath: string) => null | undefined | PackageJson$1;
|
|
1669
|
+
getPackageForModule: (absolutePath: string) => null | undefined | PackageForModule;
|
|
1670
|
+
nodeModulesPaths: ReadonlyArray<string>;
|
|
1671
|
+
preferNativePlatform: boolean;
|
|
1672
|
+
projectRoot: string;
|
|
1673
|
+
reporter: Reporter;
|
|
1674
|
+
resolveAsset: ResolveAsset;
|
|
1675
|
+
resolveRequest: null | undefined | CustomResolver;
|
|
1676
|
+
schemeResolvers: Readonly<{
|
|
1677
|
+
[scheme: string]: CustomResolver;
|
|
1678
|
+
}>;
|
|
1679
|
+
sourceExts: ReadonlyArray<string>;
|
|
1680
|
+
unstable_conditionNames: ReadonlyArray<string>;
|
|
1681
|
+
unstable_conditionsByPlatform: Readonly<{
|
|
1682
|
+
[platform: string]: ReadonlyArray<string>;
|
|
1683
|
+
}>;
|
|
1684
|
+
unstable_enablePackageExports: boolean;
|
|
1685
|
+
unstable_incrementalResolution: boolean;
|
|
1686
|
+
}>;
|
|
1687
|
+
declare class ModuleResolver {
|
|
1688
|
+
_options: Options$1;
|
|
1689
|
+
_projectRootFakeModulePath: string;
|
|
1690
|
+
_cachedEmptyModule: null | undefined | BundlerResolution;
|
|
1691
|
+
constructor(options: Options$1);
|
|
1692
|
+
_getEmptyModule(): BundlerResolution;
|
|
1693
|
+
resolveDependency(originModulePath: string, dependency: TransformResultDependency, allowHaste: boolean, platform: string | null, resolverOptions: ResolverInputOptions): BundlerResolution;
|
|
1694
|
+
/**
|
|
1695
|
+
* TODO: Return Resolution instead of coercing to BundlerResolution here
|
|
1696
|
+
*/
|
|
1697
|
+
_getFileResolvedModule(resolution: Resolution): BundlerResolution;
|
|
1698
|
+
_logWarning: (message: string) => void;
|
|
1699
|
+
_removeRoot(candidates: FileCandidates): FileCandidates;
|
|
1700
|
+
}
|
|
1701
|
+
//#endregion
|
|
1702
|
+
//#region ../../node_modules/metro/src/node-haste/DependencyGraph.d.ts
|
|
1703
|
+
declare class DependencyGraph extends EventEmitter {
|
|
1704
|
+
_config: ConfigT;
|
|
1705
|
+
_haste: FileMap;
|
|
1706
|
+
_fileSystem: FileSystem;
|
|
1707
|
+
_hasteMap: HasteMap;
|
|
1708
|
+
_moduleResolver: ModuleResolver;
|
|
1709
|
+
_resolutionCache: Map<string | symbol, Map<string | symbol, Map<string | symbol, Map<string | symbol, BundlerResolution>>>>;
|
|
1710
|
+
_initializedPromise: Promise<void>;
|
|
1711
|
+
constructor(config: ConfigT, options?: {
|
|
1712
|
+
readonly hasReducedPerformance?: boolean | undefined;
|
|
1713
|
+
readonly watch?: boolean | undefined;
|
|
1714
|
+
});
|
|
1715
|
+
_onWatcherHealthCheck(result: HealthCheckResult): void;
|
|
1716
|
+
_onWatcherStatus(status: WatcherStatus): void;
|
|
1717
|
+
ready(): Promise<void>;
|
|
1718
|
+
_onHasteChange($$PARAM_0$$: ChangeEvent): void;
|
|
1719
|
+
_createModuleResolver(): void;
|
|
1720
|
+
_getClosestPackage(absoluteModulePath: string): null | undefined | {
|
|
1721
|
+
packageJsonPath: string;
|
|
1722
|
+
packageRelativePath: string;
|
|
1723
|
+
};
|
|
1724
|
+
getAllFiles(): Array<string>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Used when watcher.unstable_lazySha1 is true
|
|
1727
|
+
*/
|
|
1728
|
+
getOrComputeSha1(mixedPath: string): Promise<{
|
|
1729
|
+
content?: Buffer | undefined;
|
|
1730
|
+
sha1: string;
|
|
1731
|
+
}>;
|
|
1732
|
+
getWatcher(): EventEmitter;
|
|
1733
|
+
end(): Promise<void>;
|
|
1734
|
+
/** Given a search context, return a list of file paths matching the query. */
|
|
1735
|
+
matchFilesWithContext(from: string, context: Readonly<{
|
|
1736
|
+
recursive: boolean;
|
|
1737
|
+
filter: RegExp;
|
|
1738
|
+
}>): Iterable<string>;
|
|
1739
|
+
resolveDependency(originModulePath: string, dependency: TransformResultDependency, platform: string | null, resolverOptions: ResolverInputOptions, extraOptions?: {
|
|
1740
|
+
assumeFlatNodeModules: boolean;
|
|
1741
|
+
}): BundlerResolution;
|
|
1742
|
+
doesFileExist: (filePath: string) => boolean;
|
|
1743
|
+
getHasteName(filePath: string): string;
|
|
1744
|
+
getDependencies(filePath: string): Array<string>;
|
|
1745
|
+
}
|
|
1746
|
+
//#endregion
|
|
1747
|
+
//#region ../../node_modules/metro/src/Bundler.d.ts
|
|
1748
|
+
type BundlerOptions = Readonly<{
|
|
1749
|
+
hasReducedPerformance?: boolean | undefined;
|
|
1750
|
+
watch?: boolean | undefined;
|
|
1751
|
+
}>;
|
|
1752
|
+
declare class Bundler {
|
|
1753
|
+
_depGraph: DependencyGraph;
|
|
1754
|
+
_initializedPromise: Promise<void>;
|
|
1755
|
+
_transformer: Transformer;
|
|
1756
|
+
constructor(config: ConfigT, options?: BundlerOptions);
|
|
1757
|
+
getWatcher(): EventEmitter;
|
|
1758
|
+
end(): Promise<void>;
|
|
1759
|
+
getDependencyGraph(): Promise<DependencyGraph>;
|
|
1760
|
+
transformFile(filePath: string, transformOptions: JsTransformOptions, fileBuffer?: Buffer): Promise<TransformResultWithSource>;
|
|
1761
|
+
ready(): Promise<void>;
|
|
1762
|
+
}
|
|
1763
|
+
//#endregion
|
|
1764
|
+
//#region ../../node_modules/metro/src/IncrementalBundler.d.ts
|
|
1765
|
+
declare type RevisionId = string;
|
|
1766
|
+
type OutputGraph = Graph;
|
|
1767
|
+
type OtherOptions = Readonly<{
|
|
1768
|
+
onProgress: Options$2['onProgress'];
|
|
1769
|
+
shallow: boolean;
|
|
1770
|
+
lazy: boolean;
|
|
1771
|
+
}>;
|
|
1772
|
+
type GraphRevision = {
|
|
1773
|
+
readonly id: RevisionId;
|
|
1774
|
+
readonly date: Date;
|
|
1775
|
+
readonly graphId: GraphId;
|
|
1776
|
+
readonly graph: OutputGraph;
|
|
1777
|
+
readonly prepend: ReadonlyArray<Module>;
|
|
1778
|
+
};
|
|
1779
|
+
type IncrementalBundlerOptions = Readonly<{
|
|
1780
|
+
hasReducedPerformance?: boolean | undefined;
|
|
1781
|
+
watch?: boolean | undefined;
|
|
1782
|
+
}>;
|
|
1783
|
+
declare class IncrementalBundler {
|
|
1784
|
+
_config: ConfigT;
|
|
1785
|
+
_bundler: Bundler;
|
|
1786
|
+
_deltaBundler: DeltaBundler;
|
|
1787
|
+
_revisionsById: Map<RevisionId, Promise<GraphRevision>>;
|
|
1788
|
+
_revisionsByGraphId: Map<GraphId, Promise<GraphRevision>>;
|
|
1789
|
+
static revisionIdFromString: (str: string) => RevisionId;
|
|
1790
|
+
constructor(config: ConfigT, options?: IncrementalBundlerOptions);
|
|
1791
|
+
end(): Promise<void>;
|
|
1792
|
+
getBundler(): Bundler;
|
|
1793
|
+
getDeltaBundler(): DeltaBundler;
|
|
1794
|
+
getRevision(revisionId: RevisionId): null | undefined | Promise<GraphRevision>;
|
|
1795
|
+
getRevisionByGraphId(graphId: GraphId): null | undefined | Promise<GraphRevision>;
|
|
1796
|
+
buildGraphForEntries(entryFiles: ReadonlyArray<string>, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions): Promise<OutputGraph>;
|
|
1797
|
+
getDependencies(entryFiles: ReadonlyArray<string>, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions): Promise<ReadOnlyDependencies>;
|
|
1798
|
+
buildGraph(entryFile: string, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions): Promise<{
|
|
1799
|
+
readonly graph: OutputGraph;
|
|
1800
|
+
readonly prepend: ReadonlyArray<Module>;
|
|
1801
|
+
}>;
|
|
1802
|
+
initializeGraph(entryFile: string, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions): Promise<{
|
|
1803
|
+
delta: DeltaResult;
|
|
1804
|
+
revision: GraphRevision;
|
|
1805
|
+
}>;
|
|
1806
|
+
updateGraph(revision: GraphRevision, reset: boolean): Promise<{
|
|
1807
|
+
delta: DeltaResult;
|
|
1808
|
+
revision: GraphRevision;
|
|
1809
|
+
}>;
|
|
1810
|
+
endGraph(graphId: GraphId): Promise<void>;
|
|
1811
|
+
_getAbsoluteEntryFiles(entryFiles: ReadonlyArray<string>): Promise<ReadonlyArray<string>>;
|
|
1812
|
+
ready(): Promise<void>;
|
|
1813
|
+
}
|
|
1814
|
+
//#endregion
|
|
1815
|
+
//#region ../../node_modules/metro/src/Server/MultipartResponse.d.ts
|
|
1816
|
+
type Data = string | Buffer | Uint8Array;
|
|
1817
|
+
type Headers = {
|
|
1818
|
+
[$$Key$$: string]: string | number;
|
|
1819
|
+
};
|
|
1820
|
+
declare class MultipartResponse {
|
|
1821
|
+
static wrapIfSupported(req: IncomingMessage, res: ServerResponse): MultipartResponse | ServerResponse;
|
|
1822
|
+
static serializeHeaders(headers: Headers): string;
|
|
1823
|
+
res: ServerResponse;
|
|
1824
|
+
headers: Headers;
|
|
1825
|
+
constructor(res: ServerResponse);
|
|
1826
|
+
writeChunk(headers: Headers | null, data?: Data, isLast?: boolean): void;
|
|
1827
|
+
writeHead(status: number, headers?: Headers): void;
|
|
1828
|
+
setHeader(name: string, value: string | number): void;
|
|
1829
|
+
end(data?: Data): void;
|
|
1830
|
+
once(name: string, fn: () => unknown): this;
|
|
1831
|
+
}
|
|
1832
|
+
//#endregion
|
|
1833
|
+
//#region ../../node_modules/metro/src/Server.d.ts
|
|
1834
|
+
type ProcessStartContext = Omit<SplitBundleOptions, 'buildNumber' | 'bundleOptions' | 'graphId' | 'graphOptions' | 'mres' | 'req' | 'revisionId' | 'bundlePerfLogger' | 'requestStartTimestamp'> & {
|
|
1835
|
+
readonly buildNumber: number;
|
|
1836
|
+
readonly bundleOptions: BundleOptions;
|
|
1837
|
+
readonly graphId: GraphId;
|
|
1838
|
+
readonly graphOptions: GraphOptions;
|
|
1839
|
+
readonly mres: MultipartResponse | ServerResponse;
|
|
1840
|
+
readonly req: IncomingMessage$1;
|
|
1841
|
+
readonly revisionId?: null | undefined | RevisionId;
|
|
1842
|
+
readonly bundlePerfLogger: RootPerfLogger;
|
|
1843
|
+
readonly requestStartTimestamp: number;
|
|
1844
|
+
};
|
|
1845
|
+
type ProcessDeleteContext = {
|
|
1846
|
+
readonly graphId: GraphId;
|
|
1847
|
+
readonly req: IncomingMessage$1;
|
|
1848
|
+
readonly res: ServerResponse;
|
|
1849
|
+
};
|
|
1850
|
+
type ProcessEndContext<T> = Omit<ProcessStartContext, 'result'> & {
|
|
1851
|
+
readonly result: T;
|
|
1852
|
+
};
|
|
1853
|
+
type ServerOptions = Readonly<{
|
|
1854
|
+
hasReducedPerformance?: boolean | undefined;
|
|
1855
|
+
onBundleBuilt?: ((bundlePath: string) => void) | undefined;
|
|
1856
|
+
watch?: boolean | undefined;
|
|
1857
|
+
}>;
|
|
1858
|
+
type FetchTiming = {
|
|
1859
|
+
graphId: GraphId;
|
|
1860
|
+
startTime: number;
|
|
1861
|
+
endTime: number | null;
|
|
1862
|
+
isPrefetch: boolean;
|
|
1863
|
+
};
|
|
1864
|
+
declare class Server$1 {
|
|
1865
|
+
_bundler: IncrementalBundler;
|
|
1866
|
+
_config: ConfigT;
|
|
1867
|
+
_createModuleId: (path: string) => number;
|
|
1868
|
+
_isEnded: boolean;
|
|
1869
|
+
_logger: typeof Logger_d_exports;
|
|
1870
|
+
_nextBundleBuildNumber: number;
|
|
1871
|
+
_platforms: Set<string>;
|
|
1872
|
+
_reporter: Reporter;
|
|
1873
|
+
_serverOptions: ServerOptions | void;
|
|
1874
|
+
_allowedSuffixesForSourceRequests: ReadonlyArray<string>;
|
|
1875
|
+
_sourceRequestRoutingMap: ReadonlyArray<[pathnamePrefix: string, normalizedRootDir: string]>;
|
|
1876
|
+
_fetchTimings: Array<FetchTiming>;
|
|
1877
|
+
_activeFetchCount: number;
|
|
1878
|
+
constructor(config: ConfigT, options?: ServerOptions);
|
|
1879
|
+
end(): Promise<void>;
|
|
1880
|
+
getBundler(): IncrementalBundler;
|
|
1881
|
+
getCreateModuleId(): (path: string) => number;
|
|
1882
|
+
_serializeGraph($$PARAM_0$$: Readonly<{
|
|
1883
|
+
splitOptions: SplitBundleOptions;
|
|
1884
|
+
prepend: ReadonlyArray<Module>;
|
|
1885
|
+
graph: ReadOnlyGraph;
|
|
1886
|
+
}>): Promise<{
|
|
1887
|
+
code: string;
|
|
1888
|
+
map: string;
|
|
1889
|
+
}>;
|
|
1890
|
+
build(bundleOptions: BundleOptions, buildOptions?: BuildOptions): Promise<{
|
|
1891
|
+
code: string;
|
|
1892
|
+
map: string;
|
|
1893
|
+
assets?: ReadonlyArray<AssetData> | undefined;
|
|
1894
|
+
}>;
|
|
1895
|
+
getRamBundleInfo(options: BundleOptions): Promise<RamBundleInfo>;
|
|
1896
|
+
getAssets(options: BundleOptions): Promise<ReadonlyArray<AssetData>>;
|
|
1897
|
+
_getAssetsFromDependencies(dependencies: ReadOnlyDependencies, platform: null | undefined | string): Promise<ReadonlyArray<AssetData>>;
|
|
1898
|
+
getOrderedDependencyPaths(options: {
|
|
1899
|
+
readonly dev: boolean;
|
|
1900
|
+
readonly entryFile: string;
|
|
1901
|
+
readonly minify: boolean;
|
|
1902
|
+
readonly platform: null | undefined | string;
|
|
1903
|
+
}): Promise<Array<string>>;
|
|
1904
|
+
_rangeRequestMiddleware(req: IncomingMessage$1, res: ServerResponse, data: string | Buffer, assetPath: string): Buffer | string;
|
|
1905
|
+
_processSingleAssetRequest(req: IncomingMessage$1, res: ServerResponse): Promise<void>;
|
|
1906
|
+
processRequest: (req: IncomingMessage$1, res: ServerResponse, next: (e: null | undefined | Error) => void) => void;
|
|
1907
|
+
_parseOptions(url: string): BundleOptions;
|
|
1908
|
+
_rewriteAndNormalizeUrl(requestUrl: string): string;
|
|
1909
|
+
_processRequest(req: IncomingMessage$1, res: ServerResponse, next: ($$PARAM_0$$: null | undefined | Error) => void): Promise<void>;
|
|
1910
|
+
_processSourceRequest(relativeFilePathname: string, rootDir: string, res: ServerResponse): Promise<void>;
|
|
1911
|
+
_createRequestProcessor<T>($$PARAM_0$$: {
|
|
1912
|
+
readonly bundleType: 'assets' | 'bundle' | 'map';
|
|
1913
|
+
readonly createStartEntry: (context: ProcessStartContext) => ActionLogEntryData;
|
|
1914
|
+
readonly createEndEntry: (context: ProcessEndContext<T>) => Partial<ActionStartLogEntry>;
|
|
1915
|
+
readonly build: (context: ProcessStartContext) => Promise<T>;
|
|
1916
|
+
readonly delete?: ((context: ProcessDeleteContext) => Promise<void>) | undefined;
|
|
1917
|
+
readonly finish: (context: ProcessEndContext<T>) => void;
|
|
1918
|
+
}): (req: IncomingMessage$1, res: ServerResponse, bundleOptions: BundleOptions, buildContext: Readonly<{
|
|
1919
|
+
buildNumber: number;
|
|
1920
|
+
bundlePerfLogger: RootPerfLogger;
|
|
1921
|
+
}>) => Promise<void>;
|
|
1922
|
+
_processBundleRequest: (req: IncomingMessage$1, res: ServerResponse, bundleOptions: BundleOptions, buildContext: Readonly<{
|
|
1923
|
+
buildNumber: number;
|
|
1924
|
+
bundlePerfLogger: RootPerfLogger;
|
|
1925
|
+
}>) => Promise<void>;
|
|
1926
|
+
_getSortedModules(graph: ReadOnlyGraph): ReadonlyArray<Module>;
|
|
1927
|
+
_processSourceMapRequest: (req: IncomingMessage$1, res: ServerResponse, bundleOptions: BundleOptions, buildContext: Readonly<{
|
|
1928
|
+
buildNumber: number;
|
|
1929
|
+
bundlePerfLogger: RootPerfLogger;
|
|
1930
|
+
}>) => Promise<void>;
|
|
1931
|
+
_processAssetsRequest: (req: IncomingMessage$1, res: ServerResponse, bundleOptions: BundleOptions, buildContext: Readonly<{
|
|
1932
|
+
buildNumber: number;
|
|
1933
|
+
bundlePerfLogger: RootPerfLogger;
|
|
1934
|
+
}>) => Promise<void>;
|
|
1935
|
+
_symbolicate(req: IncomingMessage$1, res: ServerResponse): Promise<void>;
|
|
1936
|
+
_explodedSourceMapForBundleOptions(bundleOptions: BundleOptions): Promise<ExplodedSourceMap>;
|
|
1937
|
+
_resolveWatchFolderPrefix(filePath: string): {
|
|
1938
|
+
rootDir: string;
|
|
1939
|
+
filePath: string;
|
|
1940
|
+
} | null;
|
|
1941
|
+
_resolveRelativePath(filePath: string, $$PARAM_1$$: Readonly<{
|
|
1942
|
+
relativeTo: 'project' | 'server';
|
|
1943
|
+
resolverOptions: ResolverInputOptions;
|
|
1944
|
+
transformOptions: TransformInputOptions;
|
|
1945
|
+
}>): Promise<string>;
|
|
1946
|
+
getNewBuildNumber(): number;
|
|
1947
|
+
getPlatforms(): ReadonlyArray<string>;
|
|
1948
|
+
getWatchFolders(): ReadonlyArray<string>;
|
|
1949
|
+
static DEFAULT_GRAPH_OPTIONS: Readonly<{
|
|
1950
|
+
customResolverOptions: CustomResolverOptions;
|
|
1951
|
+
customTransformOptions: CustomTransformOptions;
|
|
1952
|
+
dev: boolean;
|
|
1953
|
+
minify: boolean;
|
|
1954
|
+
unstable_transformProfile: 'default';
|
|
1955
|
+
}>;
|
|
1956
|
+
static DEFAULT_BUNDLE_OPTIONS: Omit<typeof Server$1.DEFAULT_GRAPH_OPTIONS, 'excludeSource' | 'inlineSourceMap' | 'lazy' | 'modulesOnly' | 'onProgress' | 'runModule' | 'shallow' | 'sourceMapUrl' | 'sourceUrl' | 'sourcePaths'> & {
|
|
1957
|
+
excludeSource: false;
|
|
1958
|
+
inlineSourceMap: false;
|
|
1959
|
+
lazy: false;
|
|
1960
|
+
modulesOnly: false;
|
|
1961
|
+
onProgress: null;
|
|
1962
|
+
runModule: true;
|
|
1963
|
+
shallow: false;
|
|
1964
|
+
sourceMapUrl: null;
|
|
1965
|
+
sourceUrl: null;
|
|
1966
|
+
sourcePaths: SourcePathsMode;
|
|
1967
|
+
};
|
|
1968
|
+
_getServerRootDir(): string;
|
|
1969
|
+
_getEntryPointAbsolutePath(entryFile: string): string;
|
|
1970
|
+
ready(): Promise<void>;
|
|
1971
|
+
_shouldAddModuleToIgnoreList(module: Module): boolean;
|
|
1972
|
+
_getModuleSourceUrl(module: Module, mode: SourcePathsMode): string;
|
|
1973
|
+
}
|
|
1974
|
+
//#endregion
|
|
1975
|
+
//#region ../../node_modules/metro/src/Server/symbolicate.d.ts
|
|
1976
|
+
type StackFrameInput = {
|
|
1977
|
+
readonly file: null | undefined | string;
|
|
1978
|
+
readonly lineNumber: null | undefined | number;
|
|
1979
|
+
readonly column: null | undefined | number;
|
|
1980
|
+
readonly methodName: null | undefined | string;
|
|
1981
|
+
};
|
|
1982
|
+
type IntermediateStackFrame = Omit<StackFrameInput, 'collapse'> & {
|
|
1983
|
+
collapse?: boolean | undefined;
|
|
1984
|
+
};
|
|
1985
|
+
//#endregion
|
|
1986
|
+
//#region ../../node_modules/metro-config/src/types.d.ts
|
|
1987
|
+
type ExtraTransformOptions = Readonly<{
|
|
1988
|
+
preloadedModules?: Readonly<{
|
|
1989
|
+
[path: string]: true;
|
|
1990
|
+
}> | false | undefined;
|
|
1991
|
+
ramGroups?: ReadonlyArray<string> | undefined;
|
|
1992
|
+
transform?: Readonly<{
|
|
1993
|
+
experimentalImportSupport?: boolean | undefined;
|
|
1994
|
+
inlineRequires?: Readonly<{
|
|
1995
|
+
blockList: Readonly<{
|
|
1996
|
+
[absoluteModulePath: string]: true;
|
|
1997
|
+
}>;
|
|
1998
|
+
}> | boolean | undefined;
|
|
1999
|
+
nonInlinedRequires?: ReadonlyArray<string> | undefined;
|
|
2000
|
+
unstable_memoizeInlineRequires?: boolean | undefined;
|
|
2001
|
+
unstable_nonMemoizedInlineRequires?: ReadonlyArray<string> | undefined;
|
|
2002
|
+
}> | undefined;
|
|
2003
|
+
}>;
|
|
2004
|
+
type GetTransformOptionsOpts = {
|
|
2005
|
+
dev: boolean;
|
|
2006
|
+
/**
|
|
2007
|
+
* @deprecated Always true
|
|
2008
|
+
*/
|
|
2009
|
+
hot: true;
|
|
2010
|
+
platform: null | undefined | string;
|
|
2011
|
+
};
|
|
2012
|
+
type GetTransformOptions = (entryPoints: ReadonlyArray<string>, options: GetTransformOptionsOpts, getDependenciesOf: (absoluteFilePath: string) => Promise<Array<string>>) => Promise<Partial<ExtraTransformOptions>>;
|
|
2013
|
+
type Middleware = HandleFunction;
|
|
2014
|
+
type PerfAnnotations = Partial<{
|
|
2015
|
+
string: Readonly<{
|
|
2016
|
+
[key: string]: string;
|
|
2017
|
+
}>;
|
|
2018
|
+
int: Readonly<{
|
|
2019
|
+
[key: string]: number;
|
|
2020
|
+
}>;
|
|
2021
|
+
double: Readonly<{
|
|
2022
|
+
[key: string]: number;
|
|
2023
|
+
}>;
|
|
2024
|
+
bool: Readonly<{
|
|
2025
|
+
[key: string]: boolean;
|
|
2026
|
+
}>;
|
|
2027
|
+
string_array: Readonly<{
|
|
2028
|
+
[key: string]: ReadonlyArray<string>;
|
|
2029
|
+
}>;
|
|
2030
|
+
int_array: Readonly<{
|
|
2031
|
+
[key: string]: ReadonlyArray<number>;
|
|
2032
|
+
}>;
|
|
2033
|
+
double_array: Readonly<{
|
|
2034
|
+
[key: string]: ReadonlyArray<number>;
|
|
2035
|
+
}>;
|
|
2036
|
+
bool_array: Readonly<{
|
|
2037
|
+
[key: string]: ReadonlyArray<boolean>;
|
|
2038
|
+
}>;
|
|
2039
|
+
}>;
|
|
2040
|
+
type PerfLoggerPointOptions = Readonly<{
|
|
2041
|
+
timestamp?: number | undefined;
|
|
2042
|
+
}>;
|
|
2043
|
+
interface PerfLogger {
|
|
2044
|
+
point(name: string, opts?: PerfLoggerPointOptions): void;
|
|
2045
|
+
annotate(annotations: PerfAnnotations): void;
|
|
2046
|
+
subSpan(label: string): PerfLogger;
|
|
2047
|
+
}
|
|
2048
|
+
interface RootPerfLogger extends PerfLogger {
|
|
2049
|
+
start(opts?: PerfLoggerPointOptions): void;
|
|
2050
|
+
end(status: 'SUCCESS' | 'FAIL' | 'CANCEL', opts?: PerfLoggerPointOptions): void;
|
|
2051
|
+
}
|
|
2052
|
+
type PerfLoggerFactoryOptions = Readonly<{
|
|
2053
|
+
key?: number | undefined;
|
|
2054
|
+
}>;
|
|
2055
|
+
type PerfLoggerFactory = (type: 'START_UP' | 'BUNDLING_REQUEST' | 'HMR', opts?: PerfLoggerFactoryOptions) => RootPerfLogger;
|
|
2056
|
+
type ResolverConfigT = {
|
|
2057
|
+
assetExts: ReadonlyArray<string>;
|
|
2058
|
+
assetResolutions: ReadonlyArray<string>;
|
|
2059
|
+
blockList: RegExp | Array<RegExp>;
|
|
2060
|
+
disableHierarchicalLookup: boolean;
|
|
2061
|
+
dependencyExtractor: null | undefined | string;
|
|
2062
|
+
emptyModulePath: string;
|
|
2063
|
+
enableGlobalPackages: boolean;
|
|
2064
|
+
extraNodeModules: {
|
|
2065
|
+
[packageName: string]: string;
|
|
2066
|
+
};
|
|
2067
|
+
hasteImplModulePath: null | undefined | string;
|
|
2068
|
+
nodeModulesPaths: ReadonlyArray<string>;
|
|
2069
|
+
platforms: ReadonlyArray<string>;
|
|
2070
|
+
resolveRequest: null | undefined | CustomResolver;
|
|
2071
|
+
resolverMainFields: ReadonlyArray<string>;
|
|
2072
|
+
schemeResolvers: Readonly<{
|
|
2073
|
+
[scheme: string]: CustomResolver;
|
|
2074
|
+
}>;
|
|
2075
|
+
sourceExts: ReadonlyArray<string>;
|
|
2076
|
+
unstable_conditionNames: ReadonlyArray<string>;
|
|
2077
|
+
unstable_conditionsByPlatform: Readonly<{
|
|
2078
|
+
[platform: string]: ReadonlyArray<string>;
|
|
2079
|
+
}>;
|
|
2080
|
+
unstable_enablePackageExports: boolean;
|
|
2081
|
+
unstable_incrementalResolution: boolean;
|
|
2082
|
+
useWatchman: boolean;
|
|
2083
|
+
requireCycleIgnorePatterns: ReadonlyArray<RegExp>;
|
|
2084
|
+
unstable_forceFullRefreshPatterns: ReadonlyArray<RegExp>;
|
|
2085
|
+
};
|
|
2086
|
+
type SerializerConfigT = {
|
|
2087
|
+
createModuleIdFactory: () => (path: string) => number;
|
|
2088
|
+
customSerializer: null | undefined | ((entryPoint: string, preModules: ReadonlyArray<Module>, graph: ReadOnlyGraph, options: SerializerOptions) => Promise<string | {
|
|
2089
|
+
code: string;
|
|
2090
|
+
map: string;
|
|
2091
|
+
}>);
|
|
2092
|
+
experimentalSerializerHook: (graph: ReadOnlyGraph, delta: DeltaResult) => unknown;
|
|
2093
|
+
getModulesRunBeforeMainModule: (entryFilePath: string) => Array<string>;
|
|
2094
|
+
getPolyfills: (ctx: {
|
|
2095
|
+
platform: null | undefined | string;
|
|
2096
|
+
}) => ReadonlyArray<string>;
|
|
2097
|
+
getRunModuleStatement: (moduleId: number | string, globalPrefix: string) => string;
|
|
2098
|
+
polyfillModuleNames: ReadonlyArray<string>;
|
|
2099
|
+
processModuleFilter: (modules: Module) => boolean;
|
|
2100
|
+
isThirdPartyModule: (module: Readonly<{
|
|
2101
|
+
path: string;
|
|
2102
|
+
}>) => boolean;
|
|
2103
|
+
unstable_inlineDependencyMap: boolean;
|
|
2104
|
+
unstable_lazilyDefineModules: boolean;
|
|
2105
|
+
};
|
|
2106
|
+
type TransformerConfigT = Omit<JsTransformerConfig, 'getTransformOptions' | 'transformVariants' | 'publicPath' | 'unstable_workerThreads'> & {
|
|
2107
|
+
getTransformOptions: GetTransformOptions;
|
|
2108
|
+
transformVariants: {
|
|
2109
|
+
readonly [name: string]: Partial<ExtraTransformOptions>;
|
|
2110
|
+
};
|
|
2111
|
+
publicPath: string;
|
|
2112
|
+
unstable_workerThreads: boolean;
|
|
2113
|
+
};
|
|
2114
|
+
type MetalConfigT = {
|
|
2115
|
+
cacheVersion: string;
|
|
2116
|
+
fileMapCacheDirectory?: string | undefined;
|
|
2117
|
+
hasteMapCacheDirectory?: string | undefined;
|
|
2118
|
+
unstable_fileMapCacheManagerFactory?: CacheManagerFactory | undefined;
|
|
2119
|
+
unstable_fileMapPlugins?: ReadonlyArray<InputFileMapPlugin> | undefined;
|
|
2120
|
+
maxWorkers: number;
|
|
2121
|
+
unstable_perfLoggerFactory?: null | undefined | PerfLoggerFactory;
|
|
2122
|
+
projectRoot: string;
|
|
2123
|
+
stickyWorkers: boolean;
|
|
2124
|
+
transformerPath: string;
|
|
2125
|
+
reporter: Reporter;
|
|
2126
|
+
resetCache: boolean;
|
|
2127
|
+
watchFolders: ReadonlyArray<string>;
|
|
2128
|
+
};
|
|
2129
|
+
type CacheStoresConfigT = ReadonlyArray<CacheStore<TransformResult>>;
|
|
2130
|
+
type ServerConfigT = {
|
|
2131
|
+
/** @deprecated */enhanceMiddleware: (middleware: Middleware, server: Server$1) => Middleware | Server;
|
|
2132
|
+
forwardClientLogs: boolean;
|
|
2133
|
+
port: number;
|
|
2134
|
+
rewriteRequestUrl: (url: string) => string;
|
|
2135
|
+
unstable_serverRoot: null | undefined | string;
|
|
2136
|
+
useGlobalHotkey: boolean;
|
|
2137
|
+
verifyConnections: boolean;
|
|
2138
|
+
tls: false | {
|
|
2139
|
+
ca?: string | Buffer | undefined;
|
|
2140
|
+
cert?: string | Buffer | undefined;
|
|
2141
|
+
key?: string | Buffer | undefined;
|
|
2142
|
+
requestCert?: boolean | undefined;
|
|
2143
|
+
};
|
|
2144
|
+
};
|
|
2145
|
+
type SymbolicatorConfigT = {
|
|
2146
|
+
customizeFrame: (frame: {
|
|
2147
|
+
readonly file: null | undefined | string;
|
|
2148
|
+
readonly lineNumber: null | undefined | number;
|
|
2149
|
+
readonly column: null | undefined | number;
|
|
2150
|
+
readonly methodName: null | undefined | string;
|
|
2151
|
+
}) => (null | undefined | {
|
|
2152
|
+
readonly collapse?: boolean | undefined;
|
|
2153
|
+
}) | Promise<null | undefined | {
|
|
2154
|
+
readonly collapse?: boolean | undefined;
|
|
2155
|
+
}>;
|
|
2156
|
+
customizeStack: (symbolicatedStack: Array<IntermediateStackFrame>, extraData: unknown) => Array<IntermediateStackFrame> | Promise<Array<IntermediateStackFrame>>;
|
|
2157
|
+
};
|
|
2158
|
+
type WatcherConfigT = {
|
|
2159
|
+
additionalExts: ReadonlyArray<string>;
|
|
2160
|
+
healthCheck: Readonly<{
|
|
2161
|
+
enabled: boolean;
|
|
2162
|
+
interval: number;
|
|
2163
|
+
timeout: number;
|
|
2164
|
+
filePrefix: string;
|
|
2165
|
+
}>;
|
|
2166
|
+
unstable_autoSaveCache: Readonly<{
|
|
2167
|
+
enabled: boolean;
|
|
2168
|
+
debounceMs?: number | undefined;
|
|
2169
|
+
}>;
|
|
2170
|
+
unstable_lazySha1: boolean;
|
|
2171
|
+
watchman: Readonly<{
|
|
2172
|
+
deferStates: ReadonlyArray<string>;
|
|
2173
|
+
}>;
|
|
2174
|
+
};
|
|
2175
|
+
type InputConfigT = Partial<Readonly<MetalConfigT & {
|
|
2176
|
+
cacheStores: CacheStoresConfigT | ((metroCache: MetroCache) => CacheStoresConfigT);
|
|
2177
|
+
resolver: Readonly<Partial<ResolverConfigT>>;
|
|
2178
|
+
server: Readonly<Partial<ServerConfigT>>;
|
|
2179
|
+
serializer: Readonly<Partial<SerializerConfigT>>;
|
|
2180
|
+
symbolicator: Readonly<Partial<SymbolicatorConfigT>>;
|
|
2181
|
+
transformer: Readonly<Partial<TransformerConfigT>>;
|
|
2182
|
+
watcher: Partial<Readonly<Omit<WatcherConfigT, 'healthCheck' | 'unstable_autoSaveCache' | 'watchman'> & {
|
|
2183
|
+
healthCheck: Partial<Readonly<WatcherConfigT['healthCheck']>>;
|
|
2184
|
+
unstable_autoSaveCache: Partial<Readonly<WatcherConfigT['unstable_autoSaveCache']>>;
|
|
2185
|
+
watchman: Partial<Readonly<WatcherConfigT['watchman']>>;
|
|
2186
|
+
}>>;
|
|
2187
|
+
}>>;
|
|
2188
|
+
type MetroConfig = InputConfigT;
|
|
2189
|
+
type ConfigT = Readonly<MetalConfigT & {
|
|
2190
|
+
cacheStores: CacheStoresConfigT;
|
|
2191
|
+
resolver: Readonly<ResolverConfigT>;
|
|
2192
|
+
server: Readonly<ServerConfigT>;
|
|
2193
|
+
serializer: Readonly<SerializerConfigT>;
|
|
2194
|
+
symbolicator: Readonly<SymbolicatorConfigT>;
|
|
2195
|
+
transformer: Readonly<TransformerConfigT>;
|
|
2196
|
+
watcher: Readonly<WatcherConfigT>;
|
|
2197
|
+
}>;
|
|
2198
|
+
//#endregion
|
|
2199
|
+
//#region .dts-emit/code/core/src/react-native/types/index.d.ts
|
|
2200
|
+
/**
|
|
2201
|
+
* Options for configuring WebSockets used for syncing storybook instances or sending events to storybook.
|
|
2202
|
+
*/
|
|
2203
|
+
interface WebsocketsOptions {
|
|
2204
|
+
/**
|
|
2205
|
+
* The port WebSocket server will listen on. Defaults to 7007.
|
|
2206
|
+
*/
|
|
2207
|
+
port?: number;
|
|
2208
|
+
/**
|
|
2209
|
+
* The host WebSocket server will bind to. Defaults to 'localhost'.
|
|
2210
|
+
*/
|
|
2211
|
+
host?: string;
|
|
2212
|
+
/**
|
|
2213
|
+
* Whether to use WSS/HTTPS for the channel server.
|
|
2214
|
+
*/
|
|
2215
|
+
secured?: boolean;
|
|
2216
|
+
/**
|
|
2217
|
+
* TLS private key used when `secured` is true.
|
|
2218
|
+
*/
|
|
2219
|
+
key?: string | Buffer;
|
|
2220
|
+
/**
|
|
2221
|
+
* TLS certificate used when `secured` is true.
|
|
2222
|
+
*/
|
|
2223
|
+
cert?: string | Buffer;
|
|
2224
|
+
/**
|
|
2225
|
+
* Optional certificate authority chain used when `secured` is true.
|
|
2226
|
+
*/
|
|
2227
|
+
ca?: string | Buffer | Array<string | Buffer>;
|
|
2228
|
+
/**
|
|
2229
|
+
* Optional TLS passphrase used when `secured` is true.
|
|
2230
|
+
*/
|
|
2231
|
+
passphrase?: string;
|
|
2232
|
+
}
|
|
2233
|
+
//#endregion
|
|
2234
|
+
//#region .dts-emit/code/core/src/react-native/metro/withStorybook.d.ts
|
|
2235
|
+
/** Options for configuring Storybook with React Native. */
|
|
2236
|
+
interface WithStorybookOptions {
|
|
2237
|
+
/** The path to the Storybook config folder. Defaults to './.rnstorybook'. */
|
|
2238
|
+
configPath?: string;
|
|
2239
|
+
/** WebSocket configuration for syncing storybook instances or sending events to storybook. */
|
|
2240
|
+
websockets?: WebsocketsOptions | 'auto';
|
|
2241
|
+
/** Whether to write storybook.requires.js instead of storybook.requires.ts. Defaults to false. */
|
|
2242
|
+
useJs?: boolean;
|
|
2243
|
+
/** If false, Storybook is removed from the JS bundle. Defaults to true. */
|
|
2244
|
+
enabled?: boolean;
|
|
2245
|
+
/** Whether to include doc tools in the storybook.requires file. Defaults to true. */
|
|
2246
|
+
docTools?: boolean;
|
|
2247
|
+
/**
|
|
2248
|
+
* Whether to leave out the full on-device UI (`@aussieljk/forkbook/react-native-ui`), so the
|
|
2249
|
+
* bundle has no sheets and no icons. Defaults to false.
|
|
2250
|
+
*/
|
|
2251
|
+
liteMode?: boolean;
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* Configures Metro to work with Storybook in React Native.
|
|
2255
|
+
*
|
|
2256
|
+
* @example
|
|
2257
|
+
*
|
|
2258
|
+
* ```js
|
|
2259
|
+
* const { getDefaultConfig } = require('expo/metro-config');
|
|
2260
|
+
* const { withStorybook } = require('@aussieljk/forkbook/react-native/metro/withStorybook');
|
|
2261
|
+
*
|
|
2262
|
+
* module.exports = withStorybook(getDefaultConfig(__dirname), {
|
|
2263
|
+
* enabled: process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === 'true',
|
|
2264
|
+
* });
|
|
2265
|
+
* ```
|
|
2266
|
+
*/
|
|
2267
|
+
declare function withStorybook(config: MetroConfig, options?: WithStorybookOptions): MetroConfig;
|
|
2268
|
+
//#endregion
|
|
2269
|
+
export { WithStorybookOptions, withStorybook };
|