@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
|
@@ -0,0 +1,2609 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_j88npgqhy9 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_j88npgqhy9 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_j88npgqhy9 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_j88npgqhy9.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_j88npgqhy9.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_j88npgqhy9.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
require_picocolors
|
|
14
|
+
} from "./chunk-K5RUOW42.js";
|
|
15
|
+
import {
|
|
16
|
+
__commonJS,
|
|
17
|
+
__export,
|
|
18
|
+
__toESM
|
|
19
|
+
} from "./chunk-NLPC2DDQ.js";
|
|
20
|
+
|
|
21
|
+
// ../../node_modules/sisteransi/src/index.js
|
|
22
|
+
var require_src = __commonJS({
|
|
23
|
+
"../../node_modules/sisteransi/src/index.js"(exports, module) {
|
|
24
|
+
"use strict";
|
|
25
|
+
var cursor3 = {
|
|
26
|
+
to(x, y2) {
|
|
27
|
+
return y2 ? `\x1B[${y2 + 1};${x + 1}H` : `\x1B[${x + 1}G`;
|
|
28
|
+
},
|
|
29
|
+
move(x, y2) {
|
|
30
|
+
let ret = "";
|
|
31
|
+
return x < 0 ? ret += `\x1B[${-x}D` : x > 0 && (ret += `\x1B[${x}C`), y2 < 0 ? ret += `\x1B[${-y2}A` : y2 > 0 && (ret += `\x1B[${y2}B`), ret;
|
|
32
|
+
},
|
|
33
|
+
up: (count = 1) => `\x1B[${count}A`,
|
|
34
|
+
down: (count = 1) => `\x1B[${count}B`,
|
|
35
|
+
forward: (count = 1) => `\x1B[${count}C`,
|
|
36
|
+
backward: (count = 1) => `\x1B[${count}D`,
|
|
37
|
+
nextLine: (count = 1) => "\x1B[E".repeat(count),
|
|
38
|
+
prevLine: (count = 1) => "\x1B[F".repeat(count),
|
|
39
|
+
left: "\x1B[G",
|
|
40
|
+
hide: "\x1B[?25l",
|
|
41
|
+
show: "\x1B[?25h",
|
|
42
|
+
save: "\x1B7",
|
|
43
|
+
restore: "\x1B8"
|
|
44
|
+
}, scroll = {
|
|
45
|
+
up: (count = 1) => "\x1B[S".repeat(count),
|
|
46
|
+
down: (count = 1) => "\x1B[T".repeat(count)
|
|
47
|
+
}, erase3 = {
|
|
48
|
+
screen: "\x1B[2J",
|
|
49
|
+
up: (count = 1) => "\x1B[1J".repeat(count),
|
|
50
|
+
down: (count = 1) => "\x1B[J".repeat(count),
|
|
51
|
+
line: "\x1B[2K",
|
|
52
|
+
lineEnd: "\x1B[K",
|
|
53
|
+
lineStart: "\x1B[1K",
|
|
54
|
+
lines(count) {
|
|
55
|
+
let clear = "";
|
|
56
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
57
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
58
|
+
return count && (clear += cursor3.left), clear;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep: "\x07" };
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// ../../node_modules/emoji-regex/index.js
|
|
66
|
+
var require_emoji_regex = __commonJS({
|
|
67
|
+
"../../node_modules/emoji-regex/index.js"(exports, module) {
|
|
68
|
+
module.exports = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// src/node-logger/logger/logger.ts
|
|
73
|
+
var logger_exports = {};
|
|
74
|
+
__export(logger_exports, {
|
|
75
|
+
SYMBOLS: () => SYMBOLS,
|
|
76
|
+
debug: () => debug,
|
|
77
|
+
error: () => error,
|
|
78
|
+
getLogLevel: () => getLogLevel,
|
|
79
|
+
info: () => info,
|
|
80
|
+
intro: () => intro2,
|
|
81
|
+
log: () => log2,
|
|
82
|
+
logBox: () => logBox,
|
|
83
|
+
outro: () => outro2,
|
|
84
|
+
setLogLevel: () => setLogLevel,
|
|
85
|
+
shouldLog: () => shouldLog,
|
|
86
|
+
step: () => step,
|
|
87
|
+
warn: () => warn,
|
|
88
|
+
wrapTextForClack: () => wrapTextForClack
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// ../../node_modules/@clack/core/dist/index.mjs
|
|
92
|
+
import { styleText } from "node:util";
|
|
93
|
+
import { stdout, stdin } from "node:process";
|
|
94
|
+
import * as l from "node:readline";
|
|
95
|
+
import l__default from "node:readline";
|
|
96
|
+
|
|
97
|
+
// ../../node_modules/fast-string-truncated-width/dist/utils.js
|
|
98
|
+
var getCodePointsLength = /* @__PURE__ */ (() => {
|
|
99
|
+
let SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
100
|
+
return (input) => {
|
|
101
|
+
let surrogatePairsNr = 0;
|
|
102
|
+
for (SURROGATE_PAIR_RE.lastIndex = 0; SURROGATE_PAIR_RE.test(input); )
|
|
103
|
+
surrogatePairsNr += 1;
|
|
104
|
+
return input.length - surrogatePairsNr;
|
|
105
|
+
};
|
|
106
|
+
})(), isFullWidth = (x) => x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510, isWideNotCJKTNotEmoji = (x) => x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
107
|
+
|
|
108
|
+
// ../../node_modules/fast-string-truncated-width/dist/index.js
|
|
109
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y, CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu, TAB_RE = /\t{1,1000}/y, EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, MODIFIER_RE = new RegExp("\\p{M}+", "gu"), NO_TRUNCATION = { limit: 1 / 0, ellipsis: "" }, getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
110
|
+
let LIMIT = truncationOptions.limit ?? 1 / 0, ELLIPSIS = truncationOptions.ellipsis ?? "", ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0), ANSI_WIDTH = 0, CONTROL_WIDTH = widthOptions.controlWidth ?? 0, TAB_WIDTH = widthOptions.tabWidth ?? 8, EMOJI_WIDTH = widthOptions.emojiWidth ?? 2, FULL_WIDTH_WIDTH = 2, REGULAR_WIDTH = widthOptions.regularWidth ?? 1, WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH, PARSE_BLOCKS = [
|
|
111
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
112
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
113
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
114
|
+
[TAB_RE, TAB_WIDTH],
|
|
115
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
116
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
117
|
+
], indexPrev = 0, index = 0, length = input.length, lengthExtra = 0, truncationEnabled = !1, truncationIndex = length, truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH), unmatchedStart = 0, unmatchedEnd = 0, width = 0, widthExtra = 0;
|
|
118
|
+
outer: for (; ; ) {
|
|
119
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
120
|
+
let unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
121
|
+
lengthExtra = 0;
|
|
122
|
+
for (let char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
123
|
+
let codePoint = char.codePointAt(0) || 0;
|
|
124
|
+
if (isFullWidth(codePoint) ? widthExtra = FULL_WIDTH_WIDTH : isWideNotCJKTNotEmoji(codePoint) ? widthExtra = WIDE_WIDTH : widthExtra = REGULAR_WIDTH, width + widthExtra > truncationLimit && (truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra)), width + widthExtra > LIMIT) {
|
|
125
|
+
truncationEnabled = !0;
|
|
126
|
+
break outer;
|
|
127
|
+
}
|
|
128
|
+
lengthExtra += char.length, width += widthExtra;
|
|
129
|
+
}
|
|
130
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
131
|
+
}
|
|
132
|
+
if (index >= length)
|
|
133
|
+
break outer;
|
|
134
|
+
for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
|
|
135
|
+
let [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
136
|
+
if (BLOCK_RE.lastIndex = index, BLOCK_RE.test(input)) {
|
|
137
|
+
if (lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index, widthExtra = lengthExtra * BLOCK_WIDTH, width + widthExtra > truncationLimit && (truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH))), width + widthExtra > LIMIT) {
|
|
138
|
+
truncationEnabled = !0;
|
|
139
|
+
break outer;
|
|
140
|
+
}
|
|
141
|
+
width += widthExtra, unmatchedStart = indexPrev, unmatchedEnd = index, index = indexPrev = BLOCK_RE.lastIndex;
|
|
142
|
+
continue outer;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
index += 1;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
149
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
150
|
+
truncated: truncationEnabled,
|
|
151
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
152
|
+
};
|
|
153
|
+
}, dist_default = getStringTruncatedWidth;
|
|
154
|
+
|
|
155
|
+
// ../../node_modules/fast-string-width/dist/index.js
|
|
156
|
+
var NO_TRUNCATION2 = {
|
|
157
|
+
limit: 1 / 0,
|
|
158
|
+
ellipsis: "",
|
|
159
|
+
ellipsisWidth: 0
|
|
160
|
+
}, fastStringWidth = (input, options = {}) => dist_default(input, NO_TRUNCATION2, options).width, dist_default2 = fastStringWidth;
|
|
161
|
+
|
|
162
|
+
// ../../node_modules/fast-wrap-ansi/lib/main.js
|
|
163
|
+
var ESC = "\x1B", CSI = "\x9B", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC = "]", ANSI_SGR_TERMINATOR = "m", ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`, GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y"), getClosingCode = (openingCode) => {
|
|
164
|
+
if (openingCode >= 30 && openingCode <= 37 || openingCode >= 90 && openingCode <= 97)
|
|
165
|
+
return 39;
|
|
166
|
+
if (openingCode >= 40 && openingCode <= 47 || openingCode >= 100 && openingCode <= 107)
|
|
167
|
+
return 49;
|
|
168
|
+
if (openingCode === 1 || openingCode === 2)
|
|
169
|
+
return 22;
|
|
170
|
+
if (openingCode === 3)
|
|
171
|
+
return 23;
|
|
172
|
+
if (openingCode === 4)
|
|
173
|
+
return 24;
|
|
174
|
+
if (openingCode === 7)
|
|
175
|
+
return 27;
|
|
176
|
+
if (openingCode === 8)
|
|
177
|
+
return 28;
|
|
178
|
+
if (openingCode === 9)
|
|
179
|
+
return 29;
|
|
180
|
+
if (openingCode === 0)
|
|
181
|
+
return 0;
|
|
182
|
+
}, wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, wrapWord = (rows, word, columns) => {
|
|
183
|
+
let characters = word[Symbol.iterator](), isInsideEscape = !1, isInsideLinkEscape = !1, lastRow = rows.at(-1), visible = lastRow === void 0 ? 0 : dist_default2(lastRow), currentCharacter = characters.next(), nextCharacter = characters.next(), rawCharacterIndex = 0;
|
|
184
|
+
for (; !currentCharacter.done; ) {
|
|
185
|
+
let character = currentCharacter.value, characterLength = dist_default2(character);
|
|
186
|
+
visible + characterLength <= columns ? rows[rows.length - 1] += character : (rows.push(character), visible = 0), (character === ESC || character === CSI) && (isInsideEscape = !0, isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1)), isInsideEscape ? isInsideLinkEscape ? character === ANSI_ESCAPE_BELL && (isInsideEscape = !1, isInsideLinkEscape = !1) : character === ANSI_SGR_TERMINATOR && (isInsideEscape = !1) : (visible += characterLength, visible === columns && !nextCharacter.done && (rows.push(""), visible = 0)), currentCharacter = nextCharacter, nextCharacter = characters.next(), rawCharacterIndex += character.length;
|
|
187
|
+
}
|
|
188
|
+
lastRow = rows.at(-1), !visible && lastRow !== void 0 && lastRow.length && rows.length > 1 && (rows[rows.length - 2] += rows.pop());
|
|
189
|
+
}, stringVisibleTrimSpacesRight = (string) => {
|
|
190
|
+
let words = string.split(" "), last = words.length;
|
|
191
|
+
for (; last && !dist_default2(words[last - 1]); )
|
|
192
|
+
last--;
|
|
193
|
+
return last === words.length ? string : words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
194
|
+
}, exec = (string, columns, options = {}) => {
|
|
195
|
+
if (options.trim !== !1 && string.trim() === "")
|
|
196
|
+
return "";
|
|
197
|
+
let returnValue = "", escapeCode, escapeUrl, words = string.split(" "), rows = [""], rowLength = 0;
|
|
198
|
+
for (let index = 0; index < words.length; index++) {
|
|
199
|
+
let word = words[index];
|
|
200
|
+
if (options.trim !== !1) {
|
|
201
|
+
let row = rows.at(-1) ?? "", trimmed = row.trimStart();
|
|
202
|
+
row.length !== trimmed.length && (rows[rows.length - 1] = trimmed, rowLength = dist_default2(trimmed));
|
|
203
|
+
}
|
|
204
|
+
index !== 0 && (rowLength >= columns && (options.wordWrap === !1 || options.trim === !1) && (rows.push(""), rowLength = 0), (rowLength || options.trim === !1) && (rows[rows.length - 1] += " ", rowLength++));
|
|
205
|
+
let wordLength = dist_default2(word);
|
|
206
|
+
if (options.hard && wordLength > columns) {
|
|
207
|
+
let remainingColumns = columns - rowLength, breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
208
|
+
Math.floor((wordLength - 1) / columns) < breaksStartingThisLine && rows.push(""), wrapWord(rows, word, columns), rowLength = dist_default2(rows.at(-1) ?? "");
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
212
|
+
if (options.wordWrap === !1 && rowLength < columns) {
|
|
213
|
+
wrapWord(rows, word, columns), rowLength = dist_default2(rows.at(-1) ?? "");
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
rows.push(""), rowLength = 0;
|
|
217
|
+
}
|
|
218
|
+
if (rowLength + wordLength > columns && options.wordWrap === !1) {
|
|
219
|
+
wrapWord(rows, word, columns), rowLength = dist_default2(rows.at(-1) ?? "");
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
rows[rows.length - 1] += word, rowLength += wordLength;
|
|
223
|
+
}
|
|
224
|
+
options.trim !== !1 && (rows = rows.map((row) => stringVisibleTrimSpacesRight(row)));
|
|
225
|
+
let preString = rows.join(`
|
|
226
|
+
`), inSurrogate = !1;
|
|
227
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
228
|
+
let character = preString[i2];
|
|
229
|
+
if (returnValue += character, inSurrogate)
|
|
230
|
+
inSurrogate = !1;
|
|
231
|
+
else if (inSurrogate = character >= "\uD800" && character <= "\uDBFF", inSurrogate)
|
|
232
|
+
continue;
|
|
233
|
+
if (character === ESC || character === CSI) {
|
|
234
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
235
|
+
let groups = GROUP_REGEX.exec(preString)?.groups;
|
|
236
|
+
if (groups?.code !== void 0) {
|
|
237
|
+
let code = Number.parseFloat(groups.code);
|
|
238
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
239
|
+
} else groups?.uri !== void 0 && (escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri);
|
|
240
|
+
}
|
|
241
|
+
if (preString[i2 + 1] === `
|
|
242
|
+
`) {
|
|
243
|
+
escapeUrl && (returnValue += wrapAnsiHyperlink(""));
|
|
244
|
+
let closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
245
|
+
escapeCode && closingCode && (returnValue += wrapAnsiCode(closingCode));
|
|
246
|
+
} else character === `
|
|
247
|
+
` && (escapeCode && getClosingCode(escapeCode) && (returnValue += wrapAnsiCode(escapeCode)), escapeUrl && (returnValue += wrapAnsiHyperlink(escapeUrl)));
|
|
248
|
+
}
|
|
249
|
+
return returnValue;
|
|
250
|
+
}, CRLF_OR_LF = /\r?\n/;
|
|
251
|
+
function wrapAnsi(string, columns, options) {
|
|
252
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
253
|
+
`);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ../../node_modules/@clack/core/dist/index.mjs
|
|
257
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
258
|
+
import { ReadStream } from "node:tty";
|
|
259
|
+
function findCursor(s, o, l2) {
|
|
260
|
+
if (!l2.some((r2) => !r2.disabled))
|
|
261
|
+
return s;
|
|
262
|
+
let t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
263
|
+
return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
|
|
264
|
+
}
|
|
265
|
+
var a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"], t = [
|
|
266
|
+
"January",
|
|
267
|
+
"February",
|
|
268
|
+
"March",
|
|
269
|
+
"April",
|
|
270
|
+
"May",
|
|
271
|
+
"June",
|
|
272
|
+
"July",
|
|
273
|
+
"August",
|
|
274
|
+
"September",
|
|
275
|
+
"October",
|
|
276
|
+
"November",
|
|
277
|
+
"December"
|
|
278
|
+
], settings = {
|
|
279
|
+
actions: new Set(a$1),
|
|
280
|
+
aliases: /* @__PURE__ */ new Map([
|
|
281
|
+
// vim support
|
|
282
|
+
["k", "up"],
|
|
283
|
+
["j", "down"],
|
|
284
|
+
["h", "left"],
|
|
285
|
+
["l", "right"],
|
|
286
|
+
["", "cancel"],
|
|
287
|
+
// opinionated defaults!
|
|
288
|
+
["escape", "cancel"]
|
|
289
|
+
]),
|
|
290
|
+
messages: {
|
|
291
|
+
cancel: "Canceled",
|
|
292
|
+
error: "Something went wrong"
|
|
293
|
+
},
|
|
294
|
+
withGuide: !0,
|
|
295
|
+
accessible: void 0,
|
|
296
|
+
date: {
|
|
297
|
+
monthNames: [...t],
|
|
298
|
+
messages: {
|
|
299
|
+
required: "Please enter a valid date",
|
|
300
|
+
invalidMonth: "There are only 12 months in a year",
|
|
301
|
+
invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
|
|
302
|
+
afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
|
|
303
|
+
beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
function isAccessible(n3) {
|
|
308
|
+
if (n3 !== void 0) return n3;
|
|
309
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
310
|
+
let e = process.env.ACCESSIBLE;
|
|
311
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
312
|
+
}
|
|
313
|
+
function isActionKey(n3, e) {
|
|
314
|
+
if (typeof n3 == "string")
|
|
315
|
+
return settings.aliases.get(n3) === e;
|
|
316
|
+
for (let s of n3)
|
|
317
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
318
|
+
return !0;
|
|
319
|
+
return !1;
|
|
320
|
+
}
|
|
321
|
+
function diffLines(i2, s) {
|
|
322
|
+
if (i2 === s) return;
|
|
323
|
+
let e = i2.split(`
|
|
324
|
+
`), t2 = s.split(`
|
|
325
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
326
|
+
for (let n3 = 0; n3 < r2; n3++)
|
|
327
|
+
e[n3] !== t2[n3] && f.push(n3);
|
|
328
|
+
return {
|
|
329
|
+
lines: f,
|
|
330
|
+
numLinesBefore: e.length,
|
|
331
|
+
numLinesAfter: t2.length,
|
|
332
|
+
numLines: r2
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
var R = globalThis.process.platform.startsWith("win"), CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
336
|
+
function isCancel(e) {
|
|
337
|
+
return e === CANCEL_SYMBOL;
|
|
338
|
+
}
|
|
339
|
+
function setRawMode(e, r2) {
|
|
340
|
+
let o = e;
|
|
341
|
+
o.isTTY && o.setRawMode(r2);
|
|
342
|
+
}
|
|
343
|
+
function block({
|
|
344
|
+
input: e = stdin,
|
|
345
|
+
output: r2 = stdout,
|
|
346
|
+
overwrite: o = !0,
|
|
347
|
+
hideCursor: n3 = !0
|
|
348
|
+
} = {}) {
|
|
349
|
+
let s = l.createInterface({
|
|
350
|
+
input: e,
|
|
351
|
+
output: r2,
|
|
352
|
+
prompt: "",
|
|
353
|
+
tabSize: 1
|
|
354
|
+
});
|
|
355
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(!0);
|
|
356
|
+
let t2 = (f, { name: a2, sequence: w }) => {
|
|
357
|
+
let c2 = String(f);
|
|
358
|
+
if (isActionKey([c2, a2, w], "cancel")) {
|
|
359
|
+
n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (!o) return;
|
|
363
|
+
l.moveCursor(r2, a2 === "return" ? 0 : -1, a2 === "return" ? -1 : 0, () => {
|
|
364
|
+
l.clearLine(r2, 1, () => {
|
|
365
|
+
e.once("keypress", t2);
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
370
|
+
e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(!1), s.terminal = !1, s.close();
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
var getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80, getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
374
|
+
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
375
|
+
let f = getColumns(e ?? stdout);
|
|
376
|
+
return wrapAnsi(r2, f - o.length, {
|
|
377
|
+
hard: !0,
|
|
378
|
+
trim: !1
|
|
379
|
+
}).split(`
|
|
380
|
+
`).map((c2, i2, m2) => {
|
|
381
|
+
let d = t2 ? t2(c2, i2) : c2;
|
|
382
|
+
return i2 === 0 ? `${n3}${d}` : i2 === m2.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
383
|
+
}).join(`
|
|
384
|
+
`);
|
|
385
|
+
}
|
|
386
|
+
function runValidation(e, a2) {
|
|
387
|
+
if ("~standard" in e) {
|
|
388
|
+
let n3 = e["~standard"].validate(a2);
|
|
389
|
+
return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
|
|
390
|
+
}
|
|
391
|
+
return e(a2);
|
|
392
|
+
}
|
|
393
|
+
var y = class {
|
|
394
|
+
input;
|
|
395
|
+
output;
|
|
396
|
+
_abortSignal;
|
|
397
|
+
rl;
|
|
398
|
+
opts;
|
|
399
|
+
_render;
|
|
400
|
+
_track = !1;
|
|
401
|
+
_prevFrame = "";
|
|
402
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
403
|
+
_cursor = 0;
|
|
404
|
+
state = "initial";
|
|
405
|
+
error = "";
|
|
406
|
+
value;
|
|
407
|
+
userInput = "";
|
|
408
|
+
/**
|
|
409
|
+
* Whether accessible (static, screen-reader friendly) output is enabled for
|
|
410
|
+
* this prompt, resolved from the `accessible` option, the global setting,
|
|
411
|
+
* and the `ACCESSIBLE` env var.
|
|
412
|
+
*/
|
|
413
|
+
get accessible() {
|
|
414
|
+
return isAccessible(this.opts.accessible);
|
|
415
|
+
}
|
|
416
|
+
constructor(t2, e = !0) {
|
|
417
|
+
let { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
|
|
418
|
+
this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Unsubscribe all listeners
|
|
422
|
+
*/
|
|
423
|
+
unsubscribe() {
|
|
424
|
+
this._subscribers.clear();
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Set a subscriber with opts
|
|
428
|
+
* @param event - The event name
|
|
429
|
+
*/
|
|
430
|
+
setSubscriber(t2, e) {
|
|
431
|
+
let i2 = this._subscribers.get(t2) ?? [];
|
|
432
|
+
i2.push(e), this._subscribers.set(t2, i2);
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Subscribe to an event
|
|
436
|
+
* @param event - The event name
|
|
437
|
+
* @param cb - The callback
|
|
438
|
+
*/
|
|
439
|
+
on(t2, e) {
|
|
440
|
+
this.setSubscriber(t2, { cb: e });
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Subscribe to an event once
|
|
444
|
+
* @param event - The event name
|
|
445
|
+
* @param cb - The callback
|
|
446
|
+
*/
|
|
447
|
+
once(t2, e) {
|
|
448
|
+
this.setSubscriber(t2, { cb: e, once: !0 });
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Emit an event with data
|
|
452
|
+
* @param event - The event name
|
|
453
|
+
* @param data - The data to pass to the callback
|
|
454
|
+
*/
|
|
455
|
+
emit(t2, ...e) {
|
|
456
|
+
let i2 = this._subscribers.get(t2) ?? [], s = [];
|
|
457
|
+
for (let r2 of i2)
|
|
458
|
+
r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
|
|
459
|
+
for (let r2 of s)
|
|
460
|
+
r2();
|
|
461
|
+
}
|
|
462
|
+
prompt() {
|
|
463
|
+
return new Promise((t2) => {
|
|
464
|
+
if (this._abortSignal) {
|
|
465
|
+
if (this._abortSignal.aborted)
|
|
466
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
467
|
+
this._abortSignal.addEventListener(
|
|
468
|
+
"abort",
|
|
469
|
+
() => {
|
|
470
|
+
this.state = "cancel", this.close();
|
|
471
|
+
},
|
|
472
|
+
{ once: !0 }
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
this.rl = l__default.createInterface({
|
|
476
|
+
input: this.input,
|
|
477
|
+
tabSize: 2,
|
|
478
|
+
prompt: "",
|
|
479
|
+
escapeCodeTimeout: 50,
|
|
480
|
+
terminal: !0
|
|
481
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), setRawMode(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
482
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, !1), t2(this.value);
|
|
483
|
+
}), this.once("cancel", () => {
|
|
484
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, !1), t2(CANCEL_SYMBOL);
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
_isActionKey(t2, e) {
|
|
489
|
+
return t2 === " ";
|
|
490
|
+
}
|
|
491
|
+
_shouldSubmit(t2, e) {
|
|
492
|
+
return !0;
|
|
493
|
+
}
|
|
494
|
+
_setValue(t2) {
|
|
495
|
+
this.value = t2, this.emit("value", this.value);
|
|
496
|
+
}
|
|
497
|
+
_setUserInput(t2, e) {
|
|
498
|
+
this.userInput = t2 ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
499
|
+
}
|
|
500
|
+
_clearUserInput() {
|
|
501
|
+
this.rl?.write(null, { ctrl: !0, name: "u" }), this._setUserInput("");
|
|
502
|
+
}
|
|
503
|
+
async onKeypress(t2, e) {
|
|
504
|
+
if (this.state !== "validating") {
|
|
505
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: !0, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
|
|
506
|
+
if (this.opts.validate) {
|
|
507
|
+
let i2 = runValidation(this.opts.validate, this.value), s;
|
|
508
|
+
i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
509
|
+
}
|
|
510
|
+
this.state !== "error" && (this.state = "submit");
|
|
511
|
+
}
|
|
512
|
+
isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
close() {
|
|
516
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
517
|
+
`), setRawMode(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
518
|
+
}
|
|
519
|
+
restoreCursor() {
|
|
520
|
+
let t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: !0, trim: !1 }).split(`
|
|
521
|
+
`).length - 1;
|
|
522
|
+
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
523
|
+
}
|
|
524
|
+
render() {
|
|
525
|
+
let t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
526
|
+
hard: !0,
|
|
527
|
+
trim: !1
|
|
528
|
+
});
|
|
529
|
+
if (t2 !== this._prevFrame) {
|
|
530
|
+
if (this.state === "initial")
|
|
531
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
532
|
+
else {
|
|
533
|
+
let e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
534
|
+
if (this.restoreCursor(), e) {
|
|
535
|
+
let s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2), n3 = e.lines.find((o) => o >= s);
|
|
536
|
+
if (n3 === void 0) {
|
|
537
|
+
this._prevFrame = t2;
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
if (e.lines.length === 1) {
|
|
541
|
+
this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
542
|
+
let o = t2.split(`
|
|
543
|
+
`);
|
|
544
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
|
|
545
|
+
return;
|
|
546
|
+
} else if (e.lines.length > 1) {
|
|
547
|
+
if (s < r2)
|
|
548
|
+
n3 = s;
|
|
549
|
+
else {
|
|
550
|
+
let h2 = n3 - r2;
|
|
551
|
+
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
552
|
+
}
|
|
553
|
+
this.output.write(import_sisteransi.erase.down());
|
|
554
|
+
let f = t2.split(`
|
|
555
|
+
`).slice(n3);
|
|
556
|
+
this.output.write(f.join(`
|
|
557
|
+
`)), this._prevFrame = t2;
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
this.output.write(import_sisteransi.erase.down());
|
|
562
|
+
}
|
|
563
|
+
this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
var r = class extends y {
|
|
568
|
+
get cursor() {
|
|
569
|
+
return this.value ? 0 : 1;
|
|
570
|
+
}
|
|
571
|
+
get _value() {
|
|
572
|
+
return this.cursor === 0;
|
|
573
|
+
}
|
|
574
|
+
constructor(t2) {
|
|
575
|
+
super(t2, !1), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
576
|
+
this.value = this._value;
|
|
577
|
+
}), this.on("confirm", (i2) => {
|
|
578
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
|
|
579
|
+
}), this.on("cursor", () => {
|
|
580
|
+
this.value = !this.value;
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
var a = class extends y {
|
|
585
|
+
options;
|
|
586
|
+
cursor = 0;
|
|
587
|
+
get _value() {
|
|
588
|
+
return this.options[this.cursor]?.value;
|
|
589
|
+
}
|
|
590
|
+
get _enabledOptions() {
|
|
591
|
+
return this.options.filter((e) => e.disabled !== !0);
|
|
592
|
+
}
|
|
593
|
+
toggleAll() {
|
|
594
|
+
let e = this._enabledOptions, i2 = this.value !== void 0 && this.value.length === e.length;
|
|
595
|
+
this.value = i2 ? [] : e.map((t2) => t2.value);
|
|
596
|
+
}
|
|
597
|
+
toggleInvert() {
|
|
598
|
+
let e = this.value;
|
|
599
|
+
if (!e)
|
|
600
|
+
return;
|
|
601
|
+
let i2 = this._enabledOptions.filter((t2) => !e.includes(t2.value));
|
|
602
|
+
this.value = i2.map((t2) => t2.value);
|
|
603
|
+
}
|
|
604
|
+
toggleValue() {
|
|
605
|
+
this.value === void 0 && (this.value = []);
|
|
606
|
+
let e = this.value.includes(this._value);
|
|
607
|
+
this.value = e ? this.value.filter((i2) => i2 !== this._value) : [...this.value, this._value];
|
|
608
|
+
}
|
|
609
|
+
constructor(e) {
|
|
610
|
+
super(e, !1), this.options = e.options, this.value = [...e.initialValues ?? []];
|
|
611
|
+
let i2 = Math.max(
|
|
612
|
+
this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt),
|
|
613
|
+
0
|
|
614
|
+
);
|
|
615
|
+
this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, l2) => {
|
|
616
|
+
l2.name === "a" && this.toggleAll(), l2.name === "i" && this.toggleInvert();
|
|
617
|
+
}), this.on("cursor", (t2) => {
|
|
618
|
+
switch (t2) {
|
|
619
|
+
case "left":
|
|
620
|
+
case "up":
|
|
621
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
622
|
+
break;
|
|
623
|
+
case "down":
|
|
624
|
+
case "right":
|
|
625
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
626
|
+
break;
|
|
627
|
+
case "space":
|
|
628
|
+
this.toggleValue();
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
var n$1 = class extends y {
|
|
635
|
+
options;
|
|
636
|
+
cursor = 0;
|
|
637
|
+
get _selectedValue() {
|
|
638
|
+
return this.options[this.cursor];
|
|
639
|
+
}
|
|
640
|
+
changeValue() {
|
|
641
|
+
let e = this._selectedValue;
|
|
642
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
643
|
+
}
|
|
644
|
+
constructor(e) {
|
|
645
|
+
super(e, !1), this.options = e.options;
|
|
646
|
+
let o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
647
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
648
|
+
switch (s) {
|
|
649
|
+
case "left":
|
|
650
|
+
case "up":
|
|
651
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
652
|
+
break;
|
|
653
|
+
case "down":
|
|
654
|
+
case "right":
|
|
655
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
this.changeValue();
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
var n2 = class extends y {
|
|
663
|
+
get userInputWithCursor() {
|
|
664
|
+
if (this.state === "submit")
|
|
665
|
+
return this.userInput;
|
|
666
|
+
let t2 = this.userInput;
|
|
667
|
+
if (this.cursor >= t2.length)
|
|
668
|
+
return `${this.userInput}\u2588`;
|
|
669
|
+
let r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
|
|
670
|
+
return `${r2}${styleText("inverse", s)}${e}`;
|
|
671
|
+
}
|
|
672
|
+
get cursor() {
|
|
673
|
+
return this._cursor;
|
|
674
|
+
}
|
|
675
|
+
constructor(t2) {
|
|
676
|
+
super({
|
|
677
|
+
...t2,
|
|
678
|
+
initialUserInput: t2.initialUserInput ?? t2.initialValue
|
|
679
|
+
}), this.on("userInput", (r2) => {
|
|
680
|
+
this._setValue(r2);
|
|
681
|
+
}), this.on("finalize", () => {
|
|
682
|
+
this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
// ../../node_modules/@clack/prompts/dist/index.mjs
|
|
688
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
689
|
+
import process$1 from "node:process";
|
|
690
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
691
|
+
function isUnicodeSupported() {
|
|
692
|
+
return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
693
|
+
}
|
|
694
|
+
var unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", isTTY = (o) => o.isTTY === !0, unicodeOr = (o, e) => unicode ? o : e, S_STEP_ACTIVE = unicodeOr("\u25C6", "*"), S_STEP_CANCEL = unicodeOr("\u25A0", "x"), S_STEP_ERROR = unicodeOr("\u25B2", "x"), S_STEP_SUBMIT = unicodeOr("\u25C7", "o"), S_BAR_START = unicodeOr("\u250C", "T"), S_BAR = unicodeOr("\u2502", "|"), S_BAR_END = unicodeOr("\u2514", "\u2014"), S_BAR_START_RIGHT = unicodeOr("\u2510", "T"), S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014"), S_RADIO_ACTIVE = unicodeOr("\u25CF", ">"), S_RADIO_INACTIVE = unicodeOr("\u25CB", " "), S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]"), S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]"), S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]"), S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022"), S_BAR_H = unicodeOr("\u2500", "-"), S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+"), S_CONNECT_LEFT = unicodeOr("\u251C", "+"), S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+"), S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+"), S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+"), S_INFO = unicodeOr("\u25CF", "\u2022"), S_SUCCESS = unicodeOr("\u25C6", "*"), S_WARN = unicodeOr("\u25B2", "!"), S_ERROR = unicodeOr("\u25A0", "x"), symbol = (o) => {
|
|
695
|
+
switch (o) {
|
|
696
|
+
case "initial":
|
|
697
|
+
case "active":
|
|
698
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
699
|
+
case "cancel":
|
|
700
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
701
|
+
case "error":
|
|
702
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
703
|
+
case "submit":
|
|
704
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
705
|
+
case "validating":
|
|
706
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
707
|
+
}
|
|
708
|
+
}, symbolBar = (o) => {
|
|
709
|
+
switch (o) {
|
|
710
|
+
case "initial":
|
|
711
|
+
case "active":
|
|
712
|
+
return styleText2("cyan", S_BAR);
|
|
713
|
+
case "cancel":
|
|
714
|
+
return styleText2("red", S_BAR);
|
|
715
|
+
case "error":
|
|
716
|
+
return styleText2("yellow", S_BAR);
|
|
717
|
+
case "submit":
|
|
718
|
+
return styleText2("green", S_BAR);
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
function formatInstructionFooter(o, e) {
|
|
722
|
+
let r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
723
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
724
|
+
}
|
|
725
|
+
var I = (l2, e, w, p, b, C = !1) => {
|
|
726
|
+
let r2 = e, O = 0;
|
|
727
|
+
if (C)
|
|
728
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
729
|
+
let m2 = l2[i2];
|
|
730
|
+
if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
|
|
731
|
+
}
|
|
732
|
+
else
|
|
733
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
734
|
+
let m2 = l2[i2];
|
|
735
|
+
if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
|
|
736
|
+
}
|
|
737
|
+
return { lineCount: r2, removals: O };
|
|
738
|
+
}, limitOptions = ({
|
|
739
|
+
cursor: l2,
|
|
740
|
+
options: e,
|
|
741
|
+
style: w,
|
|
742
|
+
output: p = process.stdout,
|
|
743
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
744
|
+
columnPadding: C = 0,
|
|
745
|
+
rowPadding: r2 = 4
|
|
746
|
+
}) => {
|
|
747
|
+
let i2 = getColumns(p) - C, m2 = getRows(p), M = styleText2("dim", "..."), v = Math.max(m2 - r2, 0), a2 = Math.max(Math.min(b, v), 5), f = 0;
|
|
748
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
749
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
750
|
+
0
|
|
751
|
+
));
|
|
752
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length, W2 = Math.min(
|
|
753
|
+
f + a2,
|
|
754
|
+
e.length
|
|
755
|
+
), s = [], g = 0;
|
|
756
|
+
d && g++, c2 && g++;
|
|
757
|
+
let T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
|
|
758
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
759
|
+
let n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
760
|
+
hard: !0,
|
|
761
|
+
trim: !1
|
|
762
|
+
}).split(`
|
|
763
|
+
`);
|
|
764
|
+
s.push(h2), g += h2.length;
|
|
765
|
+
}
|
|
766
|
+
if (g > v) {
|
|
767
|
+
let t2 = 0, n3 = 0, o = g, h2 = l2 - T, u3 = v, L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
768
|
+
s,
|
|
769
|
+
o,
|
|
770
|
+
h2 + 1,
|
|
771
|
+
s.length,
|
|
772
|
+
u3,
|
|
773
|
+
!0
|
|
774
|
+
);
|
|
775
|
+
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = !0, s.splice(0, t2)), n3 > 0 && (c2 = !0, s.splice(s.length - n3, n3));
|
|
776
|
+
}
|
|
777
|
+
let x = [];
|
|
778
|
+
d && x.push(M);
|
|
779
|
+
for (let t2 of s)
|
|
780
|
+
for (let n3 of t2)
|
|
781
|
+
x.push(n3);
|
|
782
|
+
return c2 && x.push(M), x;
|
|
783
|
+
};
|
|
784
|
+
var K = [
|
|
785
|
+
S_CORNER_TOP_LEFT,
|
|
786
|
+
S_CORNER_TOP_RIGHT,
|
|
787
|
+
S_CORNER_BOTTOM_LEFT,
|
|
788
|
+
S_CORNER_BOTTOM_RIGHT
|
|
789
|
+
], Q = [S_BAR_START, S_BAR_START_RIGHT, S_BAR_END, S_BAR_END_RIGHT];
|
|
790
|
+
function A$1(n3, e, t2, o) {
|
|
791
|
+
let i2 = t2, f = t2;
|
|
792
|
+
return o === "center" ? i2 = Math.floor((e - n3) / 2) : o === "right" && (i2 = e - n3 - t2), f = e - i2 - n3, [i2, f];
|
|
793
|
+
}
|
|
794
|
+
var U2 = (n3) => n3, box = (n3 = "", e = "", t2) => {
|
|
795
|
+
let o = t2?.output ?? process.stdout, i2 = getColumns(o), R2 = 2, u3 = t2?.titlePadding ?? 1, h2 = t2?.contentPadding ?? 2, w = t2?.width === void 0 || t2.width === "auto" ? 1 : Math.min(1, t2.width), m2 = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)} ` : "", b = t2?.formatBorder ?? U2, a2 = (t2?.rounded ? K : Q).map(b), _ = b(S_BAR_H), p = b(S_BAR), x = dist_default2(m2), B = dist_default2(e), y2 = i2 - x, r2 = Math.floor(i2 * w) - x;
|
|
796
|
+
if (t2?.width === "auto") {
|
|
797
|
+
let c2 = n3.split(`
|
|
798
|
+
`), s = B + u3 * 2;
|
|
799
|
+
for (let G of c2) {
|
|
800
|
+
let P = dist_default2(G) + h2 * 2;
|
|
801
|
+
P > s && (s = P);
|
|
802
|
+
}
|
|
803
|
+
let g = s + R2;
|
|
804
|
+
g < r2 && (r2 = g);
|
|
805
|
+
}
|
|
806
|
+
r2 % 2 !== 0 && (r2 < y2 ? r2++ : r2--);
|
|
807
|
+
let d = r2 - R2, T = d - u3 * 2, S = B > T ? `${e.slice(0, T - 3)}...` : e, [O, W2] = A$1(
|
|
808
|
+
dist_default2(S),
|
|
809
|
+
d,
|
|
810
|
+
u3,
|
|
811
|
+
t2?.titleAlign
|
|
812
|
+
), L = wrapAnsi(n3, d - h2 * 2, {
|
|
813
|
+
hard: !0,
|
|
814
|
+
trim: !1
|
|
815
|
+
});
|
|
816
|
+
o.write(
|
|
817
|
+
`${m2}${a2[0]}${_.repeat(O)}${S}${_.repeat(W2)}${a2[1]}
|
|
818
|
+
`
|
|
819
|
+
);
|
|
820
|
+
let E = L.split(`
|
|
821
|
+
`);
|
|
822
|
+
for (let c2 of E) {
|
|
823
|
+
let [s, g] = A$1(
|
|
824
|
+
dist_default2(c2),
|
|
825
|
+
d,
|
|
826
|
+
h2,
|
|
827
|
+
t2?.contentAlign
|
|
828
|
+
);
|
|
829
|
+
o.write(
|
|
830
|
+
`${m2}${p}${" ".repeat(s)}${c2}${" ".repeat(g)}${p}
|
|
831
|
+
`
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
o.write(`${m2}${a2[2]}${_.repeat(d)}${a2[3]}
|
|
835
|
+
`);
|
|
836
|
+
}, confirm = (e) => {
|
|
837
|
+
let a2 = e.active ?? "Yes", o = e.inactive ?? "No";
|
|
838
|
+
return new r({
|
|
839
|
+
active: a2,
|
|
840
|
+
inactive: o,
|
|
841
|
+
signal: e.signal,
|
|
842
|
+
input: e.input,
|
|
843
|
+
output: e.output,
|
|
844
|
+
initialValue: e.initialValue ?? !0,
|
|
845
|
+
render() {
|
|
846
|
+
let i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
847
|
+
e.output,
|
|
848
|
+
e.message,
|
|
849
|
+
l2,
|
|
850
|
+
u3
|
|
851
|
+
), s = `${i2 ? `${styleText2("gray", S_BAR)}
|
|
852
|
+
` : ""}${f}
|
|
853
|
+
`, c2 = this.value ? a2 : o;
|
|
854
|
+
switch (this.state) {
|
|
855
|
+
case "submit": {
|
|
856
|
+
let r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
857
|
+
return `${s}${r2}${styleText2("dim", c2)}`;
|
|
858
|
+
}
|
|
859
|
+
case "cancel": {
|
|
860
|
+
let r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
861
|
+
return `${s}${r2}${styleText2(["strikethrough", "dim"], c2)}${i2 ? `
|
|
862
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
863
|
+
}
|
|
864
|
+
default: {
|
|
865
|
+
let r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", g = i2 ? styleText2("cyan", S_BAR_END) : "";
|
|
866
|
+
return `${s}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${e.vertical ? i2 ? `
|
|
867
|
+
${styleText2("cyan", S_BAR)} ` : `
|
|
868
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", o)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${o}`}
|
|
869
|
+
${g}
|
|
870
|
+
`;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}).prompt();
|
|
875
|
+
};
|
|
876
|
+
var MULTISELECT_INSTRUCTIONS = [
|
|
877
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
878
|
+
`${styleText2("dim", "Space:")} select`,
|
|
879
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
880
|
+
], m = (i2, u3) => i2.split(`
|
|
881
|
+
`).map((d) => u3(d)).join(`
|
|
882
|
+
`), multiselect = (i2) => {
|
|
883
|
+
let u3 = (t2, a2) => {
|
|
884
|
+
let r2 = t2.label ?? String(t2.value);
|
|
885
|
+
return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2(["strikethrough", "gray"], o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m(r2, (o) => styleText2("dim", o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m(r2, (o) => styleText2(["strikethrough", "dim"], o))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m(r2, (o) => styleText2("dim", o))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2("dim", o))}`;
|
|
886
|
+
}, d = i2.required ?? !0, x = i2.showInstructions ?? !0;
|
|
887
|
+
return new a({
|
|
888
|
+
options: i2.options,
|
|
889
|
+
signal: i2.signal,
|
|
890
|
+
input: i2.input,
|
|
891
|
+
output: i2.output,
|
|
892
|
+
initialValues: i2.initialValues,
|
|
893
|
+
required: d,
|
|
894
|
+
cursorAt: i2.cursorAt,
|
|
895
|
+
validate(t2) {
|
|
896
|
+
if (d && (t2 === void 0 || t2.length === 0))
|
|
897
|
+
return `Please select at least one option.
|
|
898
|
+
${styleText2(
|
|
899
|
+
"reset",
|
|
900
|
+
styleText2(
|
|
901
|
+
"dim",
|
|
902
|
+
`Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2(
|
|
903
|
+
"gray",
|
|
904
|
+
styleText2("bgWhite", styleText2("inverse", " enter "))
|
|
905
|
+
)} to submit`
|
|
906
|
+
)
|
|
907
|
+
)}`;
|
|
908
|
+
},
|
|
909
|
+
render() {
|
|
910
|
+
let t2 = i2.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
|
|
911
|
+
i2.output,
|
|
912
|
+
i2.message,
|
|
913
|
+
t2 ? `${symbolBar(this.state)} ` : "",
|
|
914
|
+
`${symbol(this.state)} `
|
|
915
|
+
), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
|
|
916
|
+
` : ""}${a2}
|
|
917
|
+
`, o = this.value ?? [], g = (n3, l2) => {
|
|
918
|
+
if (n3.disabled)
|
|
919
|
+
return u3(n3, "disabled");
|
|
920
|
+
let s = o.includes(n3.value);
|
|
921
|
+
return l2 && s ? u3(n3, "active-selected") : s ? u3(n3, "selected") : u3(n3, l2 ? "active" : "inactive");
|
|
922
|
+
};
|
|
923
|
+
switch (this.state) {
|
|
924
|
+
case "submit": {
|
|
925
|
+
let n3 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l2 = wrapTextWithPrefix(
|
|
926
|
+
i2.output,
|
|
927
|
+
n3,
|
|
928
|
+
t2 ? `${styleText2("gray", S_BAR)} ` : ""
|
|
929
|
+
);
|
|
930
|
+
return `${r2}${l2}`;
|
|
931
|
+
}
|
|
932
|
+
case "cancel": {
|
|
933
|
+
let n3 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "cancelled")).join(styleText2("dim", ", "));
|
|
934
|
+
if (n3.trim() === "")
|
|
935
|
+
return `${r2}${styleText2("gray", S_BAR)}`;
|
|
936
|
+
let l2 = wrapTextWithPrefix(
|
|
937
|
+
i2.output,
|
|
938
|
+
n3,
|
|
939
|
+
t2 ? `${styleText2("gray", S_BAR)} ` : ""
|
|
940
|
+
);
|
|
941
|
+
return `${r2}${l2}${t2 ? `
|
|
942
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
943
|
+
}
|
|
944
|
+
case "error": {
|
|
945
|
+
let n3 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l2 = this.error.split(`
|
|
946
|
+
`).map(
|
|
947
|
+
($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
|
|
948
|
+
).join(`
|
|
949
|
+
`), s = r2.split(`
|
|
950
|
+
`).length, h2 = l2.split(`
|
|
951
|
+
`).length + 1;
|
|
952
|
+
return `${r2}${n3}${limitOptions({
|
|
953
|
+
output: i2.output,
|
|
954
|
+
options: this.options,
|
|
955
|
+
cursor: this.cursor,
|
|
956
|
+
maxItems: i2.maxItems,
|
|
957
|
+
columnPadding: n3.length,
|
|
958
|
+
rowPadding: s + h2,
|
|
959
|
+
style: g
|
|
960
|
+
}).join(`
|
|
961
|
+
${n3}`)}
|
|
962
|
+
${l2}
|
|
963
|
+
`;
|
|
964
|
+
}
|
|
965
|
+
default: {
|
|
966
|
+
let n3 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l2 = r2.split(`
|
|
967
|
+
`).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
|
|
968
|
+
`), $ = s.length + 1;
|
|
969
|
+
return `${r2}${n3}${limitOptions({
|
|
970
|
+
output: i2.output,
|
|
971
|
+
options: this.options,
|
|
972
|
+
cursor: this.cursor,
|
|
973
|
+
maxItems: i2.maxItems,
|
|
974
|
+
columnPadding: n3.length,
|
|
975
|
+
rowPadding: l2 + $,
|
|
976
|
+
style: g
|
|
977
|
+
}).join(`
|
|
978
|
+
${n3}`)}
|
|
979
|
+
${h2}
|
|
980
|
+
`;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}).prompt();
|
|
985
|
+
};
|
|
986
|
+
var log = {
|
|
987
|
+
message: (s = [], {
|
|
988
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
989
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
990
|
+
output: m2 = process.stdout,
|
|
991
|
+
spacing: l2 = 1,
|
|
992
|
+
withGuide: c2
|
|
993
|
+
} = {}) => {
|
|
994
|
+
let t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
995
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
996
|
+
t2.push(f);
|
|
997
|
+
let g = Array.isArray(s) ? s : s.split(`
|
|
998
|
+
`);
|
|
999
|
+
if (g.length > 0) {
|
|
1000
|
+
let [i2, ...y2] = g;
|
|
1001
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
1002
|
+
for (let p of y2)
|
|
1003
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
1004
|
+
}
|
|
1005
|
+
m2.write(`${t2.join(`
|
|
1006
|
+
`)}
|
|
1007
|
+
`);
|
|
1008
|
+
},
|
|
1009
|
+
info: (s, e) => {
|
|
1010
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
1011
|
+
},
|
|
1012
|
+
success: (s, e) => {
|
|
1013
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
1014
|
+
},
|
|
1015
|
+
step: (s, e) => {
|
|
1016
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
1017
|
+
},
|
|
1018
|
+
warn: (s, e) => {
|
|
1019
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
1020
|
+
},
|
|
1021
|
+
/** alias for `log.warn()`. */
|
|
1022
|
+
warning: (s, e) => {
|
|
1023
|
+
log.warn(s, e);
|
|
1024
|
+
},
|
|
1025
|
+
error: (s, e) => {
|
|
1026
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1027
|
+
}
|
|
1028
|
+
}, cancel = (o = "", t2) => {
|
|
1029
|
+
let i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1030
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
1031
|
+
|
|
1032
|
+
`);
|
|
1033
|
+
}, intro = (o = "", t2) => {
|
|
1034
|
+
let i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
1035
|
+
i2.write(`${e}${o}
|
|
1036
|
+
`);
|
|
1037
|
+
}, outro = (o = "", t2) => {
|
|
1038
|
+
let i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
1039
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
1040
|
+
i2.write(`${e}${o}
|
|
1041
|
+
|
|
1042
|
+
`);
|
|
1043
|
+
};
|
|
1044
|
+
var W = (l2) => styleText2("magenta", l2), spinner = ({
|
|
1045
|
+
indicator: l2 = "dots",
|
|
1046
|
+
onCancel: h2,
|
|
1047
|
+
output: n3 = process.stdout,
|
|
1048
|
+
cancelMessage: G,
|
|
1049
|
+
errorMessage: O,
|
|
1050
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1051
|
+
delay: F = unicode ? 80 : 120,
|
|
1052
|
+
signal: m2,
|
|
1053
|
+
...I2
|
|
1054
|
+
} = {}) => {
|
|
1055
|
+
let u3 = isCI(), M, T, d = !1, S = !1, s = "", p, w = performance.now(), x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1056
|
+
let r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1057
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1058
|
+
}, f = () => g(2), i2 = () => g(1), A2 = () => {
|
|
1059
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m2 && m2.addEventListener("abort", i2);
|
|
1060
|
+
}, H = () => {
|
|
1061
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m2 && m2.removeEventListener("abort", i2);
|
|
1062
|
+
}, y2 = () => {
|
|
1063
|
+
if (p === void 0) return;
|
|
1064
|
+
u3 && n3.write(`
|
|
1065
|
+
`);
|
|
1066
|
+
let r2 = wrapAnsi(p, x, {
|
|
1067
|
+
hard: !0,
|
|
1068
|
+
trim: !1
|
|
1069
|
+
}).split(`
|
|
1070
|
+
`);
|
|
1071
|
+
r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
|
|
1072
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1073
|
+
let r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1074
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1075
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1076
|
+
d = !0, M = block({ output: n3 }), s = C(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
1077
|
+
`);
|
|
1078
|
+
let r2 = 0, t2 = 0;
|
|
1079
|
+
A2(), T = setInterval(() => {
|
|
1080
|
+
if (u3 && s === p)
|
|
1081
|
+
return;
|
|
1082
|
+
y2(), p = s;
|
|
1083
|
+
let o = k(E[r2]), v;
|
|
1084
|
+
if (u3)
|
|
1085
|
+
v = `${o} ${s}...`;
|
|
1086
|
+
else if (l2 === "timer")
|
|
1087
|
+
v = `${o} ${s} ${_(w)}`;
|
|
1088
|
+
else {
|
|
1089
|
+
let B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1090
|
+
v = `${o} ${s}${B}`;
|
|
1091
|
+
}
|
|
1092
|
+
let j = wrapAnsi(v, x, {
|
|
1093
|
+
hard: !0,
|
|
1094
|
+
trim: !1
|
|
1095
|
+
});
|
|
1096
|
+
n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1097
|
+
}, F);
|
|
1098
|
+
}, a2 = (e = "", r2 = 0, t2 = !1) => {
|
|
1099
|
+
if (!d) return;
|
|
1100
|
+
d = !1, clearInterval(T), y2();
|
|
1101
|
+
let o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1102
|
+
s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
|
|
1103
|
+
`) : n3.write(`${o} ${s}
|
|
1104
|
+
`)), H(), M();
|
|
1105
|
+
};
|
|
1106
|
+
return {
|
|
1107
|
+
start: P,
|
|
1108
|
+
stop: (e = "") => a2(e, 0),
|
|
1109
|
+
message: (e = "") => {
|
|
1110
|
+
s = C(e ?? s);
|
|
1111
|
+
},
|
|
1112
|
+
cancel: (e = "") => a2(e, 1),
|
|
1113
|
+
error: (e = "") => a2(e, 2),
|
|
1114
|
+
clear: () => a2("", 0, !0),
|
|
1115
|
+
get isCancelled() {
|
|
1116
|
+
return S;
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
}, u2 = {
|
|
1120
|
+
light: unicodeOr("\u2500", "-"),
|
|
1121
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1122
|
+
block: unicodeOr("\u2588", "#")
|
|
1123
|
+
};
|
|
1124
|
+
var SELECT_INSTRUCTIONS = [
|
|
1125
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1126
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1127
|
+
], c = (t2, o) => t2.includes(`
|
|
1128
|
+
`) ? t2.split(`
|
|
1129
|
+
`).map((d) => o(d)).join(`
|
|
1130
|
+
`) : o(t2), select = (t2) => {
|
|
1131
|
+
let o = (n3, m2) => {
|
|
1132
|
+
if (n3 === void 0)
|
|
1133
|
+
return "";
|
|
1134
|
+
let s = n3.label ?? String(n3.value);
|
|
1135
|
+
switch (m2) {
|
|
1136
|
+
case "disabled":
|
|
1137
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
1138
|
+
case "selected":
|
|
1139
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1140
|
+
case "active":
|
|
1141
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
1142
|
+
case "cancelled":
|
|
1143
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
1144
|
+
default:
|
|
1145
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1146
|
+
}
|
|
1147
|
+
}, d = t2.showInstructions ?? !0;
|
|
1148
|
+
return new n$1({
|
|
1149
|
+
options: t2.options,
|
|
1150
|
+
signal: t2.signal,
|
|
1151
|
+
input: t2.input,
|
|
1152
|
+
output: t2.output,
|
|
1153
|
+
initialValue: t2.initialValue,
|
|
1154
|
+
render() {
|
|
1155
|
+
let n3 = t2.withGuide ?? settings.withGuide, m2 = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1156
|
+
t2.output,
|
|
1157
|
+
t2.message,
|
|
1158
|
+
s,
|
|
1159
|
+
m2
|
|
1160
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1161
|
+
` : ""}${i2}
|
|
1162
|
+
`;
|
|
1163
|
+
switch (this.state) {
|
|
1164
|
+
case "submit": {
|
|
1165
|
+
let r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1166
|
+
t2.output,
|
|
1167
|
+
o(this.options[this.cursor], "selected"),
|
|
1168
|
+
r2
|
|
1169
|
+
);
|
|
1170
|
+
return `${u3}${a2}`;
|
|
1171
|
+
}
|
|
1172
|
+
case "cancel": {
|
|
1173
|
+
let r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1174
|
+
t2.output,
|
|
1175
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1176
|
+
r2
|
|
1177
|
+
);
|
|
1178
|
+
return `${u3}${a2}${n3 ? `
|
|
1179
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1180
|
+
}
|
|
1181
|
+
default: {
|
|
1182
|
+
let r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1183
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
1184
|
+
`), b = p.length + 1;
|
|
1185
|
+
return `${u3}${r2}${limitOptions({
|
|
1186
|
+
output: t2.output,
|
|
1187
|
+
cursor: this.cursor,
|
|
1188
|
+
options: this.options,
|
|
1189
|
+
maxItems: t2.maxItems,
|
|
1190
|
+
columnPadding: r2.length,
|
|
1191
|
+
rowPadding: a2 + b,
|
|
1192
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1193
|
+
}).join(`
|
|
1194
|
+
${r2}`)}
|
|
1195
|
+
${f}
|
|
1196
|
+
`;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}).prompt();
|
|
1201
|
+
};
|
|
1202
|
+
var i = `${styleText2("gray", S_BAR)} `;
|
|
1203
|
+
var A = (l2) => l2.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, ""), taskLog = (l2) => {
|
|
1204
|
+
let r2 = l2.output ?? process.stdout, O = getColumns(r2), i2 = styleText2("gray", S_BAR), p = l2.spacing ?? 1, k = 3, m2 = l2.retainLog === !0, d = !isCI() && isTTY(r2);
|
|
1205
|
+
r2.write(`${i2}
|
|
1206
|
+
`), r2.write(`${styleText2("green", S_STEP_SUBMIT)} ${l2.title}
|
|
1207
|
+
`);
|
|
1208
|
+
for (let e = 0; e < p; e++)
|
|
1209
|
+
r2.write(`${i2}
|
|
1210
|
+
`);
|
|
1211
|
+
let n3 = [
|
|
1212
|
+
{
|
|
1213
|
+
value: "",
|
|
1214
|
+
full: ""
|
|
1215
|
+
}
|
|
1216
|
+
], v = !1, f = (e) => {
|
|
1217
|
+
if (n3.length === 0)
|
|
1218
|
+
return;
|
|
1219
|
+
let s = 0;
|
|
1220
|
+
e && (s += p + 2);
|
|
1221
|
+
for (let t2 of n3) {
|
|
1222
|
+
let { value: o, result: a2 } = t2, g = a2?.message ?? o;
|
|
1223
|
+
if (g.length === 0)
|
|
1224
|
+
continue;
|
|
1225
|
+
a2 === void 0 && t2.header !== void 0 && t2.header !== "" && (g += `
|
|
1226
|
+
${t2.header}`);
|
|
1227
|
+
let E = g.split(`
|
|
1228
|
+
`).reduce((b, w) => w === "" ? b + 1 : b + Math.ceil((w.length + k) / O), 0);
|
|
1229
|
+
s += E;
|
|
1230
|
+
}
|
|
1231
|
+
s > 0 && (s += 1, r2.write(import_sisteransi2.erase.lines(s)));
|
|
1232
|
+
}, h2 = (e, s, t2) => {
|
|
1233
|
+
let o = t2 ? `${e.full}
|
|
1234
|
+
${e.value}` : e.value;
|
|
1235
|
+
e.header !== void 0 && e.header !== "" && log.message(
|
|
1236
|
+
e.header.split(`
|
|
1237
|
+
`).map((a2) => styleText2("bold", a2)),
|
|
1238
|
+
{
|
|
1239
|
+
output: r2,
|
|
1240
|
+
secondarySymbol: i2,
|
|
1241
|
+
symbol: i2,
|
|
1242
|
+
spacing: 0
|
|
1243
|
+
}
|
|
1244
|
+
), log.message(
|
|
1245
|
+
o.split(`
|
|
1246
|
+
`).map((a2) => styleText2("dim", a2)),
|
|
1247
|
+
{
|
|
1248
|
+
output: r2,
|
|
1249
|
+
secondarySymbol: i2,
|
|
1250
|
+
symbol: i2,
|
|
1251
|
+
spacing: s ?? p
|
|
1252
|
+
}
|
|
1253
|
+
);
|
|
1254
|
+
}, T = () => {
|
|
1255
|
+
for (let e of n3) {
|
|
1256
|
+
let { header: s, value: t2, full: o } = e;
|
|
1257
|
+
(s === void 0 || s.length === 0) && t2.length === 0 || h2(e, void 0, m2 === !0 && o.length > 0);
|
|
1258
|
+
}
|
|
1259
|
+
}, L = (e, s, t2) => {
|
|
1260
|
+
if (f(!1), (t2?.raw !== !0 || !v) && e.value !== "" && (e.value += `
|
|
1261
|
+
`), e.value += A(s), v = t2?.raw === !0, l2.limit !== void 0) {
|
|
1262
|
+
let o = e.value.split(`
|
|
1263
|
+
`), a2 = o.length - l2.limit;
|
|
1264
|
+
if (a2 > 0) {
|
|
1265
|
+
let g = o.splice(0, a2);
|
|
1266
|
+
m2 && (e.full += (e.full === "" ? "" : `
|
|
1267
|
+
`) + g.join(`
|
|
1268
|
+
`));
|
|
1269
|
+
}
|
|
1270
|
+
e.value = o.join(`
|
|
1271
|
+
`);
|
|
1272
|
+
}
|
|
1273
|
+
d && y2();
|
|
1274
|
+
}, y2 = () => {
|
|
1275
|
+
for (let e of n3)
|
|
1276
|
+
e.result ? e.result.status === "error" ? log.error(e.result.message, { output: r2, secondarySymbol: i2, spacing: 0 }) : log.success(e.result.message, { output: r2, secondarySymbol: i2, spacing: 0 }) : e.value !== "" && h2(e, 0);
|
|
1277
|
+
}, B = (e, s) => {
|
|
1278
|
+
f(!1), e.result = s, d && y2();
|
|
1279
|
+
};
|
|
1280
|
+
return {
|
|
1281
|
+
message(e, s) {
|
|
1282
|
+
L(n3[0], e, s);
|
|
1283
|
+
},
|
|
1284
|
+
group(e) {
|
|
1285
|
+
let s = {
|
|
1286
|
+
header: e,
|
|
1287
|
+
value: "",
|
|
1288
|
+
full: ""
|
|
1289
|
+
};
|
|
1290
|
+
return n3.push(s), {
|
|
1291
|
+
message(t2, o) {
|
|
1292
|
+
L(s, t2, o);
|
|
1293
|
+
},
|
|
1294
|
+
error(t2) {
|
|
1295
|
+
B(s, {
|
|
1296
|
+
status: "error",
|
|
1297
|
+
message: t2
|
|
1298
|
+
});
|
|
1299
|
+
},
|
|
1300
|
+
success(t2) {
|
|
1301
|
+
B(s, {
|
|
1302
|
+
status: "success",
|
|
1303
|
+
message: t2
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
},
|
|
1308
|
+
error(e, s) {
|
|
1309
|
+
f(!0), log.error(e, { output: r2, secondarySymbol: i2, spacing: 1 }), s?.showLog !== !1 && T(), n3.splice(1, n3.length - 1), n3[0].value = "", n3[0].full = "";
|
|
1310
|
+
},
|
|
1311
|
+
success(e, s) {
|
|
1312
|
+
f(!0), log.success(e, { output: r2, secondarySymbol: i2, spacing: 1 }), s?.showLog === !0 && T(), n3.splice(1, n3.length - 1), n3[0].value = "", n3[0].full = "";
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
}, text = (t2) => new n2({
|
|
1316
|
+
validate: t2.validate,
|
|
1317
|
+
placeholder: t2.placeholder,
|
|
1318
|
+
defaultValue: t2.defaultValue,
|
|
1319
|
+
initialValue: t2.initialValue,
|
|
1320
|
+
output: t2.output,
|
|
1321
|
+
signal: t2.signal,
|
|
1322
|
+
input: t2.input,
|
|
1323
|
+
render() {
|
|
1324
|
+
let r2 = t2?.withGuide ?? settings.withGuide, l2 = `${`${r2 ? `${styleText2("gray", S_BAR)}
|
|
1325
|
+
` : ""}${symbol(this.state)} `}${t2.message}
|
|
1326
|
+
`, d = t2.placeholder && t2.placeholder.length > 0 ? (
|
|
1327
|
+
// biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
|
|
1328
|
+
styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1))
|
|
1329
|
+
) : styleText2(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
|
|
1330
|
+
switch (this.state) {
|
|
1331
|
+
case "validating": {
|
|
1332
|
+
let n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "", c2 = styleText2("dim", o), $ = styleText2("dim", "Validating...");
|
|
1333
|
+
return `${l2}${n3}${c2}
|
|
1334
|
+
${i2} ${$}
|
|
1335
|
+
`;
|
|
1336
|
+
}
|
|
1337
|
+
case "error": {
|
|
1338
|
+
let n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "", c2 = r2 ? styleText2("yellow", S_BAR_END) : "";
|
|
1339
|
+
return `${l2.trim()}
|
|
1340
|
+
${i2}${o}
|
|
1341
|
+
${c2}${n3}
|
|
1342
|
+
`;
|
|
1343
|
+
}
|
|
1344
|
+
case "submit": {
|
|
1345
|
+
let n3 = s ? `${r2 ? " " : ""}${styleText2("dim", s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
1346
|
+
return `${l2}${i2}${n3}`;
|
|
1347
|
+
}
|
|
1348
|
+
case "cancel": {
|
|
1349
|
+
let n3 = s ? ` ${styleText2(["strikethrough", "dim"], s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
1350
|
+
return `${l2}${i2}${n3}${s.trim() ? `
|
|
1351
|
+
${i2}` : ""}`;
|
|
1352
|
+
}
|
|
1353
|
+
default: {
|
|
1354
|
+
let n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "";
|
|
1355
|
+
return `${l2}${n3}${o}
|
|
1356
|
+
${i2}
|
|
1357
|
+
`;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}).prompt();
|
|
1362
|
+
|
|
1363
|
+
// src/node-logger/prompts/prompt-config.ts
|
|
1364
|
+
var prompt_config_exports = {};
|
|
1365
|
+
__export(prompt_config_exports, {
|
|
1366
|
+
getPreferredStdio: () => getPreferredStdio,
|
|
1367
|
+
getPromptLibrary: () => getPromptLibrary,
|
|
1368
|
+
getPromptProvider: () => getPromptProvider,
|
|
1369
|
+
isClackEnabled: () => isClackEnabled,
|
|
1370
|
+
setPromptLibrary: () => setPromptLibrary
|
|
1371
|
+
});
|
|
1372
|
+
|
|
1373
|
+
// src/node-logger/prompts/prompt-provider-clack.ts
|
|
1374
|
+
import { stripVTControlCharacters as stripVTControlCharacters4 } from "node:util";
|
|
1375
|
+
|
|
1376
|
+
// src/node-logger/logger/log-tracker.ts
|
|
1377
|
+
import { promises as fs } from "node:fs";
|
|
1378
|
+
import { join } from "node:path";
|
|
1379
|
+
import { stripVTControlCharacters as stripVTControlCharacters2 } from "node:util";
|
|
1380
|
+
var DEBUG_LOG_FILE_NAME = "debug-storybook.log", DEFAULT_LOG_FILE_PATH = join(process.cwd(), DEBUG_LOG_FILE_NAME), LogTracker = class {
|
|
1381
|
+
/** Array to store log entries */
|
|
1382
|
+
#logs = [];
|
|
1383
|
+
/**
|
|
1384
|
+
* Flag indicating if logs should be written to file. It is enabled when users provide the
|
|
1385
|
+
* `--logfile` flag to a CLI command.
|
|
1386
|
+
*/
|
|
1387
|
+
#shouldWriteLogsToFile = !1;
|
|
1388
|
+
/** Enables writing logs to file. */
|
|
1389
|
+
enableLogWriting() {
|
|
1390
|
+
this.#shouldWriteLogsToFile = !0;
|
|
1391
|
+
}
|
|
1392
|
+
/** Returns whether logs should be written to file. */
|
|
1393
|
+
get shouldWriteLogsToFile() {
|
|
1394
|
+
return this.#shouldWriteLogsToFile;
|
|
1395
|
+
}
|
|
1396
|
+
/** Returns a copy of all stored logs. */
|
|
1397
|
+
get logs() {
|
|
1398
|
+
return [...this.#logs];
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Adds a new log entry.
|
|
1402
|
+
*
|
|
1403
|
+
* @param level - The log level
|
|
1404
|
+
* @param message - The log message
|
|
1405
|
+
* @param metadata - Optional metadata to attach to the log, can be any JSON serializable value
|
|
1406
|
+
*/
|
|
1407
|
+
addLog(level, message, metadata) {
|
|
1408
|
+
this.#logs.push({
|
|
1409
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
1410
|
+
level,
|
|
1411
|
+
message: stripVTControlCharacters2(message),
|
|
1412
|
+
metadata
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
/** Clears all stored logs. */
|
|
1416
|
+
clear() {
|
|
1417
|
+
this.#logs = [];
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Writes all stored logs to a file and clears the log store.
|
|
1421
|
+
*
|
|
1422
|
+
* @param filePath - Optional custom file path to write logs to
|
|
1423
|
+
* @returns The path where logs were written, by default is debug-storybook.log in current working
|
|
1424
|
+
* directory
|
|
1425
|
+
*/
|
|
1426
|
+
async writeToFile(filePath) {
|
|
1427
|
+
let logFilePath = typeof filePath == "string" ? filePath : DEFAULT_LOG_FILE_PATH, logContent = this.#logs.map((log3) => {
|
|
1428
|
+
let timestamp = log3.timestamp.toLocaleTimeString("en-US", { hour12: !1 }) + `.${log3.timestamp.getMilliseconds().toString().padStart(3, "0")}`, metadata = log3.metadata ? ` ${JSON.stringify(log3.metadata)}` : "";
|
|
1429
|
+
return `[${timestamp}] [${log3.level.toUpperCase()}] ${log3.message}${metadata}`;
|
|
1430
|
+
}).join(`
|
|
1431
|
+
`);
|
|
1432
|
+
return await fs.writeFile(logFilePath, logContent, "utf-8"), this.#logs = [], logFilePath;
|
|
1433
|
+
}
|
|
1434
|
+
}, logTracker = new LogTracker();
|
|
1435
|
+
|
|
1436
|
+
// src/node-logger/wrap-utils.ts
|
|
1437
|
+
import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
|
|
1438
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
1439
|
+
|
|
1440
|
+
// ../../node_modules/strip-ansi/node_modules/ansi-regex/index.js
|
|
1441
|
+
function ansiRegex({ onlyFirst = !1 } = {}) {
|
|
1442
|
+
let pattern = "(?:(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C\\u009D]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
1443
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
// ../../node_modules/strip-ansi/index.js
|
|
1447
|
+
var regex = ansiRegex();
|
|
1448
|
+
function stripAnsi(string) {
|
|
1449
|
+
if (typeof string != "string")
|
|
1450
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
1451
|
+
return !string.includes("\x1B") && !string.includes("\x9B") ? string : string.replace(regex, "");
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
// ../../node_modules/get-east-asian-width/lookup-data.js
|
|
1455
|
+
var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109], fullwidthMinimalCodePoint = 12288, fullwidthMaximumCodePoint = 65510, fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
1456
|
+
var wideMinimalCodePoint = 4352, wideMaximumCodePoint = 262141, wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101594, 101631, 101664, 101760, 101874, 101888, 102801, 102816, 102866, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110888, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110952, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127406, 127406, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128729, 128732, 128735, 128747, 128748, 128756, 128764, 128986, 128986, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129734, 129736, 129736, 129740, 129757, 129759, 129771, 129775, 129786, 131072, 196605, 196608, 262141];
|
|
1457
|
+
|
|
1458
|
+
// ../../node_modules/get-east-asian-width/utilities.js
|
|
1459
|
+
var isInRange = (ranges, codePoint) => {
|
|
1460
|
+
let low = 0, high = Math.floor(ranges.length / 2) - 1;
|
|
1461
|
+
for (; low <= high; ) {
|
|
1462
|
+
let mid = Math.floor((low + high) / 2), i2 = mid * 2;
|
|
1463
|
+
if (codePoint < ranges[i2])
|
|
1464
|
+
high = mid - 1;
|
|
1465
|
+
else if (codePoint > ranges[i2 + 1])
|
|
1466
|
+
low = mid + 1;
|
|
1467
|
+
else
|
|
1468
|
+
return !0;
|
|
1469
|
+
}
|
|
1470
|
+
return !1;
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
// ../../node_modules/get-east-asian-width/lookup.js
|
|
1474
|
+
var commonCjkCodePoint = 19968, [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);
|
|
1475
|
+
function findWideFastPathRange(ranges) {
|
|
1476
|
+
let fastPathStart = ranges[0], fastPathEnd = ranges[1];
|
|
1477
|
+
for (let index = 0; index < ranges.length; index += 2) {
|
|
1478
|
+
let start = ranges[index], end = ranges[index + 1];
|
|
1479
|
+
if (commonCjkCodePoint >= start && commonCjkCodePoint <= end)
|
|
1480
|
+
return [start, end];
|
|
1481
|
+
end - start > fastPathEnd - fastPathStart && (fastPathStart = start, fastPathEnd = end);
|
|
1482
|
+
}
|
|
1483
|
+
return [fastPathStart, fastPathEnd];
|
|
1484
|
+
}
|
|
1485
|
+
var isAmbiguous = (codePoint) => codePoint < 161 || codePoint > 1114109 ? !1 : isInRange(ambiguousRanges, codePoint), isFullwidth = (codePoint) => codePoint < fullwidthMinimalCodePoint || codePoint > fullwidthMaximumCodePoint ? !1 : isInRange(fullwidthRanges, codePoint);
|
|
1486
|
+
var isWide = (codePoint) => codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd ? !0 : codePoint < wideMinimalCodePoint || codePoint > wideMaximumCodePoint ? !1 : isInRange(wideRanges, codePoint);
|
|
1487
|
+
|
|
1488
|
+
// ../../node_modules/get-east-asian-width/index.js
|
|
1489
|
+
function validate(codePoint) {
|
|
1490
|
+
if (!Number.isSafeInteger(codePoint))
|
|
1491
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
1492
|
+
}
|
|
1493
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = !1 } = {}) {
|
|
1494
|
+
return validate(codePoint), isFullwidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint) ? 2 : 1;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
// ../../node_modules/string-width/index.js
|
|
1498
|
+
var import_emoji_regex = __toESM(require_emoji_regex(), 1), segmenter = new Intl.Segmenter(), defaultIgnorableCodePointRegex = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u");
|
|
1499
|
+
function stringWidth(string, options = {}) {
|
|
1500
|
+
if (typeof string != "string" || string.length === 0)
|
|
1501
|
+
return 0;
|
|
1502
|
+
let {
|
|
1503
|
+
ambiguousIsNarrow = !0,
|
|
1504
|
+
countAnsiEscapeCodes = !1
|
|
1505
|
+
} = options;
|
|
1506
|
+
if (countAnsiEscapeCodes || (string = stripAnsi(string)), string.length === 0)
|
|
1507
|
+
return 0;
|
|
1508
|
+
let width = 0, eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
1509
|
+
for (let { segment: character } of segmenter.segment(string)) {
|
|
1510
|
+
let codePoint = character.codePointAt(0);
|
|
1511
|
+
if (!(codePoint <= 31 || codePoint >= 127 && codePoint <= 159) && !(codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) && !(codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) && !(codePoint >= 55296 && codePoint <= 57343) && !(codePoint >= 65024 && codePoint <= 65039) && !defaultIgnorableCodePointRegex.test(character)) {
|
|
1512
|
+
if ((0, import_emoji_regex.default)().test(character)) {
|
|
1513
|
+
width += 2;
|
|
1514
|
+
continue;
|
|
1515
|
+
}
|
|
1516
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
return width;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
// ../../node_modules/ansi-styles/index.js
|
|
1523
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`, wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, styles = {
|
|
1524
|
+
modifier: {
|
|
1525
|
+
reset: [0, 0],
|
|
1526
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
1527
|
+
bold: [1, 22],
|
|
1528
|
+
dim: [2, 22],
|
|
1529
|
+
italic: [3, 23],
|
|
1530
|
+
underline: [4, 24],
|
|
1531
|
+
overline: [53, 55],
|
|
1532
|
+
inverse: [7, 27],
|
|
1533
|
+
hidden: [8, 28],
|
|
1534
|
+
strikethrough: [9, 29]
|
|
1535
|
+
},
|
|
1536
|
+
color: {
|
|
1537
|
+
black: [30, 39],
|
|
1538
|
+
red: [31, 39],
|
|
1539
|
+
green: [32, 39],
|
|
1540
|
+
yellow: [33, 39],
|
|
1541
|
+
blue: [34, 39],
|
|
1542
|
+
magenta: [35, 39],
|
|
1543
|
+
cyan: [36, 39],
|
|
1544
|
+
white: [37, 39],
|
|
1545
|
+
// Bright color
|
|
1546
|
+
blackBright: [90, 39],
|
|
1547
|
+
gray: [90, 39],
|
|
1548
|
+
// Alias of `blackBright`
|
|
1549
|
+
grey: [90, 39],
|
|
1550
|
+
// Alias of `blackBright`
|
|
1551
|
+
redBright: [91, 39],
|
|
1552
|
+
greenBright: [92, 39],
|
|
1553
|
+
yellowBright: [93, 39],
|
|
1554
|
+
blueBright: [94, 39],
|
|
1555
|
+
magentaBright: [95, 39],
|
|
1556
|
+
cyanBright: [96, 39],
|
|
1557
|
+
whiteBright: [97, 39]
|
|
1558
|
+
},
|
|
1559
|
+
bgColor: {
|
|
1560
|
+
bgBlack: [40, 49],
|
|
1561
|
+
bgRed: [41, 49],
|
|
1562
|
+
bgGreen: [42, 49],
|
|
1563
|
+
bgYellow: [43, 49],
|
|
1564
|
+
bgBlue: [44, 49],
|
|
1565
|
+
bgMagenta: [45, 49],
|
|
1566
|
+
bgCyan: [46, 49],
|
|
1567
|
+
bgWhite: [47, 49],
|
|
1568
|
+
// Bright color
|
|
1569
|
+
bgBlackBright: [100, 49],
|
|
1570
|
+
bgGray: [100, 49],
|
|
1571
|
+
// Alias of `bgBlackBright`
|
|
1572
|
+
bgGrey: [100, 49],
|
|
1573
|
+
// Alias of `bgBlackBright`
|
|
1574
|
+
bgRedBright: [101, 49],
|
|
1575
|
+
bgGreenBright: [102, 49],
|
|
1576
|
+
bgYellowBright: [103, 49],
|
|
1577
|
+
bgBlueBright: [104, 49],
|
|
1578
|
+
bgMagentaBright: [105, 49],
|
|
1579
|
+
bgCyanBright: [106, 49],
|
|
1580
|
+
bgWhiteBright: [107, 49]
|
|
1581
|
+
}
|
|
1582
|
+
}, modifierNames = Object.keys(styles.modifier), foregroundColorNames = Object.keys(styles.color), backgroundColorNames = Object.keys(styles.bgColor), colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
1583
|
+
function assembleStyles() {
|
|
1584
|
+
let codes = /* @__PURE__ */ new Map();
|
|
1585
|
+
for (let [groupName, group] of Object.entries(styles)) {
|
|
1586
|
+
for (let [styleName, style] of Object.entries(group))
|
|
1587
|
+
styles[styleName] = {
|
|
1588
|
+
open: `\x1B[${style[0]}m`,
|
|
1589
|
+
close: `\x1B[${style[1]}m`
|
|
1590
|
+
}, group[styleName] = styles[styleName], codes.set(style[0], style[1]);
|
|
1591
|
+
Object.defineProperty(styles, groupName, {
|
|
1592
|
+
value: group,
|
|
1593
|
+
enumerable: !1
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
return Object.defineProperty(styles, "codes", {
|
|
1597
|
+
value: codes,
|
|
1598
|
+
enumerable: !1
|
|
1599
|
+
}), styles.color.close = "\x1B[39m", styles.bgColor.close = "\x1B[49m", styles.color.ansi = wrapAnsi16(), styles.color.ansi256 = wrapAnsi256(), styles.color.ansi16m = wrapAnsi16m(), styles.bgColor.ansi = wrapAnsi16(10), styles.bgColor.ansi256 = wrapAnsi256(10), styles.bgColor.ansi16m = wrapAnsi16m(10), Object.defineProperties(styles, {
|
|
1600
|
+
rgbToAnsi256: {
|
|
1601
|
+
value(red, green, blue) {
|
|
1602
|
+
return red === green && green === blue ? red < 8 ? 16 : red > 248 ? 231 : Math.round((red - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
1603
|
+
},
|
|
1604
|
+
enumerable: !1
|
|
1605
|
+
},
|
|
1606
|
+
hexToRgb: {
|
|
1607
|
+
value(hex2) {
|
|
1608
|
+
let matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex2.toString(16));
|
|
1609
|
+
if (!matches)
|
|
1610
|
+
return [0, 0, 0];
|
|
1611
|
+
let [colorString] = matches;
|
|
1612
|
+
colorString.length === 3 && (colorString = [...colorString].map((character) => character + character).join(""));
|
|
1613
|
+
let integer = Number.parseInt(colorString, 16);
|
|
1614
|
+
return [
|
|
1615
|
+
/* eslint-disable no-bitwise */
|
|
1616
|
+
integer >> 16 & 255,
|
|
1617
|
+
integer >> 8 & 255,
|
|
1618
|
+
integer & 255
|
|
1619
|
+
/* eslint-enable no-bitwise */
|
|
1620
|
+
];
|
|
1621
|
+
},
|
|
1622
|
+
enumerable: !1
|
|
1623
|
+
},
|
|
1624
|
+
hexToAnsi256: {
|
|
1625
|
+
value: (hex2) => styles.rgbToAnsi256(...styles.hexToRgb(hex2)),
|
|
1626
|
+
enumerable: !1
|
|
1627
|
+
},
|
|
1628
|
+
ansi256ToAnsi: {
|
|
1629
|
+
value(code) {
|
|
1630
|
+
if (code < 8)
|
|
1631
|
+
return 30 + code;
|
|
1632
|
+
if (code < 16)
|
|
1633
|
+
return 90 + (code - 8);
|
|
1634
|
+
let red, green, blue;
|
|
1635
|
+
if (code >= 232)
|
|
1636
|
+
red = ((code - 232) * 10 + 8) / 255, green = red, blue = red;
|
|
1637
|
+
else {
|
|
1638
|
+
code -= 16;
|
|
1639
|
+
let remainder = code % 36;
|
|
1640
|
+
red = Math.floor(code / 36) / 5, green = Math.floor(remainder / 6) / 5, blue = remainder % 6 / 5;
|
|
1641
|
+
}
|
|
1642
|
+
let value = Math.max(red, green, blue) * 2;
|
|
1643
|
+
if (value === 0)
|
|
1644
|
+
return 30;
|
|
1645
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
1646
|
+
return value === 2 && (result += 60), result;
|
|
1647
|
+
},
|
|
1648
|
+
enumerable: !1
|
|
1649
|
+
},
|
|
1650
|
+
rgbToAnsi: {
|
|
1651
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
1652
|
+
enumerable: !1
|
|
1653
|
+
},
|
|
1654
|
+
hexToAnsi: {
|
|
1655
|
+
value: (hex2) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex2)),
|
|
1656
|
+
enumerable: !1
|
|
1657
|
+
}
|
|
1658
|
+
}), styles;
|
|
1659
|
+
}
|
|
1660
|
+
var ansiStyles = assembleStyles(), ansi_styles_default = ansiStyles;
|
|
1661
|
+
|
|
1662
|
+
// ../../node_modules/wrap-ansi/index.js
|
|
1663
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
1664
|
+
"\x1B",
|
|
1665
|
+
"\x9B"
|
|
1666
|
+
]), END_CODE2 = 39, ANSI_ESCAPE_BELL2 = "\x07", ANSI_CSI2 = "[", ANSI_OSC2 = "]", ANSI_SGR_TERMINATOR2 = "m", ANSI_ESCAPE_LINK2 = `${ANSI_OSC2}8;;`, wrapAnsiCode2 = (code) => `${ESCAPES.values().next().value}${ANSI_CSI2}${code}${ANSI_SGR_TERMINATOR2}`, wrapAnsiHyperlink2 = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK2}${url}${ANSI_ESCAPE_BELL2}`, wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)), wrapWord2 = (rows, word, columns) => {
|
|
1667
|
+
let characters = [...word], isInsideEscape = !1, isInsideLinkEscape = !1, visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
1668
|
+
for (let [index, character] of characters.entries()) {
|
|
1669
|
+
let characterLength = stringWidth(character);
|
|
1670
|
+
if (visible + characterLength <= columns ? rows[rows.length - 1] += character : (rows.push(character), visible = 0), ESCAPES.has(character) && (isInsideEscape = !0, isInsideLinkEscape = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK2.length).join("") === ANSI_ESCAPE_LINK2), isInsideEscape) {
|
|
1671
|
+
isInsideLinkEscape ? character === ANSI_ESCAPE_BELL2 && (isInsideEscape = !1, isInsideLinkEscape = !1) : character === ANSI_SGR_TERMINATOR2 && (isInsideEscape = !1);
|
|
1672
|
+
continue;
|
|
1673
|
+
}
|
|
1674
|
+
visible += characterLength, visible === columns && index < characters.length - 1 && (rows.push(""), visible = 0);
|
|
1675
|
+
}
|
|
1676
|
+
!visible && rows.at(-1).length > 0 && rows.length > 1 && (rows[rows.length - 2] += rows.pop());
|
|
1677
|
+
}, stringVisibleTrimSpacesRight2 = (string) => {
|
|
1678
|
+
let words = string.split(" "), last = words.length;
|
|
1679
|
+
for (; last > 0 && !(stringWidth(words[last - 1]) > 0); )
|
|
1680
|
+
last--;
|
|
1681
|
+
return last === words.length ? string : words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1682
|
+
}, exec2 = (string, columns, options = {}) => {
|
|
1683
|
+
if (options.trim !== !1 && string.trim() === "")
|
|
1684
|
+
return "";
|
|
1685
|
+
let returnValue = "", escapeCode, escapeUrl, lengths = wordLengths(string), rows = [""];
|
|
1686
|
+
for (let [index, word] of string.split(" ").entries()) {
|
|
1687
|
+
options.trim !== !1 && (rows[rows.length - 1] = rows.at(-1).trimStart());
|
|
1688
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
1689
|
+
if (index !== 0 && (rowLength >= columns && (options.wordWrap === !1 || options.trim === !1) && (rows.push(""), rowLength = 0), (rowLength > 0 || options.trim === !1) && (rows[rows.length - 1] += " ", rowLength++)), options.hard && lengths[index] > columns) {
|
|
1690
|
+
let remainingColumns = columns - rowLength, breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
1691
|
+
Math.floor((lengths[index] - 1) / columns) < breaksStartingThisLine && rows.push(""), wrapWord2(rows, word, columns);
|
|
1692
|
+
continue;
|
|
1693
|
+
}
|
|
1694
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
1695
|
+
if (options.wordWrap === !1 && rowLength < columns) {
|
|
1696
|
+
wrapWord2(rows, word, columns);
|
|
1697
|
+
continue;
|
|
1698
|
+
}
|
|
1699
|
+
rows.push("");
|
|
1700
|
+
}
|
|
1701
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === !1) {
|
|
1702
|
+
wrapWord2(rows, word, columns);
|
|
1703
|
+
continue;
|
|
1704
|
+
}
|
|
1705
|
+
rows[rows.length - 1] += word;
|
|
1706
|
+
}
|
|
1707
|
+
options.trim !== !1 && (rows = rows.map((row) => stringVisibleTrimSpacesRight2(row)));
|
|
1708
|
+
let preString = rows.join(`
|
|
1709
|
+
`), pre = [...preString], preStringIndex = 0;
|
|
1710
|
+
for (let [index, character] of pre.entries()) {
|
|
1711
|
+
if (returnValue += character, ESCAPES.has(character)) {
|
|
1712
|
+
let { groups } = new RegExp(`(?:\\${ANSI_CSI2}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK2}(?<uri>.*)${ANSI_ESCAPE_BELL2})`).exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
1713
|
+
if (groups.code !== void 0) {
|
|
1714
|
+
let code2 = Number.parseFloat(groups.code);
|
|
1715
|
+
escapeCode = code2 === END_CODE2 ? void 0 : code2;
|
|
1716
|
+
} else groups.uri !== void 0 && (escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri);
|
|
1717
|
+
}
|
|
1718
|
+
let code = ansi_styles_default.codes.get(Number(escapeCode));
|
|
1719
|
+
pre[index + 1] === `
|
|
1720
|
+
` ? (escapeUrl && (returnValue += wrapAnsiHyperlink2("")), escapeCode && code && (returnValue += wrapAnsiCode2(code))) : character === `
|
|
1721
|
+
` && (escapeCode && code && (returnValue += wrapAnsiCode2(escapeCode)), escapeUrl && (returnValue += wrapAnsiHyperlink2(escapeUrl))), preStringIndex += character.length;
|
|
1722
|
+
}
|
|
1723
|
+
return returnValue;
|
|
1724
|
+
};
|
|
1725
|
+
function wrapAnsi2(string, columns, options) {
|
|
1726
|
+
return String(string).normalize().replaceAll(`\r
|
|
1727
|
+
`, `
|
|
1728
|
+
`).split(`
|
|
1729
|
+
`).map((line) => exec2(line, columns, options)).join(`
|
|
1730
|
+
`);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// src/node-logger/wrap-utils.ts
|
|
1734
|
+
function getTerminalWidth() {
|
|
1735
|
+
try {
|
|
1736
|
+
return process.stdout.columns > 0 ? process.stdout.columns : 80;
|
|
1737
|
+
} catch {
|
|
1738
|
+
return 80;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
var URL_REGEX = /(https?:\/\/[^\s\u0000-\u001F\u007F]+)/g;
|
|
1742
|
+
function getVisibleLength(str) {
|
|
1743
|
+
return stripVTControlCharacters3(str).length;
|
|
1744
|
+
}
|
|
1745
|
+
function getEnvFromTerminal(key) {
|
|
1746
|
+
return (process.env[key] || "").trim();
|
|
1747
|
+
}
|
|
1748
|
+
function supportsHyperlinks() {
|
|
1749
|
+
try {
|
|
1750
|
+
let termProgram = getEnvFromTerminal("TERM_PROGRAM"), termProgramVersion = getEnvFromTerminal("TERM_PROGRAM_VERSION");
|
|
1751
|
+
switch (termProgram) {
|
|
1752
|
+
case "iTerm.app":
|
|
1753
|
+
if (termProgramVersion.trim()) {
|
|
1754
|
+
let version = termProgramVersion.trim().split(".").map(Number);
|
|
1755
|
+
return version[0] > 3 || version[0] === 3 && version[1] >= 1;
|
|
1756
|
+
}
|
|
1757
|
+
return !0;
|
|
1758
|
+
// Assume recent version
|
|
1759
|
+
case "Apple_Terminal":
|
|
1760
|
+
return !1;
|
|
1761
|
+
default:
|
|
1762
|
+
return !0;
|
|
1763
|
+
}
|
|
1764
|
+
} catch {
|
|
1765
|
+
return !1;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
function protectUrls(text3, options) {
|
|
1769
|
+
let defaultMaxUrlLength = Math.floor(getTerminalWidth() * 0.8), maxLineWidth = options?.maxLineWidth ?? getTerminalWidth(), useHyperlinks = supportsHyperlinks();
|
|
1770
|
+
return text3.replace(URL_REGEX, (match, capturedUrl, offset) => {
|
|
1771
|
+
if (!useHyperlinks)
|
|
1772
|
+
return match;
|
|
1773
|
+
let searchPos = 0;
|
|
1774
|
+
for (; ; ) {
|
|
1775
|
+
let hyperlinkStart = text3.indexOf("\x1B]8;;", searchPos);
|
|
1776
|
+
if (hyperlinkStart === -1)
|
|
1777
|
+
break;
|
|
1778
|
+
let hyperlinkEnd = text3.indexOf("\x1B]8;;\x07", hyperlinkStart);
|
|
1779
|
+
if (hyperlinkEnd === -1) {
|
|
1780
|
+
searchPos = hyperlinkStart + 1;
|
|
1781
|
+
continue;
|
|
1782
|
+
}
|
|
1783
|
+
if (offset >= hyperlinkStart && offset < hyperlinkEnd + 7)
|
|
1784
|
+
return match;
|
|
1785
|
+
searchPos = hyperlinkEnd + 1;
|
|
1786
|
+
}
|
|
1787
|
+
let textBeforeUrl = text3.substring(0, offset), lastNewlineIndex = textBeforeUrl.lastIndexOf(`
|
|
1788
|
+
`), currentLinePrefix = lastNewlineIndex === -1 ? textBeforeUrl : textBeforeUrl.substring(lastNewlineIndex + 1), prefixLength = getVisibleLength(currentLinePrefix), availableSpace = maxLineWidth - prefixLength, minUrlLength = 20, configuredMax = options?.maxUrlLength ?? defaultMaxUrlLength, effectiveMaxLength = Math.min(configuredMax, defaultMaxUrlLength, availableSpace);
|
|
1789
|
+
if ((capturedUrl.length <= minUrlLength || effectiveMaxLength < minUrlLength) && (effectiveMaxLength = capturedUrl.length), capturedUrl.length > effectiveMaxLength) {
|
|
1790
|
+
let truncatedText = capturedUrl.substring(0, effectiveMaxLength - 3) + "...";
|
|
1791
|
+
return `\x1B]8;;${capturedUrl}\x07${truncatedText}\x1B]8;;\x07`;
|
|
1792
|
+
}
|
|
1793
|
+
return `\x1B]8;;${capturedUrl}\x07${capturedUrl}\x1B]8;;\x07`;
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
function createHyperlink(title, url) {
|
|
1797
|
+
return supportsHyperlinks() ? `\x1B]8;;${url}\x07${title}\x1B]8;;\x07` : `${title}: ${url}`;
|
|
1798
|
+
}
|
|
1799
|
+
function splitTextPreservingUrls(text3) {
|
|
1800
|
+
let parts = [], lastIndex = 0, match;
|
|
1801
|
+
for (URL_REGEX.lastIndex = 0; (match = URL_REGEX.exec(text3)) !== null; ) {
|
|
1802
|
+
if (match.index > lastIndex) {
|
|
1803
|
+
let beforeUrl = text3.slice(lastIndex, match.index);
|
|
1804
|
+
parts.push(...beforeUrl.split(" ").filter((part) => part.length > 0));
|
|
1805
|
+
}
|
|
1806
|
+
parts.push(match[0]), lastIndex = match.index + match[0].length;
|
|
1807
|
+
}
|
|
1808
|
+
if (lastIndex < text3.length) {
|
|
1809
|
+
let remaining = text3.slice(lastIndex);
|
|
1810
|
+
parts.push(...remaining.split(" ").filter((part) => part.length > 0));
|
|
1811
|
+
}
|
|
1812
|
+
return parts;
|
|
1813
|
+
}
|
|
1814
|
+
var MAX_OPTIMAL_WIDTH = 80;
|
|
1815
|
+
function getOptimalWidth(width) {
|
|
1816
|
+
return Math.min(width, MAX_OPTIMAL_WIDTH);
|
|
1817
|
+
}
|
|
1818
|
+
function wrapTextForClack(text3, width) {
|
|
1819
|
+
let terminalWidth = width || getTerminalWidth(), contentWidth = Math.max(terminalWidth - 10, 40), maxOptimalWidth = getOptimalWidth(contentWidth), protectedText = protectUrls(text3, { maxLineWidth: maxOptimalWidth });
|
|
1820
|
+
return wrapAnsi2(protectedText, maxOptimalWidth);
|
|
1821
|
+
}
|
|
1822
|
+
function wrapTextForClackHint(text3, width, label, _indentSpaces = 4) {
|
|
1823
|
+
let terminalWidth = width || getTerminalWidth(), reservedSpaceFirstLine = 8 + (label ? getVisibleLength(label) : 0), firstLineWidth = Math.min(
|
|
1824
|
+
MAX_OPTIMAL_WIDTH - reservedSpaceFirstLine,
|
|
1825
|
+
Math.max(terminalWidth - reservedSpaceFirstLine, 30)
|
|
1826
|
+
), indentSpaces = _indentSpaces, continuationLineWidth = getOptimalWidth(Math.max(terminalWidth - indentSpaces, 30)), protectedText = protectUrls(text3, { maxLineWidth: continuationLineWidth }), initialWrap = wrapAnsi2(protectedText, continuationLineWidth), lines = initialWrap.split(`
|
|
1827
|
+
`);
|
|
1828
|
+
if (lines.length > 0 && getVisibleLength(lines[0]) > firstLineWidth) {
|
|
1829
|
+
let words = splitTextPreservingUrls(text3), firstLinePart = "", remainingPart = "";
|
|
1830
|
+
for (let i2 = 0; i2 < words.length; i2++) {
|
|
1831
|
+
let testLine = i2 === 0 ? words[i2] : firstLinePart + " " + words[i2];
|
|
1832
|
+
if (getVisibleLength(testLine) <= firstLineWidth)
|
|
1833
|
+
firstLinePart = testLine;
|
|
1834
|
+
else {
|
|
1835
|
+
remainingPart = words.slice(i2).join(" ");
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
!firstLinePart && words.length > 0 && (firstLinePart = words[0], remainingPart = words.slice(1).join(" "));
|
|
1840
|
+
let finalLines = [firstLinePart];
|
|
1841
|
+
if (remainingPart.trim()) {
|
|
1842
|
+
let protectedRemainder = protectUrls(remainingPart.trim(), {
|
|
1843
|
+
maxLineWidth: continuationLineWidth
|
|
1844
|
+
}), wrappedRemainder = wrapAnsi2(protectedRemainder, continuationLineWidth);
|
|
1845
|
+
finalLines = finalLines.concat(wrappedRemainder.split(`
|
|
1846
|
+
`));
|
|
1847
|
+
}
|
|
1848
|
+
if (finalLines.length <= 1)
|
|
1849
|
+
return finalLines[0] || "";
|
|
1850
|
+
let indentation2 = indentSpaces > 0 ? (0, import_picocolors.reset)((0, import_picocolors.cyan)(S_BAR)) + " ".repeat(indentSpaces) : "";
|
|
1851
|
+
return finalLines.map((line, index) => index === 0 ? line : `${indentation2}${(0, import_picocolors.dim)(line)}`).join(`
|
|
1852
|
+
`);
|
|
1853
|
+
}
|
|
1854
|
+
if (lines.length <= 1)
|
|
1855
|
+
return initialWrap;
|
|
1856
|
+
let indentation = (0, import_picocolors.reset)((0, import_picocolors.cyan)(S_BAR)) + " ".repeat(indentSpaces);
|
|
1857
|
+
return lines.map((line, index) => index === 0 ? line : `${indentation}${(0, import_picocolors.dim)(line)}`).join(`
|
|
1858
|
+
`);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
// src/node-logger/prompts/prompt-provider-base.ts
|
|
1862
|
+
var PromptProvider = class {
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
// src/node-logger/prompts/prompt-provider-clack.ts
|
|
1866
|
+
var getCurrentTaskLog = () => globalThis.FORKBOOK_CURRENT_TASK_LOG ? globalThis.FORKBOOK_CURRENT_TASK_LOG[globalThis.FORKBOOK_CURRENT_TASK_LOG.length - 1] : null, setCurrentTaskLog = (taskLog3) => {
|
|
1867
|
+
globalThis.FORKBOOK_CURRENT_TASK_LOG = [...globalThis.FORKBOOK_CURRENT_TASK_LOG || [], taskLog3];
|
|
1868
|
+
}, clearCurrentTaskLog = () => {
|
|
1869
|
+
globalThis.FORKBOOK_CURRENT_TASK_LOG && globalThis.FORKBOOK_CURRENT_TASK_LOG.pop();
|
|
1870
|
+
}, formatTaskLogMessage = (message) => {
|
|
1871
|
+
let columns = process.stdout.columns || 80, rows = (length) => Math.ceil((length + 3) / columns);
|
|
1872
|
+
return message.split(`
|
|
1873
|
+
`).map((line) => {
|
|
1874
|
+
let plain = stripVTControlCharacters4(line);
|
|
1875
|
+
return rows(line.length) === rows(plain.length) ? line : plain;
|
|
1876
|
+
}).join(`
|
|
1877
|
+
`);
|
|
1878
|
+
}, ClackPromptProvider = class extends PromptProvider {
|
|
1879
|
+
async handleCancel(result, promptOptions) {
|
|
1880
|
+
isCancel(result) && (promptOptions?.onCancel ? await promptOptions.onCancel() : (cancel("Operation canceled."), process.exit(0)));
|
|
1881
|
+
}
|
|
1882
|
+
async text(options, promptOptions) {
|
|
1883
|
+
let result = await text(options);
|
|
1884
|
+
return await this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result.toString();
|
|
1885
|
+
}
|
|
1886
|
+
async confirm(options, promptOptions) {
|
|
1887
|
+
let result = await confirm({
|
|
1888
|
+
...options,
|
|
1889
|
+
message: wrapTextForClackHint(options.message, void 0, void 0, 2)
|
|
1890
|
+
});
|
|
1891
|
+
return await this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), !!result;
|
|
1892
|
+
}
|
|
1893
|
+
async select(options, promptOptions) {
|
|
1894
|
+
let result = await select({
|
|
1895
|
+
...options,
|
|
1896
|
+
message: wrapTextForClackHint(options.message, void 0, void 0, 2)
|
|
1897
|
+
});
|
|
1898
|
+
return await this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
|
|
1899
|
+
}
|
|
1900
|
+
async multiselect(options, promptOptions) {
|
|
1901
|
+
let result = await multiselect({
|
|
1902
|
+
...options,
|
|
1903
|
+
required: options.required
|
|
1904
|
+
});
|
|
1905
|
+
return await this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
|
|
1906
|
+
}
|
|
1907
|
+
spinner(options) {
|
|
1908
|
+
let task = spinner(), spinnerId = `${options.id}-spinner`;
|
|
1909
|
+
return {
|
|
1910
|
+
start: (message) => {
|
|
1911
|
+
logTracker.addLog("info", `${spinnerId}-start: ${message}`), task.start(message);
|
|
1912
|
+
},
|
|
1913
|
+
message: (message) => {
|
|
1914
|
+
logTracker.addLog("info", `${spinnerId}: ${message}`), task.message(message);
|
|
1915
|
+
},
|
|
1916
|
+
stop: (message) => {
|
|
1917
|
+
logTracker.addLog("info", `${spinnerId}-stop: ${message}`), task.stop(message);
|
|
1918
|
+
},
|
|
1919
|
+
cancel: (message) => {
|
|
1920
|
+
logTracker.addLog("info", `${spinnerId}-cancel: ${message}`), task.cancel(message);
|
|
1921
|
+
},
|
|
1922
|
+
error: (message) => {
|
|
1923
|
+
logTracker.addLog("error", `${spinnerId}-error: ${message}`), task.error(message);
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
taskLog(options) {
|
|
1928
|
+
let isCurrentTaskActive = !!getCurrentTaskLog(), task = getCurrentTaskLog() || taskLog({ limit: 10, retainLog: !0, ...options }), taskId = `${options.id}-task`;
|
|
1929
|
+
return logTracker.addLog("info", `${taskId}-start: ${options.title}`), isCurrentTaskActive || setCurrentTaskLog(task), {
|
|
1930
|
+
message: (message) => {
|
|
1931
|
+
logTracker.addLog("info", `${taskId}: ${message}`), task.message(formatTaskLogMessage(message));
|
|
1932
|
+
},
|
|
1933
|
+
error: (message) => {
|
|
1934
|
+
logTracker.addLog("error", `${taskId}-error: ${message}`), task.error(message, { showLog: !0 }), clearCurrentTaskLog();
|
|
1935
|
+
},
|
|
1936
|
+
success: (message, options2) => {
|
|
1937
|
+
logTracker.addLog("info", `${taskId}-success: ${message}`), isCurrentTaskActive || task.success(message, options2), clearCurrentTaskLog();
|
|
1938
|
+
},
|
|
1939
|
+
group(title) {
|
|
1940
|
+
logTracker.addLog("info", `${taskId}-group: ${title}`);
|
|
1941
|
+
let group = task.group(title);
|
|
1942
|
+
return setCurrentTaskLog(group), {
|
|
1943
|
+
message: (message) => {
|
|
1944
|
+
group.message(message);
|
|
1945
|
+
},
|
|
1946
|
+
success: (message) => {
|
|
1947
|
+
group.success(message), clearCurrentTaskLog();
|
|
1948
|
+
},
|
|
1949
|
+
error: (message) => {
|
|
1950
|
+
group.error(message), clearCurrentTaskLog();
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
|
|
1958
|
+
// src/node-logger/prompts/prompt-config.ts
|
|
1959
|
+
var PROVIDERS = {
|
|
1960
|
+
clack: new ClackPromptProvider()
|
|
1961
|
+
}, currentPromptLibrary = "clack", setPromptLibrary = (library) => {
|
|
1962
|
+
currentPromptLibrary = library;
|
|
1963
|
+
}, getPromptLibrary = () => currentPromptLibrary, getPromptProvider = () => PROVIDERS[currentPromptLibrary], isClackEnabled = () => currentPromptLibrary === "clack", getPreferredStdio = () => isClackEnabled() ? "pipe" : "inherit";
|
|
1964
|
+
|
|
1965
|
+
// src/node-logger/logger/colors.ts
|
|
1966
|
+
var import_picocolors2 = __toESM(require_picocolors(), 1), CLI_COLORS = {
|
|
1967
|
+
success: import_picocolors2.default.green,
|
|
1968
|
+
error: import_picocolors2.default.red,
|
|
1969
|
+
warning: import_picocolors2.default.yellow,
|
|
1970
|
+
// Improve contrast on dark terminals by using cyan for info on all platforms
|
|
1971
|
+
info: import_picocolors2.default.cyan,
|
|
1972
|
+
debug: import_picocolors2.default.gray,
|
|
1973
|
+
// Only color a link if it is the primary call to action, otherwise links shouldn't be colored
|
|
1974
|
+
cta: import_picocolors2.default.cyan,
|
|
1975
|
+
muted: import_picocolors2.default.dim,
|
|
1976
|
+
storybook: (text3) => `\x1B[38;2;255;71;133m${text3}\x1B[39m`
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
// src/node-logger/logger/logger.ts
|
|
1980
|
+
var createLogFunction = (clackFn, consoleFn, cliColors) => () => isClackEnabled() ? (...args) => {
|
|
1981
|
+
let [message, ...rest] = args, currentTaskLog = getCurrentTaskLog();
|
|
1982
|
+
currentTaskLog ? currentTaskLog.message(
|
|
1983
|
+
cliColors && typeof message == "string" ? cliColors(message) : message
|
|
1984
|
+
) : typeof message == "string" ? clackFn(wrapTextForClack(message), ...rest) : clackFn(message, ...rest);
|
|
1985
|
+
} : consoleFn, LOG_FUNCTIONS = {
|
|
1986
|
+
log: createLogFunction(log.message, console.log),
|
|
1987
|
+
info: createLogFunction(log.info, console.log),
|
|
1988
|
+
warn: createLogFunction(log.warn, console.warn, CLI_COLORS.warning),
|
|
1989
|
+
error: createLogFunction(log.error, console.error, CLI_COLORS.error),
|
|
1990
|
+
intro: createLogFunction(intro, console.log),
|
|
1991
|
+
outro: createLogFunction(outro, console.log),
|
|
1992
|
+
step: createLogFunction(log.step, console.log)
|
|
1993
|
+
}, LOG_LEVELS = {
|
|
1994
|
+
trace: 1,
|
|
1995
|
+
debug: 2,
|
|
1996
|
+
info: 3,
|
|
1997
|
+
warn: 4,
|
|
1998
|
+
error: 5,
|
|
1999
|
+
silent: 10
|
|
2000
|
+
}, currentLogLevel = "info", setLogLevel = (level) => {
|
|
2001
|
+
currentLogLevel = level;
|
|
2002
|
+
}, getLogLevel = () => currentLogLevel, shouldLog = (level) => LOG_LEVELS[currentLogLevel] <= LOG_LEVELS[level];
|
|
2003
|
+
function getMinimalTrace() {
|
|
2004
|
+
let stack = new Error().stack;
|
|
2005
|
+
if (!stack)
|
|
2006
|
+
return;
|
|
2007
|
+
let userStackLines = stack.split(`
|
|
2008
|
+
`).slice(1).filter(
|
|
2009
|
+
(line) => !["getMinimalTrace", "createLogger", "logFunction"].some((fn) => line.includes(fn))
|
|
2010
|
+
);
|
|
2011
|
+
return userStackLines.length === 0 ? void 0 : `
|
|
2012
|
+
` + userStackLines.slice(0, 4).join(`
|
|
2013
|
+
`);
|
|
2014
|
+
}
|
|
2015
|
+
var formatLogMessage = (args) => args.map((arg) => typeof arg == "string" ? arg : typeof arg == "object" ? JSON.stringify(arg, null, 2) : String(arg)).join(" ");
|
|
2016
|
+
function createLogger(level, logFn, prefix) {
|
|
2017
|
+
return function(...args) {
|
|
2018
|
+
let [message, ...rest] = args, msg = formatLogMessage([message]);
|
|
2019
|
+
if (logTracker.addLog(level, msg), level === "prompt" && (level = "info"), shouldLog(level)) {
|
|
2020
|
+
let formattedMessage = prefix ? `${prefix} ${msg}` : message;
|
|
2021
|
+
logFn(formattedMessage, ...rest);
|
|
2022
|
+
}
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
var debug = createLogger(
|
|
2026
|
+
"debug",
|
|
2027
|
+
function(message) {
|
|
2028
|
+
shouldLog("trace") && (message += getMinimalTrace()), LOG_FUNCTIONS.log()(message);
|
|
2029
|
+
},
|
|
2030
|
+
"[DEBUG]"
|
|
2031
|
+
), log2 = createLogger(
|
|
2032
|
+
"info",
|
|
2033
|
+
(...args) => LOG_FUNCTIONS.log()(...args)
|
|
2034
|
+
), info = createLogger(
|
|
2035
|
+
"info",
|
|
2036
|
+
(...args) => LOG_FUNCTIONS.info()(...args)
|
|
2037
|
+
), warn = createLogger(
|
|
2038
|
+
"warn",
|
|
2039
|
+
(...args) => LOG_FUNCTIONS.warn()(...args)
|
|
2040
|
+
), error = createLogger(
|
|
2041
|
+
"error",
|
|
2042
|
+
(...args) => LOG_FUNCTIONS.error()(...args)
|
|
2043
|
+
), logBox = (message, { title, ...options } = {}) => {
|
|
2044
|
+
try {
|
|
2045
|
+
shouldLog("info") && (logTracker.addLog("info", message), isClackEnabled() ? box(message, title, {
|
|
2046
|
+
...options,
|
|
2047
|
+
width: options.width ?? "auto"
|
|
2048
|
+
}) : console.log(message));
|
|
2049
|
+
} catch {
|
|
2050
|
+
log.message(message);
|
|
2051
|
+
}
|
|
2052
|
+
}, intro2 = (message) => {
|
|
2053
|
+
logTracker.addLog("info", message), shouldLog("info") && (console.log(""), LOG_FUNCTIONS.intro()(message));
|
|
2054
|
+
}, outro2 = (message) => {
|
|
2055
|
+
logTracker.addLog("info", message), shouldLog("info") && LOG_FUNCTIONS.outro()(message);
|
|
2056
|
+
}, step = (message) => {
|
|
2057
|
+
logTracker.addLog("info", message), shouldLog("info") && LOG_FUNCTIONS.step()(message);
|
|
2058
|
+
}, SYMBOLS = {
|
|
2059
|
+
success: CLI_COLORS.success("\u2714"),
|
|
2060
|
+
error: CLI_COLORS.error("\u2715")
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
// src/node-logger/pretty-time.ts
|
|
2064
|
+
var UNITS = ["h", "min", "s", "ms", "\u03BCs", "ns"];
|
|
2065
|
+
function prettyTime([seconds, nanoseconds]) {
|
|
2066
|
+
let values = [
|
|
2067
|
+
seconds / 3600,
|
|
2068
|
+
seconds % 3600 / 60,
|
|
2069
|
+
seconds % 60 + nanoseconds / 1e9,
|
|
2070
|
+
nanoseconds / 1e6,
|
|
2071
|
+
nanoseconds % 1e6 / 1e3,
|
|
2072
|
+
nanoseconds % 1e3
|
|
2073
|
+
], index = values.findIndex((value2) => value2 >= 1);
|
|
2074
|
+
if (index === -1)
|
|
2075
|
+
return "";
|
|
2076
|
+
let value = values[index];
|
|
2077
|
+
return `${Number(value.toFixed(value >= 10 ? 0 : 2))} ${UNITS[index]}`;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
// src/node-logger/logger/console.ts
|
|
2081
|
+
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
2082
|
+
var ConsoleLogger = class _ConsoleLogger {
|
|
2083
|
+
constructor() {
|
|
2084
|
+
this.Console = _ConsoleLogger;
|
|
2085
|
+
this.timers = /* @__PURE__ */ new Map();
|
|
2086
|
+
this.counters = /* @__PURE__ */ new Map();
|
|
2087
|
+
this.lastStatusLine = null;
|
|
2088
|
+
this.statusLineCount = 0;
|
|
2089
|
+
}
|
|
2090
|
+
// These will be overridden by child classes
|
|
2091
|
+
get prefix() {
|
|
2092
|
+
return "";
|
|
2093
|
+
}
|
|
2094
|
+
get color() {
|
|
2095
|
+
return (text3) => text3;
|
|
2096
|
+
}
|
|
2097
|
+
formatMessage(...data) {
|
|
2098
|
+
let message = data.join(" ");
|
|
2099
|
+
return this.prefix ? `${this.color(this.prefix)} ${message}` : message;
|
|
2100
|
+
}
|
|
2101
|
+
assert(condition, ...data) {
|
|
2102
|
+
condition || error(this.formatMessage("Assertion failed:", ...data));
|
|
2103
|
+
}
|
|
2104
|
+
// Needs some proper implementation
|
|
2105
|
+
// Take a look at https://github.com/webpack/webpack/blob/5f898719ae47b89bee3c126bf5d2e0081ea8c91f/lib/node/nodeConsole.js#L4
|
|
2106
|
+
// for some inspiration
|
|
2107
|
+
// status(...data: any[]): void {
|
|
2108
|
+
// const message = this.formatMessage(...data);
|
|
2109
|
+
// // If we have a previous status line, we need to clear it
|
|
2110
|
+
// if (this.lastStatusLine !== null) {
|
|
2111
|
+
// this.clearStatus();
|
|
2112
|
+
// }
|
|
2113
|
+
// // Write the status message directly to stdout without adding newlines
|
|
2114
|
+
// process.stdout.write(message);
|
|
2115
|
+
// // Update tracking variables
|
|
2116
|
+
// this.lastStatusLine = message;
|
|
2117
|
+
// this.statusLineCount = 1; // For now, assume single line status messages
|
|
2118
|
+
// // If the message contains newlines, count them
|
|
2119
|
+
// const newlineCount = (message.match(/\n/g) || []).length;
|
|
2120
|
+
// this.statusLineCount = newlineCount + 1;
|
|
2121
|
+
// }
|
|
2122
|
+
// /** Clears the current status line if one exists */
|
|
2123
|
+
// clearStatus(): void {
|
|
2124
|
+
// if (this.lastStatusLine !== null) {
|
|
2125
|
+
// // Move cursor to the beginning of the current line
|
|
2126
|
+
// process.stdout.write('\r');
|
|
2127
|
+
// // Clear the current line
|
|
2128
|
+
// process.stdout.clearLine(1);
|
|
2129
|
+
// // Reset tracking variables
|
|
2130
|
+
// this.lastStatusLine = null;
|
|
2131
|
+
// this.statusLineCount = 0;
|
|
2132
|
+
// }
|
|
2133
|
+
// }
|
|
2134
|
+
/**
|
|
2135
|
+
* The **`console.clear()`** static method clears the console if possible.
|
|
2136
|
+
*
|
|
2137
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
|
|
2138
|
+
*/
|
|
2139
|
+
clear() {
|
|
2140
|
+
console.clear();
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* The **`console.count()`** static method logs the number of times that this particular call to
|
|
2144
|
+
* `count()` has been called.
|
|
2145
|
+
*
|
|
2146
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
|
|
2147
|
+
*/
|
|
2148
|
+
count(label) {
|
|
2149
|
+
let key = label || "default", currentCount = (this.counters.get(key) || 0) + 1;
|
|
2150
|
+
this.counters.set(key, currentCount), log2(this.formatMessage(`${key}: ${currentCount}`));
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* The **`console.countReset()`** static method resets counter used with console/count_static.
|
|
2154
|
+
*
|
|
2155
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
|
|
2156
|
+
*/
|
|
2157
|
+
countReset(label) {
|
|
2158
|
+
let key = label || "default";
|
|
2159
|
+
this.counters.delete(key);
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* The **`console.debug()`** static method outputs a message to the console at the 'debug' log
|
|
2163
|
+
* level.
|
|
2164
|
+
*
|
|
2165
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
|
|
2166
|
+
*/
|
|
2167
|
+
debug(...data) {
|
|
2168
|
+
process.stdout.write(`
|
|
2169
|
+
`), debug(this.formatMessage(...data));
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* The **`console.dir()`** static method displays a list of the properties of the specified
|
|
2173
|
+
* JavaScript object.
|
|
2174
|
+
*
|
|
2175
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
|
|
2176
|
+
*/
|
|
2177
|
+
dir(item, options) {
|
|
2178
|
+
console.dir(item, options);
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* The **`console.dirxml()`** static method displays an interactive tree of the descendant
|
|
2182
|
+
* elements of the specified XML/HTML element.
|
|
2183
|
+
*
|
|
2184
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
|
|
2185
|
+
*/
|
|
2186
|
+
dirxml(...data) {
|
|
2187
|
+
console.dirxml(...data);
|
|
2188
|
+
}
|
|
2189
|
+
/**
|
|
2190
|
+
* The **`console.error()`** static method outputs a message to the console at the 'error' log
|
|
2191
|
+
* level.
|
|
2192
|
+
*
|
|
2193
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
|
|
2194
|
+
*/
|
|
2195
|
+
error(...data) {
|
|
2196
|
+
process.stdout.write(`
|
|
2197
|
+
`), error(this.formatMessage(...data));
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* The **`console.group()`** static method creates a new inline group in the Web console log,
|
|
2201
|
+
* causing any subsequent console messages to be indented by an additional level, until
|
|
2202
|
+
* console/groupEnd_static is called.
|
|
2203
|
+
*
|
|
2204
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
|
|
2205
|
+
*/
|
|
2206
|
+
group(...data) {
|
|
2207
|
+
console.group(...data);
|
|
2208
|
+
}
|
|
2209
|
+
/**
|
|
2210
|
+
* The **`console.groupCollapsed()`** static method creates a new inline group in the console.
|
|
2211
|
+
*
|
|
2212
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
|
|
2213
|
+
*/
|
|
2214
|
+
groupCollapsed(...data) {
|
|
2215
|
+
console.groupCollapsed(...data);
|
|
2216
|
+
}
|
|
2217
|
+
/**
|
|
2218
|
+
* The **`console.groupEnd()`** static method exits the current inline group in the console.
|
|
2219
|
+
*
|
|
2220
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
|
|
2221
|
+
*/
|
|
2222
|
+
groupEnd() {
|
|
2223
|
+
console.groupEnd();
|
|
2224
|
+
}
|
|
2225
|
+
/**
|
|
2226
|
+
* The **`console.info()`** static method outputs a message to the console at the 'info' log
|
|
2227
|
+
* level.
|
|
2228
|
+
*
|
|
2229
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
|
|
2230
|
+
*/
|
|
2231
|
+
info(...data) {
|
|
2232
|
+
process.stdout.write(`
|
|
2233
|
+
`), log2(this.formatMessage(...data));
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* The **`console.log()`** static method outputs a message to the console.
|
|
2237
|
+
*
|
|
2238
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
|
|
2239
|
+
*/
|
|
2240
|
+
log(...data) {
|
|
2241
|
+
process.stdout.write(`
|
|
2242
|
+
`), log2(this.formatMessage(...data));
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* The **`console.table()`** static method displays tabular data as a table.
|
|
2246
|
+
*
|
|
2247
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
|
|
2248
|
+
*/
|
|
2249
|
+
table(tabularData, properties) {
|
|
2250
|
+
console.table(tabularData, properties);
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* The **`console.time()`** static method starts a timer you can use to track how long an
|
|
2254
|
+
* operation takes.
|
|
2255
|
+
*
|
|
2256
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
|
|
2257
|
+
*/
|
|
2258
|
+
time(label) {
|
|
2259
|
+
let key = label || "default";
|
|
2260
|
+
this.timers.set(key, Date.now());
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* The **`console.timeEnd()`** static method stops a timer that was previously started by calling
|
|
2264
|
+
* console/time_static.
|
|
2265
|
+
*
|
|
2266
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
|
|
2267
|
+
*/
|
|
2268
|
+
timeEnd(label) {
|
|
2269
|
+
let key = label || "default", startTime = this.timers.get(key);
|
|
2270
|
+
if (startTime) {
|
|
2271
|
+
let duration = Date.now() - startTime;
|
|
2272
|
+
log2(this.formatMessage(`${key}: ${duration}ms`)), this.timers.delete(key);
|
|
2273
|
+
} else
|
|
2274
|
+
warn(this.formatMessage(`Timer '${key}' does not exist`));
|
|
2275
|
+
}
|
|
2276
|
+
/**
|
|
2277
|
+
* The **`console.timeLog()`** static method logs the current value of a timer that was previously
|
|
2278
|
+
* started by calling console/time_static.
|
|
2279
|
+
*
|
|
2280
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
|
|
2281
|
+
*/
|
|
2282
|
+
timeLog(label, ...data) {
|
|
2283
|
+
let key = label || "default", startTime = this.timers.get(key);
|
|
2284
|
+
if (startTime) {
|
|
2285
|
+
let duration = Date.now() - startTime;
|
|
2286
|
+
log2(this.formatMessage(`${key}: ${duration}ms`, ...data));
|
|
2287
|
+
} else
|
|
2288
|
+
warn(this.formatMessage(`Timer '${key}' does not exist`));
|
|
2289
|
+
}
|
|
2290
|
+
timeStamp(label) {
|
|
2291
|
+
let timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
2292
|
+
log2(this.formatMessage(`[${timestamp}]${label ? ` ${label}` : ""}`));
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* The **`console.trace()`** static method outputs a stack trace to the console.
|
|
2296
|
+
*
|
|
2297
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
|
|
2298
|
+
*/
|
|
2299
|
+
trace(...data) {
|
|
2300
|
+
console.trace(...data);
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* The **`console.warn()`** static method outputs a warning message to the console at the
|
|
2304
|
+
* 'warning' log level.
|
|
2305
|
+
*
|
|
2306
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
|
|
2307
|
+
*/
|
|
2308
|
+
warn(...data) {
|
|
2309
|
+
process.stdout.write(`
|
|
2310
|
+
`), warn(this.formatMessage(...data));
|
|
2311
|
+
}
|
|
2312
|
+
profile(label) {
|
|
2313
|
+
console.profile(label), log2(this.formatMessage(`Profile started: ${label}`));
|
|
2314
|
+
}
|
|
2315
|
+
profileEnd(label) {
|
|
2316
|
+
console.profileEnd(label), log2(this.formatMessage(`Profile ended: ${label}`));
|
|
2317
|
+
}
|
|
2318
|
+
}, StyledConsoleLogger = class extends ConsoleLogger {
|
|
2319
|
+
constructor(options) {
|
|
2320
|
+
super(), this._prefix = options.prefix || "", this._color = options.color;
|
|
2321
|
+
}
|
|
2322
|
+
// Override the getter methods from parent class
|
|
2323
|
+
get prefix() {
|
|
2324
|
+
return this._prefix;
|
|
2325
|
+
}
|
|
2326
|
+
get color() {
|
|
2327
|
+
return import_picocolors3.default[this._color];
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2330
|
+
|
|
2331
|
+
// src/node-logger/prompts/prompt-functions.ts
|
|
2332
|
+
var prompt_functions_exports = {};
|
|
2333
|
+
__export(prompt_functions_exports, {
|
|
2334
|
+
confirm: () => confirm2,
|
|
2335
|
+
multiselect: () => multiselect2,
|
|
2336
|
+
select: () => select2,
|
|
2337
|
+
spinner: () => spinner2,
|
|
2338
|
+
taskLog: () => taskLog2,
|
|
2339
|
+
text: () => text2
|
|
2340
|
+
});
|
|
2341
|
+
var activeSpinner = null, activeTaskLog = null, originalConsoleLog = null;
|
|
2342
|
+
if (typeof process.stdout.columns == "number" && !(process.stdout.columns > 0))
|
|
2343
|
+
try {
|
|
2344
|
+
process.stdout.columns = getTerminalWidth();
|
|
2345
|
+
} catch {
|
|
2346
|
+
}
|
|
2347
|
+
var isInteractiveTerminal = () => process.stdout.isTTY && process.stdin.isTTY && !process.env.CI, patchConsoleLog = () => {
|
|
2348
|
+
originalConsoleLog || (originalConsoleLog = console.log, console.log = (...args) => {
|
|
2349
|
+
let message = args.map((arg) => typeof arg == "string" ? arg : JSON.stringify(arg)).join(" ");
|
|
2350
|
+
activeTaskLog ? shouldLog("info") && activeTaskLog.message(message) : activeSpinner ? shouldLog("info") && activeSpinner.message(message) : originalConsoleLog(...args);
|
|
2351
|
+
});
|
|
2352
|
+
}, restoreConsoleLog = () => {
|
|
2353
|
+
originalConsoleLog && !activeSpinner && !activeTaskLog && (console.log = originalConsoleLog, originalConsoleLog = null);
|
|
2354
|
+
}, text2 = async (options, promptOptions) => getPromptProvider().text(options, promptOptions), confirm2 = async (options, promptOptions) => getPromptProvider().confirm(options, promptOptions), select2 = async (options, promptOptions) => getPromptProvider().select(options, promptOptions), multiselect2 = async (options, promptOptions) => getPromptProvider().multiselect(
|
|
2355
|
+
{
|
|
2356
|
+
...options,
|
|
2357
|
+
options: options.options.map((opt) => ({
|
|
2358
|
+
...opt,
|
|
2359
|
+
hint: opt.hint ? wrapTextForClackHint(opt.hint, void 0, opt.label || String(opt.value), 0) : void 0
|
|
2360
|
+
}))
|
|
2361
|
+
},
|
|
2362
|
+
promptOptions
|
|
2363
|
+
), spinner2 = (options) => {
|
|
2364
|
+
if (isInteractiveTerminal()) {
|
|
2365
|
+
let spinnerInstance = getPromptProvider().spinner(options), wrappedSpinner = {
|
|
2366
|
+
start: (message) => {
|
|
2367
|
+
activeSpinner = wrappedSpinner, patchConsoleLog(), shouldLog("info") && spinnerInstance.start(message);
|
|
2368
|
+
},
|
|
2369
|
+
stop: (message) => {
|
|
2370
|
+
activeSpinner = null, restoreConsoleLog(), shouldLog("info") && spinnerInstance.stop(message);
|
|
2371
|
+
},
|
|
2372
|
+
cancel: (message) => {
|
|
2373
|
+
activeSpinner = null, restoreConsoleLog(), shouldLog("info") && spinnerInstance.cancel(message);
|
|
2374
|
+
},
|
|
2375
|
+
error: (message) => {
|
|
2376
|
+
activeSpinner = null, restoreConsoleLog(), shouldLog("error") && spinnerInstance.error(message);
|
|
2377
|
+
},
|
|
2378
|
+
message: (text3) => {
|
|
2379
|
+
shouldLog("info") && spinnerInstance.message(text3);
|
|
2380
|
+
}
|
|
2381
|
+
};
|
|
2382
|
+
return wrappedSpinner;
|
|
2383
|
+
} else {
|
|
2384
|
+
let maybeLog = shouldLog("info") ? log2 : (_) => {
|
|
2385
|
+
};
|
|
2386
|
+
return {
|
|
2387
|
+
start: (message) => {
|
|
2388
|
+
message && maybeLog(message);
|
|
2389
|
+
},
|
|
2390
|
+
stop: (message) => {
|
|
2391
|
+
message && maybeLog(message);
|
|
2392
|
+
},
|
|
2393
|
+
cancel: (message) => {
|
|
2394
|
+
message && maybeLog(message);
|
|
2395
|
+
},
|
|
2396
|
+
error: (message) => {
|
|
2397
|
+
message && shouldLog("error") && error(message);
|
|
2398
|
+
},
|
|
2399
|
+
message: (message) => {
|
|
2400
|
+
maybeLog(message);
|
|
2401
|
+
}
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
}, taskLog2 = (options) => {
|
|
2405
|
+
if (isInteractiveTerminal() && shouldLog("info")) {
|
|
2406
|
+
let task = getPromptProvider().taskLog(options), wrappedTaskLog = {
|
|
2407
|
+
message: (message) => {
|
|
2408
|
+
task.message(wrapTextForClack(message));
|
|
2409
|
+
},
|
|
2410
|
+
success: (message, options2) => {
|
|
2411
|
+
activeTaskLog = null, restoreConsoleLog(), task.success(message, options2);
|
|
2412
|
+
},
|
|
2413
|
+
error: (message) => {
|
|
2414
|
+
activeTaskLog = null, restoreConsoleLog(), task.error(message);
|
|
2415
|
+
},
|
|
2416
|
+
group: function(title) {
|
|
2417
|
+
return this.message(`
|
|
2418
|
+
${title}
|
|
2419
|
+
`), {
|
|
2420
|
+
message: (message) => {
|
|
2421
|
+
task.message(wrapTextForClack(message));
|
|
2422
|
+
},
|
|
2423
|
+
success: (message) => {
|
|
2424
|
+
task.success(message);
|
|
2425
|
+
},
|
|
2426
|
+
error: (message) => {
|
|
2427
|
+
task.error(message);
|
|
2428
|
+
}
|
|
2429
|
+
};
|
|
2430
|
+
}
|
|
2431
|
+
};
|
|
2432
|
+
return activeTaskLog = wrappedTaskLog, patchConsoleLog(), wrappedTaskLog;
|
|
2433
|
+
} else {
|
|
2434
|
+
let maybeLog = shouldLog("info") ? log2 : (_) => {
|
|
2435
|
+
};
|
|
2436
|
+
return {
|
|
2437
|
+
message: (message) => {
|
|
2438
|
+
maybeLog(message);
|
|
2439
|
+
},
|
|
2440
|
+
success: (message) => {
|
|
2441
|
+
maybeLog(message);
|
|
2442
|
+
},
|
|
2443
|
+
error: (message) => {
|
|
2444
|
+
maybeLog(message);
|
|
2445
|
+
},
|
|
2446
|
+
group: (title) => (maybeLog(`
|
|
2447
|
+
${title}
|
|
2448
|
+
`), {
|
|
2449
|
+
message: (message) => {
|
|
2450
|
+
maybeLog(message);
|
|
2451
|
+
},
|
|
2452
|
+
success: (message) => {
|
|
2453
|
+
maybeLog(message);
|
|
2454
|
+
},
|
|
2455
|
+
error: (message) => {
|
|
2456
|
+
maybeLog(message);
|
|
2457
|
+
}
|
|
2458
|
+
})
|
|
2459
|
+
};
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2462
|
+
|
|
2463
|
+
// src/node-logger/tasks.ts
|
|
2464
|
+
function setupAbortController() {
|
|
2465
|
+
let abortController = new AbortController(), isRawMode = !1, wasRawMode = process.stdin.isRaw, onKeyPress = (chunk) => {
|
|
2466
|
+
let key = chunk.toString();
|
|
2467
|
+
(key === "c" || key === "C") && abortController.abort();
|
|
2468
|
+
}, cleanup = () => {
|
|
2469
|
+
isRawMode && (process.stdin.setRawMode(wasRawMode ?? !1), process.stdin.removeListener("data", onKeyPress), wasRawMode || process.stdin.pause());
|
|
2470
|
+
};
|
|
2471
|
+
if (process.stdin.isTTY)
|
|
2472
|
+
try {
|
|
2473
|
+
isRawMode = !0, process.stdin.setRawMode(!0), process.stdin.resume(), process.stdin.on("data", onKeyPress);
|
|
2474
|
+
} catch {
|
|
2475
|
+
isRawMode = !1;
|
|
2476
|
+
}
|
|
2477
|
+
return { abortController, cleanup };
|
|
2478
|
+
}
|
|
2479
|
+
var executeTask = async (childProcessFactories, {
|
|
2480
|
+
intro: intro3,
|
|
2481
|
+
error: error2,
|
|
2482
|
+
success,
|
|
2483
|
+
abortable = !1
|
|
2484
|
+
}) => {
|
|
2485
|
+
logTracker.addLog("info", intro3), log2(intro3);
|
|
2486
|
+
let abortController, cleanup;
|
|
2487
|
+
if (abortable) {
|
|
2488
|
+
let result = setupAbortController();
|
|
2489
|
+
abortController = result.abortController, cleanup = result.cleanup;
|
|
2490
|
+
}
|
|
2491
|
+
let factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
|
|
2492
|
+
try {
|
|
2493
|
+
for (let factory of factories) {
|
|
2494
|
+
let childProcess = factory(abortController?.signal);
|
|
2495
|
+
childProcess.stdout?.on("data", (data) => {
|
|
2496
|
+
let message = data.toString().trim();
|
|
2497
|
+
logTracker.addLog("info", message), log2(message);
|
|
2498
|
+
}), await childProcess;
|
|
2499
|
+
}
|
|
2500
|
+
logTracker.addLog("info", success), log2(CLI_COLORS.success(success));
|
|
2501
|
+
} catch (err) {
|
|
2502
|
+
if (abortController?.signal.aborted || err.message?.includes("Command was killed with SIGINT") || err.message?.includes("The operation was aborted"))
|
|
2503
|
+
return logTracker.addLog("info", `${intro3} aborted`), log2(CLI_COLORS.error(`${intro3} aborted`)), "aborted";
|
|
2504
|
+
let errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
|
|
2505
|
+
throw logTracker.addLog("error", error2, { error: errorMessage }), log2(CLI_COLORS.error(String(err.message ?? err))), err;
|
|
2506
|
+
} finally {
|
|
2507
|
+
cleanup?.();
|
|
2508
|
+
}
|
|
2509
|
+
}, executeTaskWithSpinner = async (childProcessFactories, {
|
|
2510
|
+
id,
|
|
2511
|
+
intro: intro3,
|
|
2512
|
+
error: error2,
|
|
2513
|
+
success,
|
|
2514
|
+
abortable = !1
|
|
2515
|
+
}) => {
|
|
2516
|
+
logTracker.addLog("info", intro3);
|
|
2517
|
+
let abortController, cleanup;
|
|
2518
|
+
if (abortable) {
|
|
2519
|
+
let result = setupAbortController();
|
|
2520
|
+
abortController = result.abortController, cleanup = result.cleanup;
|
|
2521
|
+
}
|
|
2522
|
+
let task = spinner2({ id });
|
|
2523
|
+
task.start(intro3);
|
|
2524
|
+
let factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
|
|
2525
|
+
try {
|
|
2526
|
+
for (let factory of factories) {
|
|
2527
|
+
let childProcess = factory(abortController?.signal);
|
|
2528
|
+
childProcess.stdout?.on("data", (data) => {
|
|
2529
|
+
let message = data.toString().trim().slice(0, 25);
|
|
2530
|
+
logTracker.addLog("info", `${intro3}: ${data.toString()}`), task.message(`${intro3}: ${message}`);
|
|
2531
|
+
}), await childProcess;
|
|
2532
|
+
}
|
|
2533
|
+
logTracker.addLog("info", success), task.stop(success);
|
|
2534
|
+
} catch (err) {
|
|
2535
|
+
if (abortController?.signal.aborted || err.message?.includes("Command was killed with SIGINT") || err.message?.includes("The operation was aborted"))
|
|
2536
|
+
return logTracker.addLog("info", `${intro3} aborted`), task.cancel(CLI_COLORS.warning(`${intro3} aborted`)), "aborted";
|
|
2537
|
+
let errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
|
|
2538
|
+
throw logTracker.addLog("error", error2, { error: errorMessage }), task.error(CLI_COLORS.error(error2)), err;
|
|
2539
|
+
} finally {
|
|
2540
|
+
cleanup?.();
|
|
2541
|
+
}
|
|
2542
|
+
};
|
|
2543
|
+
|
|
2544
|
+
// src/node-logger/prompts/index.ts
|
|
2545
|
+
var prompt = {
|
|
2546
|
+
...prompt_functions_exports,
|
|
2547
|
+
...prompt_config_exports,
|
|
2548
|
+
executeTask,
|
|
2549
|
+
executeTaskWithSpinner
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
// src/node-logger/index.ts
|
|
2553
|
+
var setLoggerLevel = (level = "info") => {
|
|
2554
|
+
setLogLevel(level);
|
|
2555
|
+
};
|
|
2556
|
+
function hex(hexColor) {
|
|
2557
|
+
if (!/^#?[0-9A-Fa-f]{6}$/.test(hexColor))
|
|
2558
|
+
throw new Error("Invalid hex color. It must be a 6-character hex code.");
|
|
2559
|
+
hexColor.startsWith("#") && (hexColor = hexColor.slice(1));
|
|
2560
|
+
let r2 = parseInt(hexColor.slice(0, 2), 16), g = parseInt(hexColor.slice(2, 4), 16), b = parseInt(hexColor.slice(4, 6), 16);
|
|
2561
|
+
return (text3) => `\x1B[38;2;${r2};${g};${b}m${text3}\x1B[39m`;
|
|
2562
|
+
}
|
|
2563
|
+
var colors = {
|
|
2564
|
+
pink: hex("#F1618C"),
|
|
2565
|
+
purple: hex("#B57EE5"),
|
|
2566
|
+
orange: hex("#F3AD38"),
|
|
2567
|
+
green: hex("#A2E05E"),
|
|
2568
|
+
blue: hex("#6DABF5"),
|
|
2569
|
+
red: hex("#F16161"),
|
|
2570
|
+
gray: hex("#B8C2CC")
|
|
2571
|
+
}, logger = {
|
|
2572
|
+
...logger_exports,
|
|
2573
|
+
verbose: (message) => debug(message),
|
|
2574
|
+
line: (count = 1) => log2(`${Array(count - 1).fill(`
|
|
2575
|
+
`)}`),
|
|
2576
|
+
/** For non-critical issues or warnings */
|
|
2577
|
+
warn: (message) => warn(message),
|
|
2578
|
+
trace: ({ message, time }) => debug(`${message} (${colors.purple(prettyTime(time))})`),
|
|
2579
|
+
setLevel: setLoggerLevel,
|
|
2580
|
+
setLogLevel: setLoggerLevel,
|
|
2581
|
+
error: (message) => {
|
|
2582
|
+
let msg;
|
|
2583
|
+
message instanceof Error && message.stack ? msg = message.stack.toString().replace(message.toString(), colors.red(message.toString())) : typeof message == "string" ? msg = message.toString() : msg = String(message), error(msg.replaceAll(process.cwd(), "."));
|
|
2584
|
+
}
|
|
2585
|
+
}, logged = /* @__PURE__ */ new Set(), once = (type) => (message) => {
|
|
2586
|
+
if (!logged.has(message))
|
|
2587
|
+
return logged.add(message), logger[type](message);
|
|
2588
|
+
};
|
|
2589
|
+
once.clear = () => logged.clear();
|
|
2590
|
+
once.verbose = once("verbose");
|
|
2591
|
+
once.info = once("info");
|
|
2592
|
+
once.warn = once("warn");
|
|
2593
|
+
once.error = once("error");
|
|
2594
|
+
var deprecate = once("warn");
|
|
2595
|
+
|
|
2596
|
+
export {
|
|
2597
|
+
logTracker,
|
|
2598
|
+
protectUrls,
|
|
2599
|
+
createHyperlink,
|
|
2600
|
+
CLI_COLORS,
|
|
2601
|
+
prettyTime,
|
|
2602
|
+
ConsoleLogger,
|
|
2603
|
+
StyledConsoleLogger,
|
|
2604
|
+
prompt,
|
|
2605
|
+
colors,
|
|
2606
|
+
logger,
|
|
2607
|
+
once,
|
|
2608
|
+
deprecate
|
|
2609
|
+
};
|