@aussieljk/forkbook 0.0.0-stage → 0.0.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +77 -2
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
- package/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -0
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/assets/builder-vite/iframe.html +99 -0
- package/assets/create/rendererAssets/.eslintrc.json +16 -0
- package/assets/create/rendererAssets/common/Configure.mdx +388 -0
- package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
- package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
- package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
- package/assets/create/rendererAssets/common/assets/assets.png +0 -0
- package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/assets/create/rendererAssets/common/assets/context.png +0 -0
- package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
- package/assets/create/rendererAssets/common/assets/docs.png +0 -0
- package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/assets/create/rendererAssets/common/assets/github.svg +1 -0
- package/assets/create/rendererAssets/common/assets/share.png +0 -0
- package/assets/create/rendererAssets/common/assets/styling.png +0 -0
- package/assets/create/rendererAssets/common/assets/testing.png +0 -0
- package/assets/create/rendererAssets/common/assets/theming.png +0 -0
- package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
- package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
- package/assets/create/rendererAssets/common/button.css +30 -0
- package/assets/create/rendererAssets/common/header.css +32 -0
- package/assets/create/rendererAssets/common/page.css +68 -0
- package/assets/create/templates/react-native/index.expo.js +20 -0
- package/assets/create/templates/react-native/index.js +25 -0
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/react-native/metro-env.d.ts +69 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +116 -0
- package/assets/server/base-preview-head.html +494 -0
- package/assets/server/openBrowser.applescript +94 -0
- package/assets/server/template.ejs +87 -0
- package/dist/.build-stamp +0 -0
- package/dist/_browser-chunks/Color-OEKZ7XSW.js +1025 -0
- package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
- package/dist/_browser-chunks/WithTooltip-GZSSFOG3.js +1619 -0
- package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
- package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
- package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
- package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
- package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
- package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
- package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
- package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
- package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
- package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
- package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
- package/dist/_browser-chunks/chunk-73OX2G56.js +2943 -0
- package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
- package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
- package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
- package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
- package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
- package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
- package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
- package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
- package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
- package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
- package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
- package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
- package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
- package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
- package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
- package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
- package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
- package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
- package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
- package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
- package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
- package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
- package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
- package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
- package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
- package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
- package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
- package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
- package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
- package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
- package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
- package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
- package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
- package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
- package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
- package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
- package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
- package/dist/_browser-chunks/chunk-PP4R7USA.js +2167 -0
- package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
- package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
- package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
- package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
- package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
- package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
- package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
- package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
- package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
- package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
- package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
- package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
- package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
- package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
- package/dist/_browser-chunks/chunk-VVWPND3J.js +108 -0
- package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
- package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
- package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
- package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
- package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
- package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
- package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
- package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
- package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
- package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
- package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
- package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
- package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
- package/dist/_node-chunks/attached-runtime-O4YTVUKE.js +282 -0
- package/dist/_node-chunks/builder-manager-FPV2L36T.js +1661 -0
- package/dist/_node-chunks/chunk-2BJIHWOK.js +25 -0
- package/dist/_node-chunks/chunk-2JSABFAM.js +148 -0
- package/dist/_node-chunks/chunk-2QTI45JU.js +1094 -0
- package/dist/_node-chunks/chunk-2UG3IYCC.js +26 -0
- package/dist/_node-chunks/chunk-2XDUXZGI.js +153 -0
- package/dist/_node-chunks/chunk-356LV3NX.js +36 -0
- package/dist/_node-chunks/chunk-3CLITGI2.js +121 -0
- package/dist/_node-chunks/chunk-4PK3LUHM.js +82 -0
- package/dist/_node-chunks/chunk-4TV3Z3S3.js +20 -0
- package/dist/_node-chunks/chunk-5BTU7UZ5.js +1877 -0
- package/dist/_node-chunks/chunk-5GN5N22E.js +989 -0
- package/dist/_node-chunks/chunk-5J3BMBMY.js +51 -0
- package/dist/_node-chunks/chunk-5J3O7EDY.js +21 -0
- package/dist/_node-chunks/chunk-5RNOGGO6.js +35 -0
- package/dist/_node-chunks/chunk-5WHA37KG.js +1297 -0
- package/dist/_node-chunks/chunk-6APBQVEX.js +611 -0
- package/dist/_node-chunks/chunk-6EJ5NPEM.js +98 -0
- package/dist/_node-chunks/chunk-7BVUZZIY.js +56 -0
- package/dist/_node-chunks/chunk-7DCDBICW.js +415 -0
- package/dist/_node-chunks/chunk-7LLQDMVS.js +223 -0
- package/dist/_node-chunks/chunk-7TSL7D5D.js +26 -0
- package/dist/_node-chunks/chunk-A724RK5H.js +168 -0
- package/dist/_node-chunks/chunk-AANHLH5M.js +87 -0
- package/dist/_node-chunks/chunk-ASJFOW6O.js +1133 -0
- package/dist/_node-chunks/chunk-AWJOXJAZ.js +144 -0
- package/dist/_node-chunks/chunk-AWXGCPW6.js +92 -0
- package/dist/_node-chunks/chunk-B6SKX4JF.js +414 -0
- package/dist/_node-chunks/chunk-BCRWDMAU.js +11 -0
- package/dist/_node-chunks/chunk-BE6ULVPN.js +662 -0
- package/dist/_node-chunks/chunk-BENYUF74.js +2107 -0
- package/dist/_node-chunks/chunk-CDRLLNRQ.js +209 -0
- package/dist/_node-chunks/chunk-CSXS6LVI.js +29 -0
- package/dist/_node-chunks/chunk-CWD5A6NI.js +45 -0
- package/dist/_node-chunks/chunk-CXLL2F6O.js +7162 -0
- package/dist/_node-chunks/chunk-CYPPELO4.js +1011 -0
- package/dist/_node-chunks/chunk-DUOXRUVQ.js +18 -0
- package/dist/_node-chunks/chunk-DWE36J35.js +3767 -0
- package/dist/_node-chunks/chunk-EWXASIWR.js +60 -0
- package/dist/_node-chunks/chunk-FUYZNTIS.js +23 -0
- package/dist/_node-chunks/chunk-G5OYQQDY.js +21 -0
- package/dist/_node-chunks/chunk-G6PUNHCI.js +33 -0
- package/dist/_node-chunks/chunk-GP5YLBNS.js +499 -0
- package/dist/_node-chunks/chunk-GSWBRZLU.js +110 -0
- package/dist/_node-chunks/chunk-GT5EHMNM.js +90 -0
- package/dist/_node-chunks/chunk-GVSFRNWZ.js +110 -0
- package/dist/_node-chunks/chunk-HKQEE62W.js +1193 -0
- package/dist/_node-chunks/chunk-HKUNJELN.js +132 -0
- package/dist/_node-chunks/chunk-I2ANCID7.js +3787 -0
- package/dist/_node-chunks/chunk-ICADUNQM.js +155 -0
- package/dist/_node-chunks/chunk-IJL5JOLL.js +95 -0
- package/dist/_node-chunks/chunk-ILVD64RB.js +844 -0
- package/dist/_node-chunks/chunk-ILWHW4HU.js +1218 -0
- package/dist/_node-chunks/chunk-IZISFDKM.js +7032 -0
- package/dist/_node-chunks/chunk-JBCKN6P4.js +59 -0
- package/dist/_node-chunks/chunk-JE6JEGXA.js +115 -0
- package/dist/_node-chunks/chunk-JEC2OK5B.js +5468 -0
- package/dist/_node-chunks/chunk-JVQYQTTM.js +1094 -0
- package/dist/_node-chunks/chunk-KGOAOPKR.js +35 -0
- package/dist/_node-chunks/chunk-M2BRIUUP.js +25 -0
- package/dist/_node-chunks/chunk-MDKFZRYG.js +80 -0
- package/dist/_node-chunks/chunk-MJ2UD7FU.js +26 -0
- package/dist/_node-chunks/chunk-NIHZECYO.js +48 -0
- package/dist/_node-chunks/chunk-NKAUZU4C.js +63 -0
- package/dist/_node-chunks/chunk-NZ3GOT7V.js +68 -0
- package/dist/_node-chunks/chunk-PBMWZVLD.js +49 -0
- package/dist/_node-chunks/chunk-PEIAGMSR.js +23 -0
- package/dist/_node-chunks/chunk-QMU5ODXZ.js +47 -0
- package/dist/_node-chunks/chunk-QVMUIU7S.js +40 -0
- package/dist/_node-chunks/chunk-R5FYRP6X.js +74 -0
- package/dist/_node-chunks/chunk-R7CY5LX6.js +33 -0
- package/dist/_node-chunks/chunk-RHG33T7C.js +688 -0
- package/dist/_node-chunks/chunk-RJUHZH32.js +20 -0
- package/dist/_node-chunks/chunk-RJXEPYEN.js +2700 -0
- package/dist/_node-chunks/chunk-RQVK2TOI.js +298 -0
- package/dist/_node-chunks/chunk-SRXCCL2O.js +194 -0
- package/dist/_node-chunks/chunk-SVZ6Q3CS.js +40 -0
- package/dist/_node-chunks/chunk-TB6Y6NSL.js +3837 -0
- package/dist/_node-chunks/chunk-U4GKV7GZ.js +4744 -0
- package/dist/_node-chunks/chunk-ULW4SLMN.js +2034 -0
- package/dist/_node-chunks/chunk-URRTQ2QM.js +104 -0
- package/dist/_node-chunks/chunk-US7L4S72.js +45 -0
- package/dist/_node-chunks/chunk-VQEQ7ZLS.js +4731 -0
- package/dist/_node-chunks/chunk-VXDWOVWD.js +52345 -0
- package/dist/_node-chunks/chunk-WQ7PSP6H.js +19 -0
- package/dist/_node-chunks/chunk-WVCU34IS.js +23 -0
- package/dist/_node-chunks/chunk-X6OWHTYE.js +20 -0
- package/dist/_node-chunks/chunk-XCGMRAV5.js +33 -0
- package/dist/_node-chunks/chunk-XJSYJTBD.js +59 -0
- package/dist/_node-chunks/chunk-XTTAS346.js +25 -0
- package/dist/_node-chunks/chunk-XURIZ7IC.js +32 -0
- package/dist/_node-chunks/chunk-Y2DEKWVE.js +3008 -0
- package/dist/_node-chunks/chunk-Y2GH4XO7.js +884 -0
- package/dist/_node-chunks/chunk-YWMICX2T.js +1986 -0
- package/dist/_node-chunks/chunk-ZBAIFZNB.js +5414 -0
- package/dist/_node-chunks/chunk-ZMEGPR47.js +79 -0
- package/dist/_node-chunks/dist-ZGSN23B7.js +16 -0
- package/dist/_node-chunks/globby-HWZL7XSQ.js +2884 -0
- package/dist/_node-chunks/jiti-GNDCTFYU.js +3848 -0
- package/dist/_node-chunks/lib-DI662U2R.js +366 -0
- package/dist/_node-chunks/local-runtime-4UNT5EZJ.js +78 -0
- package/dist/_node-chunks/mdx-plugin-ZY6XLLA4.js +5680 -0
- package/dist/_node-chunks/monorepo-B65J4UFS.js +121 -0
- package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-45ZTNWJS.js +121 -0
- package/dist/_node-chunks/optimized-tests-ZMNICF4R.js +22 -0
- package/dist/_node-chunks/pattern-copy-play-LOHSM7ID.js +807 -0
- package/dist/_node-chunks/postinstallAddon-NT5XE7IT.js +20 -0
- package/dist/_node-chunks/rehype-external-links-22ZBI6K4.js +121 -0
- package/dist/_node-chunks/rehype-slug-ROZVEEFZ.js +52 -0
- package/dist/_node-chunks/relaxed-limits-EDE2B34G.js +117 -0
- package/dist/_node-chunks/run-372BSBV5.js +4532 -0
- package/dist/_node-chunks/run-IR3BRDJV.js +103 -0
- package/dist/_node-chunks/session-id-OO2WQF5N.js +23 -0
- package/dist/_node-chunks/setup-6TMCKUTA.js +278 -0
- package/dist/_node-chunks/vitest.config.4.template-QJBEVCKG.js +54 -0
- package/dist/actions/decorator.d.ts +7 -0
- package/dist/actions/decorator.js +43 -0
- package/dist/actions/index.d.ts +67 -0
- package/dist/actions/index.js +28 -0
- package/dist/addon-a11y/index.d.ts +52 -0
- package/dist/addon-a11y/index.js +16 -0
- package/dist/addon-a11y/manager.js +1429 -0
- package/dist/addon-a11y/preset.js +18 -0
- package/dist/addon-a11y/preview.d.ts +17 -0
- package/dist/addon-a11y/preview.js +15 -0
- package/dist/addon-docs/blocks.d.ts +1061 -0
- package/dist/addon-docs/blocks.js +2461 -0
- package/dist/addon-docs/index.d.ts +236 -0
- package/dist/addon-docs/index.js +16 -0
- package/dist/addon-docs/manager.js +90 -0
- package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
- package/dist/addon-docs/mdx-react-shim.js +2 -0
- package/dist/addon-docs/preset.js +378 -0
- package/dist/addon-docs/preview.d.ts +4 -0
- package/dist/addon-docs/preview.js +7 -0
- package/dist/addon-links/index.d.ts +22 -0
- package/dist/addon-links/index.js +20 -0
- package/dist/addon-links/manager.js +14 -0
- package/dist/addon-links/preview.d.ts +6 -0
- package/dist/addon-links/preview.js +9 -0
- package/dist/addon-links/react/index.d.ts +25 -0
- package/dist/addon-links/react/index.js +52 -0
- package/dist/addon-mcp/preset.js +1345 -0
- package/dist/addon-mcp/preview.js +29 -0
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1174 -0
- package/dist/addon-ondevice-actions/index.d.ts +4 -0
- package/dist/addon-ondevice-actions/index.js +7 -0
- package/dist/addon-ondevice-actions/register.js +7 -0
- package/dist/addon-ondevice-controls/index.d.ts +6 -0
- package/dist/addon-ondevice-controls/index.js +14 -0
- package/dist/addon-ondevice-controls/register.js +10 -0
- package/dist/addon-pseudo-states/index.d.ts +35 -0
- package/dist/addon-pseudo-states/index.js +15 -0
- package/dist/addon-pseudo-states/manager.js +53 -0
- package/dist/addon-pseudo-states/preview.d.ts +9 -0
- package/dist/addon-pseudo-states/preview.js +10 -0
- package/dist/addon-themes/index.d.ts +80 -0
- package/dist/addon-themes/index.js +104 -0
- package/dist/addon-themes/manager.js +97 -0
- package/dist/addon-themes/postinstall.js +33 -0
- package/dist/addon-themes/preview.d.ts +6 -0
- package/dist/addon-themes/preview.js +8 -0
- package/dist/addon-vitest/constants.d.ts +132 -0
- package/dist/addon-vitest/constants.js +66 -0
- package/dist/addon-vitest/index.d.ts +4 -0
- package/dist/addon-vitest/index.js +8 -0
- package/dist/addon-vitest/manager.js +665 -0
- package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
- package/dist/addon-vitest/node/vitest.js +674 -0
- package/dist/addon-vitest/postinstall.js +24 -0
- package/dist/addon-vitest/preset.js +943 -0
- package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
- package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
- package/dist/addon-vitest/vitest-plugin/index.js +463 -0
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
- package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
- package/dist/babel/index.d.ts +2301 -0
- package/dist/babel/index.js +61 -0
- package/dist/backgrounds/index.d.ts +6 -0
- package/dist/backgrounds/index.js +15 -0
- package/dist/bin/core.js +1705 -0
- package/dist/bin/dispatcher.js +43 -0
- package/dist/bin/loader.js +115 -0
- package/dist/builder-vite/index.d.ts +50 -0
- package/dist/builder-vite/index.js +245 -0
- package/dist/builder-vite/preset.js +27 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +352 -0
- package/dist/chunk-B2t1tGRh.d.ts +284 -0
- package/dist/chunk-BCoJQE-f.d.ts +602 -0
- package/dist/chunk-BGkgZp-H.d.ts +214 -0
- package/dist/chunk-BTVrWliM.d.ts +115 -0
- package/dist/chunk-BXLImeLy.d.ts +197 -0
- package/dist/chunk-BfBzpgct.d.ts +916 -0
- package/dist/chunk-Bpi2tz-6.d.ts +511 -0
- package/dist/chunk-BxWufQms.d.ts +142 -0
- package/dist/chunk-C-bavsOH.d.ts +34 -0
- package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
- package/dist/chunk-C6PAgHLT.d.ts +12 -0
- package/dist/chunk-CMeX4WRe.d.ts +179 -0
- package/dist/chunk-Ct9xd6IM.d.ts +65 -0
- package/dist/chunk-CwQKNaYL.d.ts +15 -0
- package/dist/chunk-D7DwV41f.d.ts +3622 -0
- package/dist/chunk-DEVFdzxR.d.ts +253 -0
- package/dist/chunk-DaVb55-_.d.ts +124 -0
- package/dist/chunk-DgRNfmj_.d.ts +40 -0
- package/dist/chunk-DoIGKY33.d.ts +666 -0
- package/dist/chunk-Dr3R0DXk.d.ts +40 -0
- package/dist/chunk-DtHByo32.d.ts +55 -0
- package/dist/chunk-Dw1z1Pki.d.ts +933 -0
- package/dist/chunk-DzuY9DXg.d.ts +79 -0
- package/dist/chunk-FjDVzZTj.d.ts +62 -0
- package/dist/chunk-Kt1tW-D1.d.ts +59 -0
- package/dist/chunk-XP8oHzpE.d.ts +6 -0
- package/dist/chunk-gCX81nOr.d.ts +61 -0
- package/dist/chunk-pcFXCimE.d.ts +741 -0
- package/dist/cli/index.d.ts +1174 -0
- package/dist/cli/index.js +5613 -0
- package/dist/cli/skills/content/index.d.ts +72 -0
- package/dist/cli/skills/content/index.js +335 -0
- package/dist/cli/tools/sdk/child-host.d.ts +61 -0
- package/dist/cli/tools/sdk/child-host.js +131 -0
- package/dist/cli/tools/sdk/index.d.ts +137 -0
- package/dist/cli/tools/sdk/index.js +44 -0
- package/dist/cli-commands/bin/index.js +25 -0
- package/dist/client-logger/index.d.ts +31 -0
- package/dist/client-logger/index.js +63 -0
- package/dist/common/index.d.ts +1103 -0
- package/dist/common/index.js +364 -0
- package/dist/components/index.d.ts +1924 -0
- package/dist/components/index.js +13759 -0
- package/dist/core-events/index.d.ts +155 -0
- package/dist/core-events/index.js +136 -0
- package/dist/core-server/index.d.ts +2200 -0
- package/dist/core-server/index.js +4165 -0
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +4168 -0
- package/dist/core-server/presets/common-override-preset.js +81 -0
- package/dist/core-server/presets/common-preset.js +2187 -0
- package/dist/create/bin/index.js +23 -0
- package/dist/create/index.js +25 -0
- package/dist/csf/csf-utils.d.ts +2 -0
- package/dist/csf/csf-utils.js +19 -0
- package/dist/csf/index.d.ts +7 -0
- package/dist/csf/index.js +2142 -0
- package/dist/csf-tools/index.d.ts +1157 -0
- package/dist/csf-tools/index.js +736 -0
- package/dist/docs-tools/index.d.ts +197 -0
- package/dist/docs-tools/index.js +61 -0
- package/dist/highlight/index.d.ts +10 -0
- package/dist/highlight/index.js +15 -0
- package/dist/instrumenter/index.d.ts +113 -0
- package/dist/instrumenter/index.js +2595 -0
- package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
- package/dist/manager/_manager-chunks/globals-runtime-B0I9dSVs.js +5564 -0
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
- package/dist/manager/_manager-chunks/globals-runtime-BQCkfH1B.js +121 -0
- package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
- package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
- package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
- package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
- package/dist/manager/_manager-chunks/globals-runtime-CXoVXiJA.js +4468 -0
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
- package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
- package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
- package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
- package/dist/manager/_manager-chunks/globals-runtime-f5oIrim0.js +5102 -0
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
- package/dist/manager/_manager-chunks/runtime-Bry1Biu7.js +8936 -0
- package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
- package/dist/manager/_manager-chunks/runtime-DcJBhKG9.js +1408 -0
- package/dist/manager/_manager-chunks/runtime-DpgBAFGf.js +22 -0
- package/dist/manager/_manager-chunks/runtime-DtyerpFe.js +979 -0
- package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
- package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
- package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
- package/dist/manager/globals-runtime.js +2 -0
- package/dist/manager/globals.d.ts +23 -0
- package/dist/manager/globals.js +26 -0
- package/dist/manager/manager-stores.d.ts +2 -0
- package/dist/manager/manager-stores.js +19 -0
- package/dist/manager/runtime.js +2 -0
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +3257 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +20 -0
- package/dist/mcp/index.d.ts +270 -0
- package/dist/mcp/index.js +305 -0
- package/dist/mocking-utils/index.d.ts +689 -0
- package/dist/mocking-utils/index.js +521 -0
- package/dist/mocking-utils/mocker-runtime.js +1254 -0
- package/dist/nextjs-vite/config/preview.js +3 -0
- package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
- package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
- package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
- package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
- package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
- package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
- package/dist/nextjs-vite/index.d.ts +92 -0
- package/dist/nextjs-vite/index.js +58 -0
- package/dist/nextjs-vite/node/index.d.ts +6 -0
- package/dist/nextjs-vite/node/index.js +20 -0
- package/dist/nextjs-vite/preset.js +648 -0
- package/dist/nextjs-vite/preview.d.ts +20 -0
- package/dist/nextjs-vite/preview.js +11 -0
- package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
- package/dist/nextjs-vite/vite-plugin/index.js +19 -0
- package/dist/nextjs-vite-plugin/index.d.ts +28 -0
- package/dist/nextjs-vite-plugin/index.js +923 -0
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
- package/dist/node-logger/index.d.ts +495 -0
- package/dist/node-logger/index.js +42 -0
- package/dist/oxc-parser/index.d.ts +99 -0
- package/dist/oxc-parser/index.js +275 -0
- package/dist/oxc-parser/worker.js +37 -0
- package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
- package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
- package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
- package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
- package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
- package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
- package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
- package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
- package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
- package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
- package/dist/preview/globals.d.ts +16 -0
- package/dist/preview/globals.js +20 -0
- package/dist/preview/runtime.js +6 -0
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +147 -0
- package/dist/preview-errors.d.ts +186 -0
- package/dist/preview-errors.js +56 -0
- package/dist/react/docgen/docgen-worker.js +38 -0
- package/dist/react/entry-preview-argtypes.js +9 -0
- package/dist/react/entry-preview-docs.js +12 -0
- package/dist/react/entry-preview-rsc.js +11 -0
- package/dist/react/entry-preview.js +21 -0
- package/dist/react/index.d.ts +119 -0
- package/dist/react/index.js +26 -0
- package/dist/react/preset.js +301 -0
- package/dist/react/preview.d.ts +2 -0
- package/dist/react/preview.js +11 -0
- package/dist/react-native/bin/get-stories.js +34 -0
- package/dist/react-native/index.d.ts +160 -0
- package/dist/react-native/index.js +1547 -0
- package/dist/react-native/metro/node.d.ts +83 -0
- package/dist/react-native/metro/node.js +21 -0
- package/dist/react-native/metro/withStorybook.d.ts +2269 -0
- package/dist/react-native/metro/withStorybook.js +138 -0
- package/dist/react-native/preview.d.ts +6 -0
- package/dist/react-native/preview.js +20 -0
- package/dist/react-native/scripts/generate.d.ts +22 -0
- package/dist/react-native/scripts/generate.js +18 -0
- package/dist/react-native/stub.js +20 -0
- package/dist/react-native-theming/index.d.ts +175 -0
- package/dist/react-native-theming/index.js +2591 -0
- package/dist/react-native-ui/index.d.ts +130 -0
- package/dist/react-native-ui/index.js +1865 -0
- package/dist/react-native-ui-common/index.d.ts +230 -0
- package/dist/react-native-ui-common/index.js +514 -0
- package/dist/react-vite/index.d.ts +4 -0
- package/dist/react-vite/index.js +8 -0
- package/dist/react-vite/node/index.d.ts +6 -0
- package/dist/react-vite/node/index.js +20 -0
- package/dist/react-vite/preset.d.ts +6 -0
- package/dist/react-vite/preset.js +21 -0
- package/dist/router/index.d.ts +141 -0
- package/dist/router/index.js +1217 -0
- package/dist/server-errors.d.ts +2 -0
- package/dist/server-errors.js +149 -0
- package/dist/shared/open-service/index.d.ts +3 -0
- package/dist/shared/open-service/index.js +115 -0
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
- package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
- package/dist/shared/open-service/toolsets/docs/public.js +991 -0
- package/dist/telemetry/index.d.ts +314 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/test/index.d.ts +158 -0
- package/dist/test/index.js +19421 -0
- package/dist/theming/create.d.ts +15 -0
- package/dist/theming/create.js +11 -0
- package/dist/theming/index.d.ts +54 -0
- package/dist/theming/index.js +511 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +48 -0
- package/dist/viewport/index.d.ts +275 -0
- package/dist/viewport/index.js +21 -0
- package/package.json +1075 -4
- package/template/nextjs-vite/cli/.eslintrc.json +6 -0
- package/template/nextjs-vite/cli/js/Button.jsx +42 -0
- package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
- package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
- package/template/nextjs-vite/cli/js/Header.jsx +58 -0
- package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
- package/template/nextjs-vite/cli/js/Page.jsx +68 -0
- package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
- package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
- package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
- package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
- package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
- package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
- package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
- package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
- package/template/react/cli/.eslintrc.json +5 -0
- package/template/react/cli/js/Button.jsx +39 -0
- package/template/react/cli/js/Button.stories.js +49 -0
- package/template/react/cli/js/Header.jsx +56 -0
- package/template/react/cli/js/Header.stories.js +29 -0
- package/template/react/cli/js/Page.jsx +69 -0
- package/template/react/cli/js/Page.stories.js +28 -0
- package/template/react/cli/ts/Button.stories.ts +54 -0
- package/template/react/cli/ts/Button.tsx +37 -0
- package/template/react/cli/ts/Header.stories.ts +34 -0
- package/template/react/cli/ts/Header.tsx +56 -0
- package/template/react/cli/ts/Page.stories.ts +33 -0
- package/template/react/cli/ts/Page.tsx +73 -0
- package/template/react-vite/cli/.eslintrc.json +5 -0
- package/template/react-vite/cli/js/Button.jsx +39 -0
- package/template/react-vite/cli/js/Button.stories.js +49 -0
- package/template/react-vite/cli/js/Header.jsx +56 -0
- package/template/react-vite/cli/js/Header.stories.js +29 -0
- package/template/react-vite/cli/js/Page.jsx +69 -0
- package/template/react-vite/cli/js/Page.stories.js +28 -0
- package/template/react-vite/cli/ts/Button.stories.ts +54 -0
- package/template/react-vite/cli/ts/Button.tsx +37 -0
- package/template/react-vite/cli/ts/Header.stories.ts +34 -0
- package/template/react-vite/cli/ts/Header.tsx +56 -0
- package/template/react-vite/cli/ts/Page.stories.ts +33 -0
- package/template/react-vite/cli/ts/Page.tsx +73 -0
|
@@ -0,0 +1,2034 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_5ewvyy4zw6m from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_5ewvyy4zw6m from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_5ewvyy4zw6m from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_5ewvyy4zw6m.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_5ewvyy4zw6m.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_5ewvyy4zw6m.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
createServiceRuntime,
|
|
14
|
+
getRegisteredServices,
|
|
15
|
+
getService,
|
|
16
|
+
registerService,
|
|
17
|
+
resolveStaticPath,
|
|
18
|
+
serviceRegistryApi,
|
|
19
|
+
validateSchema
|
|
20
|
+
} from "./chunk-YWMICX2T.js";
|
|
21
|
+
import {
|
|
22
|
+
argumentsTag,
|
|
23
|
+
arrayBufferTag,
|
|
24
|
+
arrayTag,
|
|
25
|
+
booleanTag,
|
|
26
|
+
dataViewTag,
|
|
27
|
+
dateTag,
|
|
28
|
+
float32ArrayTag,
|
|
29
|
+
float64ArrayTag,
|
|
30
|
+
getSymbols,
|
|
31
|
+
getTag,
|
|
32
|
+
int16ArrayTag,
|
|
33
|
+
int32ArrayTag,
|
|
34
|
+
int8ArrayTag,
|
|
35
|
+
isBuffer,
|
|
36
|
+
isPlainObject,
|
|
37
|
+
isPrimitive,
|
|
38
|
+
isTypedArray,
|
|
39
|
+
mapTag,
|
|
40
|
+
numberTag,
|
|
41
|
+
objectTag,
|
|
42
|
+
regexpTag,
|
|
43
|
+
setTag,
|
|
44
|
+
stringTag,
|
|
45
|
+
symbolTag,
|
|
46
|
+
uint16ArrayTag,
|
|
47
|
+
uint32ArrayTag,
|
|
48
|
+
uint8ArrayTag,
|
|
49
|
+
uint8ClampedArrayTag
|
|
50
|
+
} from "./chunk-SRXCCL2O.js";
|
|
51
|
+
import {
|
|
52
|
+
any,
|
|
53
|
+
up,
|
|
54
|
+
up2
|
|
55
|
+
} from "./chunk-NZ3GOT7V.js";
|
|
56
|
+
import {
|
|
57
|
+
__commonJS,
|
|
58
|
+
__toESM
|
|
59
|
+
} from "./chunk-NKAUZU4C.js";
|
|
60
|
+
|
|
61
|
+
// ../../node_modules/picomatch/lib/constants.js
|
|
62
|
+
var require_constants = __commonJS({
|
|
63
|
+
"../../node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
64
|
+
"use strict";
|
|
65
|
+
var WIN_NO_SLASH = "[^\\\\/]", ONE_CHAR = "(?=.)", QMARK = "[^/]", END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOT = "(?!\\.)", NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, QMARK_NO_DOT = "[^.\\/]", STAR = `${QMARK}*?`, SEP = "/", POSIX_CHARS = {
|
|
66
|
+
DOT_LITERAL: "\\.",
|
|
67
|
+
PLUS_LITERAL: "\\+",
|
|
68
|
+
QMARK_LITERAL: "\\?",
|
|
69
|
+
SLASH_LITERAL: "\\/",
|
|
70
|
+
ONE_CHAR,
|
|
71
|
+
QMARK,
|
|
72
|
+
END_ANCHOR,
|
|
73
|
+
DOTS_SLASH,
|
|
74
|
+
NO_DOT,
|
|
75
|
+
NO_DOTS,
|
|
76
|
+
NO_DOT_SLASH,
|
|
77
|
+
NO_DOTS_SLASH,
|
|
78
|
+
QMARK_NO_DOT,
|
|
79
|
+
STAR,
|
|
80
|
+
START_ANCHOR,
|
|
81
|
+
SEP
|
|
82
|
+
}, WINDOWS_CHARS = {
|
|
83
|
+
...POSIX_CHARS,
|
|
84
|
+
SLASH_LITERAL: "[\\\\/]",
|
|
85
|
+
QMARK: WIN_NO_SLASH,
|
|
86
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
87
|
+
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
|
|
88
|
+
NO_DOT: "(?!\\.)",
|
|
89
|
+
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
|
|
90
|
+
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
|
|
91
|
+
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
|
|
92
|
+
QMARK_NO_DOT: "[^.\\\\/]",
|
|
93
|
+
START_ANCHOR: "(?:^|[\\\\/])",
|
|
94
|
+
END_ANCHOR: "(?:[\\\\/]|$)",
|
|
95
|
+
SEP: "\\"
|
|
96
|
+
}, POSIX_REGEX_SOURCE = {
|
|
97
|
+
__proto__: null,
|
|
98
|
+
alnum: "a-zA-Z0-9",
|
|
99
|
+
alpha: "a-zA-Z",
|
|
100
|
+
ascii: "\\x00-\\x7F",
|
|
101
|
+
blank: " \\t",
|
|
102
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
103
|
+
digit: "0-9",
|
|
104
|
+
graph: "\\x21-\\x7E",
|
|
105
|
+
lower: "a-z",
|
|
106
|
+
print: "\\x20-\\x7E ",
|
|
107
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
108
|
+
space: " \\t\\r\\n\\v\\f",
|
|
109
|
+
upper: "A-Z",
|
|
110
|
+
word: "A-Za-z0-9_",
|
|
111
|
+
xdigit: "A-Fa-f0-9"
|
|
112
|
+
};
|
|
113
|
+
module.exports = {
|
|
114
|
+
DEFAULT_MAX_EXTGLOB_RECURSION: 0,
|
|
115
|
+
MAX_LENGTH: 1024 * 64,
|
|
116
|
+
POSIX_REGEX_SOURCE,
|
|
117
|
+
// regular expressions
|
|
118
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
119
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
120
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
121
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
122
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
123
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
124
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
125
|
+
REPLACEMENTS: {
|
|
126
|
+
__proto__: null,
|
|
127
|
+
"***": "*",
|
|
128
|
+
"**/**": "**",
|
|
129
|
+
"**/**/**": "**"
|
|
130
|
+
},
|
|
131
|
+
// Digits
|
|
132
|
+
CHAR_0: 48,
|
|
133
|
+
/* 0 */
|
|
134
|
+
CHAR_9: 57,
|
|
135
|
+
/* 9 */
|
|
136
|
+
// Alphabet chars.
|
|
137
|
+
CHAR_UPPERCASE_A: 65,
|
|
138
|
+
/* A */
|
|
139
|
+
CHAR_LOWERCASE_A: 97,
|
|
140
|
+
/* a */
|
|
141
|
+
CHAR_UPPERCASE_Z: 90,
|
|
142
|
+
/* Z */
|
|
143
|
+
CHAR_LOWERCASE_Z: 122,
|
|
144
|
+
/* z */
|
|
145
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
146
|
+
/* ( */
|
|
147
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
148
|
+
/* ) */
|
|
149
|
+
CHAR_ASTERISK: 42,
|
|
150
|
+
/* * */
|
|
151
|
+
// Non-alphabetic chars.
|
|
152
|
+
CHAR_AMPERSAND: 38,
|
|
153
|
+
/* & */
|
|
154
|
+
CHAR_AT: 64,
|
|
155
|
+
/* @ */
|
|
156
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
157
|
+
/* \ */
|
|
158
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
159
|
+
/* \r */
|
|
160
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
161
|
+
/* ^ */
|
|
162
|
+
CHAR_COLON: 58,
|
|
163
|
+
/* : */
|
|
164
|
+
CHAR_COMMA: 44,
|
|
165
|
+
/* , */
|
|
166
|
+
CHAR_DOT: 46,
|
|
167
|
+
/* . */
|
|
168
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
169
|
+
/* " */
|
|
170
|
+
CHAR_EQUAL: 61,
|
|
171
|
+
/* = */
|
|
172
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
173
|
+
/* ! */
|
|
174
|
+
CHAR_FORM_FEED: 12,
|
|
175
|
+
/* \f */
|
|
176
|
+
CHAR_FORWARD_SLASH: 47,
|
|
177
|
+
/* / */
|
|
178
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
179
|
+
/* ` */
|
|
180
|
+
CHAR_HASH: 35,
|
|
181
|
+
/* # */
|
|
182
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
183
|
+
/* - */
|
|
184
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
185
|
+
/* < */
|
|
186
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
187
|
+
/* { */
|
|
188
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
189
|
+
/* [ */
|
|
190
|
+
CHAR_LINE_FEED: 10,
|
|
191
|
+
/* \n */
|
|
192
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
193
|
+
/* \u00A0 */
|
|
194
|
+
CHAR_PERCENT: 37,
|
|
195
|
+
/* % */
|
|
196
|
+
CHAR_PLUS: 43,
|
|
197
|
+
/* + */
|
|
198
|
+
CHAR_QUESTION_MARK: 63,
|
|
199
|
+
/* ? */
|
|
200
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
201
|
+
/* > */
|
|
202
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
203
|
+
/* } */
|
|
204
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
205
|
+
/* ] */
|
|
206
|
+
CHAR_SEMICOLON: 59,
|
|
207
|
+
/* ; */
|
|
208
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
209
|
+
/* ' */
|
|
210
|
+
CHAR_SPACE: 32,
|
|
211
|
+
/* */
|
|
212
|
+
CHAR_TAB: 9,
|
|
213
|
+
/* \t */
|
|
214
|
+
CHAR_UNDERSCORE: 95,
|
|
215
|
+
/* _ */
|
|
216
|
+
CHAR_VERTICAL_LINE: 124,
|
|
217
|
+
/* | */
|
|
218
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
219
|
+
/* \uFEFF */
|
|
220
|
+
/**
|
|
221
|
+
* Create EXTGLOB_CHARS
|
|
222
|
+
*/
|
|
223
|
+
extglobChars(chars) {
|
|
224
|
+
return {
|
|
225
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
226
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
227
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
228
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
229
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* Create GLOB_CHARS
|
|
234
|
+
*/
|
|
235
|
+
globChars(win32) {
|
|
236
|
+
return win32 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// ../../node_modules/picomatch/lib/utils.js
|
|
243
|
+
var require_utils = __commonJS({
|
|
244
|
+
"../../node_modules/picomatch/lib/utils.js"(exports) {
|
|
245
|
+
"use strict";
|
|
246
|
+
var {
|
|
247
|
+
REGEX_BACKSLASH,
|
|
248
|
+
REGEX_REMOVE_BACKSLASH,
|
|
249
|
+
REGEX_SPECIAL_CHARS,
|
|
250
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
251
|
+
} = require_constants();
|
|
252
|
+
exports.isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val);
|
|
253
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
254
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
255
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
256
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
257
|
+
exports.isWindows = () => {
|
|
258
|
+
if (typeof navigator < "u" && navigator.platform) {
|
|
259
|
+
let platform = navigator.platform.toLowerCase();
|
|
260
|
+
return platform === "win32" || platform === "windows";
|
|
261
|
+
}
|
|
262
|
+
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
|
|
263
|
+
};
|
|
264
|
+
exports.removeBackslashes = (str) => str.replace(REGEX_REMOVE_BACKSLASH, (match) => match === "\\" ? "" : match);
|
|
265
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
266
|
+
let idx = input.lastIndexOf(char, lastIdx);
|
|
267
|
+
return idx === -1 ? input : input[idx - 1] === "\\" ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
268
|
+
};
|
|
269
|
+
exports.removePrefix = (input, state = {}) => {
|
|
270
|
+
let output = input;
|
|
271
|
+
return output.startsWith("./") && (output = output.slice(2), state.prefix = "./"), output;
|
|
272
|
+
};
|
|
273
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
274
|
+
let prepend = options.contains ? "" : "^", append = options.contains ? "" : "$", output = `${prepend}(?:${input})${append}`;
|
|
275
|
+
return state.negated === !0 && (output = `(?:^(?!${output}).*$)`), output;
|
|
276
|
+
};
|
|
277
|
+
exports.basename = (path, { windows } = {}) => {
|
|
278
|
+
let segs = path.split(windows ? /[\\/]/ : "/"), last = segs[segs.length - 1];
|
|
279
|
+
return last === "" ? segs[segs.length - 2] : last;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// ../../node_modules/picomatch/lib/scan.js
|
|
285
|
+
var require_scan = __commonJS({
|
|
286
|
+
"../../node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
287
|
+
"use strict";
|
|
288
|
+
var utils = require_utils(), {
|
|
289
|
+
CHAR_ASTERISK,
|
|
290
|
+
/* * */
|
|
291
|
+
CHAR_AT,
|
|
292
|
+
/* @ */
|
|
293
|
+
CHAR_BACKWARD_SLASH,
|
|
294
|
+
/* \ */
|
|
295
|
+
CHAR_COMMA,
|
|
296
|
+
/* , */
|
|
297
|
+
CHAR_DOT,
|
|
298
|
+
/* . */
|
|
299
|
+
CHAR_EXCLAMATION_MARK,
|
|
300
|
+
/* ! */
|
|
301
|
+
CHAR_FORWARD_SLASH,
|
|
302
|
+
/* / */
|
|
303
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
304
|
+
/* { */
|
|
305
|
+
CHAR_LEFT_PARENTHESES,
|
|
306
|
+
/* ( */
|
|
307
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
308
|
+
/* [ */
|
|
309
|
+
CHAR_PLUS,
|
|
310
|
+
/* + */
|
|
311
|
+
CHAR_QUESTION_MARK,
|
|
312
|
+
/* ? */
|
|
313
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
314
|
+
/* } */
|
|
315
|
+
CHAR_RIGHT_PARENTHESES,
|
|
316
|
+
/* ) */
|
|
317
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
318
|
+
/* ] */
|
|
319
|
+
} = require_constants(), isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token) => {
|
|
320
|
+
token.isPrefix !== !0 && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
|
321
|
+
}, scan = (input, options) => {
|
|
322
|
+
let opts = options || {}, length = input.length - 1, scanToEnd = opts.parts === !0 || opts.tokens === !0 || opts.scanToEnd === !0, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, prev, code, token = { value: "", depth: 0, isGlob: !1 }, eos = () => index >= length, peek = () => str.charCodeAt(index + 1), advance = () => (prev = code, str.charCodeAt(++index));
|
|
323
|
+
for (; index < length; ) {
|
|
324
|
+
code = advance();
|
|
325
|
+
let next;
|
|
326
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
327
|
+
backslashes = token.backslashes = !0, code = advance(), code === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
if (braceEscaped === !0 || code === CHAR_LEFT_CURLY_BRACE) {
|
|
331
|
+
for (braces++; eos() !== !0 && (code = advance()); ) {
|
|
332
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
333
|
+
backslashes = token.backslashes = !0, advance();
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
337
|
+
braces++;
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
if (braceEscaped !== !0 && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
341
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
342
|
+
continue;
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
if (braceEscaped !== !0 && code === CHAR_COMMA) {
|
|
346
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
347
|
+
continue;
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
if (code === CHAR_RIGHT_CURLY_BRACE && (braces--, braces === 0)) {
|
|
351
|
+
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (scanToEnd === !0)
|
|
356
|
+
continue;
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
360
|
+
if (slashes.push(index), tokens.push(token), token = { value: "", depth: 0, isGlob: !1 }, finished === !0) continue;
|
|
361
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
362
|
+
start += 2;
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
lastIndex = index + 1;
|
|
366
|
+
continue;
|
|
367
|
+
}
|
|
368
|
+
if (opts.noext !== !0 && (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === !0 && peek() === CHAR_LEFT_PARENTHESES) {
|
|
369
|
+
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), scanToEnd === !0) {
|
|
370
|
+
let parens = 0;
|
|
371
|
+
for (; eos() !== !0 && (code = advance()); ) {
|
|
372
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
373
|
+
backslashes = token.backslashes = !0, advance();
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
377
|
+
parens++;
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
381
|
+
finished = !0;
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
if (code === CHAR_ASTERISK) {
|
|
390
|
+
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
391
|
+
continue;
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
395
|
+
if (isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
|
396
|
+
continue;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
400
|
+
for (; eos() !== !0 && (next = advance()); ) {
|
|
401
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
402
|
+
backslashes = token.backslashes = !0, advance();
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
406
|
+
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (scanToEnd === !0)
|
|
411
|
+
continue;
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
if (opts.nonegate !== !0 && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
415
|
+
negated = token.negated = !0, start++;
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
if (opts.noparen !== !0 && code === CHAR_LEFT_PARENTHESES) {
|
|
419
|
+
if (isGlob = token.isGlob = !0, scanToEnd === !0) {
|
|
420
|
+
let parens = 1;
|
|
421
|
+
for (; eos() !== !0 && (code = advance()); ) {
|
|
422
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
423
|
+
backslashes = token.backslashes = !0, advance();
|
|
424
|
+
continue;
|
|
425
|
+
}
|
|
426
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
427
|
+
parens++;
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
431
|
+
finished = !0;
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
if (isGlob === !0) {
|
|
440
|
+
if (finished = !0, scanToEnd === !0)
|
|
441
|
+
continue;
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
opts.noext === !0 && (isExtglob = !1, isGlob = !1);
|
|
446
|
+
let base = str, prefix = "", glob = "";
|
|
447
|
+
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && isGlob === !0 && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : isGlob === !0 ? (base = "", glob = str) : base = str, base && base !== "" && base !== "/" && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), opts.unescape === !0 && (glob && (glob = utils.removeBackslashes(glob)), base && backslashes === !0 && (base = utils.removeBackslashes(base)));
|
|
448
|
+
let state = {
|
|
449
|
+
prefix,
|
|
450
|
+
input,
|
|
451
|
+
start,
|
|
452
|
+
base,
|
|
453
|
+
glob,
|
|
454
|
+
isBrace,
|
|
455
|
+
isBracket,
|
|
456
|
+
isGlob,
|
|
457
|
+
isExtglob,
|
|
458
|
+
isGlobstar,
|
|
459
|
+
negated,
|
|
460
|
+
negatedExtglob
|
|
461
|
+
};
|
|
462
|
+
if (opts.tokens === !0 && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), opts.parts === !0 || opts.tokens === !0) {
|
|
463
|
+
let prevIndex;
|
|
464
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
465
|
+
let n2 = prevIndex !== void 0 ? prevIndex + 1 : start, i = slashes[idx], value2 = input.slice(n2, i);
|
|
466
|
+
opts.tokens && (idx === 0 && start !== 0 ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value2, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), i >= start && (parts.push(value2), prevIndex = i);
|
|
467
|
+
}
|
|
468
|
+
let n = prevIndex !== void 0 ? prevIndex + 1 : start, value = input.slice(n);
|
|
469
|
+
parts.push(value), opts.tokens && prevIndex && prevIndex + 1 < input.length && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth), state.slashes = slashes, state.parts = parts;
|
|
470
|
+
}
|
|
471
|
+
return state;
|
|
472
|
+
};
|
|
473
|
+
module.exports = scan;
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// ../../node_modules/picomatch/lib/parse.js
|
|
478
|
+
var require_parse = __commonJS({
|
|
479
|
+
"../../node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
480
|
+
"use strict";
|
|
481
|
+
var constants = require_constants(), utils = require_utils(), {
|
|
482
|
+
MAX_LENGTH,
|
|
483
|
+
POSIX_REGEX_SOURCE,
|
|
484
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
485
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
486
|
+
REPLACEMENTS
|
|
487
|
+
} = constants, expandRange = (args, options) => {
|
|
488
|
+
if (typeof options.expandRange == "function")
|
|
489
|
+
return options.expandRange(...args, options);
|
|
490
|
+
args.sort();
|
|
491
|
+
let value = `[${args.join("-")}]`;
|
|
492
|
+
try {
|
|
493
|
+
new RegExp(value);
|
|
494
|
+
} catch {
|
|
495
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
496
|
+
}
|
|
497
|
+
return value;
|
|
498
|
+
}, syntaxError = (type, char) => `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, splitTopLevel = (input) => {
|
|
499
|
+
let parts = [], bracket = 0, paren = 0, quote = 0, value = "", escaped = !1;
|
|
500
|
+
for (let ch of input) {
|
|
501
|
+
if (escaped === !0) {
|
|
502
|
+
value += ch, escaped = !1;
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (ch === "\\") {
|
|
506
|
+
value += ch, escaped = !0;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
if (ch === '"') {
|
|
510
|
+
quote = quote === 1 ? 0 : 1, value += ch;
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
if (quote === 0) {
|
|
514
|
+
if (ch === "[")
|
|
515
|
+
bracket++;
|
|
516
|
+
else if (ch === "]" && bracket > 0)
|
|
517
|
+
bracket--;
|
|
518
|
+
else if (bracket === 0) {
|
|
519
|
+
if (ch === "(")
|
|
520
|
+
paren++;
|
|
521
|
+
else if (ch === ")" && paren > 0)
|
|
522
|
+
paren--;
|
|
523
|
+
else if (ch === "|" && paren === 0) {
|
|
524
|
+
parts.push(value), value = "";
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
value += ch;
|
|
530
|
+
}
|
|
531
|
+
return parts.push(value), parts;
|
|
532
|
+
}, isPlainBranch = (branch) => {
|
|
533
|
+
let escaped = !1;
|
|
534
|
+
for (let ch of branch) {
|
|
535
|
+
if (escaped === !0) {
|
|
536
|
+
escaped = !1;
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
if (ch === "\\") {
|
|
540
|
+
escaped = !0;
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
if (/[?*+@!()[\]{}]/.test(ch))
|
|
544
|
+
return !1;
|
|
545
|
+
}
|
|
546
|
+
return !0;
|
|
547
|
+
}, normalizeSimpleBranch = (branch) => {
|
|
548
|
+
let value = branch.trim(), changed = !0;
|
|
549
|
+
for (; changed === !0; )
|
|
550
|
+
changed = !1, /^@\([^\\()[\]{}|]+\)$/.test(value) && (value = value.slice(2, -1), changed = !0);
|
|
551
|
+
if (isPlainBranch(value))
|
|
552
|
+
return value.replace(/\\(.)/g, "$1");
|
|
553
|
+
}, hasRepeatedCharPrefixOverlap = (branches) => {
|
|
554
|
+
let values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
555
|
+
for (let i = 0; i < values.length; i++)
|
|
556
|
+
for (let j = i + 1; j < values.length; j++) {
|
|
557
|
+
let a = values[i], b = values[j], char = a[0];
|
|
558
|
+
if (!(!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) && (a === b || a.startsWith(b) || b.startsWith(a)))
|
|
559
|
+
return !0;
|
|
560
|
+
}
|
|
561
|
+
return !1;
|
|
562
|
+
}, parseRepeatedExtglob = (pattern, requireEnd = !0) => {
|
|
563
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(")
|
|
564
|
+
return;
|
|
565
|
+
let bracket = 0, paren = 0, quote = 0, escaped = !1;
|
|
566
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
567
|
+
let ch = pattern[i];
|
|
568
|
+
if (escaped === !0) {
|
|
569
|
+
escaped = !1;
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
if (ch === "\\") {
|
|
573
|
+
escaped = !0;
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
if (ch === '"') {
|
|
577
|
+
quote = quote === 1 ? 0 : 1;
|
|
578
|
+
continue;
|
|
579
|
+
}
|
|
580
|
+
if (quote !== 1) {
|
|
581
|
+
if (ch === "[") {
|
|
582
|
+
bracket++;
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
if (ch === "]" && bracket > 0) {
|
|
586
|
+
bracket--;
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
589
|
+
if (!(bracket > 0)) {
|
|
590
|
+
if (ch === "(") {
|
|
591
|
+
paren++;
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
if (ch === ")" && (paren--, paren === 0))
|
|
595
|
+
return requireEnd === !0 && i !== pattern.length - 1 ? void 0 : {
|
|
596
|
+
type: pattern[0],
|
|
597
|
+
body: pattern.slice(2, i),
|
|
598
|
+
end: i
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}, buildCharClassStar = (chars) => `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`, getStarExtglobSequenceChars = (pattern) => {
|
|
604
|
+
let index = 0, chars = [];
|
|
605
|
+
for (; index < pattern.length; ) {
|
|
606
|
+
let match = parseRepeatedExtglob(pattern.slice(index), !1);
|
|
607
|
+
if (!match || match.type !== "*")
|
|
608
|
+
return;
|
|
609
|
+
let branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
610
|
+
if (branches.length !== 1)
|
|
611
|
+
return;
|
|
612
|
+
let branch = normalizeSimpleBranch(branches[0]);
|
|
613
|
+
if (!branch || branch.length !== 1)
|
|
614
|
+
return;
|
|
615
|
+
chars.push(branch), index += match.end + 1;
|
|
616
|
+
}
|
|
617
|
+
if (!(chars.length < 1))
|
|
618
|
+
return chars;
|
|
619
|
+
}, repeatedExtglobRecursion = (pattern) => {
|
|
620
|
+
let depth = 0, value = pattern.trim(), match = parseRepeatedExtglob(value);
|
|
621
|
+
for (; match; )
|
|
622
|
+
depth++, value = match.body.trim(), match = parseRepeatedExtglob(value);
|
|
623
|
+
return depth;
|
|
624
|
+
}, analyzeRepeatedExtglob = (body, options) => {
|
|
625
|
+
if (options.maxExtglobRecursion === !1)
|
|
626
|
+
return { risky: !1 };
|
|
627
|
+
let max = typeof options.maxExtglobRecursion == "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION, branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
628
|
+
if (branches.length > 1 && (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)))
|
|
629
|
+
return { risky: !0 };
|
|
630
|
+
let safeChars = [], sawStarSequence = !1, combinable = !0;
|
|
631
|
+
for (let branch of branches) {
|
|
632
|
+
let chars = getStarExtglobSequenceChars(branch);
|
|
633
|
+
if (chars) {
|
|
634
|
+
sawStarSequence = !0, safeChars.push(...chars);
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
let literal = normalizeSimpleBranch(branch);
|
|
638
|
+
if (literal && literal.length === 1) {
|
|
639
|
+
safeChars.push(literal);
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
if (combinable = !1, repeatedExtglobRecursion(branch) > max)
|
|
643
|
+
return { risky: !0 };
|
|
644
|
+
}
|
|
645
|
+
return sawStarSequence ? combinable ? { risky: !0, safeOutput: buildCharClassStar([...new Set(safeChars)]) } : { risky: !0 } : { risky: !1 };
|
|
646
|
+
}, parse = (input, options) => {
|
|
647
|
+
if (typeof input != "string")
|
|
648
|
+
throw new TypeError("Expected a string");
|
|
649
|
+
input = REPLACEMENTS[input] || input;
|
|
650
|
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
651
|
+
if (len > max)
|
|
652
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
653
|
+
let bos = { type: "bos", value: "", output: opts.prepend || "" }, tokens = [bos], capture = opts.capture ? "" : "?:", PLATFORM_CHARS = constants.globChars(opts.windows), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), {
|
|
654
|
+
DOT_LITERAL,
|
|
655
|
+
PLUS_LITERAL,
|
|
656
|
+
SLASH_LITERAL,
|
|
657
|
+
ONE_CHAR,
|
|
658
|
+
DOTS_SLASH,
|
|
659
|
+
NO_DOT,
|
|
660
|
+
NO_DOT_SLASH,
|
|
661
|
+
NO_DOTS_SLASH,
|
|
662
|
+
QMARK,
|
|
663
|
+
QMARK_NO_DOT,
|
|
664
|
+
STAR,
|
|
665
|
+
START_ANCHOR
|
|
666
|
+
} = PLATFORM_CHARS, globstar = (opts2) => `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? "" : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = opts.bash === !0 ? globstar(opts) : STAR;
|
|
667
|
+
opts.capture && (star = `(${star})`), typeof opts.noext == "boolean" && (opts.noextglob = opts.noext);
|
|
668
|
+
let state = {
|
|
669
|
+
input,
|
|
670
|
+
index: -1,
|
|
671
|
+
start: 0,
|
|
672
|
+
dot: opts.dot === !0,
|
|
673
|
+
consumed: "",
|
|
674
|
+
output: "",
|
|
675
|
+
prefix: "",
|
|
676
|
+
backtrack: !1,
|
|
677
|
+
negated: !1,
|
|
678
|
+
brackets: 0,
|
|
679
|
+
braces: 0,
|
|
680
|
+
parens: 0,
|
|
681
|
+
quotes: 0,
|
|
682
|
+
globstar: !1,
|
|
683
|
+
tokens
|
|
684
|
+
};
|
|
685
|
+
input = utils.removePrefix(input, state), len = input.length;
|
|
686
|
+
let extglobs = [], braces = [], stack = [], prev = bos, value, eos = () => state.index === len - 1, peek = state.peek = (n = 1) => input[state.index + n], advance = state.advance = () => input[++state.index] || "", remaining = () => input.slice(state.index + 1), consume = (value2 = "", num = 0) => {
|
|
687
|
+
state.consumed += value2, state.index += num;
|
|
688
|
+
}, append = (token) => {
|
|
689
|
+
state.output += token.output != null ? token.output : token.value, consume(token.value);
|
|
690
|
+
}, negate = () => {
|
|
691
|
+
let count = 1;
|
|
692
|
+
for (; peek() === "!" && (peek(2) !== "(" || peek(3) === "?"); )
|
|
693
|
+
advance(), state.start++, count++;
|
|
694
|
+
return count % 2 === 0 ? !1 : (state.negated = !0, state.start++, !0);
|
|
695
|
+
}, increment = (type) => {
|
|
696
|
+
state[type]++, stack.push(type);
|
|
697
|
+
}, decrement = (type) => {
|
|
698
|
+
state[type]--, stack.pop();
|
|
699
|
+
}, push = (tok) => {
|
|
700
|
+
if (prev.type === "globstar") {
|
|
701
|
+
let isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"), isExtglob = tok.extglob === !0 || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
702
|
+
tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob && (state.output = state.output.slice(0, -prev.output.length), prev.type = "star", prev.value = "*", prev.output = star, state.output += prev.output);
|
|
703
|
+
}
|
|
704
|
+
if (extglobs.length && tok.type !== "paren" && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && prev.type === "text" && tok.type === "text") {
|
|
705
|
+
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
tok.prev = prev, tokens.push(tok), prev = tok;
|
|
709
|
+
}, extglobOpen = (type, value2) => {
|
|
710
|
+
let token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
711
|
+
token.prev = prev, token.parens = state.parens, token.output = state.output, token.startIndex = state.index, token.tokensIndex = tokens.length;
|
|
712
|
+
let output = (opts.capture ? "(" : "") + token.open;
|
|
713
|
+
increment("parens"), push({ type, value: value2, output: state.output ? "" : ONE_CHAR }), push({ type: "paren", extglob: !0, value: advance(), output }), extglobs.push(token);
|
|
714
|
+
}, extglobClose = (token) => {
|
|
715
|
+
let literal = input.slice(token.startIndex, state.index + 1), body = input.slice(token.startIndex + 2, state.index), analysis = analyzeRepeatedExtglob(body, opts);
|
|
716
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
717
|
+
let safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0, open = tokens[token.tokensIndex];
|
|
718
|
+
open.type = "text", open.value = literal, open.output = safeOutput || utils.escapeRegex(literal);
|
|
719
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++)
|
|
720
|
+
tokens[i].value = "", tokens[i].output = "", delete tokens[i].suffix;
|
|
721
|
+
state.output = token.output + open.output, state.backtrack = !0, push({ type: "paren", extglob: !0, value, output: "" }), decrement("parens");
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
let output = token.close + (opts.capture ? ")" : ""), rest;
|
|
725
|
+
if (token.type === "negate") {
|
|
726
|
+
let extglobStar = star;
|
|
727
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/") && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
728
|
+
let expression = parse(rest, { ...options, fastpaths: !1 }).output;
|
|
729
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
730
|
+
}
|
|
731
|
+
token.prev.type === "bos" && (state.negatedExtglob = !0);
|
|
732
|
+
}
|
|
733
|
+
push({ type: "paren", extglob: !0, value, output }), decrement("parens");
|
|
734
|
+
};
|
|
735
|
+
if (opts.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
736
|
+
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => first === "\\" ? (backslashes = !0, m) : first === "?" ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : "") : index === 0 ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "") : QMARK.repeat(chars.length) : first === "." ? DOT_LITERAL.repeat(chars.length) : first === "*" ? esc ? esc + first + (rest ? star : "") : star : esc ? m : `\\${m}`);
|
|
737
|
+
return backslashes === !0 && (opts.unescape === !0 ? output = output.replace(/\\/g, "") : output = output.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), output === input && opts.contains === !0 ? (state.output = input, state) : (state.output = utils.wrapOutput(output, state, options), state);
|
|
738
|
+
}
|
|
739
|
+
for (; !eos(); ) {
|
|
740
|
+
if (value = advance(), value === "\0")
|
|
741
|
+
continue;
|
|
742
|
+
if (value === "\\") {
|
|
743
|
+
let next = peek();
|
|
744
|
+
if (next === "/" && opts.bash !== !0 || next === "." || next === ";")
|
|
745
|
+
continue;
|
|
746
|
+
if (!next) {
|
|
747
|
+
value += "\\", push({ type: "text", value });
|
|
748
|
+
continue;
|
|
749
|
+
}
|
|
750
|
+
let match = /^\\+/.exec(remaining()), slashes = 0;
|
|
751
|
+
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 !== 0 && (value += "\\")), opts.unescape === !0 ? value = advance() : value += advance(), state.brackets === 0) {
|
|
752
|
+
push({ type: "text", value });
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
757
|
+
if (opts.posix !== !1 && value === ":") {
|
|
758
|
+
let inner = prev.value.slice(1);
|
|
759
|
+
if (inner.includes("[") && (prev.posix = !0, inner.includes(":"))) {
|
|
760
|
+
let idx = prev.value.lastIndexOf("["), pre = prev.value.slice(0, idx), rest2 = prev.value.slice(idx + 2), posix2 = POSIX_REGEX_SOURCE[rest2];
|
|
761
|
+
if (posix2) {
|
|
762
|
+
prev.value = pre + posix2, state.backtrack = !0, advance(), !bos.output && tokens.indexOf(prev) === 1 && (bos.output = ONE_CHAR);
|
|
763
|
+
continue;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
(value === "[" && peek() !== ":" || value === "-" && peek() === "]") && (value = `\\${value}`), value === "]" && (prev.value === "[" || prev.value === "[^") && (value = `\\${value}`), opts.posix === !0 && value === "!" && prev.value === "[" && (value = "^"), prev.value += value, append({ value });
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
if (state.quotes === 1 && value !== '"') {
|
|
771
|
+
value = utils.escapeRegex(value), prev.value += value, append({ value });
|
|
772
|
+
continue;
|
|
773
|
+
}
|
|
774
|
+
if (value === '"') {
|
|
775
|
+
state.quotes = state.quotes === 1 ? 0 : 1, opts.keepQuotes === !0 && push({ type: "text", value });
|
|
776
|
+
continue;
|
|
777
|
+
}
|
|
778
|
+
if (value === "(") {
|
|
779
|
+
increment("parens"), push({ type: "paren", value });
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
if (value === ")") {
|
|
783
|
+
if (state.parens === 0 && opts.strictBrackets === !0)
|
|
784
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
785
|
+
let extglob = extglobs[extglobs.length - 1];
|
|
786
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
787
|
+
extglobClose(extglobs.pop());
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" }), decrement("parens");
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
if (value === "[") {
|
|
794
|
+
if (opts.nobracket === !0 || !remaining().includes("]")) {
|
|
795
|
+
if (opts.nobracket !== !0 && opts.strictBrackets === !0)
|
|
796
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
797
|
+
value = `\\${value}`;
|
|
798
|
+
} else
|
|
799
|
+
increment("brackets");
|
|
800
|
+
push({ type: "bracket", value });
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
if (value === "]") {
|
|
804
|
+
if (opts.nobracket === !0 || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
805
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
if (state.brackets === 0) {
|
|
809
|
+
if (opts.strictBrackets === !0)
|
|
810
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
811
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
decrement("brackets");
|
|
815
|
+
let prevValue = prev.value.slice(1);
|
|
816
|
+
if (prev.posix !== !0 && prevValue[0] === "^" && !prevValue.includes("/") && (value = `/${value}`), prev.value += value, append({ value }), opts.literalBrackets === !1 || utils.hasRegexChars(prevValue))
|
|
817
|
+
continue;
|
|
818
|
+
let escaped = utils.escapeRegex(prev.value);
|
|
819
|
+
if (state.output = state.output.slice(0, -prev.value.length), opts.literalBrackets === !0) {
|
|
820
|
+
state.output += escaped, prev.value = escaped;
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
823
|
+
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
if (value === "{" && opts.nobrace !== !0) {
|
|
827
|
+
increment("braces");
|
|
828
|
+
let open = {
|
|
829
|
+
type: "brace",
|
|
830
|
+
value,
|
|
831
|
+
output: "(",
|
|
832
|
+
outputIndex: state.output.length,
|
|
833
|
+
tokensIndex: state.tokens.length
|
|
834
|
+
};
|
|
835
|
+
braces.push(open), push(open);
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
if (value === "}") {
|
|
839
|
+
let brace = braces[braces.length - 1];
|
|
840
|
+
if (opts.nobrace === !0 || !brace) {
|
|
841
|
+
push({ type: "text", value, output: value });
|
|
842
|
+
continue;
|
|
843
|
+
}
|
|
844
|
+
let output = ")";
|
|
845
|
+
if (brace.dots === !0) {
|
|
846
|
+
let arr = tokens.slice(), range = [];
|
|
847
|
+
for (let i = arr.length - 1; i >= 0 && (tokens.pop(), arr[i].type !== "brace"); i--)
|
|
848
|
+
arr[i].type !== "dots" && range.unshift(arr[i].value);
|
|
849
|
+
output = expandRange(range, opts), state.backtrack = !0;
|
|
850
|
+
}
|
|
851
|
+
if (brace.comma !== !0 && brace.dots !== !0) {
|
|
852
|
+
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
|
853
|
+
brace.value = brace.output = "\\{", value = output = "\\}", state.output = out;
|
|
854
|
+
for (let t of toks)
|
|
855
|
+
state.output += t.output || t.value;
|
|
856
|
+
}
|
|
857
|
+
push({ type: "brace", value, output }), decrement("braces"), braces.pop();
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
860
|
+
if (value === "|") {
|
|
861
|
+
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({ type: "text", value });
|
|
862
|
+
continue;
|
|
863
|
+
}
|
|
864
|
+
if (value === ",") {
|
|
865
|
+
let output = value, brace = braces[braces.length - 1];
|
|
866
|
+
brace && stack[stack.length - 1] === "braces" && (brace.comma = !0, output = "|"), push({ type: "comma", value, output });
|
|
867
|
+
continue;
|
|
868
|
+
}
|
|
869
|
+
if (value === "/") {
|
|
870
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
871
|
+
state.start = state.index + 1, state.consumed = "", state.output = "", tokens.pop(), prev = bos;
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
if (value === ".") {
|
|
878
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
879
|
+
prev.value === "." && (prev.output = DOT_LITERAL);
|
|
880
|
+
let brace = braces[braces.length - 1];
|
|
881
|
+
prev.type = "dots", prev.output += value, prev.value += value, brace.dots = !0;
|
|
882
|
+
continue;
|
|
883
|
+
}
|
|
884
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
885
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
886
|
+
continue;
|
|
887
|
+
}
|
|
888
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
if (value === "?") {
|
|
892
|
+
if (!(prev && prev.value === "(") && opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
893
|
+
extglobOpen("qmark", value);
|
|
894
|
+
continue;
|
|
895
|
+
}
|
|
896
|
+
if (prev && prev.type === "paren") {
|
|
897
|
+
let next = peek(), output = value;
|
|
898
|
+
(prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) && (output = `\\${value}`), push({ type: "text", value, output });
|
|
899
|
+
continue;
|
|
900
|
+
}
|
|
901
|
+
if (opts.dot !== !0 && (prev.type === "slash" || prev.type === "bos")) {
|
|
902
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
push({ type: "qmark", value, output: QMARK });
|
|
906
|
+
continue;
|
|
907
|
+
}
|
|
908
|
+
if (value === "!") {
|
|
909
|
+
if (opts.noextglob !== !0 && peek() === "(" && (peek(2) !== "?" || !/[!=<:]/.test(peek(3)))) {
|
|
910
|
+
extglobOpen("negate", value);
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
913
|
+
if (opts.nonegate !== !0 && state.index === 0) {
|
|
914
|
+
negate();
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
if (value === "+") {
|
|
919
|
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
920
|
+
extglobOpen("plus", value);
|
|
921
|
+
continue;
|
|
922
|
+
}
|
|
923
|
+
if (prev && prev.value === "(" || opts.regex === !1) {
|
|
924
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
925
|
+
continue;
|
|
926
|
+
}
|
|
927
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
928
|
+
push({ type: "plus", value });
|
|
929
|
+
continue;
|
|
930
|
+
}
|
|
931
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
932
|
+
continue;
|
|
933
|
+
}
|
|
934
|
+
if (value === "@") {
|
|
935
|
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
|
936
|
+
push({ type: "at", extglob: !0, value, output: "" });
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
push({ type: "text", value });
|
|
940
|
+
continue;
|
|
941
|
+
}
|
|
942
|
+
if (value !== "*") {
|
|
943
|
+
(value === "$" || value === "^") && (value = `\\${value}`);
|
|
944
|
+
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
945
|
+
match && (value += match[0], state.index += match[0].length), push({ type: "text", value });
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
if (prev && (prev.type === "globstar" || prev.star === !0)) {
|
|
949
|
+
prev.type = "star", prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
let rest = remaining();
|
|
953
|
+
if (opts.noextglob !== !0 && /^\([^?]/.test(rest)) {
|
|
954
|
+
extglobOpen("star", value);
|
|
955
|
+
continue;
|
|
956
|
+
}
|
|
957
|
+
if (prev.type === "star") {
|
|
958
|
+
if (opts.noglobstar === !0) {
|
|
959
|
+
consume(value);
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
let prior = prev.prev, before = prior.prev, isStart = prior.type === "slash" || prior.type === "bos", afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
963
|
+
if (opts.bash === !0 && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
964
|
+
push({ type: "star", value, output: "" });
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
let isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"), isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
968
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
969
|
+
push({ type: "star", value, output: "" });
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
for (; rest.slice(0, 3) === "/**"; ) {
|
|
973
|
+
let after = input[state.index + 4];
|
|
974
|
+
if (after && after !== "/")
|
|
975
|
+
break;
|
|
976
|
+
rest = rest.slice(3), consume("/**", 3);
|
|
977
|
+
}
|
|
978
|
+
let isEnd = eos() || state.parens > 0 && rest === ")".repeat(state.parens) && !extglobs.some((extglob) => extglob.type === "negate");
|
|
979
|
+
if (prior.type === "bos" && eos()) {
|
|
980
|
+
prev.type = "globstar", prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
|
981
|
+
continue;
|
|
982
|
+
}
|
|
983
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && isEnd) {
|
|
984
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
|
985
|
+
continue;
|
|
986
|
+
}
|
|
987
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
988
|
+
let end = rest[1] !== void 0 ? "|$" : "";
|
|
989
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
990
|
+
continue;
|
|
991
|
+
}
|
|
992
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
993
|
+
prev.type = "globstar", prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
|
994
|
+
continue;
|
|
995
|
+
}
|
|
996
|
+
state.output = state.output.slice(0, -prev.output.length), prev.type = "globstar", prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
|
997
|
+
continue;
|
|
998
|
+
}
|
|
999
|
+
let token = { type: "star", value, output: star };
|
|
1000
|
+
if (opts.bash === !0) {
|
|
1001
|
+
token.output = ".*?", (prev.type === "bos" || prev.type === "slash") && (token.output = nodot + token.output), push(token);
|
|
1002
|
+
continue;
|
|
1003
|
+
}
|
|
1004
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === !0) {
|
|
1005
|
+
token.output = value, push(token);
|
|
1006
|
+
continue;
|
|
1007
|
+
}
|
|
1008
|
+
(state.index === state.start || prev.type === "slash" || prev.type === "dot") && (prev.type === "dot" ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : opts.dot === !0 ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), peek() !== "*" && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
|
1009
|
+
}
|
|
1010
|
+
for (; state.brackets > 0; ) {
|
|
1011
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1012
|
+
state.output = utils.escapeLast(state.output, "["), decrement("brackets");
|
|
1013
|
+
}
|
|
1014
|
+
for (; state.parens > 0; ) {
|
|
1015
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", ")"));
|
|
1016
|
+
state.output = utils.escapeLast(state.output, "("), decrement("parens");
|
|
1017
|
+
}
|
|
1018
|
+
for (; state.braces > 0; ) {
|
|
1019
|
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "}"));
|
|
1020
|
+
state.output = utils.escapeLast(state.output, "{"), decrement("braces");
|
|
1021
|
+
}
|
|
1022
|
+
if (opts.strictSlashes !== !0 && (prev.type === "star" || prev.type === "bracket") && push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }), state.backtrack === !0) {
|
|
1023
|
+
state.output = "";
|
|
1024
|
+
for (let token of state.tokens)
|
|
1025
|
+
state.output += token.output != null ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
|
1026
|
+
}
|
|
1027
|
+
return state;
|
|
1028
|
+
};
|
|
1029
|
+
parse.fastpaths = (input, options) => {
|
|
1030
|
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
1031
|
+
if (len > max)
|
|
1032
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1033
|
+
input = REPLACEMENTS[input] || input;
|
|
1034
|
+
let {
|
|
1035
|
+
DOT_LITERAL,
|
|
1036
|
+
SLASH_LITERAL,
|
|
1037
|
+
ONE_CHAR,
|
|
1038
|
+
DOTS_SLASH,
|
|
1039
|
+
NO_DOT,
|
|
1040
|
+
NO_DOTS,
|
|
1041
|
+
NO_DOTS_SLASH,
|
|
1042
|
+
STAR,
|
|
1043
|
+
START_ANCHOR
|
|
1044
|
+
} = constants.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? "" : "?:", state = { negated: !1, prefix: "" }, star = opts.bash === !0 ? ".*?" : STAR;
|
|
1045
|
+
opts.capture && (star = `(${star})`);
|
|
1046
|
+
let globstar = (opts2) => opts2.noglobstar === !0 ? star : `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str) => {
|
|
1047
|
+
switch (str) {
|
|
1048
|
+
case "*":
|
|
1049
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
1050
|
+
case ".*":
|
|
1051
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1052
|
+
case "*.*":
|
|
1053
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1054
|
+
case "*/*":
|
|
1055
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1056
|
+
case "**":
|
|
1057
|
+
return nodot + globstar(opts);
|
|
1058
|
+
case "**/*":
|
|
1059
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1060
|
+
case "**/*.*":
|
|
1061
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1062
|
+
case "**/.*":
|
|
1063
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1064
|
+
default: {
|
|
1065
|
+
let match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1066
|
+
if (!match) return;
|
|
1067
|
+
let source2 = create(match[1]);
|
|
1068
|
+
return source2 ? source2 + DOT_LITERAL + match[2] : void 0;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}, output = utils.removePrefix(input, state), source = create(output);
|
|
1072
|
+
return source && opts.strictSlashes !== !0 && (source += `${SLASH_LITERAL}?`), source;
|
|
1073
|
+
};
|
|
1074
|
+
module.exports = parse;
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
|
|
1078
|
+
// ../../node_modules/picomatch/lib/picomatch.js
|
|
1079
|
+
var require_picomatch = __commonJS({
|
|
1080
|
+
"../../node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
1081
|
+
"use strict";
|
|
1082
|
+
var scan = require_scan(), parse = require_parse(), utils = require_utils(), constants = require_constants(), isObject = (val) => val && typeof val == "object" && !Array.isArray(val), picomatch2 = (glob, options, returnState = !1) => {
|
|
1083
|
+
if (Array.isArray(glob)) {
|
|
1084
|
+
let fns = glob.map((input) => picomatch2(input, options, returnState));
|
|
1085
|
+
return (str) => {
|
|
1086
|
+
for (let isMatch of fns) {
|
|
1087
|
+
let state2 = isMatch(str);
|
|
1088
|
+
if (state2) return state2;
|
|
1089
|
+
}
|
|
1090
|
+
return !1;
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
let isState = isObject(glob) && glob.tokens && glob.input;
|
|
1094
|
+
if (glob === "" || typeof glob != "string" && !isState)
|
|
1095
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
1096
|
+
let opts = options || {}, posix2 = opts.windows, regex = isState ? picomatch2.compileRe(glob, options) : picomatch2.makeRe(glob, options, !1, !0), state = regex.state;
|
|
1097
|
+
delete regex.state;
|
|
1098
|
+
let isIgnored = () => !1;
|
|
1099
|
+
if (opts.ignore) {
|
|
1100
|
+
let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
1101
|
+
isIgnored = picomatch2(opts.ignore, ignoreOpts, returnState);
|
|
1102
|
+
}
|
|
1103
|
+
let matcher = (input, returnObject = !1) => {
|
|
1104
|
+
let { isMatch, match, output } = picomatch2.test(input, regex, options, { glob, posix: posix2 }), result = { glob, state, regex, posix: posix2, input, output, match, isMatch };
|
|
1105
|
+
return typeof opts.onResult == "function" && opts.onResult(result), isMatch === !1 ? (result.isMatch = !1, returnObject ? result : !1) : isIgnored(input) ? (typeof opts.onIgnore == "function" && opts.onIgnore(result), result.isMatch = !1, returnObject ? result : !1) : (typeof opts.onMatch == "function" && opts.onMatch(result), returnObject ? result : !0);
|
|
1106
|
+
};
|
|
1107
|
+
return returnState && (matcher.state = state), matcher;
|
|
1108
|
+
};
|
|
1109
|
+
picomatch2.test = (input, regex, options, { glob, posix: posix2 } = {}) => {
|
|
1110
|
+
if (typeof input != "string")
|
|
1111
|
+
throw new TypeError("Expected input to be a string");
|
|
1112
|
+
if (input === "")
|
|
1113
|
+
return { isMatch: !1, output: "" };
|
|
1114
|
+
let opts = options || {}, format = opts.format || (posix2 ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
|
1115
|
+
return match === !1 && (output = format ? format(input) : input, match = output === glob), (match === !1 || opts.capture === !0) && (opts.matchBase === !0 || opts.basename === !0 ? match = picomatch2.matchBase(input, regex, options, posix2) : match = regex.exec(output)), { isMatch: !!match, match, output };
|
|
1116
|
+
};
|
|
1117
|
+
picomatch2.matchBase = (input, glob, options, posix2 = options && options.windows) => (glob instanceof RegExp ? glob : picomatch2.makeRe(glob, options)).test(utils.basename(input, { windows: posix2 }));
|
|
1118
|
+
picomatch2.isMatch = (str, patterns, options) => picomatch2(patterns, options)(str);
|
|
1119
|
+
picomatch2.parse = (pattern, options) => Array.isArray(pattern) ? pattern.map((p) => picomatch2.parse(p, options)) : parse(pattern, { ...options, fastpaths: !1 });
|
|
1120
|
+
picomatch2.scan = (input, options) => scan(input, options);
|
|
1121
|
+
picomatch2.compileRe = (state, options, returnOutput = !1, returnState = !1) => {
|
|
1122
|
+
if (returnOutput === !0)
|
|
1123
|
+
return state.output;
|
|
1124
|
+
let opts = options || {}, prepend = opts.contains ? "" : "^", append = opts.contains ? "" : "$", source = `${prepend}(?:${state.output})${append}`;
|
|
1125
|
+
state && state.negated === !0 && (source = `^(?!${source}).*$`);
|
|
1126
|
+
let regex = picomatch2.toRegex(source, options);
|
|
1127
|
+
return returnState === !0 && (regex.state = state), regex;
|
|
1128
|
+
};
|
|
1129
|
+
picomatch2.makeRe = (input, options = {}, returnOutput = !1, returnState = !1) => {
|
|
1130
|
+
if (!input || typeof input != "string")
|
|
1131
|
+
throw new TypeError("Expected a non-empty string");
|
|
1132
|
+
let parsed = { negated: !1, fastpaths: !0 };
|
|
1133
|
+
return options.fastpaths !== !1 && (input[0] === "." || input[0] === "*") && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch2.compileRe(parsed, options, returnOutput, returnState);
|
|
1134
|
+
};
|
|
1135
|
+
picomatch2.toRegex = (source, options) => {
|
|
1136
|
+
try {
|
|
1137
|
+
let opts = options || {};
|
|
1138
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
1139
|
+
} catch (err) {
|
|
1140
|
+
if (options && options.debug === !0) throw err;
|
|
1141
|
+
return /$^/;
|
|
1142
|
+
}
|
|
1143
|
+
};
|
|
1144
|
+
picomatch2.constants = constants;
|
|
1145
|
+
module.exports = picomatch2;
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
|
|
1149
|
+
// ../../node_modules/picomatch/index.js
|
|
1150
|
+
var require_picomatch2 = __commonJS({
|
|
1151
|
+
"../../node_modules/picomatch/index.js"(exports, module) {
|
|
1152
|
+
"use strict";
|
|
1153
|
+
var pico = require_picomatch(), utils = require_utils();
|
|
1154
|
+
function picomatch2(glob, options, returnState = !1) {
|
|
1155
|
+
return options && (options.windows === null || options.windows === void 0) && (options = { ...options, windows: utils.isWindows() }), pico(glob, options, returnState);
|
|
1156
|
+
}
|
|
1157
|
+
Object.assign(picomatch2, pico);
|
|
1158
|
+
module.exports = picomatch2;
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
|
|
1162
|
+
// src/shared/open-service/server.ts
|
|
1163
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
1164
|
+
import { dirname, join } from "pathe";
|
|
1165
|
+
|
|
1166
|
+
// ../../node_modules/es-toolkit/dist/object/clone.mjs
|
|
1167
|
+
function clone(obj) {
|
|
1168
|
+
if (isPrimitive(obj)) return obj;
|
|
1169
|
+
if (Array.isArray(obj) || isTypedArray(obj) || obj instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && obj instanceof SharedArrayBuffer) return obj.slice(0);
|
|
1170
|
+
let prototype = Object.getPrototypeOf(obj);
|
|
1171
|
+
if (prototype == null) return Object.assign(Object.create(prototype), obj);
|
|
1172
|
+
let Constructor = prototype.constructor;
|
|
1173
|
+
if (obj instanceof Date || obj instanceof Map || obj instanceof Set) return new Constructor(obj);
|
|
1174
|
+
if (obj instanceof RegExp) {
|
|
1175
|
+
let newRegExp = new Constructor(obj);
|
|
1176
|
+
return newRegExp.lastIndex = obj.lastIndex, newRegExp;
|
|
1177
|
+
}
|
|
1178
|
+
if (obj instanceof DataView) return new Constructor(obj.buffer.slice(0));
|
|
1179
|
+
if (obj instanceof Error) {
|
|
1180
|
+
let newError;
|
|
1181
|
+
return obj instanceof AggregateError ? newError = new Constructor(obj.errors, obj.message, { cause: obj.cause }) : newError = new Constructor(obj.message, { cause: obj.cause }), newError.stack = obj.stack, Object.assign(newError, obj), newError;
|
|
1182
|
+
}
|
|
1183
|
+
return typeof File < "u" && obj instanceof File ? new Constructor([obj], obj.name, {
|
|
1184
|
+
type: obj.type,
|
|
1185
|
+
lastModified: obj.lastModified
|
|
1186
|
+
}) : typeof obj == "object" ? Object.assign(Object.create(prototype), obj) : obj;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
// ../../node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
|
|
1190
|
+
function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {
|
|
1191
|
+
let cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
|
|
1192
|
+
if (cloned !== void 0) return cloned;
|
|
1193
|
+
if (isPrimitive(valueToClone)) return valueToClone;
|
|
1194
|
+
if (stack.has(valueToClone)) return stack.get(valueToClone);
|
|
1195
|
+
if (Array.isArray(valueToClone)) {
|
|
1196
|
+
let result = new Array(valueToClone.length);
|
|
1197
|
+
stack.set(valueToClone, result);
|
|
1198
|
+
for (let i = 0; i < valueToClone.length; i++) result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
1199
|
+
return Object.hasOwn(valueToClone, "index") && (result.index = valueToClone.index), Object.hasOwn(valueToClone, "input") && (result.input = valueToClone.input), result;
|
|
1200
|
+
}
|
|
1201
|
+
if (valueToClone instanceof Date) return new Date(valueToClone.getTime());
|
|
1202
|
+
if (valueToClone instanceof RegExp) {
|
|
1203
|
+
let result = new RegExp(valueToClone.source, valueToClone.flags);
|
|
1204
|
+
return result.lastIndex = valueToClone.lastIndex, result;
|
|
1205
|
+
}
|
|
1206
|
+
if (valueToClone instanceof Map) {
|
|
1207
|
+
let result = /* @__PURE__ */ new Map();
|
|
1208
|
+
stack.set(valueToClone, result);
|
|
1209
|
+
for (let [key, value] of valueToClone) result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
|
|
1210
|
+
return result;
|
|
1211
|
+
}
|
|
1212
|
+
if (valueToClone instanceof Set) {
|
|
1213
|
+
let result = /* @__PURE__ */ new Set();
|
|
1214
|
+
stack.set(valueToClone, result);
|
|
1215
|
+
for (let value of valueToClone) result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
|
|
1216
|
+
return result;
|
|
1217
|
+
}
|
|
1218
|
+
if (isBuffer(valueToClone)) return valueToClone.subarray();
|
|
1219
|
+
if (isTypedArray(valueToClone)) {
|
|
1220
|
+
let result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
|
|
1221
|
+
stack.set(valueToClone, result);
|
|
1222
|
+
for (let i = 0; i < valueToClone.length; i++) result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
1223
|
+
return result;
|
|
1224
|
+
}
|
|
1225
|
+
if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && valueToClone instanceof SharedArrayBuffer) return valueToClone.slice(0);
|
|
1226
|
+
if (valueToClone instanceof DataView) {
|
|
1227
|
+
let result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
|
|
1228
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1229
|
+
}
|
|
1230
|
+
if (typeof File < "u" && valueToClone instanceof File) {
|
|
1231
|
+
let result = new File([valueToClone], valueToClone.name, { type: valueToClone.type });
|
|
1232
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1233
|
+
}
|
|
1234
|
+
if (typeof Blob < "u" && valueToClone instanceof Blob) {
|
|
1235
|
+
let result = new Blob([valueToClone], { type: valueToClone.type });
|
|
1236
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1237
|
+
}
|
|
1238
|
+
if (valueToClone instanceof Error) {
|
|
1239
|
+
let result = structuredClone(valueToClone);
|
|
1240
|
+
return stack.set(valueToClone, result), result.message = valueToClone.message, result.name = valueToClone.name, result.stack = valueToClone.stack, result.cause = valueToClone.cause, result.constructor = valueToClone.constructor, copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1241
|
+
}
|
|
1242
|
+
if (valueToClone instanceof Boolean) {
|
|
1243
|
+
let result = new Boolean(valueToClone.valueOf());
|
|
1244
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1245
|
+
}
|
|
1246
|
+
if (valueToClone instanceof Number) {
|
|
1247
|
+
let result = new Number(valueToClone.valueOf());
|
|
1248
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1249
|
+
}
|
|
1250
|
+
if (valueToClone instanceof String) {
|
|
1251
|
+
let result = new String(valueToClone.valueOf());
|
|
1252
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1253
|
+
}
|
|
1254
|
+
if (typeof valueToClone == "object" && isCloneableObject(valueToClone)) {
|
|
1255
|
+
let result = Object.create(Object.getPrototypeOf(valueToClone));
|
|
1256
|
+
return stack.set(valueToClone, result), copyProperties(result, valueToClone, objectToClone, stack, cloneValue), result;
|
|
1257
|
+
}
|
|
1258
|
+
return valueToClone;
|
|
1259
|
+
}
|
|
1260
|
+
function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
|
|
1261
|
+
let keys = [...Object.keys(source), ...getSymbols(source)];
|
|
1262
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1263
|
+
let key = keys[i], descriptor = Object.getOwnPropertyDescriptor(target, key);
|
|
1264
|
+
(descriptor == null || descriptor.writable) && (target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue));
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function isCloneableObject(object) {
|
|
1268
|
+
switch (getTag(object)) {
|
|
1269
|
+
case argumentsTag:
|
|
1270
|
+
case arrayTag:
|
|
1271
|
+
case arrayBufferTag:
|
|
1272
|
+
case dataViewTag:
|
|
1273
|
+
case booleanTag:
|
|
1274
|
+
case dateTag:
|
|
1275
|
+
case float32ArrayTag:
|
|
1276
|
+
case float64ArrayTag:
|
|
1277
|
+
case int8ArrayTag:
|
|
1278
|
+
case int16ArrayTag:
|
|
1279
|
+
case int32ArrayTag:
|
|
1280
|
+
case mapTag:
|
|
1281
|
+
case numberTag:
|
|
1282
|
+
case objectTag:
|
|
1283
|
+
case regexpTag:
|
|
1284
|
+
case setTag:
|
|
1285
|
+
case stringTag:
|
|
1286
|
+
case symbolTag:
|
|
1287
|
+
case uint8ArrayTag:
|
|
1288
|
+
case uint8ClampedArrayTag:
|
|
1289
|
+
case uint16ArrayTag:
|
|
1290
|
+
case uint32ArrayTag:
|
|
1291
|
+
return !0;
|
|
1292
|
+
default:
|
|
1293
|
+
return !1;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// ../../node_modules/es-toolkit/dist/object/cloneDeep.mjs
|
|
1298
|
+
function cloneDeep(obj) {
|
|
1299
|
+
return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
// ../../node_modules/es-toolkit/dist/_internal/isMergeableValue.mjs
|
|
1303
|
+
function isMergeableValue(value) {
|
|
1304
|
+
return isPlainObject(value) || Array.isArray(value);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
// ../../node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
1308
|
+
function isUnsafeProperty(key) {
|
|
1309
|
+
return key === "__proto__";
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
// ../../node_modules/es-toolkit/dist/object/mergeWith.mjs
|
|
1313
|
+
function mergeWith(target, source, merge2) {
|
|
1314
|
+
let sourceKeys = Object.keys(source);
|
|
1315
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
1316
|
+
let key = sourceKeys[i];
|
|
1317
|
+
if (isUnsafeProperty(key)) continue;
|
|
1318
|
+
let sourceValue = source[key], targetValue = target[key], merged = merge2(targetValue, sourceValue, key, target, source);
|
|
1319
|
+
merged !== void 0 ? target[key] = merged : isMergeableValue(sourceValue) && isMergeableValue(targetValue) ? target[key] = mergeWith(targetValue, sourceValue, merge2) : Array.isArray(sourceValue) ? target[key] = mergeWith([], sourceValue, merge2) : isPlainObject(sourceValue) ? target[key] = mergeWith({}, sourceValue, merge2) : (targetValue === void 0 || sourceValue !== void 0) && (target[key] = sourceValue);
|
|
1320
|
+
}
|
|
1321
|
+
return target;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
// ../../node_modules/es-toolkit/dist/object/toMerged.mjs
|
|
1325
|
+
function toMerged(target, source) {
|
|
1326
|
+
return mergeWith(cloneDeep(target), source, function mergeRecursively(targetValue, sourceValue) {
|
|
1327
|
+
if (isMergeableValue(sourceValue) && isMergeableValue(targetValue)) return mergeWith(clone(targetValue), sourceValue, mergeRecursively);
|
|
1328
|
+
if (Array.isArray(sourceValue)) return mergeWith([], sourceValue, mergeRecursively);
|
|
1329
|
+
if (isPlainObject(sourceValue)) return mergeWith({}, sourceValue, mergeRecursively);
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
// src/shared/open-service/server.ts
|
|
1334
|
+
var getService2 = getService;
|
|
1335
|
+
function registerService2(definition, registration) {
|
|
1336
|
+
return registerService(definition, registration, { relay: !0 });
|
|
1337
|
+
}
|
|
1338
|
+
async function buildStaticFiles() {
|
|
1339
|
+
let store = {}, buildTasks = [];
|
|
1340
|
+
for (let service of getRegisteredServices())
|
|
1341
|
+
for (let [queryName, query] of Object.entries(service.queries)) {
|
|
1342
|
+
let { load, staticPath, staticInputs } = query;
|
|
1343
|
+
!staticPath || !load || !staticInputs || buildTasks.push(
|
|
1344
|
+
(async () => {
|
|
1345
|
+
let inputsRuntime = createServiceRuntime(service, { registryApi: serviceRegistryApi }), inputs = await staticInputs(inputsRuntime.loadCtxForStatic);
|
|
1346
|
+
return Promise.all(
|
|
1347
|
+
inputs.map(async (input) => {
|
|
1348
|
+
let buildRuntime = createServiceRuntime(service, {
|
|
1349
|
+
registryApi: serviceRegistryApi
|
|
1350
|
+
}), validatedInput = await validateSchema(query.input, input, {
|
|
1351
|
+
kind: "query",
|
|
1352
|
+
serviceId: service.id,
|
|
1353
|
+
name: queryName,
|
|
1354
|
+
phase: "input"
|
|
1355
|
+
}), path = resolveStaticPath(service.id, queryName, { staticPath }, validatedInput);
|
|
1356
|
+
return await buildRuntime.runLoadOnce(queryName, validatedInput), { path, state: buildRuntime.getStateSnapshot() };
|
|
1357
|
+
})
|
|
1358
|
+
);
|
|
1359
|
+
})()
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
let builtStates = (await Promise.all(buildTasks)).flat();
|
|
1363
|
+
for (let { path, state } of builtStates)
|
|
1364
|
+
store[path] = path in store ? toMerged(store[path], state) : state;
|
|
1365
|
+
return store;
|
|
1366
|
+
}
|
|
1367
|
+
async function writeOpenServiceStaticFiles(outputDir) {
|
|
1368
|
+
let staticStore = await buildStaticFiles();
|
|
1369
|
+
await Promise.all(
|
|
1370
|
+
Object.entries(staticStore).map(async ([relativePath, state]) => {
|
|
1371
|
+
let outputPath = join(outputDir, "services", ...relativePath.split("/"));
|
|
1372
|
+
await mkdir(dirname(outputPath), { recursive: !0 }), await writeFile(outputPath, JSON.stringify(state, null, 2));
|
|
1373
|
+
})
|
|
1374
|
+
);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
// src/common/utils/paths.ts
|
|
1378
|
+
import { join as join2, relative as relative2, resolve as resolve3, sep as sep2 } from "node:path";
|
|
1379
|
+
|
|
1380
|
+
// ../../node_modules/tinyglobby/dist/index.mjs
|
|
1381
|
+
import { readdir, readdirSync, realpath, realpathSync, stat, statSync } from "fs";
|
|
1382
|
+
import { isAbsolute, posix, resolve as resolve2 } from "path";
|
|
1383
|
+
import { fileURLToPath } from "url";
|
|
1384
|
+
|
|
1385
|
+
// ../../node_modules/fdir/dist/index.mjs
|
|
1386
|
+
import { createRequire } from "module";
|
|
1387
|
+
import { basename, dirname as dirname2, normalize, relative, resolve, sep } from "path";
|
|
1388
|
+
import * as nativeFs from "fs";
|
|
1389
|
+
var __require = createRequire(import.meta.url);
|
|
1390
|
+
function cleanPath(path) {
|
|
1391
|
+
let normalized = normalize(path);
|
|
1392
|
+
return normalized.length > 1 && normalized[normalized.length - 1] === sep && (normalized = normalized.substring(0, normalized.length - 1)), normalized;
|
|
1393
|
+
}
|
|
1394
|
+
var SLASHES_REGEX = /[\\/]/g;
|
|
1395
|
+
function convertSlashes(path, separator) {
|
|
1396
|
+
return path.replace(SLASHES_REGEX, separator);
|
|
1397
|
+
}
|
|
1398
|
+
var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
1399
|
+
function isRootDirectory(path) {
|
|
1400
|
+
return path === "/" || WINDOWS_ROOT_DIR_REGEX.test(path);
|
|
1401
|
+
}
|
|
1402
|
+
function normalizePath(path, options) {
|
|
1403
|
+
let { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options, pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith(".");
|
|
1404
|
+
if (resolvePaths && (path = resolve(path)), (normalizePath$1 || pathNeedsCleaning) && (path = cleanPath(path)), path === ".") return "";
|
|
1405
|
+
let needsSeperator = path[path.length - 1] !== pathSeparator;
|
|
1406
|
+
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
|
|
1407
|
+
}
|
|
1408
|
+
function joinPathWithBasePath(filename, directoryPath) {
|
|
1409
|
+
return directoryPath + filename;
|
|
1410
|
+
}
|
|
1411
|
+
function joinPathWithRelativePath(root, options) {
|
|
1412
|
+
return function(filename, directoryPath) {
|
|
1413
|
+
return directoryPath.startsWith(root) ? directoryPath.slice(root.length) + filename : convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
function joinPath(filename) {
|
|
1417
|
+
return filename;
|
|
1418
|
+
}
|
|
1419
|
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
1420
|
+
return directoryPath + filename + separator;
|
|
1421
|
+
}
|
|
1422
|
+
function build$7(root, options) {
|
|
1423
|
+
let { relativePaths, includeBasePath } = options;
|
|
1424
|
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
1425
|
+
}
|
|
1426
|
+
function pushDirectoryWithRelativePath(root) {
|
|
1427
|
+
return function(directoryPath, paths) {
|
|
1428
|
+
paths.push(directoryPath.substring(root.length) || ".");
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
function pushDirectoryFilterWithRelativePath(root) {
|
|
1432
|
+
return function(directoryPath, paths, filters) {
|
|
1433
|
+
let relativePath = directoryPath.substring(root.length) || ".";
|
|
1434
|
+
filters.every((filter) => filter(relativePath, !0)) && paths.push(relativePath);
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
var pushDirectory = (directoryPath, paths) => {
|
|
1438
|
+
paths.push(directoryPath || ".");
|
|
1439
|
+
}, pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
1440
|
+
let path = directoryPath || ".";
|
|
1441
|
+
filters.every((filter) => filter(path, !0)) && paths.push(path);
|
|
1442
|
+
}, empty$2 = () => {
|
|
1443
|
+
};
|
|
1444
|
+
function build$6(root, options) {
|
|
1445
|
+
let { includeDirs, filters, relativePaths } = options;
|
|
1446
|
+
return includeDirs ? relativePaths ? filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root) : filters && filters.length ? pushDirectoryFilter : pushDirectory : empty$2;
|
|
1447
|
+
}
|
|
1448
|
+
var pushFileFilterAndCount = (filename, _paths, counts, filters) => {
|
|
1449
|
+
filters.every((filter) => filter(filename, !1)) && counts.files++;
|
|
1450
|
+
}, pushFileFilter = (filename, paths, _counts, filters) => {
|
|
1451
|
+
filters.every((filter) => filter(filename, !1)) && paths.push(filename);
|
|
1452
|
+
}, pushFileCount = (_filename, _paths, counts, _filters) => {
|
|
1453
|
+
counts.files++;
|
|
1454
|
+
}, pushFile = (filename, paths) => {
|
|
1455
|
+
paths.push(filename);
|
|
1456
|
+
}, empty$1 = () => {
|
|
1457
|
+
};
|
|
1458
|
+
function build$5(options) {
|
|
1459
|
+
let { excludeFiles, filters, onlyCounts } = options;
|
|
1460
|
+
return excludeFiles ? empty$1 : filters && filters.length ? onlyCounts ? pushFileFilterAndCount : pushFileFilter : onlyCounts ? pushFileCount : pushFile;
|
|
1461
|
+
}
|
|
1462
|
+
var getArray = (paths) => paths, getArrayGroup = () => [""].slice(0, 0);
|
|
1463
|
+
function build$4(options) {
|
|
1464
|
+
return options.group ? getArrayGroup : getArray;
|
|
1465
|
+
}
|
|
1466
|
+
var groupFiles = (groups, directory, files) => {
|
|
1467
|
+
groups.push({
|
|
1468
|
+
directory,
|
|
1469
|
+
files,
|
|
1470
|
+
dir: directory
|
|
1471
|
+
});
|
|
1472
|
+
}, empty = () => {
|
|
1473
|
+
};
|
|
1474
|
+
function build$3(options) {
|
|
1475
|
+
return options.group ? groupFiles : empty;
|
|
1476
|
+
}
|
|
1477
|
+
var resolveSymlinksAsync = function(path, state, callback$1) {
|
|
1478
|
+
let { queue, fs, options: { suppressErrors } } = state;
|
|
1479
|
+
queue.enqueue(), fs.realpath(path, (error, resolvedPath) => {
|
|
1480
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
1481
|
+
fs.stat(resolvedPath, (error$1, stat2) => {
|
|
1482
|
+
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
1483
|
+
if (stat2.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
1484
|
+
callback$1(stat2, resolvedPath), queue.dequeue(null, state);
|
|
1485
|
+
});
|
|
1486
|
+
});
|
|
1487
|
+
}, resolveSymlinks = function(path, state, callback$1) {
|
|
1488
|
+
let { queue, fs, options: { suppressErrors } } = state;
|
|
1489
|
+
queue.enqueue();
|
|
1490
|
+
try {
|
|
1491
|
+
let resolvedPath = fs.realpathSync(path), stat2 = fs.statSync(resolvedPath);
|
|
1492
|
+
if (stat2.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
1493
|
+
callback$1(stat2, resolvedPath);
|
|
1494
|
+
} catch (e) {
|
|
1495
|
+
if (!suppressErrors) throw e;
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
function build$2(options, isSynchronous) {
|
|
1499
|
+
return !options.resolveSymlinks || options.excludeSymlinks ? null : isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
1500
|
+
}
|
|
1501
|
+
function isRecursive(path, resolved, state) {
|
|
1502
|
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
1503
|
+
let parent = dirname2(path), depth = 1;
|
|
1504
|
+
for (; parent !== state.root && depth < 2; ) {
|
|
1505
|
+
let resolvedPath = state.symlinks.get(parent);
|
|
1506
|
+
!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)) ? depth++ : parent = dirname2(parent);
|
|
1507
|
+
}
|
|
1508
|
+
return state.symlinks.set(path, resolved), depth > 1;
|
|
1509
|
+
}
|
|
1510
|
+
function isRecursiveUsingRealPaths(resolved, state) {
|
|
1511
|
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
1512
|
+
}
|
|
1513
|
+
var onlyCountsSync = (state) => state.counts, groupsSync = (state) => state.groups, defaultSync = (state) => state.paths, limitFilesSync = (state) => state.paths.slice(0, state.options.maxFiles), onlyCountsAsync = (state, error, callback$1) => (report(error, callback$1, state.counts, state.options.suppressErrors), null), defaultAsync = (state, error, callback$1) => (report(error, callback$1, state.paths, state.options.suppressErrors), null), limitFilesAsync = (state, error, callback$1) => (report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors), null), groupsAsync = (state, error, callback$1) => (report(error, callback$1, state.groups, state.options.suppressErrors), null);
|
|
1514
|
+
function report(error, callback$1, output, suppressErrors) {
|
|
1515
|
+
callback$1(error && !suppressErrors ? error : null, output);
|
|
1516
|
+
}
|
|
1517
|
+
function build$1(options, isSynchronous) {
|
|
1518
|
+
let { onlyCounts, group, maxFiles } = options;
|
|
1519
|
+
return onlyCounts ? isSynchronous ? onlyCountsSync : onlyCountsAsync : group ? isSynchronous ? groupsSync : groupsAsync : maxFiles ? isSynchronous ? limitFilesSync : limitFilesAsync : isSynchronous ? defaultSync : defaultAsync;
|
|
1520
|
+
}
|
|
1521
|
+
var readdirOpts = { withFileTypes: !0 }, walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
1522
|
+
if (state.queue.enqueue(), currentDepth < 0) return state.queue.dequeue(null, state);
|
|
1523
|
+
let { fs } = state;
|
|
1524
|
+
state.visited.push(crawlPath), state.counts.directories++, fs.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
|
1525
|
+
callback$1(entries, directoryPath, currentDepth), state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
1526
|
+
});
|
|
1527
|
+
}, walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
1528
|
+
let { fs } = state;
|
|
1529
|
+
if (currentDepth < 0) return;
|
|
1530
|
+
state.visited.push(crawlPath), state.counts.directories++;
|
|
1531
|
+
let entries = [];
|
|
1532
|
+
try {
|
|
1533
|
+
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
1534
|
+
} catch (e) {
|
|
1535
|
+
if (!state.options.suppressErrors) throw e;
|
|
1536
|
+
}
|
|
1537
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
1538
|
+
};
|
|
1539
|
+
function build(isSynchronous) {
|
|
1540
|
+
return isSynchronous ? walkSync : walkAsync;
|
|
1541
|
+
}
|
|
1542
|
+
var Queue = class {
|
|
1543
|
+
count = 0;
|
|
1544
|
+
constructor(onQueueEmpty) {
|
|
1545
|
+
this.onQueueEmpty = onQueueEmpty;
|
|
1546
|
+
}
|
|
1547
|
+
enqueue() {
|
|
1548
|
+
return this.count++, this.count;
|
|
1549
|
+
}
|
|
1550
|
+
dequeue(error, output) {
|
|
1551
|
+
this.onQueueEmpty && (--this.count <= 0 || error) && (this.onQueueEmpty(error, output), error && (output.controller.abort(), this.onQueueEmpty = void 0));
|
|
1552
|
+
}
|
|
1553
|
+
}, Counter = class {
|
|
1554
|
+
_files = 0;
|
|
1555
|
+
_directories = 0;
|
|
1556
|
+
set files(num) {
|
|
1557
|
+
this._files = num;
|
|
1558
|
+
}
|
|
1559
|
+
get files() {
|
|
1560
|
+
return this._files;
|
|
1561
|
+
}
|
|
1562
|
+
set directories(num) {
|
|
1563
|
+
this._directories = num;
|
|
1564
|
+
}
|
|
1565
|
+
get directories() {
|
|
1566
|
+
return this._directories;
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* @deprecated use `directories` instead
|
|
1570
|
+
*/
|
|
1571
|
+
/* c8 ignore next 3 */
|
|
1572
|
+
get dirs() {
|
|
1573
|
+
return this._directories;
|
|
1574
|
+
}
|
|
1575
|
+
}, Aborter = class {
|
|
1576
|
+
aborted = !1;
|
|
1577
|
+
abort() {
|
|
1578
|
+
this.aborted = !0;
|
|
1579
|
+
}
|
|
1580
|
+
}, Walker = class {
|
|
1581
|
+
root;
|
|
1582
|
+
isSynchronous;
|
|
1583
|
+
state;
|
|
1584
|
+
joinPath;
|
|
1585
|
+
pushDirectory;
|
|
1586
|
+
pushFile;
|
|
1587
|
+
getArray;
|
|
1588
|
+
groupFiles;
|
|
1589
|
+
resolveSymlink;
|
|
1590
|
+
walkDirectory;
|
|
1591
|
+
callbackInvoker;
|
|
1592
|
+
constructor(root, options, callback$1) {
|
|
1593
|
+
this.isSynchronous = !callback$1, this.callbackInvoker = build$1(options, this.isSynchronous), this.root = normalizePath(root, options), this.state = {
|
|
1594
|
+
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
|
1595
|
+
paths: [""].slice(0, 0),
|
|
1596
|
+
groups: [],
|
|
1597
|
+
counts: new Counter(),
|
|
1598
|
+
options,
|
|
1599
|
+
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
|
|
1600
|
+
symlinks: /* @__PURE__ */ new Map(),
|
|
1601
|
+
visited: [""].slice(0, 0),
|
|
1602
|
+
controller: new Aborter(),
|
|
1603
|
+
fs: options.fs || nativeFs
|
|
1604
|
+
}, this.joinPath = build$7(this.root, options), this.pushDirectory = build$6(this.root, options), this.pushFile = build$5(options), this.getArray = build$4(options), this.groupFiles = build$3(options), this.resolveSymlink = build$2(options, this.isSynchronous), this.walkDirectory = build(this.isSynchronous);
|
|
1605
|
+
}
|
|
1606
|
+
start() {
|
|
1607
|
+
return this.pushDirectory(this.root, this.state.paths, this.state.options.filters), this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk), this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
1608
|
+
}
|
|
1609
|
+
walk = (entries, directoryPath, depth) => {
|
|
1610
|
+
let { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
1611
|
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
1612
|
+
let files = this.getArray(this.state.paths);
|
|
1613
|
+
for (let i = 0; i < entries.length; ++i) {
|
|
1614
|
+
let entry = entries[i];
|
|
1615
|
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
1616
|
+
let filename = this.joinPath(entry.name, directoryPath);
|
|
1617
|
+
this.pushFile(filename, files, this.state.counts, filters);
|
|
1618
|
+
} else if (entry.isDirectory()) {
|
|
1619
|
+
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
1620
|
+
if (exclude && exclude(entry.name, path)) continue;
|
|
1621
|
+
this.pushDirectory(path, paths, filters), this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
1622
|
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
1623
|
+
let path = joinPathWithBasePath(entry.name, directoryPath);
|
|
1624
|
+
this.resolveSymlink(path, this.state, (stat2, resolvedPath) => {
|
|
1625
|
+
if (stat2.isDirectory()) {
|
|
1626
|
+
if (resolvedPath = normalizePath(resolvedPath, this.state.options), exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
|
1627
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
1628
|
+
} else {
|
|
1629
|
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
1630
|
+
let filename = basename(resolvedPath), directoryPath$1 = normalizePath(dirname2(resolvedPath), this.state.options);
|
|
1631
|
+
resolvedPath = this.joinPath(filename, directoryPath$1), this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
this.groupFiles(this.state.groups, directoryPath, files);
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
function promise(root, options) {
|
|
1640
|
+
return new Promise((resolve$1, reject) => {
|
|
1641
|
+
callback(root, options, (err, output) => {
|
|
1642
|
+
if (err) return reject(err);
|
|
1643
|
+
resolve$1(output);
|
|
1644
|
+
});
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
function callback(root, options, callback$1) {
|
|
1648
|
+
new Walker(root, options, callback$1).start();
|
|
1649
|
+
}
|
|
1650
|
+
function sync(root, options) {
|
|
1651
|
+
return new Walker(root, options).start();
|
|
1652
|
+
}
|
|
1653
|
+
var APIBuilder = class {
|
|
1654
|
+
constructor(root, options) {
|
|
1655
|
+
this.root = root, this.options = options;
|
|
1656
|
+
}
|
|
1657
|
+
withPromise() {
|
|
1658
|
+
return promise(this.root, this.options);
|
|
1659
|
+
}
|
|
1660
|
+
withCallback(cb) {
|
|
1661
|
+
callback(this.root, this.options, cb);
|
|
1662
|
+
}
|
|
1663
|
+
sync() {
|
|
1664
|
+
return sync(this.root, this.options);
|
|
1665
|
+
}
|
|
1666
|
+
}, pm = null;
|
|
1667
|
+
try {
|
|
1668
|
+
__require.resolve("picomatch"), pm = __require("picomatch");
|
|
1669
|
+
} catch {
|
|
1670
|
+
}
|
|
1671
|
+
var Builder = class {
|
|
1672
|
+
globCache = {};
|
|
1673
|
+
options = {
|
|
1674
|
+
maxDepth: 1 / 0,
|
|
1675
|
+
suppressErrors: !0,
|
|
1676
|
+
pathSeparator: sep,
|
|
1677
|
+
filters: []
|
|
1678
|
+
};
|
|
1679
|
+
globFunction;
|
|
1680
|
+
constructor(options) {
|
|
1681
|
+
this.options = {
|
|
1682
|
+
...this.options,
|
|
1683
|
+
...options
|
|
1684
|
+
}, this.globFunction = this.options.globFunction;
|
|
1685
|
+
}
|
|
1686
|
+
group() {
|
|
1687
|
+
return this.options.group = !0, this;
|
|
1688
|
+
}
|
|
1689
|
+
withPathSeparator(separator) {
|
|
1690
|
+
return this.options.pathSeparator = separator, this;
|
|
1691
|
+
}
|
|
1692
|
+
withBasePath() {
|
|
1693
|
+
return this.options.includeBasePath = !0, this;
|
|
1694
|
+
}
|
|
1695
|
+
withRelativePaths() {
|
|
1696
|
+
return this.options.relativePaths = !0, this;
|
|
1697
|
+
}
|
|
1698
|
+
withDirs() {
|
|
1699
|
+
return this.options.includeDirs = !0, this;
|
|
1700
|
+
}
|
|
1701
|
+
withMaxDepth(depth) {
|
|
1702
|
+
return this.options.maxDepth = depth, this;
|
|
1703
|
+
}
|
|
1704
|
+
withMaxFiles(limit) {
|
|
1705
|
+
return this.options.maxFiles = limit, this;
|
|
1706
|
+
}
|
|
1707
|
+
withFullPaths() {
|
|
1708
|
+
return this.options.resolvePaths = !0, this.options.includeBasePath = !0, this;
|
|
1709
|
+
}
|
|
1710
|
+
withErrors() {
|
|
1711
|
+
return this.options.suppressErrors = !1, this;
|
|
1712
|
+
}
|
|
1713
|
+
withSymlinks({ resolvePaths = !0 } = {}) {
|
|
1714
|
+
return this.options.resolveSymlinks = !0, this.options.useRealPaths = resolvePaths, this.withFullPaths();
|
|
1715
|
+
}
|
|
1716
|
+
withAbortSignal(signal) {
|
|
1717
|
+
return this.options.signal = signal, this;
|
|
1718
|
+
}
|
|
1719
|
+
normalize() {
|
|
1720
|
+
return this.options.normalizePath = !0, this;
|
|
1721
|
+
}
|
|
1722
|
+
filter(predicate) {
|
|
1723
|
+
return this.options.filters.push(predicate), this;
|
|
1724
|
+
}
|
|
1725
|
+
onlyDirs() {
|
|
1726
|
+
return this.options.excludeFiles = !0, this.options.includeDirs = !0, this;
|
|
1727
|
+
}
|
|
1728
|
+
exclude(predicate) {
|
|
1729
|
+
return this.options.exclude = predicate, this;
|
|
1730
|
+
}
|
|
1731
|
+
onlyCounts() {
|
|
1732
|
+
return this.options.onlyCounts = !0, this;
|
|
1733
|
+
}
|
|
1734
|
+
crawl(root) {
|
|
1735
|
+
return new APIBuilder(root || ".", this.options);
|
|
1736
|
+
}
|
|
1737
|
+
withGlobFunction(fn) {
|
|
1738
|
+
return this.globFunction = fn, this;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* @deprecated Pass options using the constructor instead:
|
|
1742
|
+
* ```ts
|
|
1743
|
+
* new fdir(options).crawl("/path/to/root");
|
|
1744
|
+
* ```
|
|
1745
|
+
* This method will be removed in v7.0
|
|
1746
|
+
*/
|
|
1747
|
+
/* c8 ignore next 4 */
|
|
1748
|
+
crawlWithOptions(root, options) {
|
|
1749
|
+
return this.options = {
|
|
1750
|
+
...this.options,
|
|
1751
|
+
...options
|
|
1752
|
+
}, new APIBuilder(root || ".", this.options);
|
|
1753
|
+
}
|
|
1754
|
+
glob(...patterns) {
|
|
1755
|
+
return this.globFunction ? this.globWithOptions(patterns) : this.globWithOptions(patterns, { dot: !0 });
|
|
1756
|
+
}
|
|
1757
|
+
globWithOptions(patterns, ...options) {
|
|
1758
|
+
let globFn = this.globFunction || pm;
|
|
1759
|
+
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
|
1760
|
+
var isMatch = this.globCache[patterns.join("\0")];
|
|
1761
|
+
return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path) => isMatch(path)), this;
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
|
|
1765
|
+
// ../../node_modules/tinyglobby/dist/index.mjs
|
|
1766
|
+
var import_picomatch = __toESM(require_picomatch2(), 1), isReadonlyArray = Array.isArray, BACKSLASHES = /\\/g, DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/, isWin = process.platform === "win32", ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
1767
|
+
function getPartialMatcher(patterns, options = {}) {
|
|
1768
|
+
let patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount), i, j;
|
|
1769
|
+
for (i = 0; i < patternsCount; i++) {
|
|
1770
|
+
let parts = splitPattern(patterns[i]);
|
|
1771
|
+
patternsParts[i] = parts;
|
|
1772
|
+
let partsCount = parts.length, partMatchers = Array(partsCount);
|
|
1773
|
+
for (j = 0; j < partsCount; j++) partMatchers[j] = (0, import_picomatch.default)(parts[j], options);
|
|
1774
|
+
matchers[i] = partMatchers;
|
|
1775
|
+
}
|
|
1776
|
+
return (input) => {
|
|
1777
|
+
let inputParts = input.split("/");
|
|
1778
|
+
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return !0;
|
|
1779
|
+
for (i = 0; i < patternsCount; i++) {
|
|
1780
|
+
let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length);
|
|
1781
|
+
for (j = 0; j < minParts; ) {
|
|
1782
|
+
let part = patternParts[j];
|
|
1783
|
+
if (part.includes("/")) return !0;
|
|
1784
|
+
if (!matcher[j](inputParts[j])) break;
|
|
1785
|
+
if (!options.noglobstar && part === "**") return !0;
|
|
1786
|
+
j++;
|
|
1787
|
+
}
|
|
1788
|
+
if (j === inputPatternCount) return !0;
|
|
1789
|
+
}
|
|
1790
|
+
return !1;
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
var WIN32_ROOT_DIR = /^[A-Z]:\/$/i, isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
|
|
1794
|
+
function buildFormat(cwd, root, absolute) {
|
|
1795
|
+
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
1796
|
+
if (absolute) {
|
|
1797
|
+
let start = cwd.length + +!isRoot(cwd);
|
|
1798
|
+
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
|
|
1799
|
+
}
|
|
1800
|
+
let prefix = root.slice(cwd.length + 1);
|
|
1801
|
+
return prefix ? (p, isDir) => {
|
|
1802
|
+
if (p === ".") return prefix;
|
|
1803
|
+
let result = `${prefix}/${p}`;
|
|
1804
|
+
return isDir ? result.slice(0, -1) : result;
|
|
1805
|
+
} : (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
|
|
1806
|
+
}
|
|
1807
|
+
return absolute ? (p) => posix.relative(cwd, p) || "." : (p) => posix.relative(cwd, `${root}/${p}`) || ".";
|
|
1808
|
+
}
|
|
1809
|
+
function buildRelative(cwd, root) {
|
|
1810
|
+
if (root.startsWith(`${cwd}/`)) {
|
|
1811
|
+
let prefix = root.slice(cwd.length + 1);
|
|
1812
|
+
return (p) => `${prefix}/${p}`;
|
|
1813
|
+
}
|
|
1814
|
+
return (p) => {
|
|
1815
|
+
let result = posix.relative(cwd, `${root}/${p}`);
|
|
1816
|
+
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
function ensureNonDriveRelativePath(path) {
|
|
1820
|
+
return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
|
|
1821
|
+
}
|
|
1822
|
+
var splitPatternOptions = { parts: !0 };
|
|
1823
|
+
function splitPattern(path) {
|
|
1824
|
+
var _result$parts;
|
|
1825
|
+
let result = import_picomatch.default.scan(path, splitPatternOptions);
|
|
1826
|
+
return !((_result$parts = result.parts) === null || _result$parts === void 0) && _result$parts.length ? result.parts : [path];
|
|
1827
|
+
}
|
|
1828
|
+
var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePosixPath = (path) => path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapeWin32Path = (path) => path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
1829
|
+
function isDynamicPattern(pattern, options) {
|
|
1830
|
+
if (options?.caseSensitiveMatch === !1) return !0;
|
|
1831
|
+
let scan = import_picomatch.default.scan(pattern);
|
|
1832
|
+
return scan.isGlob || scan.negated;
|
|
1833
|
+
}
|
|
1834
|
+
function log(...tasks) {
|
|
1835
|
+
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
|
|
1836
|
+
}
|
|
1837
|
+
function ensureStringArray(value) {
|
|
1838
|
+
return typeof value == "string" ? [value] : value ?? [];
|
|
1839
|
+
}
|
|
1840
|
+
var PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
1841
|
+
function normalizePattern(pattern, opts, props, isIgnore) {
|
|
1842
|
+
var _PARENT_DIRECTORY$exe;
|
|
1843
|
+
let cwd = opts.cwd, result = pattern;
|
|
1844
|
+
pattern[pattern.length - 1] === "/" && (result = pattern.slice(0, -1)), result[result.length - 1] !== "*" && opts.expandDirectories && (result += "/**");
|
|
1845
|
+
let escapedCwd = escapePath(cwd);
|
|
1846
|
+
result = isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
|
|
1847
|
+
let parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0], parts = splitPattern(result);
|
|
1848
|
+
if (parentDir) {
|
|
1849
|
+
let n = (parentDir.length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
|
|
1850
|
+
for (; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]; )
|
|
1851
|
+
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
|
|
1852
|
+
let potentialRoot = posix.join(cwd, parentDir.slice(i * 3));
|
|
1853
|
+
potentialRoot[0] !== "." && props.root.length > potentialRoot.length && (props.root = ensureNonDriveRelativePath(potentialRoot), props.depthOffset = -n + i);
|
|
1854
|
+
}
|
|
1855
|
+
if (!isIgnore && props.depthOffset >= 0) {
|
|
1856
|
+
var _props$commonPath;
|
|
1857
|
+
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
|
|
1858
|
+
let newCommonPath = [], length = Math.min(props.commonPath.length, parts.length);
|
|
1859
|
+
for (let i = 0; i < length; i++) {
|
|
1860
|
+
let part = parts[i];
|
|
1861
|
+
if (part === "**" && !parts[i + 1]) {
|
|
1862
|
+
newCommonPath.pop();
|
|
1863
|
+
break;
|
|
1864
|
+
}
|
|
1865
|
+
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
|
|
1866
|
+
newCommonPath.push(part);
|
|
1867
|
+
}
|
|
1868
|
+
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
|
|
1869
|
+
}
|
|
1870
|
+
return result;
|
|
1871
|
+
}
|
|
1872
|
+
function processPatterns(options, patterns, props) {
|
|
1873
|
+
let matchPatterns = [], ignorePatterns = [];
|
|
1874
|
+
for (let pattern of options.ignore)
|
|
1875
|
+
pattern && (pattern[0] !== "!" || pattern[1] === "(") && ignorePatterns.push(normalizePattern(pattern, options, props, !0));
|
|
1876
|
+
for (let pattern of patterns)
|
|
1877
|
+
pattern && (pattern[0] !== "!" || pattern[1] === "(" ? matchPatterns.push(normalizePattern(pattern, options, props, !1)) : (pattern[1] !== "!" || pattern[2] === "(") && ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, !0)));
|
|
1878
|
+
return {
|
|
1879
|
+
match: matchPatterns,
|
|
1880
|
+
ignore: ignorePatterns
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
function buildCrawler(options, patterns) {
|
|
1884
|
+
let cwd = options.cwd, props = {
|
|
1885
|
+
root: cwd,
|
|
1886
|
+
depthOffset: 0
|
|
1887
|
+
}, processed = processPatterns(options, patterns, props);
|
|
1888
|
+
options.debug && log("internal processing patterns:", processed);
|
|
1889
|
+
let { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options, root = props.root.replace(BACKSLASHES, ""), matchOptions = {
|
|
1890
|
+
dot,
|
|
1891
|
+
nobrace: options.braceExpansion === !1,
|
|
1892
|
+
nocase: !caseSensitiveMatch,
|
|
1893
|
+
noextglob: options.extglob === !1,
|
|
1894
|
+
noglobstar: options.globstar === !1,
|
|
1895
|
+
posix: !0
|
|
1896
|
+
}, matcher = (0, import_picomatch.default)(processed.match, matchOptions), ignore = (0, import_picomatch.default)(processed.ignore, matchOptions), partialMatcher = getPartialMatcher(processed.match, matchOptions), format = buildFormat(cwd, root, absolute), excludeFormatter = absolute ? format : buildFormat(cwd, root, !0), excludePredicate = (_, p) => {
|
|
1897
|
+
let relativePath = excludeFormatter(p, !0);
|
|
1898
|
+
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
1899
|
+
}, maxDepth;
|
|
1900
|
+
options.deep !== void 0 && (maxDepth = Math.round(options.deep - props.depthOffset));
|
|
1901
|
+
let crawler = new Builder({
|
|
1902
|
+
filters: [debug ? (p, isDirectory) => {
|
|
1903
|
+
let path = format(p, isDirectory), matches = matcher(path) && !ignore(path);
|
|
1904
|
+
return matches && log(`matched ${path}`), matches;
|
|
1905
|
+
} : (p, isDirectory) => {
|
|
1906
|
+
let path = format(p, isDirectory);
|
|
1907
|
+
return matcher(path) && !ignore(path);
|
|
1908
|
+
}],
|
|
1909
|
+
exclude: debug ? (_, p) => {
|
|
1910
|
+
let skipped = excludePredicate(_, p);
|
|
1911
|
+
return log(`${skipped ? "skipped" : "crawling"} ${p}`), skipped;
|
|
1912
|
+
} : excludePredicate,
|
|
1913
|
+
fs: options.fs,
|
|
1914
|
+
pathSeparator: "/",
|
|
1915
|
+
relativePaths: !absolute,
|
|
1916
|
+
resolvePaths: absolute,
|
|
1917
|
+
includeBasePath: absolute,
|
|
1918
|
+
resolveSymlinks: followSymbolicLinks,
|
|
1919
|
+
excludeSymlinks: !followSymbolicLinks,
|
|
1920
|
+
excludeFiles: onlyDirectories,
|
|
1921
|
+
includeDirs: onlyDirectories || !options.onlyFiles,
|
|
1922
|
+
maxDepth,
|
|
1923
|
+
signal: options.signal
|
|
1924
|
+
}).crawl(root);
|
|
1925
|
+
return options.debug && log("internal properties:", {
|
|
1926
|
+
...props,
|
|
1927
|
+
root
|
|
1928
|
+
}), [crawler, cwd !== root && !absolute && buildRelative(cwd, root)];
|
|
1929
|
+
}
|
|
1930
|
+
function formatPaths(paths, mapper) {
|
|
1931
|
+
if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]);
|
|
1932
|
+
return paths;
|
|
1933
|
+
}
|
|
1934
|
+
var defaultOptions = {
|
|
1935
|
+
caseSensitiveMatch: !0,
|
|
1936
|
+
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
1937
|
+
expandDirectories: !0,
|
|
1938
|
+
followSymbolicLinks: !0,
|
|
1939
|
+
onlyFiles: !0
|
|
1940
|
+
};
|
|
1941
|
+
function getOptions(options) {
|
|
1942
|
+
let opts = Object.assign({}, options);
|
|
1943
|
+
for (let key in defaultOptions) opts[key] === void 0 && Object.assign(opts, { [key]: defaultOptions[key] });
|
|
1944
|
+
return opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve2(opts.cwd || process.cwd())).replace(BACKSLASHES, "/"), opts.ignore = ensureStringArray(opts.ignore), opts.fs && (opts.fs = {
|
|
1945
|
+
readdir: opts.fs.readdir || readdir,
|
|
1946
|
+
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
1947
|
+
realpath: opts.fs.realpath || realpath,
|
|
1948
|
+
realpathSync: opts.fs.realpathSync || realpathSync,
|
|
1949
|
+
stat: opts.fs.stat || stat,
|
|
1950
|
+
statSync: opts.fs.statSync || statSync
|
|
1951
|
+
}), opts.debug && log("globbing with options:", opts), opts;
|
|
1952
|
+
}
|
|
1953
|
+
function getCrawler(globInput, inputOptions = {}) {
|
|
1954
|
+
var _ref;
|
|
1955
|
+
if (globInput && inputOptions?.patterns) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
1956
|
+
let isModern = isReadonlyArray(globInput) || typeof globInput == "string", patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*"), options = getOptions(isModern ? inputOptions : globInput);
|
|
1957
|
+
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
|
|
1958
|
+
}
|
|
1959
|
+
function globSync(globInput, options) {
|
|
1960
|
+
let [crawler, relative3] = getCrawler(globInput, options);
|
|
1961
|
+
return crawler ? formatPaths(crawler.sync(), relative3) : [];
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
// src/common/js-package-manager/constants.ts
|
|
1965
|
+
var NPM_LOCKFILE = "package-lock.json", PNPM_LOCKFILE = "pnpm-lock.yaml", YARN_LOCKFILE = "yarn.lock", BUN_LOCKFILE = "bun.lock", BUN_LOCKFILE_BINARY = "bun.lockb", LOCK_FILES = [
|
|
1966
|
+
NPM_LOCKFILE,
|
|
1967
|
+
PNPM_LOCKFILE,
|
|
1968
|
+
YARN_LOCKFILE,
|
|
1969
|
+
BUN_LOCKFILE,
|
|
1970
|
+
BUN_LOCKFILE_BINARY
|
|
1971
|
+
];
|
|
1972
|
+
|
|
1973
|
+
// src/common/utils/paths.ts
|
|
1974
|
+
var projectRoot, getProjectRoot = () => {
|
|
1975
|
+
if (projectRoot)
|
|
1976
|
+
return projectRoot;
|
|
1977
|
+
if (process.env.FORKBOOK_PROJECT_ROOT)
|
|
1978
|
+
return process.env.FORKBOOK_PROJECT_ROOT;
|
|
1979
|
+
try {
|
|
1980
|
+
let found = up2(".git") || up2(".svn") || up2(".hg");
|
|
1981
|
+
if (found)
|
|
1982
|
+
return projectRoot = join2(found, ".."), projectRoot;
|
|
1983
|
+
} catch (e) {
|
|
1984
|
+
process.stdout.write(`
|
|
1985
|
+
error searching for repository root: ${e}
|
|
1986
|
+
`);
|
|
1987
|
+
}
|
|
1988
|
+
try {
|
|
1989
|
+
let found = any(LOCK_FILES);
|
|
1990
|
+
if (found)
|
|
1991
|
+
return projectRoot = join2(found, ".."), projectRoot;
|
|
1992
|
+
} catch (e) {
|
|
1993
|
+
process.stdout.write(`
|
|
1994
|
+
error searching for lock file: ${e}
|
|
1995
|
+
`);
|
|
1996
|
+
}
|
|
1997
|
+
try {
|
|
1998
|
+
let [basePath, rest] = __dirname.split(`${sep2}node_modules${sep2}`, 2);
|
|
1999
|
+
if (rest && !basePath.includes(`${sep2}npm-cache${sep2}`) && !relative2(basePath, process.cwd()).startsWith(".."))
|
|
2000
|
+
return projectRoot = basePath, projectRoot;
|
|
2001
|
+
} catch (e) {
|
|
2002
|
+
process.stdout.write(`
|
|
2003
|
+
error searching for splitDirname: ${e}
|
|
2004
|
+
`);
|
|
2005
|
+
}
|
|
2006
|
+
return projectRoot = process.cwd(), projectRoot;
|
|
2007
|
+
}, invalidateProjectRootCache = () => {
|
|
2008
|
+
projectRoot = void 0;
|
|
2009
|
+
}, findFilesUp = (matchers, baseDir = process.cwd()) => {
|
|
2010
|
+
let matchingFiles = [];
|
|
2011
|
+
for (let directory of up(baseDir, { last: getProjectRoot() }))
|
|
2012
|
+
matchingFiles.push(...globSync(matchers, { cwd: directory, absolute: !0 }));
|
|
2013
|
+
return matchingFiles;
|
|
2014
|
+
}, nodePathsToArray = (nodePath) => nodePath.split(process.platform === "win32" ? ";" : ":").filter(Boolean).map((p) => resolve3("./", p)), relativePattern = /^\.{1,2}([/\\]|$)/;
|
|
2015
|
+
function normalizeStoryPath(filename) {
|
|
2016
|
+
return relativePattern.test(filename) ? filename : `.${sep2}${filename}`;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
export {
|
|
2020
|
+
getService2 as getService,
|
|
2021
|
+
registerService2 as registerService,
|
|
2022
|
+
writeOpenServiceStaticFiles,
|
|
2023
|
+
require_picomatch2 as require_picomatch,
|
|
2024
|
+
NPM_LOCKFILE,
|
|
2025
|
+
PNPM_LOCKFILE,
|
|
2026
|
+
YARN_LOCKFILE,
|
|
2027
|
+
BUN_LOCKFILE,
|
|
2028
|
+
BUN_LOCKFILE_BINARY,
|
|
2029
|
+
getProjectRoot,
|
|
2030
|
+
invalidateProjectRootCache,
|
|
2031
|
+
findFilesUp,
|
|
2032
|
+
nodePathsToArray,
|
|
2033
|
+
normalizeStoryPath
|
|
2034
|
+
};
|