@aussieljk/forkbook 0.0.0-stage → 0.0.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +77 -2
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
- package/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -0
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/assets/builder-vite/iframe.html +99 -0
- package/assets/create/rendererAssets/.eslintrc.json +16 -0
- package/assets/create/rendererAssets/common/Configure.mdx +388 -0
- package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
- package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
- package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
- package/assets/create/rendererAssets/common/assets/assets.png +0 -0
- package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/assets/create/rendererAssets/common/assets/context.png +0 -0
- package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
- package/assets/create/rendererAssets/common/assets/docs.png +0 -0
- package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/assets/create/rendererAssets/common/assets/github.svg +1 -0
- package/assets/create/rendererAssets/common/assets/share.png +0 -0
- package/assets/create/rendererAssets/common/assets/styling.png +0 -0
- package/assets/create/rendererAssets/common/assets/testing.png +0 -0
- package/assets/create/rendererAssets/common/assets/theming.png +0 -0
- package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
- package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
- package/assets/create/rendererAssets/common/button.css +30 -0
- package/assets/create/rendererAssets/common/header.css +32 -0
- package/assets/create/rendererAssets/common/page.css +68 -0
- package/assets/create/templates/react-native/index.expo.js +20 -0
- package/assets/create/templates/react-native/index.js +25 -0
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/react-native/metro-env.d.ts +69 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +116 -0
- package/assets/server/base-preview-head.html +494 -0
- package/assets/server/openBrowser.applescript +94 -0
- package/assets/server/template.ejs +87 -0
- package/dist/.build-stamp +0 -0
- package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
- package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
- package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
- package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
- package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
- package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
- package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
- package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
- package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
- package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
- package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
- package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
- package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
- package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
- package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
- package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
- package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
- package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
- package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
- package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
- package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
- package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
- package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
- package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
- package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
- package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
- package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
- package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
- package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
- package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
- package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
- package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
- package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
- package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
- package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
- package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
- package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
- package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
- package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
- package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
- package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
- package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
- package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
- package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
- package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
- package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
- package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
- package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
- package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
- package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
- package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
- package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
- package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
- package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
- package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
- package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
- package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
- package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
- package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
- package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
- package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
- package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
- package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
- package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
- package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
- package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
- package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
- package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
- package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
- package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
- package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
- package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
- package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
- package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
- package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
- package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
- package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
- package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
- package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
- package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
- package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
- package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
- package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
- package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
- package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
- package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
- package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
- package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
- package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
- package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
- package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
- package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
- package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
- package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
- package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
- package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
- package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
- package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
- package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
- package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
- package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
- package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
- package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
- package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
- package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
- package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
- package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
- package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
- package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
- package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
- package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
- package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
- package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
- package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
- package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
- package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
- package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
- package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
- package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
- package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
- package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
- package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
- package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
- package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
- package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
- package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
- package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
- package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
- package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
- package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
- package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
- package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
- package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
- package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
- package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
- package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
- package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
- package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
- package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
- package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
- package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
- package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
- package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
- package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
- package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
- package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
- package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
- package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
- package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
- package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
- package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
- package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
- package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
- package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
- package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
- package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
- package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
- package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
- package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
- package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
- package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
- package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
- package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
- package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
- package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
- package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
- package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
- package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
- package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
- package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
- package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
- package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
- package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
- package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
- package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
- package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
- package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
- package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
- package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
- package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
- package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
- package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
- package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
- package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
- package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
- package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
- package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
- package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
- package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
- package/dist/actions/decorator.d.ts +7 -0
- package/dist/actions/decorator.js +43 -0
- package/dist/actions/index.d.ts +67 -0
- package/dist/actions/index.js +28 -0
- package/dist/addon-a11y/index.d.ts +52 -0
- package/dist/addon-a11y/index.js +16 -0
- package/dist/addon-a11y/manager.js +1429 -0
- package/dist/addon-a11y/preset.js +18 -0
- package/dist/addon-a11y/preview.d.ts +17 -0
- package/dist/addon-a11y/preview.js +15 -0
- package/dist/addon-docs/blocks.d.ts +1061 -0
- package/dist/addon-docs/blocks.js +2461 -0
- package/dist/addon-docs/index.d.ts +236 -0
- package/dist/addon-docs/index.js +16 -0
- package/dist/addon-docs/manager.js +90 -0
- package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
- package/dist/addon-docs/mdx-react-shim.js +2 -0
- package/dist/addon-docs/preset.js +378 -0
- package/dist/addon-docs/preview.d.ts +4 -0
- package/dist/addon-docs/preview.js +7 -0
- package/dist/addon-links/index.d.ts +22 -0
- package/dist/addon-links/index.js +20 -0
- package/dist/addon-links/manager.js +14 -0
- package/dist/addon-links/preview.d.ts +6 -0
- package/dist/addon-links/preview.js +9 -0
- package/dist/addon-links/react/index.d.ts +25 -0
- package/dist/addon-links/react/index.js +52 -0
- package/dist/addon-mcp/preset.js +1345 -0
- package/dist/addon-mcp/preview.js +29 -0
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
- package/dist/addon-ondevice-actions/index.d.ts +4 -0
- package/dist/addon-ondevice-actions/index.js +7 -0
- package/dist/addon-ondevice-actions/register.js +7 -0
- package/dist/addon-ondevice-controls/index.d.ts +6 -0
- package/dist/addon-ondevice-controls/index.js +14 -0
- package/dist/addon-ondevice-controls/register.js +10 -0
- package/dist/addon-pseudo-states/index.d.ts +35 -0
- package/dist/addon-pseudo-states/index.js +15 -0
- package/dist/addon-pseudo-states/manager.js +53 -0
- package/dist/addon-pseudo-states/preview.d.ts +9 -0
- package/dist/addon-pseudo-states/preview.js +10 -0
- package/dist/addon-themes/index.d.ts +80 -0
- package/dist/addon-themes/index.js +104 -0
- package/dist/addon-themes/manager.js +97 -0
- package/dist/addon-themes/postinstall.js +33 -0
- package/dist/addon-themes/preview.d.ts +6 -0
- package/dist/addon-themes/preview.js +8 -0
- package/dist/addon-vitest/constants.d.ts +132 -0
- package/dist/addon-vitest/constants.js +66 -0
- package/dist/addon-vitest/index.d.ts +4 -0
- package/dist/addon-vitest/index.js +8 -0
- package/dist/addon-vitest/manager.js +665 -0
- package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
- package/dist/addon-vitest/node/vitest.js +674 -0
- package/dist/addon-vitest/postinstall.js +24 -0
- package/dist/addon-vitest/preset.js +943 -0
- package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
- package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
- package/dist/addon-vitest/vitest-plugin/index.js +463 -0
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
- package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
- package/dist/babel/index.d.ts +2301 -0
- package/dist/babel/index.js +61 -0
- package/dist/backgrounds/index.d.ts +6 -0
- package/dist/backgrounds/index.js +15 -0
- package/dist/bin/core.js +1705 -0
- package/dist/bin/dispatcher.js +43 -0
- package/dist/bin/loader.js +115 -0
- package/dist/builder-vite/index.d.ts +50 -0
- package/dist/builder-vite/index.js +245 -0
- package/dist/builder-vite/preset.js +27 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +352 -0
- package/dist/chunk-B2t1tGRh.d.ts +284 -0
- package/dist/chunk-BCoJQE-f.d.ts +602 -0
- package/dist/chunk-BGkgZp-H.d.ts +214 -0
- package/dist/chunk-BTVrWliM.d.ts +115 -0
- package/dist/chunk-BXLImeLy.d.ts +197 -0
- package/dist/chunk-BfBzpgct.d.ts +916 -0
- package/dist/chunk-Bpi2tz-6.d.ts +511 -0
- package/dist/chunk-BxWufQms.d.ts +142 -0
- package/dist/chunk-C-bavsOH.d.ts +34 -0
- package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
- package/dist/chunk-C6PAgHLT.d.ts +12 -0
- package/dist/chunk-CMeX4WRe.d.ts +179 -0
- package/dist/chunk-Ct9xd6IM.d.ts +65 -0
- package/dist/chunk-CwQKNaYL.d.ts +15 -0
- package/dist/chunk-D7DwV41f.d.ts +3622 -0
- package/dist/chunk-DEVFdzxR.d.ts +253 -0
- package/dist/chunk-DaVb55-_.d.ts +124 -0
- package/dist/chunk-DgRNfmj_.d.ts +40 -0
- package/dist/chunk-DoIGKY33.d.ts +666 -0
- package/dist/chunk-Dr3R0DXk.d.ts +40 -0
- package/dist/chunk-DtHByo32.d.ts +55 -0
- package/dist/chunk-Dw1z1Pki.d.ts +933 -0
- package/dist/chunk-DzuY9DXg.d.ts +79 -0
- package/dist/chunk-FjDVzZTj.d.ts +62 -0
- package/dist/chunk-Kt1tW-D1.d.ts +59 -0
- package/dist/chunk-XP8oHzpE.d.ts +6 -0
- package/dist/chunk-gCX81nOr.d.ts +61 -0
- package/dist/chunk-pcFXCimE.d.ts +741 -0
- package/dist/cli/index.d.ts +1174 -0
- package/dist/cli/index.js +5613 -0
- package/dist/cli/skills/content/index.d.ts +72 -0
- package/dist/cli/skills/content/index.js +335 -0
- package/dist/cli/tools/sdk/child-host.d.ts +61 -0
- package/dist/cli/tools/sdk/child-host.js +131 -0
- package/dist/cli/tools/sdk/index.d.ts +137 -0
- package/dist/cli/tools/sdk/index.js +44 -0
- package/dist/cli-commands/bin/index.js +25 -0
- package/dist/client-logger/index.d.ts +31 -0
- package/dist/client-logger/index.js +63 -0
- package/dist/common/index.d.ts +1103 -0
- package/dist/common/index.js +364 -0
- package/dist/components/index.d.ts +1924 -0
- package/dist/components/index.js +13759 -0
- package/dist/core-events/index.d.ts +155 -0
- package/dist/core-events/index.js +136 -0
- package/dist/core-server/index.d.ts +2200 -0
- package/dist/core-server/index.js +4165 -0
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +4168 -0
- package/dist/core-server/presets/common-override-preset.js +81 -0
- package/dist/core-server/presets/common-preset.js +2187 -0
- package/dist/create/bin/index.js +23 -0
- package/dist/create/index.js +25 -0
- package/dist/csf/csf-utils.d.ts +2 -0
- package/dist/csf/csf-utils.js +19 -0
- package/dist/csf/index.d.ts +7 -0
- package/dist/csf/index.js +2142 -0
- package/dist/csf-tools/index.d.ts +1157 -0
- package/dist/csf-tools/index.js +736 -0
- package/dist/docs-tools/index.d.ts +197 -0
- package/dist/docs-tools/index.js +61 -0
- package/dist/highlight/index.d.ts +10 -0
- package/dist/highlight/index.js +15 -0
- package/dist/instrumenter/index.d.ts +113 -0
- package/dist/instrumenter/index.js +2595 -0
- package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
- package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
- package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
- package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
- package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
- package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
- package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
- package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
- package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
- package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
- package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
- package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
- package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
- package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
- package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
- package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
- package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
- package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
- package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
- package/dist/manager/globals-runtime.js +2 -0
- package/dist/manager/globals.d.ts +23 -0
- package/dist/manager/globals.js +26 -0
- package/dist/manager/manager-stores.d.ts +2 -0
- package/dist/manager/manager-stores.js +19 -0
- package/dist/manager/runtime.js +2 -0
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +3257 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +20 -0
- package/dist/mcp/index.d.ts +270 -0
- package/dist/mcp/index.js +305 -0
- package/dist/mocking-utils/index.d.ts +689 -0
- package/dist/mocking-utils/index.js +521 -0
- package/dist/mocking-utils/mocker-runtime.js +1254 -0
- package/dist/nextjs-vite/config/preview.js +3 -0
- package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
- package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
- package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
- package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
- package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
- package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
- package/dist/nextjs-vite/index.d.ts +92 -0
- package/dist/nextjs-vite/index.js +58 -0
- package/dist/nextjs-vite/node/index.d.ts +6 -0
- package/dist/nextjs-vite/node/index.js +20 -0
- package/dist/nextjs-vite/preset.js +648 -0
- package/dist/nextjs-vite/preview.d.ts +20 -0
- package/dist/nextjs-vite/preview.js +11 -0
- package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
- package/dist/nextjs-vite/vite-plugin/index.js +19 -0
- package/dist/nextjs-vite-plugin/index.d.ts +28 -0
- package/dist/nextjs-vite-plugin/index.js +923 -0
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
- package/dist/node-logger/index.d.ts +495 -0
- package/dist/node-logger/index.js +42 -0
- package/dist/oxc-parser/index.d.ts +99 -0
- package/dist/oxc-parser/index.js +275 -0
- package/dist/oxc-parser/worker.js +37 -0
- package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
- package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
- package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
- package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
- package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
- package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
- package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
- package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
- package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
- package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
- package/dist/preview/globals.d.ts +16 -0
- package/dist/preview/globals.js +20 -0
- package/dist/preview/runtime.js +6 -0
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +147 -0
- package/dist/preview-errors.d.ts +186 -0
- package/dist/preview-errors.js +56 -0
- package/dist/react/docgen/docgen-worker.js +38 -0
- package/dist/react/entry-preview-argtypes.js +9 -0
- package/dist/react/entry-preview-docs.js +12 -0
- package/dist/react/entry-preview-rsc.js +11 -0
- package/dist/react/entry-preview.js +21 -0
- package/dist/react/index.d.ts +119 -0
- package/dist/react/index.js +26 -0
- package/dist/react/preset.js +301 -0
- package/dist/react/preview.d.ts +2 -0
- package/dist/react/preview.js +11 -0
- package/dist/react-native/bin/get-stories.js +34 -0
- package/dist/react-native/index.d.ts +160 -0
- package/dist/react-native/index.js +1547 -0
- package/dist/react-native/metro/node.d.ts +83 -0
- package/dist/react-native/metro/node.js +21 -0
- package/dist/react-native/metro/withStorybook.d.ts +2269 -0
- package/dist/react-native/metro/withStorybook.js +138 -0
- package/dist/react-native/preview.d.ts +6 -0
- package/dist/react-native/preview.js +20 -0
- package/dist/react-native/scripts/generate.d.ts +22 -0
- package/dist/react-native/scripts/generate.js +18 -0
- package/dist/react-native/stub.js +20 -0
- package/dist/react-native-theming/index.d.ts +175 -0
- package/dist/react-native-theming/index.js +2591 -0
- package/dist/react-native-ui/index.d.ts +130 -0
- package/dist/react-native-ui/index.js +1448 -0
- package/dist/react-native-ui-common/index.d.ts +230 -0
- package/dist/react-native-ui-common/index.js +514 -0
- package/dist/react-vite/index.d.ts +4 -0
- package/dist/react-vite/index.js +8 -0
- package/dist/react-vite/node/index.d.ts +6 -0
- package/dist/react-vite/node/index.js +20 -0
- package/dist/react-vite/preset.d.ts +6 -0
- package/dist/react-vite/preset.js +21 -0
- package/dist/router/index.d.ts +141 -0
- package/dist/router/index.js +1217 -0
- package/dist/server-errors.d.ts +2 -0
- package/dist/server-errors.js +149 -0
- package/dist/shared/open-service/index.d.ts +3 -0
- package/dist/shared/open-service/index.js +115 -0
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
- package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
- package/dist/shared/open-service/toolsets/docs/public.js +991 -0
- package/dist/telemetry/index.d.ts +314 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/test/index.d.ts +158 -0
- package/dist/test/index.js +19421 -0
- package/dist/theming/create.d.ts +15 -0
- package/dist/theming/create.js +11 -0
- package/dist/theming/index.d.ts +54 -0
- package/dist/theming/index.js +511 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +48 -0
- package/dist/viewport/index.d.ts +275 -0
- package/dist/viewport/index.js +21 -0
- package/package.json +1054 -4
- package/template/nextjs-vite/cli/.eslintrc.json +6 -0
- package/template/nextjs-vite/cli/js/Button.jsx +42 -0
- package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
- package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
- package/template/nextjs-vite/cli/js/Header.jsx +58 -0
- package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
- package/template/nextjs-vite/cli/js/Page.jsx +68 -0
- package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
- package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
- package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
- package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
- package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
- package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
- package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
- package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
- package/template/react/cli/.eslintrc.json +5 -0
- package/template/react/cli/js/Button.jsx +39 -0
- package/template/react/cli/js/Button.stories.js +49 -0
- package/template/react/cli/js/Header.jsx +56 -0
- package/template/react/cli/js/Header.stories.js +29 -0
- package/template/react/cli/js/Page.jsx +69 -0
- package/template/react/cli/js/Page.stories.js +28 -0
- package/template/react/cli/ts/Button.stories.ts +54 -0
- package/template/react/cli/ts/Button.tsx +37 -0
- package/template/react/cli/ts/Header.stories.ts +34 -0
- package/template/react/cli/ts/Header.tsx +56 -0
- package/template/react/cli/ts/Page.stories.ts +33 -0
- package/template/react/cli/ts/Page.tsx +73 -0
- package/template/react-vite/cli/.eslintrc.json +5 -0
- package/template/react-vite/cli/js/Button.jsx +39 -0
- package/template/react-vite/cli/js/Button.stories.js +49 -0
- package/template/react-vite/cli/js/Header.jsx +56 -0
- package/template/react-vite/cli/js/Header.stories.js +29 -0
- package/template/react-vite/cli/js/Page.jsx +69 -0
- package/template/react-vite/cli/js/Page.stories.js +28 -0
- package/template/react-vite/cli/ts/Button.stories.ts +54 -0
- package/template/react-vite/cli/ts/Button.tsx +37 -0
- package/template/react-vite/cli/ts/Header.stories.ts +34 -0
- package/template/react-vite/cli/ts/Header.tsx +56 -0
- package/template/react-vite/cli/ts/Page.stories.ts +33 -0
- package/template/react-vite/cli/ts/Page.tsx +73 -0
|
@@ -0,0 +1,1284 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_ro17f80mg6k from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ro17f80mg6k from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ro17f80mg6k from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ro17f80mg6k.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ro17f80mg6k.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ro17f80mg6k.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Forkbook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
require_supports_color
|
|
14
|
+
} from "../../_node-chunks/chunk-BS2WMZMR.js";
|
|
15
|
+
import {
|
|
16
|
+
__commonJS,
|
|
17
|
+
__require,
|
|
18
|
+
__toESM
|
|
19
|
+
} from "../../_node-chunks/chunk-CXRU72ET.js";
|
|
20
|
+
|
|
21
|
+
// ../../node_modules/make-dir/index.js
|
|
22
|
+
var require_make_dir = __commonJS({
|
|
23
|
+
"../../node_modules/make-dir/index.js"(exports, module) {
|
|
24
|
+
"use strict";
|
|
25
|
+
var fs = __require("fs"), path = __require("path"), { promisify } = __require("util"), semverGte = __require("semver/functions/gte"), useNativeRecursiveOption = semverGte(process.version, "10.12.0"), checkPath = (pth) => {
|
|
26
|
+
if (process.platform === "win32" && /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""))) {
|
|
27
|
+
let error = new Error(`Path contains invalid characters: ${pth}`);
|
|
28
|
+
throw error.code = "EINVAL", error;
|
|
29
|
+
}
|
|
30
|
+
}, processOptions = (options) => ({
|
|
31
|
+
...{
|
|
32
|
+
mode: 511,
|
|
33
|
+
fs
|
|
34
|
+
},
|
|
35
|
+
...options
|
|
36
|
+
}), permissionError = (pth) => {
|
|
37
|
+
let error = new Error(`operation not permitted, mkdir '${pth}'`);
|
|
38
|
+
return error.code = "EPERM", error.errno = -4048, error.path = pth, error.syscall = "mkdir", error;
|
|
39
|
+
}, makeDir = async (input, options) => {
|
|
40
|
+
checkPath(input), options = processOptions(options);
|
|
41
|
+
let mkdir = promisify(options.fs.mkdir), stat = promisify(options.fs.stat);
|
|
42
|
+
if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
|
|
43
|
+
let pth = path.resolve(input);
|
|
44
|
+
return await mkdir(pth, {
|
|
45
|
+
mode: options.mode,
|
|
46
|
+
recursive: !0
|
|
47
|
+
}), pth;
|
|
48
|
+
}
|
|
49
|
+
let make = async (pth) => {
|
|
50
|
+
try {
|
|
51
|
+
return await mkdir(pth, options.mode), pth;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
if (error.code === "EPERM")
|
|
54
|
+
throw error;
|
|
55
|
+
if (error.code === "ENOENT") {
|
|
56
|
+
if (path.dirname(pth) === pth)
|
|
57
|
+
throw permissionError(pth);
|
|
58
|
+
if (error.message.includes("null bytes"))
|
|
59
|
+
throw error;
|
|
60
|
+
return await make(path.dirname(pth)), make(pth);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
if (!(await stat(pth)).isDirectory())
|
|
64
|
+
throw new Error("The path is not a directory");
|
|
65
|
+
} catch {
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
return pth;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return make(path.resolve(input));
|
|
72
|
+
};
|
|
73
|
+
module.exports = makeDir;
|
|
74
|
+
module.exports.sync = (input, options) => {
|
|
75
|
+
if (checkPath(input), options = processOptions(options), useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
|
|
76
|
+
let pth = path.resolve(input);
|
|
77
|
+
return fs.mkdirSync(pth, {
|
|
78
|
+
mode: options.mode,
|
|
79
|
+
recursive: !0
|
|
80
|
+
}), pth;
|
|
81
|
+
}
|
|
82
|
+
let make = (pth) => {
|
|
83
|
+
try {
|
|
84
|
+
options.fs.mkdirSync(pth, options.mode);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
if (error.code === "EPERM")
|
|
87
|
+
throw error;
|
|
88
|
+
if (error.code === "ENOENT") {
|
|
89
|
+
if (path.dirname(pth) === pth)
|
|
90
|
+
throw permissionError(pth);
|
|
91
|
+
if (error.message.includes("null bytes"))
|
|
92
|
+
throw error;
|
|
93
|
+
return make(path.dirname(pth)), make(pth);
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
if (!options.fs.statSync(pth).isDirectory())
|
|
97
|
+
throw new Error("The path is not a directory");
|
|
98
|
+
} catch {
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return pth;
|
|
103
|
+
};
|
|
104
|
+
return make(path.resolve(input));
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// ../../node_modules/istanbul-lib-report/lib/file-writer.js
|
|
110
|
+
var require_file_writer = __commonJS({
|
|
111
|
+
"../../node_modules/istanbul-lib-report/lib/file-writer.js"(exports, module) {
|
|
112
|
+
"use strict";
|
|
113
|
+
var path = __require("path"), fs = __require("fs"), mkdirp = require_make_dir(), supportsColor = require_supports_color(), ContentWriter = class {
|
|
114
|
+
/**
|
|
115
|
+
* returns the colorized version of a string. Typically,
|
|
116
|
+
* content writers that write to files will return the
|
|
117
|
+
* same string and ones writing to a tty will wrap it in
|
|
118
|
+
* appropriate escape sequences.
|
|
119
|
+
* @param {String} str the string to colorize
|
|
120
|
+
* @param {String} clazz one of `high`, `medium` or `low`
|
|
121
|
+
* @returns {String} the colorized form of the string
|
|
122
|
+
*/
|
|
123
|
+
colorize(str) {
|
|
124
|
+
return str;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* writes a string appended with a newline to the destination
|
|
128
|
+
* @param {String} str the string to write
|
|
129
|
+
*/
|
|
130
|
+
println(str) {
|
|
131
|
+
this.write(`${str}
|
|
132
|
+
`);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* closes this content writer. Should be called after all writes are complete.
|
|
136
|
+
*/
|
|
137
|
+
close() {
|
|
138
|
+
}
|
|
139
|
+
}, FileContentWriter = class extends ContentWriter {
|
|
140
|
+
constructor(fd) {
|
|
141
|
+
super(), this.fd = fd;
|
|
142
|
+
}
|
|
143
|
+
write(str) {
|
|
144
|
+
fs.writeSync(this.fd, str);
|
|
145
|
+
}
|
|
146
|
+
close() {
|
|
147
|
+
fs.closeSync(this.fd);
|
|
148
|
+
}
|
|
149
|
+
}, capture = !1, output = "", ConsoleWriter = class extends ContentWriter {
|
|
150
|
+
write(str) {
|
|
151
|
+
capture ? output += str : process.stdout.write(str);
|
|
152
|
+
}
|
|
153
|
+
colorize(str, clazz) {
|
|
154
|
+
let colors = {
|
|
155
|
+
low: "31;1",
|
|
156
|
+
medium: "33;1",
|
|
157
|
+
high: "32;1"
|
|
158
|
+
};
|
|
159
|
+
return supportsColor.stdout && colors[clazz] ? `\x1B[${colors[clazz]}m${str}\x1B[0m` : str;
|
|
160
|
+
}
|
|
161
|
+
}, FileWriter = class _FileWriter {
|
|
162
|
+
constructor(baseDir) {
|
|
163
|
+
if (!baseDir)
|
|
164
|
+
throw new Error("baseDir must be specified");
|
|
165
|
+
this.baseDir = baseDir;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* static helpers for capturing stdout report output;
|
|
169
|
+
* super useful for tests!
|
|
170
|
+
*/
|
|
171
|
+
static startCapture() {
|
|
172
|
+
capture = !0;
|
|
173
|
+
}
|
|
174
|
+
static stopCapture() {
|
|
175
|
+
capture = !1;
|
|
176
|
+
}
|
|
177
|
+
static getOutput() {
|
|
178
|
+
return output;
|
|
179
|
+
}
|
|
180
|
+
static resetOutput() {
|
|
181
|
+
output = "";
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* returns a FileWriter that is rooted at the supplied subdirectory
|
|
185
|
+
* @param {String} subdir the subdirectory under which to root the
|
|
186
|
+
* returned FileWriter
|
|
187
|
+
* @returns {FileWriter}
|
|
188
|
+
*/
|
|
189
|
+
writerForDir(subdir) {
|
|
190
|
+
if (path.isAbsolute(subdir))
|
|
191
|
+
throw new Error(
|
|
192
|
+
`Cannot create subdir writer for absolute path: ${subdir}`
|
|
193
|
+
);
|
|
194
|
+
return new _FileWriter(`${this.baseDir}/${subdir}`);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* copies a file from a source directory to a destination name
|
|
198
|
+
* @param {String} source path to source file
|
|
199
|
+
* @param {String} dest relative path to destination file
|
|
200
|
+
* @param {String} [header=undefined] optional text to prepend to destination
|
|
201
|
+
* (e.g., an "this file is autogenerated" comment, copyright notice, etc.)
|
|
202
|
+
*/
|
|
203
|
+
copyFile(source, dest, header) {
|
|
204
|
+
if (path.isAbsolute(dest))
|
|
205
|
+
throw new Error(`Cannot write to absolute path: ${dest}`);
|
|
206
|
+
dest = path.resolve(this.baseDir, dest), mkdirp.sync(path.dirname(dest));
|
|
207
|
+
let contents;
|
|
208
|
+
header ? contents = header + fs.readFileSync(source, "utf8") : contents = fs.readFileSync(source), fs.writeFileSync(dest, contents);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* returns a content writer for writing content to the supplied file.
|
|
212
|
+
* @param {String|null} file the relative path to the file or the special
|
|
213
|
+
* values `"-"` or `null` for writing to the console
|
|
214
|
+
* @returns {ContentWriter}
|
|
215
|
+
*/
|
|
216
|
+
writeFile(file) {
|
|
217
|
+
if (file === null || file === "-")
|
|
218
|
+
return new ConsoleWriter();
|
|
219
|
+
if (path.isAbsolute(file))
|
|
220
|
+
throw new Error(`Cannot write to absolute path: ${file}`);
|
|
221
|
+
return file = path.resolve(this.baseDir, file), mkdirp.sync(path.dirname(file)), new FileContentWriter(fs.openSync(file, "w"));
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
module.exports = FileWriter;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// ../../node_modules/istanbul-lib-report/lib/xml-writer.js
|
|
229
|
+
var require_xml_writer = __commonJS({
|
|
230
|
+
"../../node_modules/istanbul-lib-report/lib/xml-writer.js"(exports, module) {
|
|
231
|
+
"use strict";
|
|
232
|
+
function attrString(attrs) {
|
|
233
|
+
return Object.entries(attrs || {}).map(([k, v]) => ` ${k}="${v}"`).join("");
|
|
234
|
+
}
|
|
235
|
+
var XMLWriter = class {
|
|
236
|
+
constructor(contentWriter) {
|
|
237
|
+
this.cw = contentWriter, this.stack = [];
|
|
238
|
+
}
|
|
239
|
+
indent(str) {
|
|
240
|
+
return this.stack.map(() => " ").join("") + str;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* writes the opening XML tag with the supplied attributes
|
|
244
|
+
* @param {String} name tag name
|
|
245
|
+
* @param {Object} [attrs=null] attrs attributes for the tag
|
|
246
|
+
*/
|
|
247
|
+
openTag(name, attrs) {
|
|
248
|
+
let str = this.indent(`<${name + attrString(attrs)}>`);
|
|
249
|
+
this.cw.println(str), this.stack.push(name);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* closes an open XML tag.
|
|
253
|
+
* @param {String} name - tag name to close. This must match the writer's
|
|
254
|
+
* notion of the tag that is currently open.
|
|
255
|
+
*/
|
|
256
|
+
closeTag(name) {
|
|
257
|
+
if (this.stack.length === 0)
|
|
258
|
+
throw new Error(`Attempt to close tag ${name} when not opened`);
|
|
259
|
+
let stashed = this.stack.pop(), str = `</${name}>`;
|
|
260
|
+
if (stashed !== name)
|
|
261
|
+
throw new Error(
|
|
262
|
+
`Attempt to close tag ${name} when ${stashed} was the one open`
|
|
263
|
+
);
|
|
264
|
+
this.cw.println(this.indent(str));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* writes a tag and its value opening and closing it at the same time
|
|
268
|
+
* @param {String} name tag name
|
|
269
|
+
* @param {Object} [attrs=null] attrs tag attributes
|
|
270
|
+
* @param {String} [content=null] content optional tag content
|
|
271
|
+
*/
|
|
272
|
+
inlineTag(name, attrs, content) {
|
|
273
|
+
let str = "<" + name + attrString(attrs);
|
|
274
|
+
content ? str += `>${content}</${name}>` : str += "/>", str = this.indent(str), this.cw.println(str);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* closes all open tags and ends the document
|
|
278
|
+
*/
|
|
279
|
+
closeAll() {
|
|
280
|
+
this.stack.slice().reverse().forEach((name) => {
|
|
281
|
+
this.closeTag(name);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
module.exports = XMLWriter;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
// ../../node_modules/istanbul-lib-report/lib/tree.js
|
|
290
|
+
var require_tree = __commonJS({
|
|
291
|
+
"../../node_modules/istanbul-lib-report/lib/tree.js"(exports, module) {
|
|
292
|
+
"use strict";
|
|
293
|
+
var Visitor = class {
|
|
294
|
+
constructor(delegate) {
|
|
295
|
+
this.delegate = delegate;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
["Start", "End", "Summary", "SummaryEnd", "Detail"].map((k) => `on${k}`).forEach((fn) => {
|
|
299
|
+
Object.defineProperty(Visitor.prototype, fn, {
|
|
300
|
+
writable: !0,
|
|
301
|
+
value(node, state) {
|
|
302
|
+
typeof this.delegate[fn] == "function" && this.delegate[fn](node, state);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
var CompositeVisitor = class extends Visitor {
|
|
307
|
+
constructor(visitors) {
|
|
308
|
+
super(), Array.isArray(visitors) || (visitors = [visitors]), this.visitors = visitors.map((v) => v instanceof Visitor ? v : new Visitor(v));
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
["Start", "Summary", "SummaryEnd", "Detail", "End"].map((k) => `on${k}`).forEach((fn) => {
|
|
312
|
+
Object.defineProperty(CompositeVisitor.prototype, fn, {
|
|
313
|
+
value(node, state) {
|
|
314
|
+
this.visitors.forEach((v) => {
|
|
315
|
+
v[fn](node, state);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
var BaseNode = class {
|
|
321
|
+
isRoot() {
|
|
322
|
+
return !this.getParent();
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* visit all nodes depth-first from this node down. Note that `onStart`
|
|
326
|
+
* and `onEnd` are never called on the visitor even if the current
|
|
327
|
+
* node is the root of the tree.
|
|
328
|
+
* @param visitor a full visitor that is called during tree traversal
|
|
329
|
+
* @param state optional state that is passed around
|
|
330
|
+
*/
|
|
331
|
+
visit(visitor, state) {
|
|
332
|
+
this.isSummary() ? visitor.onSummary(this, state) : visitor.onDetail(this, state), this.getChildren().forEach((child) => {
|
|
333
|
+
child.visit(visitor, state);
|
|
334
|
+
}), this.isSummary() && visitor.onSummaryEnd(this, state);
|
|
335
|
+
}
|
|
336
|
+
}, BaseTree = class {
|
|
337
|
+
constructor(root) {
|
|
338
|
+
this.root = root;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* returns the root node of the tree
|
|
342
|
+
*/
|
|
343
|
+
getRoot() {
|
|
344
|
+
return this.root;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* visits the tree depth-first with the supplied partial visitor
|
|
348
|
+
* @param visitor - a potentially partial visitor
|
|
349
|
+
* @param state - the state to be passed around during tree traversal
|
|
350
|
+
*/
|
|
351
|
+
visit(visitor, state) {
|
|
352
|
+
visitor instanceof Visitor || (visitor = new Visitor(visitor)), visitor.onStart(this.getRoot(), state), this.getRoot().visit(visitor, state), visitor.onEnd(this.getRoot(), state);
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
module.exports = {
|
|
356
|
+
BaseTree,
|
|
357
|
+
BaseNode,
|
|
358
|
+
Visitor,
|
|
359
|
+
CompositeVisitor
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
// ../../node_modules/istanbul-lib-report/lib/watermarks.js
|
|
365
|
+
var require_watermarks = __commonJS({
|
|
366
|
+
"../../node_modules/istanbul-lib-report/lib/watermarks.js"(exports, module) {
|
|
367
|
+
"use strict";
|
|
368
|
+
module.exports = {
|
|
369
|
+
getDefault() {
|
|
370
|
+
return {
|
|
371
|
+
statements: [50, 80],
|
|
372
|
+
functions: [50, 80],
|
|
373
|
+
branches: [50, 80],
|
|
374
|
+
lines: [50, 80]
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
// ../../node_modules/istanbul-lib-coverage/lib/percent.js
|
|
382
|
+
var require_percent = __commonJS({
|
|
383
|
+
"../../node_modules/istanbul-lib-coverage/lib/percent.js"(exports, module) {
|
|
384
|
+
"use strict";
|
|
385
|
+
module.exports = function(covered, total) {
|
|
386
|
+
let tmp;
|
|
387
|
+
return total > 0 ? (tmp = 1e3 * 100 * covered / total, Math.floor(tmp / 10) / 100) : 100;
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
// ../../node_modules/istanbul-lib-coverage/lib/data-properties.js
|
|
393
|
+
var require_data_properties = __commonJS({
|
|
394
|
+
"../../node_modules/istanbul-lib-coverage/lib/data-properties.js"(exports, module) {
|
|
395
|
+
"use strict";
|
|
396
|
+
module.exports = function(klass, properties) {
|
|
397
|
+
properties.forEach((p) => {
|
|
398
|
+
Object.defineProperty(klass.prototype, p, {
|
|
399
|
+
enumerable: !0,
|
|
400
|
+
get() {
|
|
401
|
+
return this.data[p];
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
// ../../node_modules/istanbul-lib-coverage/lib/coverage-summary.js
|
|
410
|
+
var require_coverage_summary = __commonJS({
|
|
411
|
+
"../../node_modules/istanbul-lib-coverage/lib/coverage-summary.js"(exports, module) {
|
|
412
|
+
"use strict";
|
|
413
|
+
var percent = require_percent(), dataProperties = require_data_properties();
|
|
414
|
+
function blankSummary() {
|
|
415
|
+
let empty = () => ({
|
|
416
|
+
total: 0,
|
|
417
|
+
covered: 0,
|
|
418
|
+
skipped: 0,
|
|
419
|
+
pct: "Unknown"
|
|
420
|
+
});
|
|
421
|
+
return {
|
|
422
|
+
lines: empty(),
|
|
423
|
+
statements: empty(),
|
|
424
|
+
functions: empty(),
|
|
425
|
+
branches: empty(),
|
|
426
|
+
branchesTrue: empty()
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
function assertValidSummary(obj) {
|
|
430
|
+
if (!(obj && obj.lines && obj.statements && obj.functions && obj.branches))
|
|
431
|
+
throw new Error(
|
|
432
|
+
"Invalid summary coverage object, missing keys, found:" + Object.keys(obj).join(",")
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
var CoverageSummary = class _CoverageSummary {
|
|
436
|
+
/**
|
|
437
|
+
* @constructor
|
|
438
|
+
* @param {Object|CoverageSummary} [obj=undefined] an optional data object or
|
|
439
|
+
* another coverage summary to initialize this object with.
|
|
440
|
+
*/
|
|
441
|
+
constructor(obj) {
|
|
442
|
+
obj ? obj instanceof _CoverageSummary ? this.data = obj.data : this.data = obj : this.data = blankSummary(), assertValidSummary(this.data);
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* merges a second summary coverage object into this one
|
|
446
|
+
* @param {CoverageSummary} obj - another coverage summary object
|
|
447
|
+
*/
|
|
448
|
+
merge(obj) {
|
|
449
|
+
return [
|
|
450
|
+
"lines",
|
|
451
|
+
"statements",
|
|
452
|
+
"branches",
|
|
453
|
+
"functions",
|
|
454
|
+
"branchesTrue"
|
|
455
|
+
].forEach((key) => {
|
|
456
|
+
obj[key] && (this[key].total += obj[key].total, this[key].covered += obj[key].covered, this[key].skipped += obj[key].skipped, this[key].pct = percent(this[key].covered, this[key].total));
|
|
457
|
+
}), this;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* returns a POJO that is JSON serializable. May be used to get the raw
|
|
461
|
+
* summary object.
|
|
462
|
+
*/
|
|
463
|
+
toJSON() {
|
|
464
|
+
return this.data;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* return true if summary has no lines of code
|
|
468
|
+
*/
|
|
469
|
+
isEmpty() {
|
|
470
|
+
return this.lines.total === 0;
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
dataProperties(CoverageSummary, [
|
|
474
|
+
"lines",
|
|
475
|
+
"statements",
|
|
476
|
+
"functions",
|
|
477
|
+
"branches",
|
|
478
|
+
"branchesTrue"
|
|
479
|
+
]);
|
|
480
|
+
module.exports = {
|
|
481
|
+
CoverageSummary
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// ../../node_modules/istanbul-lib-coverage/lib/file-coverage.js
|
|
487
|
+
var require_file_coverage = __commonJS({
|
|
488
|
+
"../../node_modules/istanbul-lib-coverage/lib/file-coverage.js"(exports, module) {
|
|
489
|
+
"use strict";
|
|
490
|
+
var percent = require_percent(), dataProperties = require_data_properties(), { CoverageSummary } = require_coverage_summary();
|
|
491
|
+
function emptyCoverage(filePath, reportLogic) {
|
|
492
|
+
let cov = {
|
|
493
|
+
path: filePath,
|
|
494
|
+
statementMap: {},
|
|
495
|
+
fnMap: {},
|
|
496
|
+
branchMap: {},
|
|
497
|
+
s: {},
|
|
498
|
+
f: {},
|
|
499
|
+
b: {}
|
|
500
|
+
};
|
|
501
|
+
return reportLogic && (cov.bT = {}), cov;
|
|
502
|
+
}
|
|
503
|
+
function assertValidObject(obj) {
|
|
504
|
+
if (!(obj && obj.path && obj.statementMap && obj.fnMap && obj.branchMap && obj.s && obj.f && obj.b))
|
|
505
|
+
throw new Error(
|
|
506
|
+
"Invalid file coverage object, missing keys, found:" + Object.keys(obj).join(",")
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
var keyFromLoc = ({ start, end }) => `${start.line}|${start.column}|${end.line}|${end.column}`, isObj = (o) => !!o && typeof o == "object", isLineCol = (o) => isObj(o) && typeof o.line == "number" && typeof o.column == "number", isLoc = (o) => isObj(o) && isLineCol(o.start) && isLineCol(o.end), getLoc = (o) => isLoc(o) ? o : isLoc(o.loc) ? o.loc : null, findNearestContainer = (item, map) => {
|
|
510
|
+
let itemLoc = getLoc(item);
|
|
511
|
+
if (!itemLoc) return null;
|
|
512
|
+
let nearestContainingItem = null, containerDistance = null, containerKey = null;
|
|
513
|
+
for (let [i, mapItem] of Object.entries(map)) {
|
|
514
|
+
let mapLoc = getLoc(mapItem);
|
|
515
|
+
if (!mapLoc) continue;
|
|
516
|
+
let distance = [
|
|
517
|
+
itemLoc.start.line - mapLoc.start.line,
|
|
518
|
+
itemLoc.start.column - mapLoc.start.column,
|
|
519
|
+
mapLoc.end.line - itemLoc.end.line,
|
|
520
|
+
mapLoc.end.column - itemLoc.end.column
|
|
521
|
+
];
|
|
522
|
+
if (distance[0] < 0 || distance[2] < 0 || distance[0] === 0 && distance[1] < 0 || distance[2] === 0 && distance[3] < 0)
|
|
523
|
+
continue;
|
|
524
|
+
if (nearestContainingItem === null) {
|
|
525
|
+
containerDistance = distance, nearestContainingItem = mapItem, containerKey = i;
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
let closerBefore = distance[0] < containerDistance[0] || distance[0] === 0 && distance[1] < containerDistance[1], closerAfter = distance[2] < containerDistance[2] || distance[2] === 0 && distance[3] < containerDistance[3];
|
|
529
|
+
(closerBefore || closerAfter) && (containerDistance = distance, nearestContainingItem = mapItem, containerKey = i);
|
|
530
|
+
}
|
|
531
|
+
return containerKey;
|
|
532
|
+
}, addHits = (aHits, bHits) => typeof aHits == "number" && typeof bHits == "number" ? aHits + bHits : Array.isArray(aHits) && Array.isArray(bHits) ? aHits.map((a, i) => (a || 0) + (bHits[i] || 0)) : null, addNearestContainerHits = (item, itemHits, map, mapHits) => {
|
|
533
|
+
let container = findNearestContainer(item, map);
|
|
534
|
+
return container ? addHits(itemHits, mapHits[container]) : itemHits;
|
|
535
|
+
}, mergeProp = (aHits, aMap, bHits, bMap, itemKey = keyFromLoc) => {
|
|
536
|
+
let aItems = {};
|
|
537
|
+
for (let [key, itemHits] of Object.entries(aHits)) {
|
|
538
|
+
let item = aMap[key];
|
|
539
|
+
aItems[itemKey(item)] = [itemHits, item];
|
|
540
|
+
}
|
|
541
|
+
let bItems = {};
|
|
542
|
+
for (let [key, itemHits] of Object.entries(bHits)) {
|
|
543
|
+
let item = bMap[key];
|
|
544
|
+
bItems[itemKey(item)] = [itemHits, item];
|
|
545
|
+
}
|
|
546
|
+
let mergedItems = {};
|
|
547
|
+
for (let [key, aValue] of Object.entries(aItems)) {
|
|
548
|
+
let aItemHits = aValue[0], aItem = aValue[1], bValue = bItems[key];
|
|
549
|
+
bValue ? aItemHits = addHits(aItemHits, bValue[0]) : aItemHits = addNearestContainerHits(aItem, aItemHits, bMap, bHits), mergedItems[key] = [aItemHits, aItem];
|
|
550
|
+
}
|
|
551
|
+
for (let [key, bValue] of Object.entries(bItems)) {
|
|
552
|
+
let bItemHits = bValue[0], bItem = bValue[1];
|
|
553
|
+
mergedItems[key] || (bItemHits = addNearestContainerHits(bItem, bItemHits, aMap, aHits), mergedItems[key] = [bItemHits, bItem]);
|
|
554
|
+
}
|
|
555
|
+
let hits = {}, map = {};
|
|
556
|
+
return Object.values(mergedItems).forEach(([itemHits, item], i) => {
|
|
557
|
+
hits[i] = itemHits, map[i] = item;
|
|
558
|
+
}), [hits, map];
|
|
559
|
+
}, FileCoverage = class _FileCoverage {
|
|
560
|
+
/**
|
|
561
|
+
* @constructor
|
|
562
|
+
* @param {Object|FileCoverage|String} pathOrObj is a string that initializes
|
|
563
|
+
* and empty coverage object with the specified file path or a data object that
|
|
564
|
+
* has all the required properties for a file coverage object.
|
|
565
|
+
*/
|
|
566
|
+
constructor(pathOrObj, reportLogic = !1) {
|
|
567
|
+
if (!pathOrObj)
|
|
568
|
+
throw new Error(
|
|
569
|
+
"Coverage must be initialized with a path or an object"
|
|
570
|
+
);
|
|
571
|
+
if (typeof pathOrObj == "string")
|
|
572
|
+
this.data = emptyCoverage(pathOrObj, reportLogic);
|
|
573
|
+
else if (pathOrObj instanceof _FileCoverage)
|
|
574
|
+
this.data = pathOrObj.data;
|
|
575
|
+
else if (typeof pathOrObj == "object")
|
|
576
|
+
this.data = pathOrObj;
|
|
577
|
+
else
|
|
578
|
+
throw new Error("Invalid argument to coverage constructor");
|
|
579
|
+
assertValidObject(this.data);
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* returns computed line coverage from statement coverage.
|
|
583
|
+
* This is a map of hits keyed by line number in the source.
|
|
584
|
+
*/
|
|
585
|
+
getLineCoverage() {
|
|
586
|
+
let statementMap = this.data.statementMap, statements = this.data.s, lineMap = /* @__PURE__ */ Object.create(null);
|
|
587
|
+
return Object.entries(statements).forEach(([st, count]) => {
|
|
588
|
+
if (!statementMap[st])
|
|
589
|
+
return;
|
|
590
|
+
let { line } = statementMap[st].start, prevVal = lineMap[line];
|
|
591
|
+
(prevVal === void 0 || prevVal < count) && (lineMap[line] = count);
|
|
592
|
+
}), lineMap;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* returns an array of uncovered line numbers.
|
|
596
|
+
* @returns {Array} an array of line numbers for which no hits have been
|
|
597
|
+
* collected.
|
|
598
|
+
*/
|
|
599
|
+
getUncoveredLines() {
|
|
600
|
+
let lc = this.getLineCoverage(), ret = [];
|
|
601
|
+
return Object.entries(lc).forEach(([l, hits]) => {
|
|
602
|
+
hits === 0 && ret.push(l);
|
|
603
|
+
}), ret;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* returns a map of branch coverage by source line number.
|
|
607
|
+
* @returns {Object} an object keyed by line number. Each object
|
|
608
|
+
* has a `covered`, `total` and `coverage` (percentage) property.
|
|
609
|
+
*/
|
|
610
|
+
getBranchCoverageByLine() {
|
|
611
|
+
let branchMap = this.branchMap, branches = this.b, ret = {};
|
|
612
|
+
return Object.entries(branchMap).forEach(([k, map]) => {
|
|
613
|
+
let line = map.line || map.loc.start.line, branchData = branches[k];
|
|
614
|
+
ret[line] = ret[line] || [], ret[line].push(...branchData);
|
|
615
|
+
}), Object.entries(ret).forEach(([k, dataArray]) => {
|
|
616
|
+
let covered = dataArray.filter((item) => item > 0), coverage = covered.length / dataArray.length * 100;
|
|
617
|
+
ret[k] = {
|
|
618
|
+
covered: covered.length,
|
|
619
|
+
total: dataArray.length,
|
|
620
|
+
coverage
|
|
621
|
+
};
|
|
622
|
+
}), ret;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* return a JSON-serializable POJO for this file coverage object
|
|
626
|
+
*/
|
|
627
|
+
toJSON() {
|
|
628
|
+
return this.data;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* merges a second coverage object into this one, updating hit counts
|
|
632
|
+
* @param {FileCoverage} other - the coverage object to be merged into this one.
|
|
633
|
+
* Note that the other object should have the same structure as this one (same file).
|
|
634
|
+
*/
|
|
635
|
+
merge(other) {
|
|
636
|
+
if (other.all === !0)
|
|
637
|
+
return;
|
|
638
|
+
if (this.all === !0) {
|
|
639
|
+
this.data = other.data;
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
let [hits, map] = mergeProp(
|
|
643
|
+
this.s,
|
|
644
|
+
this.statementMap,
|
|
645
|
+
other.s,
|
|
646
|
+
other.statementMap
|
|
647
|
+
);
|
|
648
|
+
this.data.s = hits, this.data.statementMap = map;
|
|
649
|
+
let keyFromLocProp = (x) => keyFromLoc(x.loc), keyFromLocationsProp = (x) => keyFromLoc(x.locations[0]);
|
|
650
|
+
[hits, map] = mergeProp(
|
|
651
|
+
this.f,
|
|
652
|
+
this.fnMap,
|
|
653
|
+
other.f,
|
|
654
|
+
other.fnMap,
|
|
655
|
+
keyFromLocProp
|
|
656
|
+
), this.data.f = hits, this.data.fnMap = map, [hits, map] = mergeProp(
|
|
657
|
+
this.b,
|
|
658
|
+
this.branchMap,
|
|
659
|
+
other.b,
|
|
660
|
+
other.branchMap,
|
|
661
|
+
keyFromLocationsProp
|
|
662
|
+
), this.data.b = hits, this.data.branchMap = map, this.bT && other.bT && ([hits, map] = mergeProp(
|
|
663
|
+
this.bT,
|
|
664
|
+
this.branchMap,
|
|
665
|
+
other.bT,
|
|
666
|
+
other.branchMap,
|
|
667
|
+
keyFromLocationsProp
|
|
668
|
+
), this.data.bT = hits);
|
|
669
|
+
}
|
|
670
|
+
computeSimpleTotals(property) {
|
|
671
|
+
let stats = this[property];
|
|
672
|
+
typeof stats == "function" && (stats = stats.call(this));
|
|
673
|
+
let ret = {
|
|
674
|
+
total: Object.keys(stats).length,
|
|
675
|
+
covered: Object.values(stats).filter((v) => !!v).length,
|
|
676
|
+
skipped: 0
|
|
677
|
+
};
|
|
678
|
+
return ret.pct = percent(ret.covered, ret.total), ret;
|
|
679
|
+
}
|
|
680
|
+
computeBranchTotals(property) {
|
|
681
|
+
let stats = this[property], ret = { total: 0, covered: 0, skipped: 0 };
|
|
682
|
+
return Object.values(stats).forEach((branches) => {
|
|
683
|
+
ret.covered += branches.filter((hits) => hits > 0).length, ret.total += branches.length;
|
|
684
|
+
}), ret.pct = percent(ret.covered, ret.total), ret;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* resets hit counts for all statements, functions and branches
|
|
688
|
+
* in this coverage object resulting in zero coverage.
|
|
689
|
+
*/
|
|
690
|
+
resetHits() {
|
|
691
|
+
let statements = this.s, functions = this.f, branches = this.b, branchesTrue = this.bT;
|
|
692
|
+
Object.keys(statements).forEach((s) => {
|
|
693
|
+
statements[s] = 0;
|
|
694
|
+
}), Object.keys(functions).forEach((f) => {
|
|
695
|
+
functions[f] = 0;
|
|
696
|
+
}), Object.keys(branches).forEach((b) => {
|
|
697
|
+
branches[b].fill(0);
|
|
698
|
+
}), branchesTrue && Object.keys(branchesTrue).forEach((bT) => {
|
|
699
|
+
branchesTrue[bT].fill(0);
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* returns a CoverageSummary for this file coverage object
|
|
704
|
+
* @returns {CoverageSummary}
|
|
705
|
+
*/
|
|
706
|
+
toSummary() {
|
|
707
|
+
let ret = {};
|
|
708
|
+
return ret.lines = this.computeSimpleTotals("getLineCoverage"), ret.functions = this.computeSimpleTotals("f", "fnMap"), ret.statements = this.computeSimpleTotals("s", "statementMap"), ret.branches = this.computeBranchTotals("b"), this.bT && (ret.branchesTrue = this.computeBranchTotals("bT")), new CoverageSummary(ret);
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
dataProperties(FileCoverage, [
|
|
712
|
+
"path",
|
|
713
|
+
"statementMap",
|
|
714
|
+
"fnMap",
|
|
715
|
+
"branchMap",
|
|
716
|
+
"s",
|
|
717
|
+
"f",
|
|
718
|
+
"b",
|
|
719
|
+
"bT",
|
|
720
|
+
"all"
|
|
721
|
+
]);
|
|
722
|
+
module.exports = {
|
|
723
|
+
FileCoverage,
|
|
724
|
+
// exported for testing
|
|
725
|
+
findNearestContainer,
|
|
726
|
+
addHits,
|
|
727
|
+
addNearestContainerHits
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
// ../../node_modules/istanbul-lib-coverage/lib/coverage-map.js
|
|
733
|
+
var require_coverage_map = __commonJS({
|
|
734
|
+
"../../node_modules/istanbul-lib-coverage/lib/coverage-map.js"(exports, module) {
|
|
735
|
+
"use strict";
|
|
736
|
+
var { FileCoverage } = require_file_coverage(), { CoverageSummary } = require_coverage_summary();
|
|
737
|
+
function maybeConstruct(obj, klass) {
|
|
738
|
+
return obj instanceof klass ? obj : new klass(obj);
|
|
739
|
+
}
|
|
740
|
+
function loadMap(source) {
|
|
741
|
+
let data = /* @__PURE__ */ Object.create(null);
|
|
742
|
+
return source && Object.entries(source).forEach(([k, cov]) => {
|
|
743
|
+
data[k] = maybeConstruct(cov, FileCoverage);
|
|
744
|
+
}), data;
|
|
745
|
+
}
|
|
746
|
+
var CoverageMap = class _CoverageMap {
|
|
747
|
+
/**
|
|
748
|
+
* @constructor
|
|
749
|
+
* @param {Object} [obj=undefined] obj A coverage map from which to initialize this
|
|
750
|
+
* map's contents. This can be the raw global coverage object.
|
|
751
|
+
*/
|
|
752
|
+
constructor(obj) {
|
|
753
|
+
obj instanceof _CoverageMap ? this.data = obj.data : this.data = loadMap(obj);
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* merges a second coverage map into this one
|
|
757
|
+
* @param {CoverageMap} obj - a CoverageMap or its raw data. Coverage is merged
|
|
758
|
+
* correctly for the same files and additional file coverage keys are created
|
|
759
|
+
* as needed.
|
|
760
|
+
*/
|
|
761
|
+
merge(obj) {
|
|
762
|
+
let other = maybeConstruct(obj, _CoverageMap);
|
|
763
|
+
Object.values(other.data).forEach((fc) => {
|
|
764
|
+
this.addFileCoverage(fc);
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* filter the coveragemap based on the callback provided
|
|
769
|
+
* @param {Function (filename)} callback - Returns true if the path
|
|
770
|
+
* should be included in the coveragemap. False if it should be
|
|
771
|
+
* removed.
|
|
772
|
+
*/
|
|
773
|
+
filter(callback) {
|
|
774
|
+
Object.keys(this.data).forEach((k) => {
|
|
775
|
+
callback(k) || delete this.data[k];
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* returns a JSON-serializable POJO for this coverage map
|
|
780
|
+
* @returns {Object}
|
|
781
|
+
*/
|
|
782
|
+
toJSON() {
|
|
783
|
+
return this.data;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* returns an array for file paths for which this map has coverage
|
|
787
|
+
* @returns {Array{string}} - array of files
|
|
788
|
+
*/
|
|
789
|
+
files() {
|
|
790
|
+
return Object.keys(this.data);
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* returns the file coverage for the specified file.
|
|
794
|
+
* @param {String} file
|
|
795
|
+
* @returns {FileCoverage}
|
|
796
|
+
*/
|
|
797
|
+
fileCoverageFor(file) {
|
|
798
|
+
let fc = this.data[file];
|
|
799
|
+
if (!fc)
|
|
800
|
+
throw new Error(`No file coverage available for: ${file}`);
|
|
801
|
+
return fc;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* adds a file coverage object to this map. If the path for the object,
|
|
805
|
+
* already exists in the map, it is merged with the existing coverage
|
|
806
|
+
* otherwise a new key is added to the map.
|
|
807
|
+
* @param {FileCoverage} fc the file coverage to add
|
|
808
|
+
*/
|
|
809
|
+
addFileCoverage(fc) {
|
|
810
|
+
let cov = new FileCoverage(fc), { path } = cov;
|
|
811
|
+
this.data[path] ? this.data[path].merge(cov) : this.data[path] = cov;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* returns the coverage summary for all the file coverage objects in this map.
|
|
815
|
+
* @returns {CoverageSummary}
|
|
816
|
+
*/
|
|
817
|
+
getCoverageSummary() {
|
|
818
|
+
let ret = new CoverageSummary();
|
|
819
|
+
return Object.values(this.data).forEach((fc) => {
|
|
820
|
+
ret.merge(fc.toSummary());
|
|
821
|
+
}), ret;
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
module.exports = {
|
|
825
|
+
CoverageMap
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
// ../../node_modules/istanbul-lib-coverage/index.js
|
|
831
|
+
var require_istanbul_lib_coverage = __commonJS({
|
|
832
|
+
"../../node_modules/istanbul-lib-coverage/index.js"(exports, module) {
|
|
833
|
+
"use strict";
|
|
834
|
+
var { FileCoverage } = require_file_coverage(), { CoverageMap } = require_coverage_map(), { CoverageSummary } = require_coverage_summary();
|
|
835
|
+
module.exports = {
|
|
836
|
+
/**
|
|
837
|
+
* creates a coverage summary object
|
|
838
|
+
* @param {Object} obj an argument with the same semantics
|
|
839
|
+
* as the one passed to the `CoverageSummary` constructor
|
|
840
|
+
* @returns {CoverageSummary}
|
|
841
|
+
*/
|
|
842
|
+
createCoverageSummary(obj) {
|
|
843
|
+
return obj && obj instanceof CoverageSummary ? obj : new CoverageSummary(obj);
|
|
844
|
+
},
|
|
845
|
+
/**
|
|
846
|
+
* creates a CoverageMap object
|
|
847
|
+
* @param {Object} obj optional - an argument with the same semantics
|
|
848
|
+
* as the one passed to the CoverageMap constructor.
|
|
849
|
+
* @returns {CoverageMap}
|
|
850
|
+
*/
|
|
851
|
+
createCoverageMap(obj) {
|
|
852
|
+
return obj && obj instanceof CoverageMap ? obj : new CoverageMap(obj);
|
|
853
|
+
},
|
|
854
|
+
/**
|
|
855
|
+
* creates a FileCoverage object
|
|
856
|
+
* @param {Object} obj optional - an argument with the same semantics
|
|
857
|
+
* as the one passed to the FileCoverage constructor.
|
|
858
|
+
* @returns {FileCoverage}
|
|
859
|
+
*/
|
|
860
|
+
createFileCoverage(obj) {
|
|
861
|
+
return obj && obj instanceof FileCoverage ? obj : new FileCoverage(obj);
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
module.exports.classes = {
|
|
865
|
+
/**
|
|
866
|
+
* the file coverage constructor
|
|
867
|
+
*/
|
|
868
|
+
FileCoverage
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
// ../../node_modules/istanbul-lib-report/lib/path.js
|
|
874
|
+
var require_path = __commonJS({
|
|
875
|
+
"../../node_modules/istanbul-lib-report/lib/path.js"(exports, module) {
|
|
876
|
+
"use strict";
|
|
877
|
+
var path = __require("path"), parsePath = path.parse, SEP = path.sep, origParser = parsePath, origSep = SEP;
|
|
878
|
+
function makeRelativeNormalizedPath(str, sep) {
|
|
879
|
+
let parsed = parsePath(str), root = parsed.root, dir, file = parsed.base, quoted, pos;
|
|
880
|
+
return sep === "\\" && (pos = root.indexOf(":\\"), pos >= 0 && (root = root.substring(0, pos + 2))), dir = parsed.dir.substring(root.length), str === "" ? [] : (sep !== "/" && (quoted = new RegExp(sep.replace(/\W/g, "\\$&"), "g"), dir = dir.replace(quoted, "/"), file = file.replace(quoted, "/")), dir !== "" ? dir = `${dir}/${file}` : dir = file, dir.substring(0, 1) === "/" && (dir = dir.substring(1)), dir = dir.split(/\/+/), dir);
|
|
881
|
+
}
|
|
882
|
+
var Path = class _Path {
|
|
883
|
+
constructor(strOrArray) {
|
|
884
|
+
if (Array.isArray(strOrArray))
|
|
885
|
+
this.v = strOrArray;
|
|
886
|
+
else if (typeof strOrArray == "string")
|
|
887
|
+
this.v = makeRelativeNormalizedPath(strOrArray, SEP);
|
|
888
|
+
else
|
|
889
|
+
throw new Error(
|
|
890
|
+
`Invalid Path argument must be string or array:${strOrArray}`
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
toString() {
|
|
894
|
+
return this.v.join("/");
|
|
895
|
+
}
|
|
896
|
+
hasParent() {
|
|
897
|
+
return this.v.length > 0;
|
|
898
|
+
}
|
|
899
|
+
parent() {
|
|
900
|
+
if (!this.hasParent())
|
|
901
|
+
throw new Error("Unable to get parent for 0 elem path");
|
|
902
|
+
let p = this.v.slice();
|
|
903
|
+
return p.pop(), new _Path(p);
|
|
904
|
+
}
|
|
905
|
+
elements() {
|
|
906
|
+
return this.v.slice();
|
|
907
|
+
}
|
|
908
|
+
name() {
|
|
909
|
+
return this.v.slice(-1)[0];
|
|
910
|
+
}
|
|
911
|
+
contains(other) {
|
|
912
|
+
let i;
|
|
913
|
+
if (other.length > this.length)
|
|
914
|
+
return !1;
|
|
915
|
+
for (i = 0; i < other.length; i += 1)
|
|
916
|
+
if (this.v[i] !== other.v[i])
|
|
917
|
+
return !1;
|
|
918
|
+
return !0;
|
|
919
|
+
}
|
|
920
|
+
ancestorOf(other) {
|
|
921
|
+
return other.contains(this) && other.length !== this.length;
|
|
922
|
+
}
|
|
923
|
+
descendantOf(other) {
|
|
924
|
+
return this.contains(other) && other.length !== this.length;
|
|
925
|
+
}
|
|
926
|
+
commonPrefixPath(other) {
|
|
927
|
+
let len = this.length > other.length ? other.length : this.length, i, ret = [];
|
|
928
|
+
for (i = 0; i < len && this.v[i] === other.v[i]; i += 1)
|
|
929
|
+
ret.push(this.v[i]);
|
|
930
|
+
return new _Path(ret);
|
|
931
|
+
}
|
|
932
|
+
static compare(a, b) {
|
|
933
|
+
let al = a.length, bl = b.length;
|
|
934
|
+
if (al < bl)
|
|
935
|
+
return -1;
|
|
936
|
+
if (al > bl)
|
|
937
|
+
return 1;
|
|
938
|
+
let astr = a.toString(), bstr = b.toString();
|
|
939
|
+
return astr < bstr ? -1 : astr > bstr ? 1 : 0;
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
["push", "pop", "shift", "unshift", "splice"].forEach((fn) => {
|
|
943
|
+
Object.defineProperty(Path.prototype, fn, {
|
|
944
|
+
value(...args) {
|
|
945
|
+
return this.v[fn](...args);
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
});
|
|
949
|
+
Object.defineProperty(Path.prototype, "length", {
|
|
950
|
+
enumerable: !0,
|
|
951
|
+
get() {
|
|
952
|
+
return this.v.length;
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
module.exports = Path;
|
|
956
|
+
Path.tester = {
|
|
957
|
+
setParserAndSep(p, sep) {
|
|
958
|
+
parsePath = p, SEP = sep;
|
|
959
|
+
},
|
|
960
|
+
reset() {
|
|
961
|
+
parsePath = origParser, SEP = origSep;
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
|
|
967
|
+
// ../../node_modules/istanbul-lib-report/lib/summarizer-factory.js
|
|
968
|
+
var require_summarizer_factory = __commonJS({
|
|
969
|
+
"../../node_modules/istanbul-lib-report/lib/summarizer-factory.js"(exports, module) {
|
|
970
|
+
"use strict";
|
|
971
|
+
var coverage = require_istanbul_lib_coverage(), Path = require_path(), { BaseNode, BaseTree } = require_tree(), ReportNode = class _ReportNode extends BaseNode {
|
|
972
|
+
constructor(path, fileCoverage) {
|
|
973
|
+
super(), this.path = path, this.parent = null, this.fileCoverage = fileCoverage, this.children = [];
|
|
974
|
+
}
|
|
975
|
+
static createRoot(children) {
|
|
976
|
+
let root = new _ReportNode(new Path([]));
|
|
977
|
+
return children.forEach((child) => {
|
|
978
|
+
root.addChild(child);
|
|
979
|
+
}), root;
|
|
980
|
+
}
|
|
981
|
+
addChild(child) {
|
|
982
|
+
child.parent = this, this.children.push(child);
|
|
983
|
+
}
|
|
984
|
+
asRelative(p) {
|
|
985
|
+
return p.substring(0, 1) === "/" ? p.substring(1) : p;
|
|
986
|
+
}
|
|
987
|
+
getQualifiedName() {
|
|
988
|
+
return this.asRelative(this.path.toString());
|
|
989
|
+
}
|
|
990
|
+
getRelativeName() {
|
|
991
|
+
let parent = this.getParent(), myPath = this.path, relPath, i, parentPath = parent ? parent.path : new Path([]);
|
|
992
|
+
if (parentPath.ancestorOf(myPath)) {
|
|
993
|
+
for (relPath = new Path(myPath.elements()), i = 0; i < parentPath.length; i += 1)
|
|
994
|
+
relPath.shift();
|
|
995
|
+
return this.asRelative(relPath.toString());
|
|
996
|
+
}
|
|
997
|
+
return this.asRelative(this.path.toString());
|
|
998
|
+
}
|
|
999
|
+
getParent() {
|
|
1000
|
+
return this.parent;
|
|
1001
|
+
}
|
|
1002
|
+
getChildren() {
|
|
1003
|
+
return this.children;
|
|
1004
|
+
}
|
|
1005
|
+
isSummary() {
|
|
1006
|
+
return !this.fileCoverage;
|
|
1007
|
+
}
|
|
1008
|
+
getFileCoverage() {
|
|
1009
|
+
return this.fileCoverage;
|
|
1010
|
+
}
|
|
1011
|
+
getCoverageSummary(filesOnly) {
|
|
1012
|
+
let cacheProp = `c_${filesOnly ? "files" : "full"}`, summary;
|
|
1013
|
+
if (Object.prototype.hasOwnProperty.call(this, cacheProp))
|
|
1014
|
+
return this[cacheProp];
|
|
1015
|
+
if (!this.isSummary())
|
|
1016
|
+
summary = this.getFileCoverage().toSummary();
|
|
1017
|
+
else {
|
|
1018
|
+
let count = 0;
|
|
1019
|
+
summary = coverage.createCoverageSummary(), this.getChildren().forEach((child) => {
|
|
1020
|
+
filesOnly && child.isSummary() || (count += 1, summary.merge(child.getCoverageSummary(filesOnly)));
|
|
1021
|
+
}), count === 0 && filesOnly && (summary = null);
|
|
1022
|
+
}
|
|
1023
|
+
return this[cacheProp] = summary, summary;
|
|
1024
|
+
}
|
|
1025
|
+
}, ReportTree = class extends BaseTree {
|
|
1026
|
+
constructor(root, childPrefix) {
|
|
1027
|
+
super(root);
|
|
1028
|
+
let maybePrefix = (node) => {
|
|
1029
|
+
childPrefix && !node.isRoot() && node.path.unshift(childPrefix);
|
|
1030
|
+
};
|
|
1031
|
+
this.visit({
|
|
1032
|
+
onDetail: maybePrefix,
|
|
1033
|
+
onSummary(node) {
|
|
1034
|
+
maybePrefix(node), node.children.sort((a, b) => {
|
|
1035
|
+
let astr = a.path.toString(), bstr = b.path.toString();
|
|
1036
|
+
return astr < bstr ? -1 : astr > bstr ? 1 : (
|
|
1037
|
+
/* istanbul ignore next */
|
|
1038
|
+
0
|
|
1039
|
+
);
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
function findCommonParent(paths) {
|
|
1046
|
+
return paths.reduce(
|
|
1047
|
+
(common, path) => common.commonPrefixPath(path),
|
|
1048
|
+
paths[0] || new Path([])
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
function findOrCreateParent(parentPath, nodeMap, created = () => {
|
|
1052
|
+
}) {
|
|
1053
|
+
let parent = nodeMap[parentPath.toString()];
|
|
1054
|
+
return parent || (parent = new ReportNode(parentPath), nodeMap[parentPath.toString()] = parent, created(parentPath, parent)), parent;
|
|
1055
|
+
}
|
|
1056
|
+
function toDirParents(list) {
|
|
1057
|
+
let nodeMap = /* @__PURE__ */ Object.create(null);
|
|
1058
|
+
return list.forEach((o) => {
|
|
1059
|
+
findOrCreateParent(o.path.parent(), nodeMap).addChild(new ReportNode(o.path, o.fileCoverage));
|
|
1060
|
+
}), Object.values(nodeMap);
|
|
1061
|
+
}
|
|
1062
|
+
function addAllPaths(topPaths, nodeMap, path, node) {
|
|
1063
|
+
findOrCreateParent(
|
|
1064
|
+
path.parent(),
|
|
1065
|
+
nodeMap,
|
|
1066
|
+
(parentPath, parent2) => {
|
|
1067
|
+
parentPath.hasParent() ? addAllPaths(topPaths, nodeMap, parentPath, parent2) : topPaths.push(parent2);
|
|
1068
|
+
}
|
|
1069
|
+
).addChild(node);
|
|
1070
|
+
}
|
|
1071
|
+
function foldIntoOneDir(node, parent) {
|
|
1072
|
+
let { children } = node;
|
|
1073
|
+
return children.length === 1 && !children[0].fileCoverage ? (children[0].parent = parent, foldIntoOneDir(children[0], parent)) : (node.children = children.map((child) => foldIntoOneDir(child, node)), node);
|
|
1074
|
+
}
|
|
1075
|
+
function pkgSummaryPrefix(dirParents, commonParent) {
|
|
1076
|
+
if (dirParents.some((dp) => dp.path.length === 0))
|
|
1077
|
+
return commonParent.length === 0 ? "root" : commonParent.name();
|
|
1078
|
+
}
|
|
1079
|
+
var SummarizerFactory = class {
|
|
1080
|
+
constructor(coverageMap, defaultSummarizer = "pkg") {
|
|
1081
|
+
this._coverageMap = coverageMap, this._defaultSummarizer = defaultSummarizer, this._initialList = coverageMap.files().map((filePath) => ({
|
|
1082
|
+
filePath,
|
|
1083
|
+
path: new Path(filePath),
|
|
1084
|
+
fileCoverage: coverageMap.fileCoverageFor(filePath)
|
|
1085
|
+
})), this._commonParent = findCommonParent(
|
|
1086
|
+
this._initialList.map((o) => o.path.parent())
|
|
1087
|
+
), this._commonParent.length > 0 && this._initialList.forEach((o) => {
|
|
1088
|
+
o.path.splice(0, this._commonParent.length);
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
get defaultSummarizer() {
|
|
1092
|
+
return this[this._defaultSummarizer];
|
|
1093
|
+
}
|
|
1094
|
+
get flat() {
|
|
1095
|
+
return this._flat || (this._flat = new ReportTree(
|
|
1096
|
+
ReportNode.createRoot(
|
|
1097
|
+
this._initialList.map(
|
|
1098
|
+
(node) => new ReportNode(node.path, node.fileCoverage)
|
|
1099
|
+
)
|
|
1100
|
+
)
|
|
1101
|
+
)), this._flat;
|
|
1102
|
+
}
|
|
1103
|
+
_createPkg() {
|
|
1104
|
+
let dirParents = toDirParents(this._initialList);
|
|
1105
|
+
return dirParents.length === 1 ? new ReportTree(dirParents[0]) : new ReportTree(
|
|
1106
|
+
ReportNode.createRoot(dirParents),
|
|
1107
|
+
pkgSummaryPrefix(dirParents, this._commonParent)
|
|
1108
|
+
);
|
|
1109
|
+
}
|
|
1110
|
+
get pkg() {
|
|
1111
|
+
return this._pkg || (this._pkg = this._createPkg()), this._pkg;
|
|
1112
|
+
}
|
|
1113
|
+
_createNested() {
|
|
1114
|
+
let nodeMap = /* @__PURE__ */ Object.create(null), topPaths = [];
|
|
1115
|
+
this._initialList.forEach((o) => {
|
|
1116
|
+
let node = new ReportNode(o.path, o.fileCoverage);
|
|
1117
|
+
addAllPaths(topPaths, nodeMap, o.path, node);
|
|
1118
|
+
});
|
|
1119
|
+
let topNodes = topPaths.map((node) => foldIntoOneDir(node));
|
|
1120
|
+
return topNodes.length === 1 ? new ReportTree(topNodes[0]) : new ReportTree(ReportNode.createRoot(topNodes));
|
|
1121
|
+
}
|
|
1122
|
+
get nested() {
|
|
1123
|
+
return this._nested || (this._nested = this._createNested()), this._nested;
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
module.exports = SummarizerFactory;
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
// ../../node_modules/istanbul-lib-report/lib/context.js
|
|
1131
|
+
var require_context = __commonJS({
|
|
1132
|
+
"../../node_modules/istanbul-lib-report/lib/context.js"(exports, module) {
|
|
1133
|
+
"use strict";
|
|
1134
|
+
var fs = __require("fs"), FileWriter = require_file_writer(), XMLWriter = require_xml_writer(), tree = require_tree(), watermarks = require_watermarks(), SummarizerFactory = require_summarizer_factory();
|
|
1135
|
+
function defaultSourceLookup(path) {
|
|
1136
|
+
try {
|
|
1137
|
+
return fs.readFileSync(path, "utf8");
|
|
1138
|
+
} catch (ex) {
|
|
1139
|
+
throw new Error(`Unable to lookup source: ${path} (${ex.message})`);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
function normalizeWatermarks(specified = {}) {
|
|
1143
|
+
return Object.entries(watermarks.getDefault()).forEach(([k, value]) => {
|
|
1144
|
+
let specValue = specified[k];
|
|
1145
|
+
(!Array.isArray(specValue) || specValue.length !== 2) && (specified[k] = value);
|
|
1146
|
+
}), specified;
|
|
1147
|
+
}
|
|
1148
|
+
var Context = class {
|
|
1149
|
+
constructor(opts) {
|
|
1150
|
+
this.dir = opts.dir || "coverage", this.watermarks = normalizeWatermarks(opts.watermarks), this.sourceFinder = opts.sourceFinder || defaultSourceLookup, this._summarizerFactory = new SummarizerFactory(
|
|
1151
|
+
opts.coverageMap,
|
|
1152
|
+
opts.defaultSummarizer
|
|
1153
|
+
), this.data = {};
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* returns a FileWriter implementation for reporting use. Also available
|
|
1157
|
+
* as the `writer` property on the context.
|
|
1158
|
+
* @returns {Writer}
|
|
1159
|
+
*/
|
|
1160
|
+
getWriter() {
|
|
1161
|
+
return this.writer;
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* returns the source code for the specified file path or throws if
|
|
1165
|
+
* the source could not be found.
|
|
1166
|
+
* @param {String} filePath the file path as found in a file coverage object
|
|
1167
|
+
* @returns {String} the source code
|
|
1168
|
+
*/
|
|
1169
|
+
getSource(filePath) {
|
|
1170
|
+
return this.sourceFinder(filePath);
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* returns the coverage class given a coverage
|
|
1174
|
+
* types and a percentage value.
|
|
1175
|
+
* @param {String} type - the coverage type, one of `statements`, `functions`,
|
|
1176
|
+
* `branches`, or `lines`
|
|
1177
|
+
* @param {Number} value - the percentage value
|
|
1178
|
+
* @returns {String} one of `high`, `medium` or `low`
|
|
1179
|
+
*/
|
|
1180
|
+
classForPercent(type, value) {
|
|
1181
|
+
let watermarks2 = this.watermarks[type];
|
|
1182
|
+
return watermarks2 ? value < watermarks2[0] ? "low" : value >= watermarks2[1] ? "high" : "medium" : "unknown";
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* returns an XML writer for the supplied content writer
|
|
1186
|
+
* @param {ContentWriter} contentWriter the content writer to which the returned XML writer
|
|
1187
|
+
* writes data
|
|
1188
|
+
* @returns {XMLWriter}
|
|
1189
|
+
*/
|
|
1190
|
+
getXMLWriter(contentWriter) {
|
|
1191
|
+
return new XMLWriter(contentWriter);
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* returns a full visitor given a partial one.
|
|
1195
|
+
* @param {Object} partialVisitor a partial visitor only having the functions of
|
|
1196
|
+
* interest to the caller. These functions are called with a scope that is the
|
|
1197
|
+
* supplied object.
|
|
1198
|
+
* @returns {Visitor}
|
|
1199
|
+
*/
|
|
1200
|
+
getVisitor(partialVisitor) {
|
|
1201
|
+
return new tree.Visitor(partialVisitor);
|
|
1202
|
+
}
|
|
1203
|
+
getTree(name = "defaultSummarizer") {
|
|
1204
|
+
return this._summarizerFactory[name];
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
Object.defineProperty(Context.prototype, "writer", {
|
|
1208
|
+
enumerable: !0,
|
|
1209
|
+
get() {
|
|
1210
|
+
return this.data.writer || (this.data.writer = new FileWriter(this.dir)), this.data.writer;
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
module.exports = Context;
|
|
1214
|
+
}
|
|
1215
|
+
});
|
|
1216
|
+
|
|
1217
|
+
// ../../node_modules/istanbul-lib-report/lib/report-base.js
|
|
1218
|
+
var require_report_base = __commonJS({
|
|
1219
|
+
"../../node_modules/istanbul-lib-report/lib/report-base.js"(exports, module) {
|
|
1220
|
+
"use strict";
|
|
1221
|
+
var _summarizer = /* @__PURE__ */ Symbol("ReportBase.#summarizer"), ReportBase2 = class {
|
|
1222
|
+
constructor(opts = {}) {
|
|
1223
|
+
this[_summarizer] = opts.summarizer;
|
|
1224
|
+
}
|
|
1225
|
+
execute(context) {
|
|
1226
|
+
context.getTree(this[_summarizer]).visit(this, context);
|
|
1227
|
+
}
|
|
1228
|
+
};
|
|
1229
|
+
module.exports = ReportBase2;
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
|
|
1233
|
+
// ../../node_modules/istanbul-lib-report/index.js
|
|
1234
|
+
var require_istanbul_lib_report = __commonJS({
|
|
1235
|
+
"../../node_modules/istanbul-lib-report/index.js"(exports, module) {
|
|
1236
|
+
"use strict";
|
|
1237
|
+
var Context = require_context(), watermarks = require_watermarks(), ReportBase2 = require_report_base();
|
|
1238
|
+
module.exports = {
|
|
1239
|
+
/**
|
|
1240
|
+
* returns a reporting context for the supplied options
|
|
1241
|
+
* @param {Object} [opts=null] opts
|
|
1242
|
+
* @returns {Context}
|
|
1243
|
+
*/
|
|
1244
|
+
createContext(opts) {
|
|
1245
|
+
return new Context(opts);
|
|
1246
|
+
},
|
|
1247
|
+
/**
|
|
1248
|
+
* returns the default watermarks that would be used when not
|
|
1249
|
+
* overridden
|
|
1250
|
+
* @returns {Object} an object with `statements`, `functions`, `branches`,
|
|
1251
|
+
* and `line` keys. Each value is a 2 element array that has the low and
|
|
1252
|
+
* high watermark as percentages.
|
|
1253
|
+
*/
|
|
1254
|
+
getDefaultWatermarks() {
|
|
1255
|
+
return watermarks.getDefault();
|
|
1256
|
+
},
|
|
1257
|
+
/**
|
|
1258
|
+
* Base class for all reports
|
|
1259
|
+
*/
|
|
1260
|
+
ReportBase: ReportBase2
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
|
|
1265
|
+
// src/addon-vitest/node/coverage-reporter.ts
|
|
1266
|
+
var import_istanbul_lib_report = __toESM(require_istanbul_lib_report(), 1), StorybookCoverageReporter = class extends import_istanbul_lib_report.ReportBase {
|
|
1267
|
+
#testManager;
|
|
1268
|
+
constructor(opts) {
|
|
1269
|
+
super(), this.#testManager = opts.testManager;
|
|
1270
|
+
}
|
|
1271
|
+
onSummary(node) {
|
|
1272
|
+
if (!node.isRoot())
|
|
1273
|
+
return;
|
|
1274
|
+
let rawCoverageSummary = node.getCoverageSummary(!1), percentage = Math.round(rawCoverageSummary.data.statements.pct), [lowWatermark = 50, highWatermark = 80] = this.#testManager.vitestManager.vitest?.config.coverage.watermarks?.statements ?? [], coverageSummary = {
|
|
1275
|
+
percentage,
|
|
1276
|
+
status: percentage < lowWatermark ? "negative" : percentage < highWatermark ? "warning" : "positive"
|
|
1277
|
+
};
|
|
1278
|
+
this.#testManager.onCoverageCollected(coverageSummary);
|
|
1279
|
+
}
|
|
1280
|
+
}, coverage_reporter_default = StorybookCoverageReporter;
|
|
1281
|
+
export {
|
|
1282
|
+
coverage_reporter_default as default,
|
|
1283
|
+
StorybookCoverageReporter as "module.exports"
|
|
1284
|
+
};
|