@aussieljk/forkbook 0.0.1-5 → 0.0.1-7
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/dist/_browser-chunks/{Color-GTF4GM7L.js → Color-2YRIFQLC.js} +1 -1
- package/dist/_browser-chunks/WithTooltip-4R5JMWZ7.js +196 -0
- package/dist/_browser-chunks/{chunk-MJY6ITYT.js → chunk-4EFKUJG2.js} +10 -10
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-DAUHYZUB.js} +550 -1621
- package/dist/_browser-chunks/chunk-E47B5255.js +1149 -0
- package/dist/_browser-chunks/{chunk-K6GRZSXS.js → chunk-EQKMUQF3.js} +4 -3
- package/dist/_browser-chunks/{chunk-GU3X2J4S.js → chunk-FRAOQJDI.js} +3 -1
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-H4ZHAXN3.js} +1 -1
- package/dist/_browser-chunks/{chunk-HOSBMS2F.js → chunk-HTL5ODCB.js} +1 -1
- package/dist/_browser-chunks/{chunk-ZLWA5RIE.js → chunk-I4ATZPNZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-6SHRDXGF.js → chunk-IJYLSHY7.js} +173 -87
- package/dist/_browser-chunks/{chunk-SZCSXISG.js → chunk-NA4ITZTK.js} +7 -5
- package/dist/_browser-chunks/chunk-NGMQJMCY.js +53 -0
- package/dist/_browser-chunks/{chunk-K2B36HKM.js → chunk-O24AZJZ7.js} +1 -1
- package/dist/_browser-chunks/{chunk-NMRSYACM.js → chunk-SFMQDIN2.js} +4 -3
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/chunk-WVF42CP2.js +6027 -0
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-YYWKZ7O3.js} +3 -1
- package/dist/_node-chunks/{attached-runtime-IOE3BXIY.js → attached-runtime-WFZCCGUB.js} +29 -29
- package/dist/_node-chunks/{builder-manager-GDFEGD72.js → builder-manager-DHKHRZK4.js} +155 -148
- package/dist/_node-chunks/{chunk-M2QB5ALN.js → chunk-3ZCGT6VF.js} +6 -6
- package/dist/_node-chunks/{chunk-SUJXQU74.js → chunk-4HGC3G6B.js} +46 -15
- package/dist/_node-chunks/{chunk-WMQ2VCTF.js → chunk-5PYQ573S.js} +7 -7
- package/dist/_node-chunks/{chunk-TYCDPVIH.js → chunk-64JPAW3T.js} +6 -6
- package/dist/_node-chunks/chunk-6CB3XSQ2.js +495 -0
- package/dist/_node-chunks/{chunk-MHDKWHOA.js → chunk-6K3ZE4HN.js} +6 -6
- package/dist/_node-chunks/{chunk-3DCJB2D4.js → chunk-6QZ3PX5R.js} +6 -6
- package/dist/_node-chunks/{chunk-6DOJKR3V.js → chunk-7HVDL6M3.js} +29843 -51588
- package/dist/_node-chunks/chunk-7PMQPS5E.js +347 -0
- package/dist/_node-chunks/{chunk-L5CY6HKG.js → chunk-7V5AOV2J.js} +7 -7
- package/dist/_node-chunks/{chunk-AXJJB2K6.js → chunk-7VHCAGBJ.js} +8 -8
- package/dist/_node-chunks/{chunk-3DX6THMV.js → chunk-ATX7SHS7.js} +8 -8
- package/dist/_node-chunks/{chunk-SDXU22OH.js → chunk-BQC6WCUS.js} +6 -6
- package/dist/_node-chunks/{chunk-D6B2DRQZ.js → chunk-BR4WDRY6.js} +8 -8
- package/dist/_node-chunks/{chunk-SJZQ44OR.js → chunk-BRHJ4P3A.js} +6 -6
- package/dist/_node-chunks/{chunk-N4FLP7AO.js → chunk-CBBFNVFZ.js} +7 -7
- package/dist/_node-chunks/{chunk-PHXCOTMO.js → chunk-CDFQORVD.js} +34 -949
- package/dist/_node-chunks/{chunk-SR3BCYEH.js → chunk-CENNLCU7.js} +6 -6
- package/dist/_node-chunks/{chunk-OTFIQXHR.js → chunk-CNMMDQC3.js} +27 -50
- package/dist/_node-chunks/{chunk-E4C2H45J.js → chunk-DMDZPUHM.js} +6 -6
- package/dist/_node-chunks/{chunk-45LRLOYO.js → chunk-DT45EUDD.js} +60 -134
- package/dist/_node-chunks/{chunk-KQFHT7SW.js → chunk-EAL4RVEF.js} +6 -6
- package/dist/_node-chunks/chunk-EFFWFE6W.js +11 -0
- package/dist/_node-chunks/{chunk-MDGNN3FJ.js → chunk-ESCZ2NSB.js} +6 -6
- package/dist/_node-chunks/{chunk-T2I453AJ.js → chunk-ESZIQTUH.js} +7 -7
- package/dist/_node-chunks/{chunk-HWY2CAUH.js → chunk-F3SAYS4R.js} +6 -6
- package/dist/_node-chunks/{chunk-LSP54OYM.js → chunk-FTUQ7T3V.js} +25 -8
- package/dist/_node-chunks/{chunk-AAAUVDWT.js → chunk-FVFSSIGA.js} +10 -10
- package/dist/_node-chunks/{chunk-GS4VNNSS.js → chunk-G2AANC4A.js} +6 -6
- package/dist/_node-chunks/{chunk-SAAQFJL4.js → chunk-HUMAXGH2.js} +6 -6
- package/dist/_node-chunks/{chunk-A4XRNDN4.js → chunk-I535GEPH.js} +7 -7
- package/dist/_node-chunks/{chunk-CK4EHW3K.js → chunk-J3Q56GX3.js} +25 -25
- package/dist/_node-chunks/{chunk-U47PBQZ3.js → chunk-JDKYP7FW.js} +10 -10
- package/dist/_node-chunks/{chunk-7TUSIVWS.js → chunk-JED5F3H2.js} +6 -6
- package/dist/_node-chunks/{chunk-UM5G27IC.js → chunk-JMS4H7QB.js} +7 -7
- package/dist/_node-chunks/{chunk-GR65OLAH.js → chunk-JOSJ64KD.js} +7 -7
- package/dist/_node-chunks/{chunk-XUHEL63G.js → chunk-JPHSU5OI.js} +6 -6
- package/dist/_node-chunks/{chunk-NYWD5LYM.js → chunk-JQICISDD.js} +6 -6
- package/dist/_node-chunks/{chunk-I3DKGHVD.js → chunk-JTLOSDYL.js} +9 -9
- package/dist/_node-chunks/{chunk-5KAJVK4E.js → chunk-K5RUOW42.js} +7 -7
- package/dist/_node-chunks/{chunk-UKEJISQU.js → chunk-KHWCZDIW.js} +650 -9
- package/dist/_node-chunks/chunk-KWER36VB.js +20 -0
- package/dist/_node-chunks/{chunk-YTBTCM22.js → chunk-LJTP5PAJ.js} +6 -6
- package/dist/_node-chunks/chunk-LZYYZ62Y.js +19 -0
- package/dist/_node-chunks/{chunk-CGXW2HFE.js → chunk-M7ZVSBNU.js} +6 -6
- package/dist/_node-chunks/{chunk-BTFSFATC.js → chunk-MBIIJTGQ.js} +11 -10
- package/dist/_node-chunks/{chunk-VBSVLIXU.js → chunk-MF3AT3JQ.js} +6 -6
- package/dist/_node-chunks/{chunk-AX2ALHBK.js → chunk-MF5BYASO.js} +9 -6
- package/dist/_node-chunks/{chunk-JJNO3SFI.js → chunk-MJFMB4WD.js} +9 -9
- package/dist/_node-chunks/{chunk-E4TBS4MV.js → chunk-MRWBN46D.js} +8 -8
- package/dist/_node-chunks/{chunk-QQXFB4YA.js → chunk-MZQXEAI6.js} +9 -9
- package/dist/_node-chunks/{chunk-TZ2TZW2K.js → chunk-NLPC2DDQ.js} +6 -6
- package/dist/_node-chunks/{chunk-HCX5R46Q.js → chunk-NQAFLS5U.js} +8 -8
- package/dist/_node-chunks/{chunk-5LE7GXEC.js → chunk-NSZGBFPR.js} +6 -6
- package/dist/_node-chunks/{chunk-WHDCECIV.js → chunk-NUYBFTOU.js} +7 -7
- package/dist/_node-chunks/{chunk-RCPKLP3X.js → chunk-O7VJA7SM.js} +7 -7
- package/dist/_node-chunks/{chunk-2GY2FKLH.js → chunk-OGJ7LDX3.js} +7 -7
- package/dist/_node-chunks/{chunk-F4Q7OCCN.js → chunk-OWT6AVWK.js} +8 -8
- package/dist/_node-chunks/{chunk-LCXIUTOU.js → chunk-P3GOMPP3.js} +7 -7
- package/dist/_node-chunks/{chunk-KCAPE7OJ.js → chunk-PQLXHVWK.js} +6 -6
- package/dist/_node-chunks/{chunk-V45RRBTK.js → chunk-Q6QRFKHB.js} +8 -8
- package/dist/_node-chunks/{chunk-VJSOHPVD.js → chunk-QSP42ZBM.js} +6 -6
- package/dist/_node-chunks/{chunk-7XUQM6SR.js → chunk-QWDR5OWQ.js} +14 -14
- package/dist/_node-chunks/{chunk-YLKS7U3M.js → chunk-QWRQXG2V.js} +8 -8
- package/dist/_node-chunks/{chunk-4WO3GNZQ.js → chunk-R6AKCXPH.js} +6 -6
- package/dist/_node-chunks/{chunk-AXQ6LLSE.js → chunk-RCY7TLET.js} +8 -8
- package/dist/_node-chunks/chunk-RKKMQA6N.js +620 -0
- package/dist/_node-chunks/{chunk-BV3QRFE6.js → chunk-RZ7UEP4N.js} +6 -6
- package/dist/_node-chunks/{chunk-OSJFTZ5N.js → chunk-S3HB4EWT.js} +6 -6
- package/dist/_node-chunks/{chunk-QZVFIEOM.js → chunk-SHH7JROR.js} +6 -6
- package/dist/_node-chunks/{chunk-Q33BYVLY.js → chunk-SWHTDOB4.js} +7 -7
- package/dist/_node-chunks/{chunk-ZPPVG262.js → chunk-SZYMLCHF.js} +6 -6
- package/dist/_node-chunks/{chunk-ES5QZBSB.js → chunk-TOGDRW2W.js} +6 -6
- package/dist/_node-chunks/{chunk-J64XMUPF.js → chunk-U3E7E4Q2.js} +10 -10
- package/dist/_node-chunks/{chunk-RECGEABN.js → chunk-U6DHF3RM.js} +7 -7
- package/dist/_node-chunks/{chunk-OB2XHL53.js → chunk-UAG3XK32.js} +31 -30
- package/dist/_node-chunks/{chunk-BBD2KUV4.js → chunk-UF6Q6L5C.js} +22 -20
- package/dist/_node-chunks/chunk-UGXN7JTT.js +18 -0
- package/dist/_node-chunks/{chunk-EWAGCBER.js → chunk-UNCBLHIP.js} +8 -8
- package/dist/_node-chunks/chunk-UPJMGWMZ.js +25 -0
- package/dist/_node-chunks/chunk-UVV24PG4.js +69 -0
- package/dist/_node-chunks/{chunk-E6KXSYWR.js → chunk-WBB4NQ6H.js} +6 -6
- package/dist/_node-chunks/{chunk-B2IOB2V3.js → chunk-WHOF2BJB.js} +7 -7
- package/dist/_node-chunks/{chunk-FA36CEN4.js → chunk-WME5NEJA.js} +6 -6
- package/dist/_node-chunks/{chunk-BFZG4UTW.js → chunk-X63YMAHP.js} +7 -7
- package/dist/_node-chunks/chunk-Y2GHAOKI.js +25 -0
- package/dist/_node-chunks/{chunk-AXG3EMKS.js → chunk-Y6G64J5S.js} +7 -15
- package/dist/_node-chunks/chunk-YVIPYJ53.js +2609 -0
- package/dist/_node-chunks/{chunk-NDGTNFUN.js → chunk-YZWUD7I5.js} +16 -13
- package/dist/_node-chunks/{chunk-VN3A5CEH.js → chunk-ZIDIYSJQ.js} +7 -7
- package/dist/_node-chunks/chunk-ZSGOW4WQ.js +20 -0
- package/dist/_node-chunks/dist-5EG56KTF.js +16 -0
- package/dist/_node-chunks/dist-UEXSNGGQ.js +27 -0
- package/dist/_node-chunks/{local-runtime-RW6AAWSX.js → local-runtime-UN5QK2SE.js} +20 -20
- package/dist/_node-chunks/{mdx-plugin-BKWCT6CB.js → mdx-plugin-6M6CMNL3.js} +2263 -130
- package/dist/_node-chunks/{monorepo-ZFJ6HM34.js → monorepo-253VKW4B.js} +11 -11
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-C3EW4VJW.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-3ZOE54OQ.js} +11 -11
- package/dist/_node-chunks/optimized-tests-JSWLRMEI.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-2ZMJNCBS.js → pattern-copy-play-CCCJRMSL.js} +9 -9
- package/dist/_node-chunks/postinstallAddon-VMANBHPR.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-RT5Z62RV.js → rehype-external-links-LJTPLCGD.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-H5TWHJ6G.js → rehype-slug-KQI7ULEZ.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-DYLWZGE4.js → relaxed-limits-MUE2NI7S.js} +11 -11
- package/dist/_node-chunks/{run-65LLGSVR.js → run-PGZMPNMS.js} +246 -13
- package/dist/_node-chunks/{run-BQQLK454.js → run-SYLR25HA.js} +17 -17
- package/dist/_node-chunks/session-id-J4A25UQ6.js +23 -0
- package/dist/_node-chunks/{setup-NEO7XX66.js → setup-XZWSUYPG.js} +8 -8
- package/dist/_node-chunks/{vitest.config.4.template-6P3FZQTY.js → vitest.config.4.template-T25YYRGV.js} +7 -7
- package/dist/actions/decorator.js +2 -1
- package/dist/actions/index.js +2 -1
- package/dist/addon-a11y/index.js +2 -1
- package/dist/addon-a11y/manager.js +6 -5
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.js +2 -1
- package/dist/addon-docs/blocks.js +28 -14
- package/dist/addon-docs/manager.js +2 -2
- package/dist/addon-docs/preset.js +10 -10
- package/dist/addon-links/index.js +3 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +3 -2
- package/dist/addon-links/react/index.js +2 -1
- package/dist/addon-mcp/preset.js +8 -8
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +21 -44
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +2 -2
- package/dist/addon-vitest/node/coverage-reporter.js +8 -8
- package/dist/addon-vitest/node/vitest.js +16 -16
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +15 -16
- package/dist/addon-vitest/vitest-plugin/global-setup.js +7 -7
- package/dist/addon-vitest/vitest-plugin/index.js +17 -17
- package/dist/babel/index.d.ts +91 -842
- package/dist/babel/index.js +13 -19
- package/dist/bin/core.js +61 -60
- package/dist/bin/dispatcher.js +16 -11
- package/dist/bin/loader.js +16 -15
- package/dist/builder-vite/index.js +15 -15
- package/dist/builder-vite/preset.js +13 -13
- package/dist/{chunk-Jf7j2Ot0.d.ts → chunk-BGhyFTJO.d.ts} +1 -1
- package/dist/{chunk-Ce6uhJuR.d.ts → chunk-B_ZhEPlo.d.ts} +1 -1
- package/dist/{chunk-CZHsX9Zo.d.ts → chunk-CMaYrou5.d.ts} +1 -1
- package/dist/chunk-CV4-Z2pn.d.ts +30 -0
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-CYuvV2sR.d.ts} +11 -13
- package/dist/{chunk-DpljNJTz.d.ts → chunk-LrH1y9J2.d.ts} +39 -0
- package/dist/cli/index.d.ts +13 -866
- package/dist/cli/index.js +42 -4952
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +1 -1
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.js +3 -1
- package/dist/common/index.d.ts +5 -4
- package/dist/common/index.js +35 -37
- package/dist/components/index.d.ts +14 -231
- package/dist/components/index.js +2512 -8359
- package/dist/core-events/index.d.ts +3 -2
- package/dist/core-events/index.js +3 -1
- package/dist/core-server/index.d.ts +2 -2
- package/dist/core-server/index.js +450 -147
- package/dist/core-server/presets/common-manager.js +62 -866
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +39 -40
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/index.d.ts +1 -1
- package/dist/csf/index.js +27 -93
- package/dist/csf-tools/index.d.ts +14 -12
- package/dist/csf-tools/index.js +14 -14
- package/dist/instrumenter/index.js +3 -1
- package/dist/manager/_manager-chunks/{globals-runtime-BgVwdR45.js → globals-runtime-4fCHtNC6.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DW1HVuLt.js → globals-runtime-BKPOYSwp.js} +410 -379
- package/dist/manager/_manager-chunks/{globals-runtime-zVfMhZAt.js → globals-runtime-BMIT8BJb.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-CUBVmgcG.js → globals-runtime-BO0pfoqL.js} +4 -4
- package/dist/manager/_manager-chunks/{globals-runtime-Bke4A4DG.js → globals-runtime-BZKYJxYC.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-D_YKR9nf.js → globals-runtime-Bpc_ftuT.js} +1252 -539
- package/dist/manager/_manager-chunks/{globals-runtime-DCOX9nD5.js → globals-runtime-CBviMKtt.js} +1 -17
- package/dist/manager/_manager-chunks/{globals-runtime-CTB3rhS1.js → globals-runtime-CI-C7ncS.js} +10 -10
- package/dist/manager/_manager-chunks/{globals-runtime-Cr3nYYcT.js → globals-runtime-CI_p54Ha.js} +59 -60
- package/dist/manager/_manager-chunks/{globals-runtime-CiLcg4q9.js → globals-runtime-CTyYXvUm.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DqNrRmOM.js → globals-runtime-CoCzM1V_.js} +93 -2146
- package/dist/manager/_manager-chunks/{globals-runtime-CXKb33hg.js → globals-runtime-CzEhVGVp.js} +141 -54
- package/dist/manager/_manager-chunks/{globals-runtime-CF4o9_wT.js → globals-runtime-D82vqOGq.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-ALpzCL93.js → globals-runtime-DB8fVA5g.js} +2 -145
- package/dist/manager/_manager-chunks/{globals-runtime-DMvB3-IM.js → globals-runtime-DMq1Phbl.js} +153 -141
- package/dist/manager/_manager-chunks/globals-runtime-DOPUchia.js +5282 -0
- package/dist/manager/_manager-chunks/{globals-runtime-BcNHymiF.js → globals-runtime-Dbt08xWQ.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-m07udJ_K.js → globals-runtime-kmPSyf3j.js} +637 -1730
- package/dist/manager/_manager-chunks/{runtime-DMig8mT7.js → runtime-5o_11Jae.js} +4 -3
- package/dist/manager/_manager-chunks/{runtime-DrjpEyLM.js → runtime-B4U0u9p4.js} +5 -147
- package/dist/manager/_manager-chunks/{runtime-B-eSQdxk.js → runtime-BM30BmeT.js} +503 -44
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/{runtime-a5zd7km2.js → runtime-Cf0p9DUx.js} +5 -531
- package/dist/manager/_manager-chunks/{runtime-Cdz2BHhM.js → runtime-D-nYLsdk.js} +57 -34
- package/dist/manager/_manager-chunks/runtime-D09XMY6V.js +294 -0
- package/dist/manager/_manager-chunks/{runtime-Bldwclun.js → runtime-DvrwKw7z.js} +92 -303
- package/dist/manager/_manager-chunks/{runtime-DGHNKNQl.js → runtime-DzxaTqVN.js} +10 -29
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/{runtime-Cmu7D8A0.js → runtime-ecY5qnmo.js} +193 -184
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +22 -28
- package/dist/manager-errors.d.ts +1 -1
- package/dist/mcp/index.js +8 -8
- package/dist/mocking-utils/index.js +16 -11
- package/dist/nextjs-vite/index.js +3 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
- package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
- package/dist/nextjs-vite/preset.js +93 -14
- package/dist/nextjs-vite/vite-plugin/index.js +7 -7
- package/dist/nextjs-vite-plugin/index.d.ts +1 -2
- package/dist/nextjs-vite-plugin/index.js +12 -27
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/node-logger/index.d.ts +65 -72
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +11 -13
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/preview/_chunks/{runtime-DVM_AHbR.js → runtime-6P-h06Te.js} +51 -50
- package/dist/preview/_chunks/{runtime-BoxmlDdB.js → runtime-B9KKIDGa.js} +202 -81
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-BPwAnlRx.js} +482 -334
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-BUnOhg9h.js} +2 -2
- package/dist/preview/_chunks/runtime-Bcv1hJky.js +6305 -0
- package/dist/preview/_chunks/{runtime-CqHxptiK.js → runtime-C1jgT6tJ.js} +93 -2145
- package/dist/preview/_chunks/{runtime-D7B4bVe_.js → runtime-C8QFpkFV.js} +6 -6
- package/dist/preview/_chunks/{runtime-CijtAN7R.js → runtime-DdqR8Fd0.js} +15 -6
- package/dist/preview/_chunks/{runtime-B3y8ocOg.js → runtime-DvBfMhis.js} +2 -2
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-WapFVPAh.js} +29 -29
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +2 -1
- package/dist/preview-errors.d.ts +1 -1
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.js +6 -4
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.js +3 -2
- package/dist/react-native/bin/get-stories.js +8 -8
- package/dist/react-native/index.js +25 -211
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/withStorybook.js +11 -10
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.js +7 -7
- package/dist/router/index.js +3 -1
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +1 -1
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/telemetry/index.js +43 -45
- package/dist/test/index.js +808 -573
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.js +22 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +21 -44
- package/dist/_browser-chunks/WithTooltip-V55S6YCY.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-UDQ3XQFC.js +0 -108
- package/dist/_node-chunks/chunk-6QQTZT3Z.js +0 -19
- package/dist/_node-chunks/chunk-BRD332PB.js +0 -3008
- package/dist/_node-chunks/chunk-E2XKJLXK.js +0 -4731
- package/dist/_node-chunks/chunk-F2LQJXAB.js +0 -29
- package/dist/_node-chunks/chunk-MCZZMBPA.js +0 -20
- package/dist/_node-chunks/chunk-MMFUHYSU.js +0 -23
- package/dist/_node-chunks/chunk-UGFY5LEG.js +0 -18
- package/dist/_node-chunks/chunk-UO5ZOCSQ.js +0 -662
- package/dist/_node-chunks/chunk-UW35FCXF.js +0 -20
- package/dist/_node-chunks/chunk-VMUXW2E2.js +0 -5414
- package/dist/_node-chunks/chunk-VNXE7UJL.js +0 -51
- package/dist/_node-chunks/chunk-VRJJ43P2.js +0 -11
- package/dist/_node-chunks/chunk-WCJUS7OC.js +0 -1877
- package/dist/_node-chunks/chunk-WMBMSNB7.js +0 -36
- package/dist/_node-chunks/chunk-YV2QBXU6.js +0 -3823
- package/dist/_node-chunks/chunk-ZZNBVMBU.js +0 -25
- package/dist/_node-chunks/dist-VFUGPNLK.js +0 -16
- package/dist/_node-chunks/globby-N7LO32D3.js +0 -2884
- package/dist/_node-chunks/jiti-SJDZ7LQB.js +0 -3848
- package/dist/_node-chunks/lib-4HD6QL5R.js +0 -366
- package/dist/_node-chunks/optimized-tests-LVKXZ3HQ.js +0 -22
- package/dist/_node-chunks/postinstallAddon-I6MAL6PW.js +0 -20
- package/dist/_node-chunks/session-id-6Z2RXBTG.js +0 -23
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-Bon7UvQk.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DDOIxI_l.js +0 -1584
- package/dist/manager/_manager-chunks/runtime-CuJiHYCp.js +0 -22
- package/dist/manager/_manager-chunks/runtime-DFhLVh8q.js +0 -456
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
package/dist/babel/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as DeclareModuleExports, $i as TSTypeAnnotation, $n as NumberLiteralTypeAnnotation, $r as TSAsExpression, $t as Identifier, A as ClassBody, Aa as TypeParameterInstantiation, Ai as TSModuleBlock, An as JSXSpreadAttribute, Ar as QualifiedTypeIdentifier, At as ExportSpecifier, B as CompletionStatement, Ba as VariableDeclarator, Bi as TSParameterProperty, Bn as Method, Br as SpreadProperty$1, Bt as For, C as BooleanLiteralTypeAnnotation, Ca as TupleExpression, Ci as TSInterfaceBody, Cn as JSXExpressionContainer, Cr as PipelineTopicExpression, Ct as ExistsTypeAnnotation, D as CatchClause, Da as TypeCastExpression, Di as TSLiteralType, Dn as JSXNamespacedName, Dr as Program, Dt as ExportDefaultSpecifier, E as CallExpression, Ea as TypeAnnotation, Ei as TSIntrinsicKeyword, En as JSXMemberExpression, Er as PrivateName, Et as ExportDefaultDeclaration, F as ClassPrivateMethod, Fa as UnionTypeAnnotation, Fi as TSNonNullExpression, Fn as Literal, Fr as RestProperty$1, Ft as Flow, G as DecimalLiteral, Ga as WhileStatement, Gi as TSSatisfiesExpression, Gn as ModuleSpecifier, Gr as StringLiteralTypeAnnotation, Gt as Function, H as ConditionalExpression, Ha as VoidPattern, Hi as TSPropertySignature, Hn as MixedTypeAnnotation, Hr as Statement, Ht as ForOfStatement, I as ClassPrivateProperty, Ia as UpdateExpression, Ii as TSNullKeyword, In as LogicalExpression, Ir as ReturnStatement, It as FlowBaseAnnotation, J as DeclareExportAllDeclaration, Ja as index_d_exports
|
|
1
|
+
import { $ as DeclareModuleExports, $i as TSTypeAnnotation, $n as NumberLiteralTypeAnnotation, $r as TSAsExpression, $t as Identifier, A as ClassBody, Aa as TypeParameterInstantiation, Ai as TSModuleBlock, An as JSXSpreadAttribute, Ar as QualifiedTypeIdentifier, At as ExportSpecifier, B as CompletionStatement, Ba as VariableDeclarator, Bi as TSParameterProperty, Bn as Method, Br as SpreadProperty$1, Bt as For, C as BooleanLiteralTypeAnnotation, Ca as TupleExpression, Ci as TSInterfaceBody, Cn as JSXExpressionContainer, Cr as PipelineTopicExpression, Ct as ExistsTypeAnnotation, D as CatchClause, Da as TypeCastExpression, Di as TSLiteralType, Dn as JSXNamespacedName, Dr as Program, Dt as ExportDefaultSpecifier, E as CallExpression, Ea as TypeAnnotation, Ei as TSIntrinsicKeyword, En as JSXMemberExpression, Er as PrivateName, Et as ExportDefaultDeclaration, F as ClassPrivateMethod, Fa as UnionTypeAnnotation, Fi as TSNonNullExpression, Fn as Literal, Fr as RestProperty$1, Ft as Flow, G as DecimalLiteral, Ga as WhileStatement, Gi as TSSatisfiesExpression, Gn as ModuleSpecifier, Gr as StringLiteralTypeAnnotation, Gt as Function, H as ConditionalExpression, Ha as VoidPattern, Hi as TSPropertySignature, Hn as MixedTypeAnnotation, Hr as Statement, Ht as ForOfStatement, I as ClassPrivateProperty, Ia as UpdateExpression, Ii as TSNullKeyword, In as LogicalExpression, Ir as ReturnStatement, It as FlowBaseAnnotation, J as DeclareExportAllDeclaration, Ja as index_d_exports, Ji as TSTemplateLiteralType, Jn as Noop, Jr as SwitchCase, Jt as FunctionParameter, K as Declaration, Ka as WithStatement, Ki as TSStringKeyword, Kn as NewExpression, Kr as StringTypeAnnotation, Kt as FunctionDeclaration, L as ClassProperty, La as UserWhitespacable, Li as TSNumberKeyword, Ln as Loop, Lr as Scopable, Lt as FlowDeclaration, M as ClassExpression, Ma as TypeofTypeAnnotation, Mi as TSNamedTupleMember, Mn as JSXText, Mr as RegExpLiteral, Mt as ExpressionStatement, N as ClassImplements, Na as UnaryExpression, Ni as TSNamespaceExportDeclaration, Nn as LVal, Nr as RegexLiteral$1, Nt as ExpressionWrapper, O as Class, Oa as TypeParameter, Oi as TSMappedType, On as JSXOpeningElement, Or as Property, Ot as ExportNamedDeclaration, P as ClassMethod, Pa as UnaryLike, Pi as TSNeverKeyword, Pn as LabeledStatement, Pr as RestElement, Pt as File, Q as DeclareModule, Qi as TSTypeAliasDeclaration, Qn as NumberLiteral$1, Qr as TSArrayType, Qt as GenericTypeAnnotation, R as Comment, Ra as V8IntrinsicIdentifier, Ri as TSObjectKeyword, Rn as MemberExpression, Rr as SequenceExpression, Rt as FlowPredicate, S as BooleanLiteral, Sa as TryStatement, Si as TSInstantiationExpression, Sn as JSXEmptyExpression, Sr as PipelinePrimaryTopicReference, St as EnumSymbolBody, T as BreakStatement, Ta as TypeAlias, Ti as TSIntersectionType, Tn as JSXIdentifier, Tr as Private, Tt as ExportDeclaration, U as ContinueStatement, Ua as VoidTypeAnnotation, Ui as TSQualifiedName, Un as ModuleDeclaration, Ur as StaticBlock, Ut as ForStatement, V as Conditional, Va as Variance, Vi as TSParenthesizedType, Vn as Miscellaneous, Vr as Standardized, Vt as ForInStatement, W as DebuggerStatement, Wa as While, Wi as TSRestType, Wn as ModuleExpression, Wr as StringLiteral, Wt as ForXStatement, X as DeclareFunction, Xi as TSTupleType, Xn as NullLiteralTypeAnnotation, Xr as SymbolTypeAnnotation, Xt as FunctionTypeAnnotation, Y as DeclareExportDeclaration, Yi as TSThisType, Yn as NullLiteral, Yr as SwitchStatement, Yt as FunctionParent, Z as DeclareInterface, Zi as TSType, Zn as NullableTypeAnnotation, Zr as TSAnyKeyword, Zt as FunctionTypeParam, _ as BinaryExpression, _a as Terminatorless, _i as TSImportEqualsDeclaration, _n as JSX, _r as Options$1, _t as EnumMember, a as Aliases, aa as TSTypeParameterDeclaration, ai as TSConstructSignatureDeclaration, an as ImportDefaultSpecifier, ar as ObjectPattern, at as DeprecatedAliases, b as BlockParent, ba as ThrowStatement, bi as TSIndexedAccessType, bn as JSXClosingFragment, br as PatternLike, bt as EnumStringBody, c as ArrayExpression, ca as TSTypeQuery, ci as TSDeclareMethod, cn as ImportOrExportDeclaration, cr as ObjectTypeCallProperty, ct as DoExpression, d as ArrowFunctionExpression, da as TSUnionType, di as TSEnumDeclaration, dn as InferredPredicate, dr as ObjectTypeProperty, dt as EmptyTypeAnnotation, ea as TSTypeAssertion, ei as TSBaseType, en as IfStatement, er as NumberTypeAnnotation, et as DeclareOpaqueType, f as AssignmentExpression, fa as TSUnknownKeyword, fi as TSEnumMember, fn as InterfaceDeclaration, fr as ObjectTypeSpreadProperty, ft as EnumBody, g as Binary, ga as TemplateLiteral, gi as TSFunctionType, gn as IntersectionTypeAnnotation, gr as OptionalMemberExpression, gt as EnumDefaultedMember, h as BigIntLiteral, ha as TemplateElement, hi as TSExternalModuleReference, hn as InterpreterDirective, hr as OptionalIndexedAccessType, ht as EnumDeclaration, i as Accessor, ia as TSTypeParameter, ii as TSConditionalType, in as ImportDeclaration, ir as ObjectMethod, it as Decorator, j as ClassDeclaration, ja as TypeScript, ji as TSModuleDeclaration, jn as JSXSpreadChild, jr as RecordExpression, jt as Expression, k as ClassAccessorProperty, ka as TypeParameterDeclaration, ki as TSMethodSignature, kn as JSXOpeningFragment, kr as Pureish, kt as ExportNamespaceSpecifier, l as ArrayPattern, la as TSTypeReference, li as TSEntityName, ln as ImportSpecifier, lr as ObjectTypeIndexer, lt as DoWhileStatement, m as AwaitExpression, ma as TaggedTemplateExpression, mi as TSExpressionWithTypeArguments, mn as InterfaceTypeAnnotation, mr as OptionalCallExpression, mt as EnumBooleanMember, na as TSTypeLiteral, ni as TSBooleanKeyword, nn as Import, nr as ObjectExpression, nt as DeclareVariable, o as AnyTypeAnnotation, oa as TSTypeParameterInstantiation, oi as TSConstructorType, on as ImportExpression, or as ObjectProperty, ot as Directive, p as AssignmentPattern, pa as TSVoidKeyword, pi as TSExportAssignment, pn as InterfaceExtends, pr as OpaqueType, pt as EnumBooleanBody, q as DeclareClass, qa as YieldExpression, qi as TSSymbolKeyword, qn as Node, qr as Super, qt as FunctionExpression, r as generate$1, ra as TSTypeOperator, ri as TSCallSignatureDeclaration, rn as ImportAttribute, rr as ObjectMember, rt as DeclaredPredicate, s as ArgumentPlaceholder, sa as TSTypePredicate, si as TSDeclareFunction, sn as ImportNamespaceSpecifier, sr as ObjectTypeAnnotation, st as DirectiveLiteral, t as GeneratorOptions, ta as TSTypeElement, ti as TSBigIntKeyword, tn as Immutable, tr as NumericLiteral, tt as DeclareTypeAlias, u as ArrayTypeAnnotation, ua as TSUndefinedKeyword, ui as TSEnumBody, un as IndexedAccessType, ur as ObjectTypeInternalSlot, ut as EmptyStatement, v as BindExpression, va as ThisExpression, vi as TSImportType, vn as JSXAttribute, vr as ParenthesizedExpression, vt as EnumNumberBody, w as BooleanTypeAnnotation, wa as TupleTypeAnnotation, wi as TSInterfaceDeclaration, wn as JSXFragment, wr as Placeholder, wt as ExportAllDeclaration, x as BlockStatement, xa as TopicReference, xi as TSInferType, xn as JSXElement, xr as PipelineBareFunction, xt as EnumStringMember, y as Block, ya as ThisTypeAnnotation, yi as TSIndexSignature, yn as JSXClosingElement, yr as Pattern, yt as EnumNumberMember, z as CommentTypeShorthand, za as VariableDeclaration, zi as TSOptionalType, zn as MetaProperty, zr as SpreadElement, zt as FlowType } from "../chunk-D7DwV41f.js";
|
|
2
2
|
import * as recast from "recast";
|
|
3
3
|
import { Options as RecastOptions } from "recast";
|
|
4
4
|
|
|
5
5
|
//#region ../../node_modules/@babel/parser/typings/babel-parser.d.ts
|
|
6
6
|
declare namespace babel_parser_d_exports {
|
|
7
|
-
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult
|
|
7
|
+
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
|
|
8
8
|
}
|
|
9
9
|
declare class Position {
|
|
10
10
|
line: number;
|
|
@@ -185,7 +185,7 @@ interface Options {
|
|
|
185
185
|
}
|
|
186
186
|
type ParserOptions = Partial<Options>;
|
|
187
187
|
type ParseError = ParseError$1<object>;
|
|
188
|
-
type ParseResult
|
|
188
|
+
type ParseResult<Result extends File | Expression = File> = Result & {
|
|
189
189
|
comments: File["comments"];
|
|
190
190
|
errors: null | ParseError[];
|
|
191
191
|
tokens?: File["tokens"];
|
|
@@ -193,105 +193,25 @@ type ParseResult$1<Result extends File | Expression = File> = Result & {
|
|
|
193
193
|
/**
|
|
194
194
|
* Parse the provided code as an entire ECMAScript program.
|
|
195
195
|
*/
|
|
196
|
-
declare function parse
|
|
197
|
-
declare function parseExpression(input: string, options?: ParserOptions): ParseResult
|
|
196
|
+
declare function parse(input: string, options?: ParserOptions): ParseResult<File>;
|
|
197
|
+
declare function parseExpression(input: string, options?: ParserOptions): ParseResult<Expression>;
|
|
198
198
|
declare const tokTypes: {
|
|
199
199
|
// todo(flow->ts) real token type
|
|
200
200
|
[name: string]: any;
|
|
201
201
|
};
|
|
202
202
|
//#endregion
|
|
203
|
-
//#region ../../node_modules/@types/babel__template/index.d.ts
|
|
204
|
-
interface TemplateBuilderOptions extends ParserOptions {
|
|
205
|
-
/**
|
|
206
|
-
* A set of placeholder names to automatically accept.
|
|
207
|
-
* Items in this list do not need to match `placeholderPattern`.
|
|
208
|
-
*
|
|
209
|
-
* This option cannot be used when using `%%foo%%` style placeholders.
|
|
210
|
-
*/
|
|
211
|
-
placeholderWhitelist?: Set<string> | null | undefined;
|
|
212
|
-
/**
|
|
213
|
-
* A pattern to search for when looking for `Identifier` and `StringLiteral`
|
|
214
|
-
* nodes that should be considered as placeholders.
|
|
215
|
-
*
|
|
216
|
-
* `false` will disable placeholder searching placeholders, leaving only
|
|
217
|
-
* the `placeholderWhitelist` value to find replacements.
|
|
218
|
-
*
|
|
219
|
-
* This option cannot be used when using `%%foo%%` style placeholders.
|
|
220
|
-
*
|
|
221
|
-
* @default /^[_$A-Z0-9]+$/
|
|
222
|
-
*/
|
|
223
|
-
placeholderPattern?: RegExp | false | null | undefined;
|
|
224
|
-
/**
|
|
225
|
-
* Set this to `true` to preserve comments from the template string
|
|
226
|
-
* into the resulting AST, or `false` to automatically discard comments.
|
|
227
|
-
*
|
|
228
|
-
* @default false
|
|
229
|
-
*/
|
|
230
|
-
preserveComments?: boolean | null | undefined;
|
|
231
|
-
/**
|
|
232
|
-
* Set to `true` to use `%%foo%%` style placeholders, `false` to use legacy placeholders
|
|
233
|
-
* described by `placeholderPattern` or `placeholderWhitelist`.
|
|
234
|
-
*
|
|
235
|
-
* When it is not set, it behaves as `true` if there are syntactic placeholders, otherwise as `false`.
|
|
236
|
-
*
|
|
237
|
-
* @since 7.4.0
|
|
238
|
-
*/
|
|
239
|
-
syntacticPlaceholders?: boolean | null | undefined;
|
|
240
|
-
}
|
|
241
|
-
interface TemplateBuilder<T> {
|
|
242
|
-
/**
|
|
243
|
-
* Build a new builder, merging the given options with the previous ones.
|
|
244
|
-
*/
|
|
245
|
-
(opts: TemplateBuilderOptions): TemplateBuilder<T>;
|
|
246
|
-
/**
|
|
247
|
-
* Building from a string produces an AST builder function by default.
|
|
248
|
-
*/
|
|
249
|
-
(code: string, opts?: TemplateBuilderOptions): (arg?: PublicReplacements) => T;
|
|
250
|
-
/**
|
|
251
|
-
* Building from a template literal produces an AST builder function by default.
|
|
252
|
-
*/
|
|
253
|
-
(tpl: TemplateStringsArray, ...args: unknown[]): (arg?: PublicReplacements) => T;
|
|
254
|
-
/**
|
|
255
|
-
* Allow users to explicitly create templates that produce ASTs,
|
|
256
|
-
* skipping the need for an intermediate function.
|
|
257
|
-
*
|
|
258
|
-
* Does not allow `%%foo%%` style placeholders.
|
|
259
|
-
*/
|
|
260
|
-
ast: {
|
|
261
|
-
(tpl: string, opts?: TemplateBuilderOptions): T;
|
|
262
|
-
(tpl: TemplateStringsArray, ...args: unknown[]): T;
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
type PublicReplacements = {
|
|
266
|
-
[index: string]: unknown;
|
|
267
|
-
} | unknown[];
|
|
268
|
-
declare const smart: TemplateBuilder<Statement | Statement[]>;
|
|
269
|
-
declare const statement: TemplateBuilder<Statement>;
|
|
270
|
-
declare const statements: TemplateBuilder<Statement[]>;
|
|
271
|
-
declare const expression: TemplateBuilder<Expression>;
|
|
272
|
-
declare const program: TemplateBuilder<Program>;
|
|
273
|
-
type DefaultTemplateBuilder = typeof smart & {
|
|
274
|
-
smart: typeof smart;
|
|
275
|
-
statement: typeof statement;
|
|
276
|
-
statements: typeof statements;
|
|
277
|
-
expression: typeof expression;
|
|
278
|
-
program: typeof program;
|
|
279
|
-
ast: typeof smart.ast;
|
|
280
|
-
};
|
|
281
|
-
declare const templateBuilder: DefaultTemplateBuilder;
|
|
282
|
-
//#endregion
|
|
283
203
|
//#region ../../node_modules/@types/babel__traverse/index.d.ts
|
|
284
204
|
declare const traverse$1: {
|
|
285
|
-
<S>(parent: Node
|
|
286
|
-
(parent: Node
|
|
205
|
+
<S>(parent: Node, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath): void;
|
|
206
|
+
(parent: Node, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void;
|
|
287
207
|
visitors: typeof visitors;
|
|
288
208
|
verify: typeof visitors.verify;
|
|
289
209
|
explode: typeof visitors.explode;
|
|
290
|
-
cheap: (node: Node
|
|
291
|
-
node: (node: Node
|
|
292
|
-
clearNode: (node: Node
|
|
293
|
-
removeProperties: (tree: Node
|
|
294
|
-
hasType: (tree: Node
|
|
210
|
+
cheap: (node: Node, enter: (node: Node) => void) => void;
|
|
211
|
+
node: (node: Node, opts: TraverseOptions, scope?: Scope, state?: any, path?: NodePath, skipKeys?: Record<string, boolean>) => void;
|
|
212
|
+
clearNode: (node: Node, opts?: Options$1) => void;
|
|
213
|
+
removeProperties: (tree: Node, opts?: Options$1) => Node;
|
|
214
|
+
hasType: (tree: Node, type: Node["type"], denylistTypes?: string[]) => boolean;
|
|
295
215
|
cache: typeof cache;
|
|
296
216
|
};
|
|
297
217
|
declare namespace visitors {
|
|
@@ -309,21 +229,21 @@ declare namespace visitors {
|
|
|
309
229
|
* - Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes
|
|
310
230
|
* - `enter` and `exit` functions are wrapped in arrays, to ease merging of visitors
|
|
311
231
|
*/
|
|
312
|
-
function explode<S = unknown>(visitor: Visitor<S>): { [Type in Exclude<Node
|
|
232
|
+
function explode<S = unknown>(visitor: Visitor<S>): { [Type in Exclude<Node, DeprecatedAliases>["type"]]?: VisitNodeObject<S, Extract<Node, {
|
|
313
233
|
type: Type;
|
|
314
234
|
}>> };
|
|
315
235
|
function verify(visitor: Visitor): void;
|
|
316
236
|
function merge<State>(visitors: Array<Visitor<State>>): Visitor<State>;
|
|
317
|
-
function merge(visitors: Visitor[], states?: any[], wrapper?: (stateKey: any, visitorKey: keyof Visitor, func: VisitNodeFunction<unknown, Node
|
|
237
|
+
function merge(visitors: Visitor[], states?: any[], wrapper?: (stateKey: any, visitorKey: keyof Visitor, func: VisitNodeFunction<unknown, Node>) => VisitNodeFunction<unknown, Node> | null): Visitor;
|
|
318
238
|
}
|
|
319
239
|
declare namespace cache {
|
|
320
|
-
let path: WeakMap<Node
|
|
321
|
-
let scope: WeakMap<Node
|
|
240
|
+
let path: WeakMap<Node, Map<Node, NodePath>>;
|
|
241
|
+
let scope: WeakMap<Node, Scope>;
|
|
322
242
|
function clear(): void;
|
|
323
243
|
function clearPath(): void;
|
|
324
244
|
function clearScope(): void;
|
|
325
245
|
}
|
|
326
|
-
type TraverseOptions<S = Node
|
|
246
|
+
type TraverseOptions<S = Node> = {
|
|
327
247
|
scope?: Scope;
|
|
328
248
|
noScope?: boolean;
|
|
329
249
|
denylist?: NodeType[]; /** @deprecated will be removed in Babel 8 */
|
|
@@ -338,9 +258,9 @@ declare class Scope {
|
|
|
338
258
|
constructor(path: NodePath, parentScope?: Scope);
|
|
339
259
|
uid: number;
|
|
340
260
|
path: NodePath;
|
|
341
|
-
block: Node
|
|
261
|
+
block: Node;
|
|
342
262
|
labels: Map<string, NodePath<LabeledStatement>>;
|
|
343
|
-
parentBlock: Node
|
|
263
|
+
parentBlock: Node;
|
|
344
264
|
parent: Scope;
|
|
345
265
|
hub: HubInterface;
|
|
346
266
|
bindings: {
|
|
@@ -361,8 +281,8 @@ declare class Scope {
|
|
|
361
281
|
/** Variables available in current context. */
|
|
362
282
|
static contextVariables: string[];
|
|
363
283
|
/** Traverse node with current scope and path. */
|
|
364
|
-
traverse<S>(node: Node
|
|
365
|
-
traverse(node: Node
|
|
284
|
+
traverse<S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void;
|
|
285
|
+
traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void;
|
|
366
286
|
/** Generate a unique identifier and add it to the current scope. */
|
|
367
287
|
generateDeclaredUidIdentifier(name?: string): Identifier;
|
|
368
288
|
/** Generate a unique identifier. */
|
|
@@ -370,7 +290,7 @@ declare class Scope {
|
|
|
370
290
|
/** Generate a unique `_id1` binding. */
|
|
371
291
|
generateUid(name?: string): string;
|
|
372
292
|
/** Generate a unique identifier based on a node. */
|
|
373
|
-
generateUidIdentifierBasedOnNode(parent: Node
|
|
293
|
+
generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): Identifier;
|
|
374
294
|
/**
|
|
375
295
|
* Determine whether evaluating the specific input `node` is a consequenceless reference. ie.
|
|
376
296
|
* evaluating it wont result in potentially arbitrary code from being ran. The following are
|
|
@@ -380,13 +300,13 @@ declare class Scope {
|
|
|
380
300
|
* - `super` expressions
|
|
381
301
|
* - Bound identifiers
|
|
382
302
|
*/
|
|
383
|
-
isStatic(node: Node
|
|
303
|
+
isStatic(node: Node): boolean;
|
|
384
304
|
/** Possibly generate a memoised identifier if it is not static and has consequences. */
|
|
385
|
-
maybeGenerateMemoised(node: Node
|
|
305
|
+
maybeGenerateMemoised(node: Node, dontPush?: boolean): Identifier;
|
|
386
306
|
checkBlockScopedCollisions(local: Binding, kind: BindingKind, name: string, id: object): void;
|
|
387
|
-
rename(oldName: string, newName?: string, block?: Node
|
|
307
|
+
rename(oldName: string, newName?: string, block?: Node): void;
|
|
388
308
|
dump(): void;
|
|
389
|
-
toArray(node: Node
|
|
309
|
+
toArray(node: Node, i?: number | boolean, arrayLikeIsIterable?: boolean): ArrayExpression | CallExpression | Identifier;
|
|
390
310
|
hasLabel(name: string): boolean;
|
|
391
311
|
getLabel(name: string): NodePath<LabeledStatement> | undefined;
|
|
392
312
|
registerLabel(path: NodePath<LabeledStatement>): void;
|
|
@@ -398,7 +318,7 @@ declare class Scope {
|
|
|
398
318
|
hasUid(name: string): boolean;
|
|
399
319
|
hasGlobal(name: string): boolean;
|
|
400
320
|
hasReference(name: string): boolean;
|
|
401
|
-
isPure(node: Node
|
|
321
|
+
isPure(node: Node, constantsOnly?: boolean): boolean;
|
|
402
322
|
/**
|
|
403
323
|
* Set some arbitrary data on the current scope.
|
|
404
324
|
*/
|
|
@@ -439,7 +359,7 @@ declare class Scope {
|
|
|
439
359
|
getAllBindings(): Record<string, Binding>;
|
|
440
360
|
/** Walks the scope tree and gathers all declarations of `kind`. */
|
|
441
361
|
getAllBindingsOfKind(...kinds: string[]): Record<string, Binding>;
|
|
442
|
-
bindingIdentifierEquals(name: string, node: Node
|
|
362
|
+
bindingIdentifierEquals(name: string, node: Node): boolean;
|
|
443
363
|
getBinding(name: string): Binding | undefined;
|
|
444
364
|
getOwnBinding(name: string): Binding | undefined;
|
|
445
365
|
getBindingIdentifier(name: string): Identifier;
|
|
@@ -498,28 +418,28 @@ declare class Binding {
|
|
|
498
418
|
/** Decrement the amount of references to this binding. */
|
|
499
419
|
dereference(): void;
|
|
500
420
|
}
|
|
501
|
-
type Visitor<S = unknown> = VisitNodeObject<S, Node
|
|
421
|
+
type Visitor<S = unknown> = VisitNodeObject<S, Node> & { [N in Node as N["type"]]?: VisitNode<S, N extends {
|
|
502
422
|
type: N["type"];
|
|
503
423
|
} ? N : never> } & { [K in keyof Aliases]?: VisitNode<S, Aliases[K]> } & { [K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]> } & {
|
|
504
424
|
// Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
|
|
505
425
|
// too complex for TS. So we type it as a general visitor only if the key contains `|`
|
|
506
426
|
// this is good enough for non-visitor traverse options e.g. `noScope`
|
|
507
|
-
[k: `${string}|${string}`]: VisitNode<S, Node
|
|
427
|
+
[k: `${string}|${string}`]: VisitNode<S, Node>;
|
|
508
428
|
};
|
|
509
|
-
type VisitNode<S, P extends Node
|
|
510
|
-
type VisitNodeFunction<S, P extends Node
|
|
511
|
-
type NodeType = Node
|
|
512
|
-
interface VisitNodeObject<S, P extends Node
|
|
429
|
+
type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
|
430
|
+
type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>, state: S) => void;
|
|
431
|
+
type NodeType = Node["type"] | keyof Aliases;
|
|
432
|
+
interface VisitNodeObject<S, P extends Node> {
|
|
513
433
|
enter?: VisitNodeFunction<S, P>;
|
|
514
434
|
exit?: VisitNodeFunction<S, P>;
|
|
515
435
|
}
|
|
516
|
-
type NodeKeyOfArrays<T extends Node
|
|
517
|
-
type NodePaths<T extends Node
|
|
518
|
-
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node
|
|
519
|
-
type NodesInsertionParam<T extends Node
|
|
520
|
-
declare class NodePath<T = Node
|
|
521
|
-
constructor(hub: HubInterface, parent: Node
|
|
522
|
-
parent: Node
|
|
436
|
+
type NodeKeyOfArrays<T extends Node> = { [P in keyof T]-?: T[P] extends Array<Node | null | undefined> ? P : never }[keyof T];
|
|
437
|
+
type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[] ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> } : T extends Node ? [NodePath<T>] : never;
|
|
438
|
+
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node ? P : never) : never;
|
|
439
|
+
type NodesInsertionParam<T extends Node> = T | readonly T[] | [T, ...T[]];
|
|
440
|
+
declare class NodePath<T = Node> {
|
|
441
|
+
constructor(hub: HubInterface, parent: Node);
|
|
442
|
+
parent: Node;
|
|
523
443
|
hub: Hub;
|
|
524
444
|
data: Record<string | symbol, unknown>;
|
|
525
445
|
context: TraversalContext;
|
|
@@ -529,32 +449,32 @@ declare class NodePath<T = Node$1> {
|
|
|
529
449
|
opts: any; // exploded TraverseOptions
|
|
530
450
|
skipKeys: Record<string, boolean> | null;
|
|
531
451
|
parentPath: T extends Program ? null : NodePath;
|
|
532
|
-
container: Node
|
|
452
|
+
container: Node | Node[] | null;
|
|
533
453
|
listKey: string | null;
|
|
534
454
|
key: string | number | null;
|
|
535
455
|
node: T;
|
|
536
|
-
type: T extends Node
|
|
456
|
+
type: T extends Node ? T["type"] : T extends null | undefined ? undefined : Node["type"] | undefined;
|
|
537
457
|
shouldSkip: boolean;
|
|
538
458
|
shouldStop: boolean;
|
|
539
459
|
removed: boolean;
|
|
540
460
|
inList: boolean;
|
|
541
461
|
parentKey: string;
|
|
542
462
|
typeAnnotation: object;
|
|
543
|
-
static get<C extends Node
|
|
463
|
+
static get<C extends Node, K extends keyof C>(opts: {
|
|
544
464
|
hub?: HubInterface;
|
|
545
465
|
parentPath: NodePath | null;
|
|
546
|
-
parent: Node
|
|
466
|
+
parent: Node;
|
|
547
467
|
container: C;
|
|
548
468
|
key: K;
|
|
549
469
|
}): NodePath<C[K]>;
|
|
550
|
-
static get<C extends Node
|
|
470
|
+
static get<C extends Node, L extends NodeKeyOfArrays<C>>(opts: {
|
|
551
471
|
hub?: HubInterface;
|
|
552
472
|
parentPath: NodePath | null;
|
|
553
|
-
parent: Node
|
|
473
|
+
parent: Node;
|
|
554
474
|
container: C;
|
|
555
475
|
listKey: L;
|
|
556
476
|
key: number;
|
|
557
|
-
}): C[L] extends Array<Node
|
|
477
|
+
}): C[L] extends Array<Node | null | undefined> ? NodePath<C[L][number]> : never;
|
|
558
478
|
getScope(scope: Scope): Scope;
|
|
559
479
|
setData(key: string | symbol, val: any): any;
|
|
560
480
|
getData(key: string | symbol, def?: any): any;
|
|
@@ -591,7 +511,7 @@ declare class NodePath<T = Node$1> {
|
|
|
591
511
|
*/
|
|
592
512
|
getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath;
|
|
593
513
|
/** Get the earliest path in the tree where the provided `paths` intersect. */
|
|
594
|
-
getDeepestCommonAncestorFrom(paths: NodePath[], filter?: (deepest: Node
|
|
514
|
+
getDeepestCommonAncestorFrom(paths: NodePath[], filter?: (deepest: Node, i: number, ancestries: NodePath[][]) => NodePath): NodePath;
|
|
595
515
|
/**
|
|
596
516
|
* Build an array of node paths containing the entire ancestry of the current node path.
|
|
597
517
|
*
|
|
@@ -622,7 +542,7 @@ declare class NodePath<T = Node$1> {
|
|
|
622
542
|
* - Insert the provided nodes after the current node.
|
|
623
543
|
* - Remove the current node.
|
|
624
544
|
*/
|
|
625
|
-
replaceWithMultiple<Nodes extends Node
|
|
545
|
+
replaceWithMultiple<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
|
|
626
546
|
/**
|
|
627
547
|
* Parse a string as an expression and replace the current node with the result.
|
|
628
548
|
*
|
|
@@ -632,7 +552,7 @@ declare class NodePath<T = Node$1> {
|
|
|
632
552
|
*/
|
|
633
553
|
replaceWithSourceString(replacement: string): [NodePath];
|
|
634
554
|
/** Replace the current node with another. */
|
|
635
|
-
replaceWith<R extends Node
|
|
555
|
+
replaceWith<R extends Node>(replacementPath: R | NodePath<R>): [NodePath<R>];
|
|
636
556
|
replaceWith<R extends NodePath>(replacementPath: R): [R];
|
|
637
557
|
/**
|
|
638
558
|
* This method takes an array of statements nodes and then explodes it
|
|
@@ -640,7 +560,7 @@ declare class NodePath<T = Node$1> {
|
|
|
640
560
|
* extremely important to retain original semantics.
|
|
641
561
|
*/
|
|
642
562
|
replaceExpressionWithStatements(nodes: Statement[]): NodePaths<Expression | Statement>;
|
|
643
|
-
replaceInline<Nodes extends Node
|
|
563
|
+
replaceInline<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>; // #endregion
|
|
644
564
|
// #region ------------------------- evaluation -------------------------
|
|
645
565
|
/**
|
|
646
566
|
* Walk the input `node` and statically evaluate if it's truthy.
|
|
@@ -712,7 +632,7 @@ declare class NodePath<T = Node$1> {
|
|
|
712
632
|
* This is because arrow functions may implicitly return an expression, which
|
|
713
633
|
* is the same as containing a block statement.
|
|
714
634
|
*/
|
|
715
|
-
canSwapBetweenExpressionAndStatement(replacement: Node
|
|
635
|
+
canSwapBetweenExpressionAndStatement(replacement: Node): boolean;
|
|
716
636
|
/** Check whether the current path references a completion record */
|
|
717
637
|
isCompletionRecord(allowInsideFunction?: boolean): boolean;
|
|
718
638
|
/**
|
|
@@ -781,12 +701,12 @@ declare class NodePath<T = Node$1> {
|
|
|
781
701
|
}>; // #endregion
|
|
782
702
|
// #region ------------------------- modification -------------------------
|
|
783
703
|
/** Insert the provided nodes before the current one. */
|
|
784
|
-
insertBefore<Nodes extends NodesInsertionParam<Node
|
|
704
|
+
insertBefore<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
785
705
|
/**
|
|
786
706
|
* Insert the provided nodes after the current one. When inserting nodes after an
|
|
787
707
|
* expression, ensure that the completion record is correct by pushing the current node.
|
|
788
708
|
*/
|
|
789
|
-
insertAfter<Nodes extends NodesInsertionParam<Node
|
|
709
|
+
insertAfter<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
790
710
|
/** Update all sibling node paths after `fromIndex` by `incrementBy`. */
|
|
791
711
|
updateSiblingKeys(fromIndex: number, incrementBy: number): void;
|
|
792
712
|
/**
|
|
@@ -794,13 +714,13 @@ declare class NodePath<T = Node$1> {
|
|
|
794
714
|
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
795
715
|
* @param nodes - the nodes to insert.
|
|
796
716
|
*/
|
|
797
|
-
unshiftContainer<T extends Node
|
|
717
|
+
unshiftContainer<T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
798
718
|
/**
|
|
799
719
|
* Insert child nodes at the end of the current node.
|
|
800
720
|
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
801
721
|
* @param nodes - the nodes to insert.
|
|
802
722
|
*/
|
|
803
|
-
pushContainer<T extends Node
|
|
723
|
+
pushContainer<T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
804
724
|
/** Hoist the current node to the highest scope possible and return a UID referencing it. */
|
|
805
725
|
hoist(scope: Scope): void; // #endregion
|
|
806
726
|
// #region ------------------------- family -------------------------
|
|
@@ -1478,14 +1398,14 @@ interface HubInterface {
|
|
|
1478
1398
|
getCode(): string | undefined;
|
|
1479
1399
|
getScope(): Scope | undefined;
|
|
1480
1400
|
addHelper(name: string): any;
|
|
1481
|
-
buildError(node: Node
|
|
1401
|
+
buildError(node: Node, msg: string, Error: ErrorConstructor): Error;
|
|
1482
1402
|
}
|
|
1483
1403
|
declare class Hub implements HubInterface {
|
|
1484
1404
|
constructor();
|
|
1485
1405
|
getCode(): string | undefined;
|
|
1486
1406
|
getScope(): Scope | undefined;
|
|
1487
1407
|
addHelper(name: string): any;
|
|
1488
|
-
buildError(node: Node
|
|
1408
|
+
buildError(node: Node, msg: string, Error?: ErrorConstructor): Error;
|
|
1489
1409
|
}
|
|
1490
1410
|
interface TraversalContext<S = unknown> {
|
|
1491
1411
|
parentPath: NodePath;
|
|
@@ -1498,719 +1418,25 @@ interface TraversalContext<S = unknown> {
|
|
|
1498
1418
|
type ImplGetOfArray<T extends readonly unknown[], K extends string> = K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : never; // dprint-ignore
|
|
1499
1419
|
type ImplGetByKey<T, K extends string> = T extends readonly unknown[] ? ImplGetOfArray<T, K> : K extends keyof T ? T[K] : K extends `${infer N extends number}` ? N extends keyof T ? T[N] : never : never; // dprint-ignore
|
|
1500
1420
|
type ImplGetRecursive<T, K extends string> = K extends `${infer L}.${infer R}` ? ImplGetRecursive<ImplGetByKey<T, L>, R> : ImplGetByKey<T, K>;
|
|
1501
|
-
type NodePathResult<T> = (Extract<T, Node
|
|
1421
|
+
type NodePathResult<T> = (Extract<T, Node | null | undefined> extends never ? never : NodePath<Extract<T, Node | null | undefined>>) | (T extends Array<Node | null | undefined> ? Array<NodePath<T[number]>> : never);
|
|
1502
1422
|
interface VirtualTypeAliases {
|
|
1503
1423
|
BindingIdentifier: Identifier;
|
|
1504
|
-
BlockScoped: Node
|
|
1424
|
+
BlockScoped: Node;
|
|
1505
1425
|
ExistentialTypeParam: ExistsTypeAnnotation;
|
|
1506
1426
|
Flow: Flow | ImportDeclaration | ExportDeclaration | ImportSpecifier;
|
|
1507
1427
|
ForAwaitStatement: ForOfStatement;
|
|
1508
|
-
Generated: Node
|
|
1428
|
+
Generated: Node;
|
|
1509
1429
|
NumericLiteralTypeAnnotation: NumberLiteralTypeAnnotation;
|
|
1510
|
-
Pure: Node
|
|
1511
|
-
Referenced: Node
|
|
1430
|
+
Pure: Node;
|
|
1431
|
+
Referenced: Node;
|
|
1512
1432
|
ReferencedIdentifier: Identifier | JSXIdentifier;
|
|
1513
1433
|
ReferencedMemberExpression: MemberExpression;
|
|
1514
1434
|
RestProperty: RestElement;
|
|
1515
1435
|
Scope: Scopable | Pattern;
|
|
1516
1436
|
SpreadProperty: RestElement;
|
|
1517
|
-
User: Node
|
|
1437
|
+
User: Node;
|
|
1518
1438
|
Var: VariableDeclaration;
|
|
1519
1439
|
}
|
|
1520
|
-
declare namespace index_d_exports {
|
|
1521
|
-
export { BabelFile, BabelFileMetadata, BabelFileModulesMetadata, BabelFileResult, ConfigAPI, ConfigFunction, ConfigItem, CreateConfigItemOptions, DEFAULT_EXTENSIONS, EnvFunction, FileParseCallback, FileResultCallback, GeneratorOptions, MatchPattern, MatchPatternContext, Node, NodePath, ParseResult, ParserOptions, PartialConfig, PluginItem, PluginObj, PluginOptions, PluginPass, PluginTarget, SimpleCacheCallback, SimpleCacheConfigurator, SimpleCacheKey, TransformCaller, TransformOptions, Visitor, createConfigItem, loadOptions, loadPartialConfig, loadPartialConfigAsync, parse, parseAsync, parseSync, resolvePlugin, resolvePreset, templateBuilder as template, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, traverse$1 as traverse, index_d_exports$1 as types, version };
|
|
1522
|
-
}
|
|
1523
|
-
type Node = Node$1;
|
|
1524
|
-
type ParseResult = ReturnType<typeof parse$1>;
|
|
1525
|
-
declare const version: string;
|
|
1526
|
-
declare const DEFAULT_EXTENSIONS: [".js", ".jsx", ".es6", ".es", ".mjs"];
|
|
1527
|
-
/**
|
|
1528
|
-
* Source map standard format as to revision 3
|
|
1529
|
-
* @see {@link https://sourcemaps.info/spec.html}
|
|
1530
|
-
* @see {@link https://github.com/mozilla/source-map/blob/HEAD/source-map.d.ts}
|
|
1531
|
-
*/
|
|
1532
|
-
interface InputSourceMap {
|
|
1533
|
-
version: number;
|
|
1534
|
-
sources: string[];
|
|
1535
|
-
names: string[];
|
|
1536
|
-
sourceRoot?: string | undefined;
|
|
1537
|
-
sourcesContent?: string[] | undefined;
|
|
1538
|
-
mappings: string;
|
|
1539
|
-
file: string;
|
|
1540
|
-
}
|
|
1541
|
-
interface TransformOptions {
|
|
1542
|
-
/**
|
|
1543
|
-
* Specify which assumptions it can make about your code, to better optimize the compilation result. **NOTE**: This replaces the various `loose` options in plugins in favor of
|
|
1544
|
-
* top-level options that can apply to multiple plugins
|
|
1545
|
-
*
|
|
1546
|
-
* @see https://babeljs.io/docs/en/assumptions
|
|
1547
|
-
*/
|
|
1548
|
-
assumptions?: {
|
|
1549
|
-
[name: string]: boolean;
|
|
1550
|
-
} | null | undefined;
|
|
1551
|
-
/**
|
|
1552
|
-
* Include the AST in the returned object
|
|
1553
|
-
*
|
|
1554
|
-
* Default: `false`
|
|
1555
|
-
*/
|
|
1556
|
-
ast?: boolean | null | undefined;
|
|
1557
|
-
/**
|
|
1558
|
-
* Attach a comment after all non-user injected code
|
|
1559
|
-
*
|
|
1560
|
-
* Default: `null`
|
|
1561
|
-
*/
|
|
1562
|
-
auxiliaryCommentAfter?: string | null | undefined;
|
|
1563
|
-
/**
|
|
1564
|
-
* Attach a comment before all non-user injected code
|
|
1565
|
-
*
|
|
1566
|
-
* Default: `null`
|
|
1567
|
-
*/
|
|
1568
|
-
auxiliaryCommentBefore?: string | null | undefined;
|
|
1569
|
-
/**
|
|
1570
|
-
* Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of.
|
|
1571
|
-
*
|
|
1572
|
-
* Default: `"."`
|
|
1573
|
-
*/
|
|
1574
|
-
root?: string | null | undefined;
|
|
1575
|
-
/**
|
|
1576
|
-
* This option, combined with the "root" value, defines how Babel chooses its project root.
|
|
1577
|
-
* The different modes define different ways that Babel can process the "root" value to get
|
|
1578
|
-
* the final project root.
|
|
1579
|
-
*
|
|
1580
|
-
* @see https://babeljs.io/docs/en/next/options#rootmode
|
|
1581
|
-
*/
|
|
1582
|
-
rootMode?: "root" | "upward" | "upward-optional" | undefined;
|
|
1583
|
-
/**
|
|
1584
|
-
* The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files.
|
|
1585
|
-
*
|
|
1586
|
-
* Default: `undefined`
|
|
1587
|
-
*/
|
|
1588
|
-
configFile?: string | boolean | null | undefined;
|
|
1589
|
-
/**
|
|
1590
|
-
* Specify whether or not to use .babelrc and
|
|
1591
|
-
* .babelignore files.
|
|
1592
|
-
*
|
|
1593
|
-
* Default: `true`
|
|
1594
|
-
*/
|
|
1595
|
-
babelrc?: boolean | null | undefined;
|
|
1596
|
-
/**
|
|
1597
|
-
* Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search
|
|
1598
|
-
* inside of. Defaults to only searching the "root" package.
|
|
1599
|
-
*
|
|
1600
|
-
* Default: `(root)`
|
|
1601
|
-
*/
|
|
1602
|
-
babelrcRoots?: boolean | MatchPattern | MatchPattern[] | null | undefined;
|
|
1603
|
-
/**
|
|
1604
|
-
* Toggles whether or not browserslist config sources are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json.
|
|
1605
|
-
* This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
|
|
1606
|
-
*
|
|
1607
|
-
* If a string is specified, it must represent the path of a browserslist configuration file. Relative paths are resolved relative to the configuration file which specifies
|
|
1608
|
-
* this option, or to `cwd` when it's passed as part of the programmatic options.
|
|
1609
|
-
*
|
|
1610
|
-
* Default: `true`
|
|
1611
|
-
*/
|
|
1612
|
-
browserslistConfigFile?: boolean | null | undefined;
|
|
1613
|
-
/**
|
|
1614
|
-
* The Browserslist environment to use.
|
|
1615
|
-
*
|
|
1616
|
-
* Default: `undefined`
|
|
1617
|
-
*/
|
|
1618
|
-
browserslistEnv?: string | null | undefined;
|
|
1619
|
-
/**
|
|
1620
|
-
* By default `babel.transformFromAst` will clone the input AST to avoid mutations.
|
|
1621
|
-
* Specifying `cloneInputAst: false` can improve parsing performance if the input AST is not used elsewhere.
|
|
1622
|
-
*
|
|
1623
|
-
* Default: `true`
|
|
1624
|
-
*/
|
|
1625
|
-
cloneInputAst?: boolean | null | undefined;
|
|
1626
|
-
/**
|
|
1627
|
-
* Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"`
|
|
1628
|
-
*
|
|
1629
|
-
* Default: env vars
|
|
1630
|
-
*/
|
|
1631
|
-
envName?: string | undefined;
|
|
1632
|
-
/**
|
|
1633
|
-
* If any of patterns match, the current configuration object is considered inactive and is ignored during config processing.
|
|
1634
|
-
*/
|
|
1635
|
-
exclude?: MatchPattern | MatchPattern[] | undefined;
|
|
1636
|
-
/**
|
|
1637
|
-
* Enable code generation
|
|
1638
|
-
*
|
|
1639
|
-
* Default: `true`
|
|
1640
|
-
*/
|
|
1641
|
-
code?: boolean | null | undefined;
|
|
1642
|
-
/**
|
|
1643
|
-
* Output comments in generated output
|
|
1644
|
-
*
|
|
1645
|
-
* Default: `true`
|
|
1646
|
-
*/
|
|
1647
|
-
comments?: boolean | null | undefined;
|
|
1648
|
-
/**
|
|
1649
|
-
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB
|
|
1650
|
-
*
|
|
1651
|
-
* Default: `"auto"`
|
|
1652
|
-
*/
|
|
1653
|
-
compact?: boolean | "auto" | null | undefined;
|
|
1654
|
-
/**
|
|
1655
|
-
* The working directory that Babel's programmatic options are loaded relative to.
|
|
1656
|
-
*
|
|
1657
|
-
* Default: `"."`
|
|
1658
|
-
*/
|
|
1659
|
-
cwd?: string | null | undefined;
|
|
1660
|
-
/**
|
|
1661
|
-
* Utilities may pass a caller object to identify themselves to Babel and
|
|
1662
|
-
* pass capability-related flags for use by configs, presets and plugins.
|
|
1663
|
-
*
|
|
1664
|
-
* @see https://babeljs.io/docs/en/next/options#caller
|
|
1665
|
-
*/
|
|
1666
|
-
caller?: TransformCaller | undefined;
|
|
1667
|
-
/**
|
|
1668
|
-
* This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }`
|
|
1669
|
-
* which will use those options when the `envName` is `production`
|
|
1670
|
-
*
|
|
1671
|
-
* Default: `{}`
|
|
1672
|
-
*/
|
|
1673
|
-
env?: {
|
|
1674
|
-
[index: string]: TransformOptions | null | undefined;
|
|
1675
|
-
} | null | undefined;
|
|
1676
|
-
/**
|
|
1677
|
-
* A path to a `.babelrc` file to extend
|
|
1678
|
-
*
|
|
1679
|
-
* Default: `null`
|
|
1680
|
-
*/
|
|
1681
|
-
extends?: string | null | undefined;
|
|
1682
|
-
/**
|
|
1683
|
-
* Filename for use in errors etc
|
|
1684
|
-
*
|
|
1685
|
-
* Default: `"unknown"`
|
|
1686
|
-
*/
|
|
1687
|
-
filename?: string | null | undefined;
|
|
1688
|
-
/**
|
|
1689
|
-
* Filename relative to `sourceRoot`
|
|
1690
|
-
*
|
|
1691
|
-
* Default: `(filename)`
|
|
1692
|
-
*/
|
|
1693
|
-
filenameRelative?: string | null | undefined;
|
|
1694
|
-
/**
|
|
1695
|
-
* An object containing the options to be passed down to the babel code generator, @babel/generator
|
|
1696
|
-
*
|
|
1697
|
-
* Default: `{}`
|
|
1698
|
-
*/
|
|
1699
|
-
generatorOpts?: GeneratorOptions | null | undefined;
|
|
1700
|
-
/**
|
|
1701
|
-
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used
|
|
1702
|
-
*
|
|
1703
|
-
* Default: `null`
|
|
1704
|
-
*/
|
|
1705
|
-
getModuleId?: ((moduleName: string) => string | null | undefined) | null | undefined;
|
|
1706
|
-
/**
|
|
1707
|
-
* ANSI highlight syntax error code frames
|
|
1708
|
-
*
|
|
1709
|
-
* Default: `true`
|
|
1710
|
-
*/
|
|
1711
|
-
highlightCode?: boolean | null | undefined;
|
|
1712
|
-
/**
|
|
1713
|
-
* Opposite to the `only` option. `ignore` is disregarded if `only` is specified
|
|
1714
|
-
*
|
|
1715
|
-
* Default: `null`
|
|
1716
|
-
*/
|
|
1717
|
-
ignore?: MatchPattern[] | null | undefined;
|
|
1718
|
-
/**
|
|
1719
|
-
* This option is a synonym for "test"
|
|
1720
|
-
*/
|
|
1721
|
-
include?: MatchPattern | MatchPattern[] | undefined;
|
|
1722
|
-
/**
|
|
1723
|
-
* A source map object that the output source map will be based on
|
|
1724
|
-
*
|
|
1725
|
-
* Default: `null`
|
|
1726
|
-
*/
|
|
1727
|
-
inputSourceMap?: InputSourceMap | null | undefined;
|
|
1728
|
-
/**
|
|
1729
|
-
* Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe)
|
|
1730
|
-
*
|
|
1731
|
-
* Default: `false`
|
|
1732
|
-
*/
|
|
1733
|
-
minified?: boolean | null | undefined;
|
|
1734
|
-
/**
|
|
1735
|
-
* Specify a custom name for module ids
|
|
1736
|
-
*
|
|
1737
|
-
* Default: `null`
|
|
1738
|
-
*/
|
|
1739
|
-
moduleId?: string | null | undefined;
|
|
1740
|
-
/**
|
|
1741
|
-
* If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules)
|
|
1742
|
-
*
|
|
1743
|
-
* Default: `false`
|
|
1744
|
-
*/
|
|
1745
|
-
moduleIds?: boolean | null | undefined;
|
|
1746
|
-
/**
|
|
1747
|
-
* Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions
|
|
1748
|
-
*
|
|
1749
|
-
* Default: `(sourceRoot)`
|
|
1750
|
-
*/
|
|
1751
|
-
moduleRoot?: string | null | undefined;
|
|
1752
|
-
/**
|
|
1753
|
-
* A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile
|
|
1754
|
-
* a non-matching file it's returned verbatim
|
|
1755
|
-
*
|
|
1756
|
-
* Default: `null`
|
|
1757
|
-
*/
|
|
1758
|
-
only?: MatchPattern[] | null | undefined;
|
|
1759
|
-
/**
|
|
1760
|
-
* Allows users to provide an array of options that will be merged into the current configuration one at a time.
|
|
1761
|
-
* This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply
|
|
1762
|
-
*/
|
|
1763
|
-
overrides?: TransformOptions[] | undefined;
|
|
1764
|
-
/**
|
|
1765
|
-
* An object containing the options to be passed down to the babel parser, @babel/parser
|
|
1766
|
-
*
|
|
1767
|
-
* Default: `{}`
|
|
1768
|
-
*/
|
|
1769
|
-
parserOpts?: ParserOptions | null | undefined;
|
|
1770
|
-
/**
|
|
1771
|
-
* List of plugins to load and use
|
|
1772
|
-
*
|
|
1773
|
-
* Default: `[]`
|
|
1774
|
-
*/
|
|
1775
|
-
plugins?: PluginItem[] | null | undefined;
|
|
1776
|
-
/**
|
|
1777
|
-
* List of presets (a set of plugins) to load and use
|
|
1778
|
-
*
|
|
1779
|
-
* Default: `[]`
|
|
1780
|
-
*/
|
|
1781
|
-
presets?: PluginItem[] | null | undefined;
|
|
1782
|
-
/**
|
|
1783
|
-
* Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns)
|
|
1784
|
-
*
|
|
1785
|
-
* Default: `false`
|
|
1786
|
-
*/
|
|
1787
|
-
retainLines?: boolean | null | undefined;
|
|
1788
|
-
/**
|
|
1789
|
-
* An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used
|
|
1790
|
-
*
|
|
1791
|
-
* Default: `null`
|
|
1792
|
-
*/
|
|
1793
|
-
shouldPrintComment?: ((commentContents: string) => boolean) | null | undefined;
|
|
1794
|
-
/**
|
|
1795
|
-
* Set `sources[0]` on returned source map
|
|
1796
|
-
*
|
|
1797
|
-
* Default: `(filenameRelative)`
|
|
1798
|
-
*/
|
|
1799
|
-
sourceFileName?: string | null | undefined;
|
|
1800
|
-
/**
|
|
1801
|
-
* If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"`
|
|
1802
|
-
* then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!**
|
|
1803
|
-
*
|
|
1804
|
-
* Default: `false`
|
|
1805
|
-
*/
|
|
1806
|
-
sourceMaps?: boolean | "inline" | "both" | null | undefined;
|
|
1807
|
-
/**
|
|
1808
|
-
* The root from which all sources are relative
|
|
1809
|
-
*
|
|
1810
|
-
* Default: `(moduleRoot)`
|
|
1811
|
-
*/
|
|
1812
|
-
sourceRoot?: string | null | undefined;
|
|
1813
|
-
/**
|
|
1814
|
-
* Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6
|
|
1815
|
-
* `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`.
|
|
1816
|
-
*
|
|
1817
|
-
* Default: `("module")`
|
|
1818
|
-
*/
|
|
1819
|
-
sourceType?: "script" | "module" | "unambiguous" | null | undefined;
|
|
1820
|
-
/**
|
|
1821
|
-
* If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing.
|
|
1822
|
-
*/
|
|
1823
|
-
test?: MatchPattern | MatchPattern[] | undefined;
|
|
1824
|
-
/**
|
|
1825
|
-
* Describes the environments you support/target for your project.
|
|
1826
|
-
* This can either be a [browserslist-compatible](https://github.com/ai/browserslist) query (with [caveats](https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries))
|
|
1827
|
-
*
|
|
1828
|
-
* Default: `{}`
|
|
1829
|
-
*/
|
|
1830
|
-
targets?: string | string[] | {
|
|
1831
|
-
esmodules?: boolean;
|
|
1832
|
-
node?: Omit<string, "current"> | "current" | true;
|
|
1833
|
-
safari?: Omit<string, "tp"> | "tp";
|
|
1834
|
-
browsers?: string | string[];
|
|
1835
|
-
android?: string;
|
|
1836
|
-
chrome?: string;
|
|
1837
|
-
deno?: string;
|
|
1838
|
-
edge?: string;
|
|
1839
|
-
electron?: string;
|
|
1840
|
-
firefox?: string;
|
|
1841
|
-
ie?: string;
|
|
1842
|
-
ios?: string;
|
|
1843
|
-
opera?: string;
|
|
1844
|
-
rhino?: string;
|
|
1845
|
-
samsung?: string;
|
|
1846
|
-
};
|
|
1847
|
-
/**
|
|
1848
|
-
* An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as
|
|
1849
|
-
* `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`.
|
|
1850
|
-
*/
|
|
1851
|
-
wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null | undefined;
|
|
1852
|
-
}
|
|
1853
|
-
interface TransformCaller {
|
|
1854
|
-
// the only required property
|
|
1855
|
-
name: string; // e.g. set to true by `babel-loader` and false by `babel-jest`
|
|
1856
|
-
supportsStaticESM?: boolean | undefined;
|
|
1857
|
-
supportsDynamicImport?: boolean | undefined;
|
|
1858
|
-
supportsExportNamespaceFrom?: boolean | undefined;
|
|
1859
|
-
supportsTopLevelAwait?: boolean | undefined; // augment this with a "declare module '@babel/core' { ... }" if you need more keys
|
|
1860
|
-
}
|
|
1861
|
-
type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
|
|
1862
|
-
interface MatchPatternContext {
|
|
1863
|
-
envName: string;
|
|
1864
|
-
dirname: string;
|
|
1865
|
-
caller: TransformCaller | undefined;
|
|
1866
|
-
}
|
|
1867
|
-
type MatchPattern = string | RegExp | ((filename: string | undefined, context: MatchPatternContext) => boolean);
|
|
1868
|
-
/**
|
|
1869
|
-
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
|
1870
|
-
*/
|
|
1871
|
-
declare function transform(code: string, callback: FileResultCallback): void;
|
|
1872
|
-
/**
|
|
1873
|
-
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
|
1874
|
-
*/
|
|
1875
|
-
declare function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
|
1876
|
-
/**
|
|
1877
|
-
* Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API.
|
|
1878
|
-
*/
|
|
1879
|
-
declare function transform(code: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1880
|
-
/**
|
|
1881
|
-
* Transforms the passed in code. Returning an object with the generated code, source map, and AST.
|
|
1882
|
-
*/
|
|
1883
|
-
declare function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1884
|
-
/**
|
|
1885
|
-
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
|
1886
|
-
*/
|
|
1887
|
-
declare function transformAsync(code: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
|
1888
|
-
/**
|
|
1889
|
-
* Asynchronously transforms the entire contents of a file.
|
|
1890
|
-
*/
|
|
1891
|
-
declare function transformFile(filename: string, callback: FileResultCallback): void;
|
|
1892
|
-
/**
|
|
1893
|
-
* Asynchronously transforms the entire contents of a file.
|
|
1894
|
-
*/
|
|
1895
|
-
declare function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
|
1896
|
-
/**
|
|
1897
|
-
* Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`.
|
|
1898
|
-
*/
|
|
1899
|
-
declare function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1900
|
-
/**
|
|
1901
|
-
* Asynchronously transforms the entire contents of a file.
|
|
1902
|
-
*/
|
|
1903
|
-
declare function transformFileAsync(filename: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
|
1904
|
-
/**
|
|
1905
|
-
* Given an AST, transform it.
|
|
1906
|
-
*/
|
|
1907
|
-
declare function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void;
|
|
1908
|
-
/**
|
|
1909
|
-
* Given an AST, transform it.
|
|
1910
|
-
*/
|
|
1911
|
-
declare function transformFromAst(ast: Node, code: string | undefined, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
|
1912
|
-
/**
|
|
1913
|
-
* Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API.
|
|
1914
|
-
*/
|
|
1915
|
-
declare function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1916
|
-
/**
|
|
1917
|
-
* Given an AST, transform it.
|
|
1918
|
-
*/
|
|
1919
|
-
declare function transformFromAstAsync(ast: Node, code?: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
|
1920
|
-
// A babel plugin is a simple function which must return an object matching
|
|
1921
|
-
// the following interface. Babel will throw if it finds unknown properties.
|
|
1922
|
-
// The list of allowed plugin keys is here:
|
|
1923
|
-
// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71
|
|
1924
|
-
interface PluginObj<S = PluginPass> {
|
|
1925
|
-
name?: string | undefined;
|
|
1926
|
-
manipulateOptions?(opts: any, parserOpts: any): void;
|
|
1927
|
-
pre?(this: S, file: BabelFile): void;
|
|
1928
|
-
visitor: Visitor<S>;
|
|
1929
|
-
post?(this: S, file: BabelFile): void;
|
|
1930
|
-
inherits?: any;
|
|
1931
|
-
}
|
|
1932
|
-
interface BabelFile {
|
|
1933
|
-
ast: File;
|
|
1934
|
-
opts: TransformOptions;
|
|
1935
|
-
hub: Hub;
|
|
1936
|
-
metadata: object;
|
|
1937
|
-
path: NodePath<Program>;
|
|
1938
|
-
scope: Scope;
|
|
1939
|
-
inputMap: object | null;
|
|
1940
|
-
code: string;
|
|
1941
|
-
}
|
|
1942
|
-
interface PluginPass {
|
|
1943
|
-
file: BabelFile;
|
|
1944
|
-
key: string;
|
|
1945
|
-
opts: object;
|
|
1946
|
-
cwd: string;
|
|
1947
|
-
filename: string | undefined;
|
|
1948
|
-
get(key: unknown): any;
|
|
1949
|
-
set(key: unknown, value: unknown): void;
|
|
1950
|
-
[key: string]: unknown;
|
|
1951
|
-
}
|
|
1952
|
-
interface BabelFileResult {
|
|
1953
|
-
ast?: File | null | undefined;
|
|
1954
|
-
code?: string | null | undefined;
|
|
1955
|
-
ignored?: boolean | undefined;
|
|
1956
|
-
map?: {
|
|
1957
|
-
version: number;
|
|
1958
|
-
sources: string[];
|
|
1959
|
-
names: string[];
|
|
1960
|
-
sourceRoot?: string | undefined;
|
|
1961
|
-
sourcesContent?: string[] | undefined;
|
|
1962
|
-
mappings: string;
|
|
1963
|
-
file: string;
|
|
1964
|
-
} | null | undefined;
|
|
1965
|
-
metadata?: BabelFileMetadata | undefined;
|
|
1966
|
-
}
|
|
1967
|
-
interface BabelFileMetadata {
|
|
1968
|
-
usedHelpers: string[];
|
|
1969
|
-
marked: Array<{
|
|
1970
|
-
type: string;
|
|
1971
|
-
message: string;
|
|
1972
|
-
loc: object;
|
|
1973
|
-
}>;
|
|
1974
|
-
modules: BabelFileModulesMetadata;
|
|
1975
|
-
}
|
|
1976
|
-
interface BabelFileModulesMetadata {
|
|
1977
|
-
imports: object[];
|
|
1978
|
-
exports: {
|
|
1979
|
-
exported: object[];
|
|
1980
|
-
specifiers: object[];
|
|
1981
|
-
};
|
|
1982
|
-
}
|
|
1983
|
-
type FileParseCallback = (err: Error | null, result: ParseResult | null) => any;
|
|
1984
|
-
/**
|
|
1985
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
1986
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
1987
|
-
*/
|
|
1988
|
-
declare function parse(code: string, callback: FileParseCallback): void;
|
|
1989
|
-
/**
|
|
1990
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
1991
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
1992
|
-
*/
|
|
1993
|
-
declare function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void;
|
|
1994
|
-
/**
|
|
1995
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
1996
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
1997
|
-
*/
|
|
1998
|
-
declare function parse(code: string, options?: TransformOptions): ParseResult | null;
|
|
1999
|
-
/**
|
|
2000
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
2001
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
2002
|
-
*/
|
|
2003
|
-
declare function parseSync(code: string, options?: TransformOptions): ParseResult | null;
|
|
2004
|
-
/**
|
|
2005
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
2006
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
2007
|
-
*/
|
|
2008
|
-
declare function parseAsync(code: string, options?: TransformOptions): Promise<ParseResult | null>;
|
|
2009
|
-
/**
|
|
2010
|
-
* Resolve Babel's options fully, resulting in an options object where:
|
|
2011
|
-
*
|
|
2012
|
-
* * opts.plugins is a full list of Plugin instances.
|
|
2013
|
-
* * opts.presets is empty and all presets are flattened into opts.
|
|
2014
|
-
* * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel
|
|
2015
|
-
* will not make a second attempt to load config files.
|
|
2016
|
-
*
|
|
2017
|
-
* Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to
|
|
2018
|
-
* use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to
|
|
2019
|
-
* invalidate properly, but it is the best we have at the moment.
|
|
2020
|
-
*/
|
|
2021
|
-
declare function loadOptions(options?: TransformOptions): object | null;
|
|
2022
|
-
/**
|
|
2023
|
-
* To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and
|
|
2024
|
-
* presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it
|
|
2025
|
-
* as then see fit and pass it back to Babel again.
|
|
2026
|
-
*
|
|
2027
|
-
* * `babelrc: string | void` - The path of the `.babelrc` file, if there was one.
|
|
2028
|
-
* * `babelignore: string | void` - The path of the `.babelignore` file, if there was one.
|
|
2029
|
-
* * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back
|
|
2030
|
-
* to Babel again.
|
|
2031
|
-
* * `plugins: Array<ConfigItem>` - See below.
|
|
2032
|
-
* * `presets: Array<ConfigItem>` - See below.
|
|
2033
|
-
* * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to
|
|
2034
|
-
* Babel will not make a second attempt to load config files.
|
|
2035
|
-
*
|
|
2036
|
-
* `ConfigItem` instances expose properties to introspect the values, but each item should be treated as
|
|
2037
|
-
* immutable. If changes are desired, the item should be removed from the list and replaced with either a normal
|
|
2038
|
-
* Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for
|
|
2039
|
-
* information about `ConfigItem` fields.
|
|
2040
|
-
*/
|
|
2041
|
-
declare function loadPartialConfig(options?: TransformOptions): Readonly<PartialConfig> | null;
|
|
2042
|
-
declare function loadPartialConfigAsync(options?: TransformOptions): Promise<Readonly<PartialConfig> | null>;
|
|
2043
|
-
interface PartialConfig {
|
|
2044
|
-
options: TransformOptions;
|
|
2045
|
-
babelrc?: string | undefined;
|
|
2046
|
-
babelignore?: string | undefined;
|
|
2047
|
-
config?: string | undefined;
|
|
2048
|
-
hasFilesystemConfig: () => boolean;
|
|
2049
|
-
}
|
|
2050
|
-
interface ConfigItem {
|
|
2051
|
-
/**
|
|
2052
|
-
* The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]`
|
|
2053
|
-
*/
|
|
2054
|
-
name?: string | undefined;
|
|
2055
|
-
/**
|
|
2056
|
-
* The resolved value of the plugin.
|
|
2057
|
-
*/
|
|
2058
|
-
value: object | ((...args: any[]) => any);
|
|
2059
|
-
/**
|
|
2060
|
-
* The options object passed to the plugin.
|
|
2061
|
-
*/
|
|
2062
|
-
options?: object | false | undefined;
|
|
2063
|
-
/**
|
|
2064
|
-
* The path that the options are relative to.
|
|
2065
|
-
*/
|
|
2066
|
-
dirname: string;
|
|
2067
|
-
/**
|
|
2068
|
-
* Information about the plugin's file, if Babel knows it.
|
|
2069
|
-
* *
|
|
2070
|
-
*/
|
|
2071
|
-
file?: {
|
|
2072
|
-
/**
|
|
2073
|
-
* The file that the user requested, e.g. `"@babel/env"`
|
|
2074
|
-
*/
|
|
2075
|
-
request: string;
|
|
2076
|
-
/**
|
|
2077
|
-
* The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
|
|
2078
|
-
*/
|
|
2079
|
-
resolved: string;
|
|
2080
|
-
} | null | undefined;
|
|
2081
|
-
}
|
|
2082
|
-
type PluginOptions = object | undefined | false;
|
|
2083
|
-
type PluginTarget = string | object | ((...args: any[]) => any);
|
|
2084
|
-
type PluginItem = ConfigItem | PluginObj<any> | PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined];
|
|
2085
|
-
declare function resolvePlugin(name: string, dirname: string): string | null;
|
|
2086
|
-
declare function resolvePreset(name: string, dirname: string): string | null;
|
|
2087
|
-
interface CreateConfigItemOptions {
|
|
2088
|
-
dirname?: string | undefined;
|
|
2089
|
-
type?: "preset" | "plugin" | undefined;
|
|
2090
|
-
}
|
|
2091
|
-
/**
|
|
2092
|
-
* Allows build tooling to create and cache config items up front. If this function is called multiple times for a
|
|
2093
|
-
* given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected
|
|
2094
|
-
* plugins and presets to inject, pre-constructing the config items would be recommended.
|
|
2095
|
-
*/
|
|
2096
|
-
declare function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem;
|
|
2097
|
-
// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
|
|
2098
|
-
/**
|
|
2099
|
-
* @see https://babeljs.io/docs/en/next/config-files#config-function-api
|
|
2100
|
-
*/
|
|
2101
|
-
interface ConfigAPI {
|
|
2102
|
-
/**
|
|
2103
|
-
* The version string for the Babel version that is loading the config file.
|
|
2104
|
-
*
|
|
2105
|
-
* @see https://babeljs.io/docs/en/next/config-files#apiversion
|
|
2106
|
-
*/
|
|
2107
|
-
version: string;
|
|
2108
|
-
/**
|
|
2109
|
-
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
|
2110
|
-
*/
|
|
2111
|
-
cache: SimpleCacheConfigurator;
|
|
2112
|
-
/**
|
|
2113
|
-
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
|
2114
|
-
*/
|
|
2115
|
-
env: EnvFunction; // undocumented; currently hardcoded to return 'false'
|
|
2116
|
-
// async(): boolean
|
|
2117
|
-
/**
|
|
2118
|
-
* This API is used as a way to access the `caller` data that has been passed to Babel.
|
|
2119
|
-
* Since many instances of Babel may be running in the same process with different `caller` values,
|
|
2120
|
-
* this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
|
|
2121
|
-
*
|
|
2122
|
-
* The `caller` value is available as the first parameter of the callback function.
|
|
2123
|
-
* It is best used with something like this to toggle configuration behavior
|
|
2124
|
-
* based on a specific environment:
|
|
2125
|
-
*
|
|
2126
|
-
* @example
|
|
2127
|
-
* function isBabelRegister(caller?: { name: string }) {
|
|
2128
|
-
* return !!(caller && caller.name === "@babel/register")
|
|
2129
|
-
* }
|
|
2130
|
-
* api.caller(isBabelRegister)
|
|
2131
|
-
*
|
|
2132
|
-
* @see https://babeljs.io/docs/en/next/config-files#apicallercb
|
|
2133
|
-
*/
|
|
2134
|
-
caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions["caller"]) => T): T;
|
|
2135
|
-
/**
|
|
2136
|
-
* While `api.version` can be useful in general, it's sometimes nice to just declare your version.
|
|
2137
|
-
* This API exposes a simple way to do that with:
|
|
2138
|
-
*
|
|
2139
|
-
* @example
|
|
2140
|
-
* api.assertVersion(7) // major version only
|
|
2141
|
-
* api.assertVersion("^7.2")
|
|
2142
|
-
*
|
|
2143
|
-
* @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
|
|
2144
|
-
*/
|
|
2145
|
-
assertVersion(versionRange: number | string): boolean; // NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
|
|
2146
|
-
// tokTypes: typeof tokTypes
|
|
2147
|
-
}
|
|
2148
|
-
/**
|
|
2149
|
-
* JS configs are great because they can compute a config on the fly,
|
|
2150
|
-
* but the downside there is that it makes caching harder.
|
|
2151
|
-
* Babel wants to avoid re-executing the config function every time a file is compiled,
|
|
2152
|
-
* because then it would also need to re-execute any plugin and preset functions
|
|
2153
|
-
* referenced in that config.
|
|
2154
|
-
*
|
|
2155
|
-
* To avoid this, Babel expects users of config functions to tell it how to manage caching
|
|
2156
|
-
* within a config file.
|
|
2157
|
-
*
|
|
2158
|
-
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
|
2159
|
-
*/
|
|
2160
|
-
interface SimpleCacheConfigurator {
|
|
2161
|
-
// there is an undocumented call signature that is a shorthand for forever()/never()/using().
|
|
2162
|
-
// (ever: boolean): void
|
|
2163
|
-
// <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
|
|
2164
|
-
/**
|
|
2165
|
-
* Permacache the computed config and never call the function again.
|
|
2166
|
-
*/
|
|
2167
|
-
forever(): void;
|
|
2168
|
-
/**
|
|
2169
|
-
* Do not cache this config, and re-execute the function every time.
|
|
2170
|
-
*/
|
|
2171
|
-
never(): void;
|
|
2172
|
-
/**
|
|
2173
|
-
* Any time the using callback returns a value other than the one that was expected,
|
|
2174
|
-
* the overall config function will be called again and a new entry will be added to the cache.
|
|
2175
|
-
*
|
|
2176
|
-
* @example
|
|
2177
|
-
* api.cache.using(() => process.env.NODE_ENV)
|
|
2178
|
-
*/
|
|
2179
|
-
using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
|
2180
|
-
/**
|
|
2181
|
-
* Any time the using callback returns a value other than the one that was expected,
|
|
2182
|
-
* the overall config function will be called again and all entries in the cache will
|
|
2183
|
-
* be replaced with the result.
|
|
2184
|
-
*
|
|
2185
|
-
* @example
|
|
2186
|
-
* api.cache.invalidate(() => process.env.NODE_ENV)
|
|
2187
|
-
*/
|
|
2188
|
-
invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
|
2189
|
-
}
|
|
2190
|
-
// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
|
|
2191
|
-
type SimpleCacheKey = string | boolean | number | null | undefined;
|
|
2192
|
-
type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
|
|
2193
|
-
/**
|
|
2194
|
-
* Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function
|
|
2195
|
-
* meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel
|
|
2196
|
-
* was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set.
|
|
2197
|
-
*
|
|
2198
|
-
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
|
2199
|
-
*/
|
|
2200
|
-
interface EnvFunction {
|
|
2201
|
-
/**
|
|
2202
|
-
* @returns the current `envName` string
|
|
2203
|
-
*/
|
|
2204
|
-
(): string;
|
|
2205
|
-
/**
|
|
2206
|
-
* @returns `true` if the `envName` is `===` any of the given strings
|
|
2207
|
-
*/
|
|
2208
|
-
(envName: string | readonly string[]): boolean; // the official documentation is misleading for this one...
|
|
2209
|
-
// this just passes the callback to `cache.using` but with an additional argument.
|
|
2210
|
-
// it returns its result instead of necessarily returning a boolean.
|
|
2211
|
-
<T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions["envName"]>) => T): T;
|
|
2212
|
-
}
|
|
2213
|
-
type ConfigFunction = (api: ConfigAPI) => TransformOptions;
|
|
2214
1440
|
//#endregion
|
|
2215
1441
|
//#region .dts-emit/code/core/src/babel/babelParse.d.ts
|
|
2216
1442
|
declare const parserOptions: ParserOptions;
|
|
@@ -2219,7 +1445,31 @@ interface ASTNode {
|
|
|
2219
1445
|
type: string;
|
|
2220
1446
|
}
|
|
2221
1447
|
declare const babelPrint: (ast: ASTNode) => string;
|
|
2222
|
-
declare const babelParseExpression: (code: string) => ParseResult
|
|
1448
|
+
declare const babelParseExpression: (code: string) => ParseResult<Expression>;
|
|
1449
|
+
//#endregion
|
|
1450
|
+
//#region .dts-emit/code/core/src/babel/babel-file.d.ts
|
|
1451
|
+
/** A parsed file with its Program path, like the `File` of @babel/core. */
|
|
1452
|
+
interface BabelFile {
|
|
1453
|
+
ast: File;
|
|
1454
|
+
code: string;
|
|
1455
|
+
opts: {
|
|
1456
|
+
filename?: string;
|
|
1457
|
+
};
|
|
1458
|
+
path: NodePath<Program>;
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Makes the Program path of `ast` the same way the `File` class of @babel/core does, without
|
|
1462
|
+
* @babel/core. The hub gives `path.buildCodeFrameError` a code frame from `code`.
|
|
1463
|
+
*/
|
|
1464
|
+
declare function createBabelFile({
|
|
1465
|
+
code,
|
|
1466
|
+
ast,
|
|
1467
|
+
filename
|
|
1468
|
+
}: {
|
|
1469
|
+
code: string;
|
|
1470
|
+
ast: File;
|
|
1471
|
+
filename?: string;
|
|
1472
|
+
}): BabelFile;
|
|
2223
1473
|
//#endregion
|
|
2224
1474
|
//#region .dts-emit/code/core/src/babel/expression-resolver.d.ts
|
|
2225
1475
|
/** Recursively unwraps TypeScript type annotation expressions (as X, satisfies X, <X>expr). */
|
|
@@ -2296,6 +1546,5 @@ declare const canUpdateVitestConfigFile: (fileContent: string) => boolean;
|
|
|
2296
1546
|
//#region .dts-emit/code/core/src/babel/index.d.ts
|
|
2297
1547
|
declare const traverse: typeof traverse$1;
|
|
2298
1548
|
declare const generate: typeof generate$1;
|
|
2299
|
-
declare const BabelFileClass: any;
|
|
2300
1549
|
//#endregion
|
|
2301
|
-
export { type BabelFile,
|
|
1550
|
+
export { type BabelFile, type GeneratorOptions, type NodePath, type RecastOptions, babelParse, babelParseExpression, babelPrint, canUpdateVitestConfigFile, createBabelFile, generate, getConfigObjectFromMergeArg, getEffectiveMergeConfigCall, getTargetConfigObject, isDefineConfigLike, isImportedDefineConfigLikeIdentifier, babel_parser_d_exports as parser, parserOptions, recast, resolveExpression, traverse, index_d_exports as types, unwrapTSExpression };
|