powerlines 0.9.0 → 0.10.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/dist/astro.cjs +9 -9
- package/dist/astro.d.cts +2 -1
- package/dist/astro.d.ts +2 -1
- package/dist/astro.js +6 -6
- package/dist/{chunk-3L4KRPXQ.cjs → chunk-2RHPFVYT.cjs} +17 -18
- package/dist/{chunk-VQ5O5N7V.js → chunk-3Y5CCIJR.js} +3 -3
- package/dist/{chunk-YE56I7CZ.cjs → chunk-5XYGZ3DC.cjs} +2 -2
- package/dist/{chunk-V4TNA6HX.js → chunk-5Y4JYQ66.js} +3 -3
- package/dist/{chunk-WM76YQJH.cjs → chunk-66GXB2UY.cjs} +4 -4
- package/dist/{chunk-VOB62ELC.js → chunk-6TJGZR5X.js} +4 -4
- package/dist/{chunk-OKC6TA7P.js → chunk-6UDHGAAI.js} +3 -3
- package/dist/{chunk-ETEQKM36.cjs → chunk-7IWH37DY.cjs} +2 -2
- package/dist/{chunk-BDTLKRKQ.js → chunk-EGSEJQCE.js} +3 -3
- package/dist/{chunk-ILVCZATT.js → chunk-GPPJ2CRE.js} +2 -2
- package/dist/{chunk-RGJMMCOR.js → chunk-HVT7PBFF.js} +3 -3
- package/dist/chunk-IJBH5OUN.cjs +12 -0
- package/dist/chunk-JBTSAOIQ.js +31 -0
- package/dist/{chunk-W3NQCDUN.js → chunk-KYGEWAEG.js} +3 -3
- package/dist/{chunk-FOLQTZUP.cjs → chunk-L2SAK2JC.cjs} +4 -4
- package/dist/chunk-LXMNDUPG.cjs +12 -0
- package/dist/{chunk-GHW2FUF5.js → chunk-N7NE3VOU.js} +4 -4
- package/dist/{chunk-OEL3BTQP.js → chunk-OYIM2M74.js} +547 -522
- package/dist/{chunk-QK36ULYT.cjs → chunk-QHGPZK2H.cjs} +4 -4
- package/dist/chunk-RQ4CHMPO.cjs +12 -0
- package/dist/chunk-S5QFX2GM.cjs +12 -0
- package/dist/{chunk-IOBFVFH2.js → chunk-S746E63M.js} +3 -3
- package/dist/{chunk-MKZOY5EV.js → chunk-SDEBJQDT.js} +12 -13
- package/dist/chunk-SL3CXJWD.cjs +34 -0
- package/dist/{chunk-KC4VY5X4.cjs → chunk-UHCRNFFC.cjs} +9 -9
- package/dist/{chunk-ZQZ5ZUGG.cjs → chunk-UTVZVGM3.cjs} +555 -530
- package/dist/{chunk-QIKKQQF7.cjs → chunk-UZQYBO6Z.cjs} +4 -4
- package/dist/{chunk-65PSZQFC.js → chunk-VIRKTIPK.js} +3 -3
- package/dist/{chunk-UYS3BU6I.js → chunk-WCPY7HPU.js} +4 -4
- package/dist/{chunk-MMDBMHAW.js → chunk-WPVIF35O.js} +2 -2
- package/dist/chunk-YG7U2GIR.cjs +24 -0
- package/dist/{chunk-BY4UTCHZ.cjs → chunk-ZBDP43LG.cjs} +6 -6
- package/dist/chunk-ZFATNDSY.cjs +12 -0
- package/dist/{chunk-C3I5QEF5.js → chunk-ZU4IRZSQ.js} +7 -7
- package/dist/define-config.d.cts +2 -1
- package/dist/define-config.d.ts +2 -1
- package/dist/esbuild.cjs +8 -8
- package/dist/esbuild.d.cts +2 -1
- package/dist/esbuild.d.ts +2 -1
- package/dist/esbuild.js +5 -5
- package/dist/extend-plugin.d.cts +2 -1
- package/dist/extend-plugin.d.ts +2 -1
- package/dist/farm.cjs +4 -4
- package/dist/farm.d.cts +2 -1
- package/dist/farm.d.ts +2 -1
- package/dist/farm.js +3 -3
- package/dist/{hooks-D0gf1nT3.d.ts → hooks-BGYnc61f.d.ts} +1 -1
- package/dist/{hooks-fVJu9DCF.d.cts → hooks-gk8S8LFP.d.cts} +1 -1
- package/dist/index.cjs +27 -27
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +18 -18
- package/dist/internal/api.cjs +3 -3
- package/dist/internal/api.d.cts +3 -2
- package/dist/internal/api.d.ts +3 -2
- package/dist/internal/api.js +2 -2
- package/dist/lib/build/esbuild.cjs +4 -4
- package/dist/lib/build/esbuild.d.cts +2 -1
- package/dist/lib/build/esbuild.d.ts +2 -1
- package/dist/lib/build/esbuild.js +1 -1
- package/dist/lib/build/index.cjs +25 -25
- package/dist/lib/build/index.d.cts +3 -2
- package/dist/lib/build/index.d.ts +3 -2
- package/dist/lib/build/index.js +9 -9
- package/dist/lib/build/rolldown.cjs +3 -3
- package/dist/lib/build/rolldown.d.cts +2 -1
- package/dist/lib/build/rolldown.d.ts +2 -1
- package/dist/lib/build/rolldown.js +2 -2
- package/dist/lib/build/rollup.cjs +3 -3
- package/dist/lib/build/rollup.d.cts +2 -1
- package/dist/lib/build/rollup.d.ts +2 -1
- package/dist/lib/build/rollup.js +1 -1
- package/dist/lib/build/rspack.cjs +2 -2
- package/dist/lib/build/rspack.d.cts +2 -1
- package/dist/lib/build/rspack.d.ts +2 -1
- package/dist/lib/build/rspack.js +1 -1
- package/dist/lib/build/tsup.cjs +5 -5
- package/dist/lib/build/tsup.d.cts +2 -1
- package/dist/lib/build/tsup.d.ts +2 -1
- package/dist/lib/build/tsup.js +2 -2
- package/dist/lib/build/unbuild.cjs +6 -6
- package/dist/lib/build/unbuild.d.cts +3 -2
- package/dist/lib/build/unbuild.d.ts +3 -2
- package/dist/lib/build/unbuild.js +3 -3
- package/dist/lib/build/vite.cjs +4 -4
- package/dist/lib/build/vite.d.cts +2 -1
- package/dist/lib/build/vite.d.ts +2 -1
- package/dist/lib/build/vite.js +2 -2
- package/dist/lib/build/webpack.cjs +2 -2
- package/dist/lib/build/webpack.d.cts +2 -1
- package/dist/lib/build/webpack.d.ts +2 -1
- package/dist/lib/build/webpack.js +1 -1
- package/dist/lib/{chunk-7CZ2QZEV.js → chunk-3I2YOM2E.js} +4 -4
- package/dist/lib/chunk-3I2YOM2E.js.map +1 -0
- package/dist/lib/{chunk-KAOWUIFH.cjs → chunk-4XUVP2LL.cjs} +3 -3
- package/dist/lib/chunk-4XUVP2LL.cjs.map +1 -0
- package/dist/lib/{chunk-ZKYZWEHY.cjs → chunk-6U2UX2PX.cjs} +4 -4
- package/dist/lib/chunk-6U2UX2PX.cjs.map +1 -0
- package/dist/lib/{chunk-VRNWPH35.cjs → chunk-7EAV6Q7B.cjs} +10 -9
- package/dist/lib/chunk-7EAV6Q7B.cjs.map +1 -0
- package/dist/lib/{chunk-ZYBUJ2HE.js → chunk-CAPN4FSS.js} +7 -7
- package/dist/lib/chunk-CAPN4FSS.js.map +1 -0
- package/dist/lib/{chunk-LTBRHAQ2.cjs → chunk-GJNFAFKR.cjs} +4 -4
- package/dist/lib/chunk-GJNFAFKR.cjs.map +1 -0
- package/dist/lib/{chunk-VANFTXBT.cjs → chunk-GWYTWFZE.cjs} +7 -7
- package/dist/lib/chunk-GWYTWFZE.cjs.map +1 -0
- package/dist/lib/{chunk-DKE25WTL.js → chunk-HQ6TGY34.js} +2 -2
- package/dist/lib/chunk-HQ6TGY34.js.map +1 -0
- package/dist/lib/{chunk-QSBORJCS.js → chunk-HZDOJWUO.js} +6 -6
- package/dist/lib/chunk-HZDOJWUO.js.map +1 -0
- package/dist/lib/{chunk-ECJPGNXE.cjs → chunk-IK3ABDPP.cjs} +2 -2
- package/dist/lib/chunk-IK3ABDPP.cjs.map +1 -0
- package/dist/lib/{chunk-G5DJO4HA.cjs → chunk-JTUL3477.cjs} +5 -5
- package/dist/lib/chunk-JTUL3477.cjs.map +1 -0
- package/dist/lib/{chunk-E7UTFXPP.js → chunk-KFE2IR3Y.js} +4 -4
- package/dist/lib/chunk-KFE2IR3Y.js.map +1 -0
- package/dist/lib/{chunk-RY67J24J.js → chunk-KSBESEOF.js} +2 -2
- package/dist/lib/chunk-KSBESEOF.js.map +1 -0
- package/dist/lib/{chunk-26W3IQT6.js → chunk-LTVWU4J2.js} +5 -5
- package/dist/lib/chunk-LTVWU4J2.js.map +1 -0
- package/dist/lib/{chunk-GWAVDFOE.js → chunk-M7U5RMK7.js} +8 -6
- package/dist/lib/chunk-M7U5RMK7.js.map +1 -0
- package/dist/lib/{chunk-YQG6JE5R.cjs → chunk-M7WHFUKR.cjs} +549 -527
- package/dist/lib/chunk-M7WHFUKR.cjs.map +1 -0
- package/dist/lib/{chunk-EOO7IRCI.js → chunk-MAHHHINV.js} +3 -3
- package/dist/lib/chunk-MAHHHINV.js.map +1 -0
- package/dist/lib/{chunk-7FQQFIHR.cjs → chunk-NANLYIUO.cjs} +4 -4
- package/dist/lib/chunk-NANLYIUO.cjs.map +1 -0
- package/dist/lib/{chunk-TNCZYSNV.js → chunk-NE46WXNJ.js} +2 -2
- package/dist/lib/chunk-NE46WXNJ.js.map +1 -0
- package/dist/lib/{chunk-QGJVGFY4.js → chunk-OF5IJ4WG.js} +6 -6
- package/dist/lib/chunk-OF5IJ4WG.js.map +1 -0
- package/dist/lib/{chunk-6IEUZ5DZ.js → chunk-PIFE7MUZ.js} +525 -503
- package/dist/lib/chunk-PIFE7MUZ.js.map +1 -0
- package/dist/lib/{chunk-2ZYHO243.js → chunk-PXSRMP4E.js} +2 -2
- package/dist/lib/chunk-PXSRMP4E.js.map +1 -0
- package/dist/lib/{chunk-CXYZENE4.js → chunk-Q2L3FNJO.js} +13 -7
- package/dist/lib/chunk-Q2L3FNJO.js.map +1 -0
- package/dist/lib/{chunk-XFIGAAKN.cjs → chunk-Q2RUDKWY.cjs} +8 -6
- package/dist/lib/chunk-Q2RUDKWY.cjs.map +1 -0
- package/dist/lib/{chunk-NFDRIBCM.js → chunk-Q3KJZ3B5.js} +5 -7
- package/dist/lib/chunk-Q3KJZ3B5.js.map +1 -0
- package/dist/lib/{chunk-FHZJQZOE.cjs → chunk-QXJHCA3E.cjs} +7 -7
- package/dist/lib/chunk-QXJHCA3E.cjs.map +1 -0
- package/dist/lib/{chunk-TZFBE35T.cjs → chunk-RQICHHZM.cjs} +2 -2
- package/dist/lib/chunk-RQICHHZM.cjs.map +1 -0
- package/dist/lib/{chunk-7MXG5EG2.js → chunk-RXQWNSZX.js} +3 -3
- package/dist/lib/chunk-RXQWNSZX.js.map +1 -0
- package/dist/lib/{chunk-I6A564OE.cjs → chunk-U36VZLW6.cjs} +2 -2
- package/dist/lib/chunk-U36VZLW6.cjs.map +1 -0
- package/dist/lib/{chunk-65DUUIIF.cjs → chunk-UQJWVRRE.cjs} +2 -2
- package/dist/lib/chunk-UQJWVRRE.cjs.map +1 -0
- package/dist/lib/{chunk-XHCRXNQ3.cjs → chunk-V5OY4ALI.cjs} +5 -5
- package/dist/lib/chunk-V5OY4ALI.cjs.map +1 -0
- package/dist/lib/{chunk-I3I4BYJ4.js → chunk-VJN72T2O.js} +5 -5
- package/dist/lib/chunk-VJN72T2O.js.map +1 -0
- package/dist/lib/{chunk-KACTPBW2.cjs → chunk-W4OMKQ7W.cjs} +14 -8
- package/dist/lib/chunk-W4OMKQ7W.cjs.map +1 -0
- package/dist/lib/{chunk-SB3NFYXT.cjs → chunk-XZD7S5TU.cjs} +5 -5
- package/dist/lib/chunk-XZD7S5TU.cjs.map +1 -0
- package/dist/lib/{chunk-PJKWY74P.js → chunk-YBIWVB66.js} +10 -9
- package/dist/lib/chunk-YBIWVB66.js.map +1 -0
- package/dist/lib/{chunk-JXIRUV56.js → chunk-YF3YHK4X.js} +5 -5
- package/dist/lib/chunk-YF3YHK4X.js.map +1 -0
- package/dist/lib/{chunk-TJQEGHJA.cjs → chunk-YVDJCVE5.cjs} +12 -12
- package/dist/lib/chunk-YVDJCVE5.cjs.map +1 -0
- package/dist/lib/{chunk-M2TB43VG.cjs → chunk-ZP7PDTVE.cjs} +7 -9
- package/dist/lib/chunk-ZP7PDTVE.cjs.map +1 -0
- package/dist/lib/{config-BOPIY57U.d.cts → config-AuIGsUck.d.cts} +110 -106
- package/dist/lib/{config-Chd_3Uh3.d.ts → config-B_WTwd49.d.ts} +110 -106
- package/dist/lib/config-file.d.cts +2 -1
- package/dist/lib/config-file.d.ts +2 -1
- package/dist/lib/entry.d.cts +2 -1
- package/dist/lib/entry.d.ts +2 -1
- package/dist/lib/{hooks-DkVRKYVN.d.cts → hooks-4KkL9GD2.d.cts} +1 -1
- package/dist/lib/{hooks-56fQP2HY.d.ts → hooks-DErK4Fv4.d.ts} +1 -1
- package/dist/lib/index.cjs +36 -36
- package/dist/lib/index.d.cts +3 -2
- package/dist/lib/index.d.ts +3 -2
- package/dist/lib/index.js +11 -11
- package/dist/lib/logger.d.cts +2 -1
- package/dist/lib/logger.d.ts +2 -1
- package/dist/lib/typescript/compiler-host.cjs +6 -6
- package/dist/lib/typescript/compiler-host.cjs.map +1 -1
- package/dist/lib/typescript/compiler-host.d.cts +2 -1
- package/dist/lib/typescript/compiler-host.d.ts +2 -1
- package/dist/lib/typescript/compiler-host.js +5 -5
- package/dist/lib/typescript/compiler-host.js.map +1 -1
- package/dist/lib/typescript/import-transformer.cjs +1 -1
- package/dist/lib/typescript/import-transformer.cjs.map +1 -1
- package/dist/lib/typescript/import-transformer.d.cts +2 -1
- package/dist/lib/typescript/import-transformer.d.ts +2 -1
- package/dist/lib/typescript/import-transformer.js +1 -1
- package/dist/lib/typescript/import-transformer.js.map +1 -1
- package/dist/lib/typescript/index.cjs +6 -6
- package/dist/lib/typescript/index.d.cts +2 -1
- package/dist/lib/typescript/index.d.ts +2 -1
- package/dist/lib/typescript/index.js +1 -1
- package/dist/lib/typescript/program.cjs +6 -6
- package/dist/lib/typescript/program.d.cts +2 -1
- package/dist/lib/typescript/program.d.ts +2 -1
- package/dist/lib/typescript/program.js +1 -1
- package/dist/lib/unplugin/factory.cjs +6 -6
- package/dist/lib/unplugin/factory.d.cts +3 -2
- package/dist/lib/unplugin/factory.d.ts +3 -2
- package/dist/lib/unplugin/factory.js +5 -5
- package/dist/lib/unplugin/index.cjs +9 -9
- package/dist/lib/unplugin/index.d.cts +3 -2
- package/dist/lib/unplugin/index.d.ts +3 -2
- package/dist/lib/unplugin/index.js +6 -6
- package/dist/lib/unplugin/plugin.cjs +4 -4
- package/dist/lib/unplugin/plugin.d.cts +2 -1
- package/dist/lib/unplugin/plugin.d.ts +2 -1
- package/dist/lib/unplugin/plugin.js +3 -3
- package/dist/lib/unplugin/resolve-id.cjs +2 -2
- package/dist/lib/unplugin/resolve-id.d.cts +2 -1
- package/dist/lib/unplugin/resolve-id.d.ts +2 -1
- package/dist/lib/unplugin/resolve-id.js +1 -1
- package/dist/lib/utilities/cache.cjs +4 -4
- package/dist/lib/utilities/cache.js +2 -2
- package/dist/lib/utilities/file-header.d.cts +2 -1
- package/dist/lib/utilities/file-header.d.ts +2 -1
- package/dist/lib/utilities/index.cjs +24 -24
- package/dist/lib/utilities/index.d.cts +2 -1
- package/dist/lib/utilities/index.d.ts +2 -1
- package/dist/lib/utilities/index.js +7 -7
- package/dist/lib/utilities/meta.cjs +8 -8
- package/dist/lib/utilities/meta.d.cts +2 -1
- package/dist/lib/utilities/meta.d.ts +2 -1
- package/dist/lib/utilities/meta.js +1 -1
- package/dist/lib/utilities/plugin-helpers.d.cts +2 -1
- package/dist/lib/utilities/plugin-helpers.d.ts +2 -1
- package/dist/lib/utilities/resolve-path.cjs +2 -2
- package/dist/lib/utilities/resolve-path.d.cts +2 -1
- package/dist/lib/utilities/resolve-path.d.ts +2 -1
- package/dist/lib/utilities/resolve-path.js +1 -1
- package/dist/lib/utilities/source-file.cjs +4 -4
- package/dist/lib/utilities/source-file.js +1 -1
- package/dist/lib/utilities/source-map.cjs +2 -2
- package/dist/lib/utilities/source-map.js +1 -1
- package/dist/lib/utilities/worker.cjs +3 -3
- package/dist/lib/utilities/worker.d.cts +2 -1
- package/dist/lib/utilities/worker.d.ts +2 -1
- package/dist/lib/utilities/worker.js +1 -1
- package/dist/lib/utilities/write-file.cjs +2 -2
- package/dist/lib/utilities/write-file.d.cts +2 -1
- package/dist/lib/utilities/write-file.d.ts +2 -1
- package/dist/lib/utilities/write-file.js +1 -1
- package/dist/next.cjs +8 -8
- package/dist/next.js +5 -5
- package/dist/nuxt.cjs +10 -10
- package/dist/nuxt.js +7 -7
- package/dist/{resolved-NZTd64-O.d.cts → resolved-CcuVqMqc.d.cts} +28 -3
- package/dist/{resolved-DhHHMnUD.d.ts → resolved-Dhscmo3z.d.ts} +28 -3
- package/dist/rolldown.cjs +7 -7
- package/dist/rolldown.d.cts +2 -1
- package/dist/rolldown.d.ts +2 -1
- package/dist/rolldown.js +4 -4
- package/dist/rollup.cjs +7 -7
- package/dist/rollup.d.cts +2 -1
- package/dist/rollup.d.ts +2 -1
- package/dist/rollup.js +4 -4
- package/dist/rspack.cjs +7 -7
- package/dist/rspack.d.cts +2 -1
- package/dist/rspack.d.ts +2 -1
- package/dist/rspack.js +4 -4
- package/dist/tsup.cjs +9 -9
- package/dist/tsup.js +6 -6
- package/dist/types/babel.d.cts +2 -1
- package/dist/types/babel.d.ts +2 -1
- package/dist/types/commands.d.cts +2 -1
- package/dist/types/commands.d.ts +2 -1
- package/dist/types/compiler.d.cts +2 -1
- package/dist/types/compiler.d.ts +2 -1
- package/dist/types/config.d.cts +2 -1
- package/dist/types/config.d.ts +2 -1
- package/dist/types/context.cjs +2 -2
- package/dist/types/context.d.cts +2 -1
- package/dist/types/context.d.ts +2 -1
- package/dist/types/context.js +1 -1
- package/dist/types/hooks.d.cts +2 -1
- package/dist/types/hooks.d.ts +2 -1
- package/dist/types/index.cjs +9 -9
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.js +2 -2
- package/dist/types/internal.d.cts +3 -2
- package/dist/types/internal.d.ts +3 -2
- package/dist/types/plugin.d.cts +2 -1
- package/dist/types/plugin.d.ts +2 -1
- package/dist/types/resolved.d.cts +2 -1
- package/dist/types/resolved.d.ts +2 -1
- package/dist/types/unplugin.d.cts +2 -1
- package/dist/types/unplugin.d.ts +2 -1
- package/dist/types/vfs.cjs +7 -7
- package/dist/types/vfs.d.cts +93 -111
- package/dist/types/vfs.d.ts +93 -111
- package/dist/types/vfs.js +1 -1
- package/dist/unloader.cjs +7 -7
- package/dist/unloader.d.cts +2 -1
- package/dist/unloader.d.ts +2 -1
- package/dist/unloader.js +4 -4
- package/dist/unplugin.cjs +19 -19
- package/dist/unplugin.d.cts +3 -2
- package/dist/unplugin.d.ts +3 -2
- package/dist/unplugin.js +16 -16
- package/dist/vite.cjs +8 -8
- package/dist/vite.d.cts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.js +5 -5
- package/dist/webpack.cjs +7 -7
- package/dist/webpack.d.cts +2 -1
- package/dist/webpack.d.ts +2 -1
- package/dist/webpack.js +4 -4
- package/package.json +9 -9
- package/dist/chunk-4JUWHOFJ.cjs +0 -12
- package/dist/chunk-ARHKVB3S.cjs +0 -12
- package/dist/chunk-JCXSBKRJ.js +0 -31
- package/dist/chunk-NRMXL6VA.cjs +0 -34
- package/dist/chunk-QKXJRYA5.cjs +0 -12
- package/dist/chunk-STLRGAW6.cjs +0 -24
- package/dist/chunk-TJIHTRP5.cjs +0 -12
- package/dist/chunk-VES34CLG.cjs +0 -12
- package/dist/lib/chunk-26W3IQT6.js.map +0 -1
- package/dist/lib/chunk-2ZYHO243.js.map +0 -1
- package/dist/lib/chunk-65DUUIIF.cjs.map +0 -1
- package/dist/lib/chunk-6IEUZ5DZ.js.map +0 -1
- package/dist/lib/chunk-7CZ2QZEV.js.map +0 -1
- package/dist/lib/chunk-7FQQFIHR.cjs.map +0 -1
- package/dist/lib/chunk-7MXG5EG2.js.map +0 -1
- package/dist/lib/chunk-CXYZENE4.js.map +0 -1
- package/dist/lib/chunk-DKE25WTL.js.map +0 -1
- package/dist/lib/chunk-E7UTFXPP.js.map +0 -1
- package/dist/lib/chunk-ECJPGNXE.cjs.map +0 -1
- package/dist/lib/chunk-EOO7IRCI.js.map +0 -1
- package/dist/lib/chunk-FHZJQZOE.cjs.map +0 -1
- package/dist/lib/chunk-G5DJO4HA.cjs.map +0 -1
- package/dist/lib/chunk-GWAVDFOE.js.map +0 -1
- package/dist/lib/chunk-I3I4BYJ4.js.map +0 -1
- package/dist/lib/chunk-I6A564OE.cjs.map +0 -1
- package/dist/lib/chunk-JXIRUV56.js.map +0 -1
- package/dist/lib/chunk-KACTPBW2.cjs.map +0 -1
- package/dist/lib/chunk-KAOWUIFH.cjs.map +0 -1
- package/dist/lib/chunk-LTBRHAQ2.cjs.map +0 -1
- package/dist/lib/chunk-M2TB43VG.cjs.map +0 -1
- package/dist/lib/chunk-NFDRIBCM.js.map +0 -1
- package/dist/lib/chunk-PJKWY74P.js.map +0 -1
- package/dist/lib/chunk-QGJVGFY4.js.map +0 -1
- package/dist/lib/chunk-QSBORJCS.js.map +0 -1
- package/dist/lib/chunk-RY67J24J.js.map +0 -1
- package/dist/lib/chunk-SB3NFYXT.cjs.map +0 -1
- package/dist/lib/chunk-TJQEGHJA.cjs.map +0 -1
- package/dist/lib/chunk-TNCZYSNV.js.map +0 -1
- package/dist/lib/chunk-TZFBE35T.cjs.map +0 -1
- package/dist/lib/chunk-VANFTXBT.cjs.map +0 -1
- package/dist/lib/chunk-VRNWPH35.cjs.map +0 -1
- package/dist/lib/chunk-XFIGAAKN.cjs.map +0 -1
- package/dist/lib/chunk-XHCRXNQ3.cjs.map +0 -1
- package/dist/lib/chunk-YQG6JE5R.cjs.map +0 -1
- package/dist/lib/chunk-ZKYZWEHY.cjs.map +0 -1
- package/dist/lib/chunk-ZYBUJ2HE.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkAPVMN2H7_cjs = require('./chunk-APVMN2H7.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk5XYGZ3DC_cjs = require('./chunk-5XYGZ3DC.cjs');
|
|
5
5
|
var chunk5VPVJHJO_cjs = require('./chunk-5VPVJHJO.cjs');
|
|
6
6
|
var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
7
7
|
var console = require('@storm-software/config-tools/logger/console');
|
|
@@ -13,8 +13,6 @@ var helpers = require('@stryke/fs/helpers');
|
|
|
13
13
|
var install = require('@stryke/fs/install');
|
|
14
14
|
var listFiles = require('@stryke/fs/list-files');
|
|
15
15
|
var packageFns = require('@stryke/fs/package-fns');
|
|
16
|
-
var filePathFns = require('@stryke/path/file-path-fns');
|
|
17
|
-
var isParentPath = require('@stryke/path/is-parent-path');
|
|
18
16
|
var joinPaths = require('@stryke/path/join-paths');
|
|
19
17
|
var replace = require('@stryke/path/replace');
|
|
20
18
|
var isError = require('@stryke/type-checks/is-error');
|
|
@@ -30,10 +28,10 @@ var json = require('@stryke/fs/json');
|
|
|
30
28
|
var append = require('@stryke/path/append');
|
|
31
29
|
var defu5 = require('defu');
|
|
32
30
|
var ts2 = require('typescript');
|
|
33
|
-
var titleCase = require('@stryke/string-format/title-case');
|
|
34
31
|
require('@stryke/fs/remove-file');
|
|
35
32
|
var hashFiles = require('@stryke/hash/hash-files');
|
|
36
33
|
var getUnique = require('@stryke/helpers/get-unique');
|
|
34
|
+
var filePathFns = require('@stryke/path/file-path-fns');
|
|
37
35
|
var kebabCase = require('@stryke/string-format/kebab-case');
|
|
38
36
|
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
39
37
|
var writeFile$1 = require('@stryke/fs/write-file');
|
|
@@ -41,10 +39,12 @@ var prettier = require('prettier');
|
|
|
41
39
|
var resolve = require('@stryke/fs/resolve');
|
|
42
40
|
var getConfig = require('@storm-software/config-tools/get-config');
|
|
43
41
|
var c12 = require('c12');
|
|
42
|
+
var titleCase = require('@stryke/string-format/title-case');
|
|
44
43
|
var getEnvPaths = require('@stryke/env/get-env-paths');
|
|
45
44
|
var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
|
|
46
45
|
var murmurhash = require('@stryke/hash/murmurhash');
|
|
47
46
|
var omit = require('@stryke/helpers/omit');
|
|
47
|
+
var isType = require('@stryke/path/is-type');
|
|
48
48
|
var join = require('@stryke/path/join');
|
|
49
49
|
var isNull = require('@stryke/type-checks/is-null');
|
|
50
50
|
var isString = require('@stryke/type-checks/is-string');
|
|
@@ -56,7 +56,7 @@ var colors = require('@storm-software/config-tools/utilities/colors');
|
|
|
56
56
|
var noop = require('@stryke/helpers/noop');
|
|
57
57
|
var jiti = require('jiti');
|
|
58
58
|
var bufferToString = require('@stryke/convert/buffer-to-string');
|
|
59
|
-
var
|
|
59
|
+
var isParentPath = require('@stryke/path/is-parent-path');
|
|
60
60
|
var prettyBytes = require('@stryke/string-format/pretty-bytes');
|
|
61
61
|
var isBuffer = require('@stryke/type-checks/is-buffer');
|
|
62
62
|
var memfs = require('memfs');
|
|
@@ -184,26 +184,6 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
chunkPK6SKIKE_cjs.__name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
|
|
187
|
-
function getBaseFileHeader(context) {
|
|
188
|
-
return `
|
|
189
|
-
// Generated with ${titleCase.titleCase(context.config.framework)}
|
|
190
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
191
|
-
`;
|
|
192
|
-
}
|
|
193
|
-
chunkPK6SKIKE_cjs.__name(getBaseFileHeader, "getBaseFileHeader");
|
|
194
|
-
function getFileHeader(context, options = {}) {
|
|
195
|
-
const { directive = null, prettierIgnore = false } = options;
|
|
196
|
-
return `/* eslint-disable */
|
|
197
|
-
// biome-ignore lint: disable
|
|
198
|
-
${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `
|
|
199
|
-
|
|
200
|
-
${directive}
|
|
201
|
-
` : "\n"}
|
|
202
|
-
${getBaseFileHeader(context)}
|
|
203
|
-
|
|
204
|
-
`;
|
|
205
|
-
}
|
|
206
|
-
chunkPK6SKIKE_cjs.__name(getFileHeader, "getFileHeader");
|
|
207
187
|
var PROJECT_ROOT_HASH_LENGTH = 45;
|
|
208
188
|
var CACHE_HASH_LENGTH = 62;
|
|
209
189
|
function getPrefixedProjectRootHash(name, projectRootHash) {
|
|
@@ -228,11 +208,13 @@ chunkPK6SKIKE_cjs.__name(getChecksum, "getChecksum");
|
|
|
228
208
|
async function writeMetaFile(context) {
|
|
229
209
|
const metaFilePath = joinPaths.joinPaths(context.dataPath, "meta.json");
|
|
230
210
|
context.log(types.LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
|
|
231
|
-
await context.fs.
|
|
211
|
+
await context.fs.writeFile(metaFilePath, JSON.stringify({
|
|
232
212
|
...context.meta,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}, null, 2)
|
|
213
|
+
virtualFiles: context.fs[chunk5XYGZ3DC_cjs.__VFS_VIRTUAL__].toJSON(context.artifactsPath),
|
|
214
|
+
virtualFilesMeta: context.fs.getPartialMeta()
|
|
215
|
+
}, null, 2), {
|
|
216
|
+
mode: "fs"
|
|
217
|
+
});
|
|
236
218
|
}
|
|
237
219
|
chunkPK6SKIKE_cjs.__name(writeMetaFile, "writeMetaFile");
|
|
238
220
|
function isPlugin(value) {
|
|
@@ -498,6 +480,154 @@ function createResolver(options) {
|
|
|
498
480
|
return baseResolver;
|
|
499
481
|
}
|
|
500
482
|
chunkPK6SKIKE_cjs.__name(createResolver, "createResolver");
|
|
483
|
+
function isBufferEncoding(options) {
|
|
484
|
+
return isSetString.isSetString(options) || options === null;
|
|
485
|
+
}
|
|
486
|
+
chunkPK6SKIKE_cjs.__name(isBufferEncoding, "isBufferEncoding");
|
|
487
|
+
function isPowerlinesWriteFileOptions(options) {
|
|
488
|
+
return !isBufferEncoding(options) && isSetObject.isSetObject(options) && ("skipFormat" in options || "mode" in options && (options.mode === "fs" || options.mode === "virtual"));
|
|
489
|
+
}
|
|
490
|
+
chunkPK6SKIKE_cjs.__name(isPowerlinesWriteFileOptions, "isPowerlinesWriteFileOptions");
|
|
491
|
+
function isNodeWriteFileOptions(options) {
|
|
492
|
+
return !isUndefined.isUndefined(options) && (isBufferEncoding(options) || !isPowerlinesWriteFileOptions(options));
|
|
493
|
+
}
|
|
494
|
+
chunkPK6SKIKE_cjs.__name(isNodeWriteFileOptions, "isNodeWriteFileOptions");
|
|
495
|
+
function isPowerLinesWriteFileData(data) {
|
|
496
|
+
return !!(isSetObject.isSetObject(data) && "code" in data && data.code);
|
|
497
|
+
}
|
|
498
|
+
chunkPK6SKIKE_cjs.__name(isPowerLinesWriteFileData, "isPowerLinesWriteFileData");
|
|
499
|
+
var FILE_PREFIX = "file://";
|
|
500
|
+
function toFilePath(pathOrUrl) {
|
|
501
|
+
if (!pathOrUrl) {
|
|
502
|
+
throw new Error("No Path or URL provided to Virtual File System");
|
|
503
|
+
}
|
|
504
|
+
let result = pathOrUrl.toString();
|
|
505
|
+
if (result.startsWith(FILE_PREFIX)) {
|
|
506
|
+
result = result.slice(FILE_PREFIX.length);
|
|
507
|
+
}
|
|
508
|
+
return result;
|
|
509
|
+
}
|
|
510
|
+
chunkPK6SKIKE_cjs.__name(toFilePath, "toFilePath");
|
|
511
|
+
var FS_METHODS = [
|
|
512
|
+
"mkdir",
|
|
513
|
+
"mkdirSync",
|
|
514
|
+
"rmdir",
|
|
515
|
+
"rmdirSync",
|
|
516
|
+
"unlink",
|
|
517
|
+
"unlinkSync",
|
|
518
|
+
"existsSync",
|
|
519
|
+
"realpathSync",
|
|
520
|
+
"writeFileSync",
|
|
521
|
+
"readFileSync",
|
|
522
|
+
"readdirSync",
|
|
523
|
+
"createWriteStream",
|
|
524
|
+
"WriteStream",
|
|
525
|
+
"createReadStream",
|
|
526
|
+
"ReadStream"
|
|
527
|
+
];
|
|
528
|
+
var FS_PROMISE_METHODS = [
|
|
529
|
+
"mkdir",
|
|
530
|
+
"rm",
|
|
531
|
+
"rmdir",
|
|
532
|
+
"unlink",
|
|
533
|
+
"writeFile",
|
|
534
|
+
"readFile",
|
|
535
|
+
"readdir",
|
|
536
|
+
"stat",
|
|
537
|
+
"lstat"
|
|
538
|
+
];
|
|
539
|
+
function cloneFS(originalFS) {
|
|
540
|
+
const clonedFS = {
|
|
541
|
+
...originalFS,
|
|
542
|
+
promises: {
|
|
543
|
+
...originalFS.promises ?? {}
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
for (const method of FS_METHODS) {
|
|
547
|
+
if (originalFS[method]) {
|
|
548
|
+
clonedFS[method] = originalFS[method];
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
originalFS.promises ??= {};
|
|
552
|
+
for (const method of FS_PROMISE_METHODS) {
|
|
553
|
+
if (originalFS.promises[method]) {
|
|
554
|
+
clonedFS.promises ??= {};
|
|
555
|
+
clonedFS.promises[method] = originalFS.promises[method];
|
|
556
|
+
clonedFS[method] = originalFS.promises[method];
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
for (const prop in clonedFS) {
|
|
560
|
+
if (isFunction.isFunction(clonedFS[prop])) {
|
|
561
|
+
clonedFS[prop] = clonedFS[prop].bind(originalFS);
|
|
562
|
+
if (isFunction.isFunction(clonedFS.promises[prop])) {
|
|
563
|
+
clonedFS.promises[prop] = clonedFS.promises[prop].bind(originalFS);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
for (const prop in clonedFS.promises) {
|
|
568
|
+
if (isFunction.isFunction(clonedFS.promises[prop])) {
|
|
569
|
+
clonedFS.promises[prop] = clonedFS.promises[prop].bind(originalFS);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return clonedFS;
|
|
573
|
+
}
|
|
574
|
+
chunkPK6SKIKE_cjs.__name(cloneFS, "cloneFS");
|
|
575
|
+
function patchFS(originalFS, vfs) {
|
|
576
|
+
const clonedFS = cloneFS(originalFS);
|
|
577
|
+
originalFS.mkdirSync = (file, options) => vfs.mkdirSync(toFilePath(file), options);
|
|
578
|
+
originalFS.mkdir = (file, options, callback) => vfs.mkdir(toFilePath(file), options, callback);
|
|
579
|
+
originalFS.promises.mkdir = async (file, options) => vfs.mkdir(toFilePath(file), options);
|
|
580
|
+
originalFS.unlinkSync = (file) => vfs.unlinkSync(toFilePath(file));
|
|
581
|
+
originalFS.promises.rm = async (file, options) => vfs.rm(toFilePath(file), options);
|
|
582
|
+
originalFS.promises.unlink = async (file) => vfs.unlink(toFilePath(file));
|
|
583
|
+
originalFS.existsSync = (file) => vfs.existsSync(toFilePath(file));
|
|
584
|
+
Object.defineProperty(originalFS, "realpathSync", {
|
|
585
|
+
value: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((file, options) => vfs.realpathSync(toFilePath(file), options), "value")
|
|
586
|
+
});
|
|
587
|
+
originalFS.writeFileSync = (file, data, options) => vfs.writeFileSync(toFilePath(file), data, options);
|
|
588
|
+
originalFS.promises.writeFile = async (file, data, options) => vfs.writeFile(toFilePath(file), data, options);
|
|
589
|
+
originalFS.readFileSync = (file, options) => vfs.readFileSync(toFilePath(file), options);
|
|
590
|
+
originalFS.promises.readFile = (file, options) => vfs.readFile(toFilePath(file), options);
|
|
591
|
+
originalFS.readdirSync = (file, options) => vfs.readdirSync(toFilePath(file), options);
|
|
592
|
+
originalFS.promises.readdir = (file, options) => vfs.readdir(toFilePath(file), options);
|
|
593
|
+
Object.defineProperty(originalFS, "statSync", {
|
|
594
|
+
value: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((file, options) => vfs.statSync(toFilePath(file), options), "value")
|
|
595
|
+
});
|
|
596
|
+
originalFS.stat = (file, options) => vfs.statSync(toFilePath(file), options);
|
|
597
|
+
originalFS.promises.stat = (file, options) => vfs.stat(toFilePath(file), options);
|
|
598
|
+
Object.defineProperty(originalFS, "lstatSync", {
|
|
599
|
+
value: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((file, options) => vfs.lstatSync(toFilePath(file), options), "value")
|
|
600
|
+
});
|
|
601
|
+
originalFS.lstat = (file, options) => vfs.lstatSync(toFilePath(file), options);
|
|
602
|
+
originalFS.promises.lstat = (file, options) => vfs.lstat(toFilePath(file), options);
|
|
603
|
+
return () => {
|
|
604
|
+
originalFS.mkdirSync = clonedFS.mkdirSync;
|
|
605
|
+
originalFS.mkdir = clonedFS.mkdir;
|
|
606
|
+
originalFS.promises.mkdir = clonedFS.promises.mkdir;
|
|
607
|
+
originalFS.unlinkSync = clonedFS.unlinkSync;
|
|
608
|
+
originalFS.promises.rm = clonedFS.promises.rm;
|
|
609
|
+
originalFS.promises.unlink = clonedFS.promises.unlink;
|
|
610
|
+
originalFS.existsSync = clonedFS.existsSync;
|
|
611
|
+
originalFS.realpathSync = clonedFS.realpathSync;
|
|
612
|
+
originalFS.writeFileSync = clonedFS.writeFileSync;
|
|
613
|
+
originalFS.promises.writeFile = clonedFS.promises.writeFile;
|
|
614
|
+
originalFS.readFileSync = clonedFS.readFileSync;
|
|
615
|
+
originalFS.promises.readFile = clonedFS.promises.readFile;
|
|
616
|
+
originalFS.readdirSync = clonedFS.readdirSync;
|
|
617
|
+
originalFS.promises.readdir = clonedFS.promises.readdir;
|
|
618
|
+
Object.defineProperty(originalFS, "statSync", {
|
|
619
|
+
value: clonedFS.statSync
|
|
620
|
+
});
|
|
621
|
+
originalFS.stat = clonedFS.stat;
|
|
622
|
+
originalFS.promises.stat = clonedFS.promises.stat;
|
|
623
|
+
Object.defineProperty(originalFS, "lstatSync", {
|
|
624
|
+
value: clonedFS.lstatSync
|
|
625
|
+
});
|
|
626
|
+
originalFS.lstat = clonedFS.lstat;
|
|
627
|
+
originalFS.promises.lstat = clonedFS.promises.lstat;
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
chunkPK6SKIKE_cjs.__name(patchFS, "patchFS");
|
|
501
631
|
var VirtualFileSystem = class {
|
|
502
632
|
static {
|
|
503
633
|
chunkPK6SKIKE_cjs.__name(this, "VirtualFileSystem");
|
|
@@ -505,7 +635,11 @@ var VirtualFileSystem = class {
|
|
|
505
635
|
/**
|
|
506
636
|
* The internal map of virtual files.
|
|
507
637
|
*/
|
|
508
|
-
#
|
|
638
|
+
#meta = {};
|
|
639
|
+
/**
|
|
640
|
+
* A map of unique identifiers to their virtual file paths.
|
|
641
|
+
*/
|
|
642
|
+
#ids = {};
|
|
509
643
|
/**
|
|
510
644
|
* A map of virtual file paths to their underlying file content.
|
|
511
645
|
*/
|
|
@@ -546,39 +680,88 @@ var VirtualFileSystem = class {
|
|
|
546
680
|
*/
|
|
547
681
|
#log;
|
|
548
682
|
/**
|
|
683
|
+
* Checks if a path exists in the virtual file system (VFS).
|
|
684
|
+
*
|
|
685
|
+
* @param path - The path to check.
|
|
686
|
+
* @returns `true` if the path exists, otherwise `false`.
|
|
687
|
+
*/
|
|
688
|
+
#existsSync(path) {
|
|
689
|
+
const formattedPath = this.formatPath(path);
|
|
690
|
+
return this.#virtualFS.existsSync(formattedPath) || this.#fs.existsSync(formattedPath) || this.resolveFS(path).existsSync(formattedPath);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
549
693
|
* Exposes the internal VFS map for advanced usage.
|
|
550
694
|
*/
|
|
551
|
-
get [
|
|
695
|
+
get [chunk5XYGZ3DC_cjs.__VFS_CACHE__]() {
|
|
552
696
|
return this.#cachedFS;
|
|
553
697
|
}
|
|
554
698
|
/**
|
|
555
699
|
* Exposes the internal VFS resolver cache for advanced usage.
|
|
556
700
|
*/
|
|
557
|
-
get [
|
|
701
|
+
get [chunk5XYGZ3DC_cjs.__VFS_RESOLVER__]() {
|
|
558
702
|
return this.#cachedResolver;
|
|
559
703
|
}
|
|
560
704
|
/**
|
|
561
705
|
* Exposes the internal VFS map for advanced usage.
|
|
562
706
|
*/
|
|
563
|
-
get [
|
|
707
|
+
get [chunk5XYGZ3DC_cjs.__VFS_VIRTUAL__]() {
|
|
564
708
|
return this.#virtualFS;
|
|
565
709
|
}
|
|
566
710
|
/**
|
|
567
711
|
* Exposes the internal UFS map for advanced usage.
|
|
568
712
|
*/
|
|
569
|
-
get [
|
|
713
|
+
get [chunk5XYGZ3DC_cjs.__VFS_UNIFIED__]() {
|
|
570
714
|
return this.#unifiedFS;
|
|
571
715
|
}
|
|
572
716
|
/**
|
|
717
|
+
* A proxy to access the underlying file metadata.
|
|
718
|
+
*/
|
|
719
|
+
get meta() {
|
|
720
|
+
return new Proxy(this.#meta, {
|
|
721
|
+
get: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target, prop) => {
|
|
722
|
+
if (target[prop]) {
|
|
723
|
+
return {
|
|
724
|
+
id: prop,
|
|
725
|
+
mode: this.#virtualFS.existsSync(prop) ? "virtual" : this.#fs.existsSync(prop) ? "fs" : this.#context.config.output.mode,
|
|
726
|
+
details: {},
|
|
727
|
+
variant: "normal",
|
|
728
|
+
...target[prop]
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
return void 0;
|
|
732
|
+
}, "get"),
|
|
733
|
+
set: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target, prop, value) => {
|
|
734
|
+
target[prop] = value;
|
|
735
|
+
this.#ids[value.id || prop] = prop;
|
|
736
|
+
return true;
|
|
737
|
+
}, "set"),
|
|
738
|
+
deleteProperty: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((target, prop) => {
|
|
739
|
+
delete this.#ids[target[prop]?.id || prop];
|
|
740
|
+
delete target[prop];
|
|
741
|
+
return true;
|
|
742
|
+
}, "deleteProperty")
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* A map of module ids to their file paths.
|
|
747
|
+
*/
|
|
748
|
+
get ids() {
|
|
749
|
+
return this.#ids;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
573
752
|
* Creates a new instance of the VirtualFileSystem.
|
|
574
753
|
*
|
|
575
754
|
* @param context - The context of the virtual file system, typically containing options and logging functions.
|
|
576
755
|
* @param serialized - A map of files/file contents to populate in cache
|
|
577
756
|
*/
|
|
578
|
-
constructor(context, serialized) {
|
|
757
|
+
constructor(context, serialized = {}) {
|
|
579
758
|
this.#context = context;
|
|
580
759
|
this.#cachedFS = /* @__PURE__ */ new Map();
|
|
581
|
-
this.#
|
|
760
|
+
this.#meta = Object.fromEntries(Object.entries(serialized.virtualFilesMeta ?? {}));
|
|
761
|
+
this.#ids = Object.fromEntries(Object.entries(this.#meta).map(([path, data]) => [
|
|
762
|
+
data.id || path,
|
|
763
|
+
path
|
|
764
|
+
]));
|
|
582
765
|
if (!this.#fs.existsSync(this.#context.dataPath)) {
|
|
583
766
|
this.#fs.mkdirSync(this.#context.dataPath, {
|
|
584
767
|
recursive: true
|
|
@@ -644,13 +827,13 @@ var VirtualFileSystem = class {
|
|
|
644
827
|
}
|
|
645
828
|
this.#log = extendLog(this.#context.log, "virtual-file-system");
|
|
646
829
|
}
|
|
647
|
-
[
|
|
830
|
+
[chunk5XYGZ3DC_cjs.__VFS_INIT__]() {
|
|
648
831
|
if (!this.#isPatched && this.#context.config.output.mode !== "fs") {
|
|
649
832
|
this.#revert = patchFS(fs__default.default, this);
|
|
650
833
|
this.#isPatched = true;
|
|
651
834
|
}
|
|
652
835
|
}
|
|
653
|
-
[
|
|
836
|
+
[chunk5XYGZ3DC_cjs.__VFS_REVERT__]() {
|
|
654
837
|
if (this.#isPatched && this.#context.config.output.mode !== "fs") {
|
|
655
838
|
if (!this.#revert) {
|
|
656
839
|
throw new Error("Attempting to revert File System patch prior to calling `__init__` function");
|
|
@@ -660,65 +843,44 @@ var VirtualFileSystem = class {
|
|
|
660
843
|
}
|
|
661
844
|
}
|
|
662
845
|
/**
|
|
663
|
-
*
|
|
846
|
+
* Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
664
847
|
*
|
|
665
|
-
* @
|
|
848
|
+
* @param pathOrId - The path or id to check.
|
|
849
|
+
* @param options - Optional parameters for resolving the path.
|
|
850
|
+
* @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
666
851
|
*/
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
*
|
|
673
|
-
* @returns An array of formatted runtime IDs.
|
|
674
|
-
*/
|
|
675
|
-
get runtimeIds() {
|
|
676
|
-
return Array.from(this.builtinIdMap.keys()).map((id) => this.formatRuntimeId(id));
|
|
677
|
-
}
|
|
678
|
-
/**
|
|
679
|
-
* Checks if a given path or ID corresponds to a runtime file.
|
|
680
|
-
*
|
|
681
|
-
* @param pathOrId - The path or ID to check.
|
|
682
|
-
* @param options - Options for resolving the path, such as paths to check.
|
|
683
|
-
* @returns `true` if the path or ID corresponds to a runtime file, otherwise `false`.
|
|
684
|
-
*/
|
|
685
|
-
isBuiltinFile(pathOrId, options) {
|
|
686
|
-
return !!this.builtinIdMap.values().find((path) => path === this.resolvePath(pathOrId, {
|
|
852
|
+
isVirtual(pathOrId, options = {}) {
|
|
853
|
+
if (!pathOrId) {
|
|
854
|
+
return false;
|
|
855
|
+
}
|
|
856
|
+
const resolvedPath = this.resolve(pathOrId, {
|
|
687
857
|
...options,
|
|
688
858
|
type: "file"
|
|
689
|
-
})
|
|
859
|
+
});
|
|
860
|
+
if (!resolvedPath) {
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
return this.meta[resolvedPath]?.mode === "virtual";
|
|
690
864
|
}
|
|
691
865
|
/**
|
|
692
|
-
*
|
|
866
|
+
* Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
693
867
|
*
|
|
694
|
-
* @param
|
|
695
|
-
* @
|
|
868
|
+
* @param pathOrId - The path or id to check.
|
|
869
|
+
* @param options - Optional parameters for resolving the path.
|
|
870
|
+
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
696
871
|
*/
|
|
697
|
-
|
|
698
|
-
return id.startsWith(`${this.#context.config.output.builtinPrefix}:`);
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* Check if a path or ID corresponds to a virtual file.
|
|
702
|
-
*
|
|
703
|
-
* @param pathOrId - The path or ID to check.
|
|
704
|
-
* @param options - Options for resolving the path, such as paths to check.
|
|
705
|
-
* @returns Whether the path or ID corresponds to a virtual file.
|
|
706
|
-
*/
|
|
707
|
-
isVirtualFile(pathOrId, options = {}) {
|
|
872
|
+
isFs(pathOrId, options = {}) {
|
|
708
873
|
if (!pathOrId) {
|
|
709
874
|
return false;
|
|
710
875
|
}
|
|
711
|
-
const resolvedPath = this.
|
|
876
|
+
const resolvedPath = this.resolve(pathOrId, {
|
|
712
877
|
...options,
|
|
713
878
|
type: "file"
|
|
714
879
|
});
|
|
715
880
|
if (!resolvedPath) {
|
|
716
881
|
return false;
|
|
717
882
|
}
|
|
718
|
-
|
|
719
|
-
return true;
|
|
720
|
-
}
|
|
721
|
-
return this.#virtualFS.existsSync(resolvedPath);
|
|
883
|
+
return this.meta[resolvedPath]?.mode === "fs";
|
|
722
884
|
}
|
|
723
885
|
/**
|
|
724
886
|
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
@@ -732,37 +894,6 @@ var VirtualFileSystem = class {
|
|
|
732
894
|
return !!this.#context.tsconfig.options.paths && Object.keys(this.#context.tsconfig.options.paths).some((path) => pathOrId.startsWith(path.replaceAll("*", "")));
|
|
733
895
|
}
|
|
734
896
|
/**
|
|
735
|
-
* Checks if a given ID corresponds to a runtime file path.
|
|
736
|
-
*
|
|
737
|
-
* @param id - The unique identifier for the runtime file.
|
|
738
|
-
* @param pathOrId - The path or ID to check.
|
|
739
|
-
* @returns `true` if the ID corresponds to the path or ID of a runtime file, otherwise `false`.
|
|
740
|
-
*/
|
|
741
|
-
isMatchingBuiltinId(id, pathOrId) {
|
|
742
|
-
const resolvedPath = this.resolvePath(pathOrId);
|
|
743
|
-
const resolvedId = this.resolveId(pathOrId);
|
|
744
|
-
return !!(this.isBuiltinFile(pathOrId) && (resolvedPath && (resolvedPath === this.builtinIdMap.get(id) || resolvedPath === this.builtinIdMap.get(this.formatRuntimeId(id))) || resolvedId && (resolvedId === this.builtinIdMap.get(id) || resolvedId === this.builtinIdMap.get(this.formatRuntimeId(id)))));
|
|
745
|
-
}
|
|
746
|
-
/**
|
|
747
|
-
* Lists all runtime files in the virtual file system.
|
|
748
|
-
*
|
|
749
|
-
* @returns A promise that resolves to an array of runtime files.
|
|
750
|
-
*/
|
|
751
|
-
async listBuiltinFiles() {
|
|
752
|
-
const runtimeFiles = [];
|
|
753
|
-
for (const [id, path] of this.builtinIdMap.entries()) {
|
|
754
|
-
const contents = await this.readFile(path);
|
|
755
|
-
if (contents) {
|
|
756
|
-
runtimeFiles.push({
|
|
757
|
-
id: this.formatRuntimeId(id),
|
|
758
|
-
path,
|
|
759
|
-
contents
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
return runtimeFiles;
|
|
764
|
-
}
|
|
765
|
-
/**
|
|
766
897
|
* Lists files in a given path.
|
|
767
898
|
*
|
|
768
899
|
* @param path - The path to list files from.
|
|
@@ -779,7 +910,7 @@ var VirtualFileSystem = class {
|
|
|
779
910
|
*/
|
|
780
911
|
unlinkSync(path, options) {
|
|
781
912
|
const formattedPath = toFilePath(path);
|
|
782
|
-
if (!this.
|
|
913
|
+
if (!this.isFile(formattedPath)) {
|
|
783
914
|
return;
|
|
784
915
|
}
|
|
785
916
|
this.#log(types.LogLevelLabel.TRACE, `Synchronously removing file: ${formattedPath}`);
|
|
@@ -794,7 +925,7 @@ var VirtualFileSystem = class {
|
|
|
794
925
|
*/
|
|
795
926
|
async unlink(path, options) {
|
|
796
927
|
const formattedPath = toFilePath(path);
|
|
797
|
-
if (!this.
|
|
928
|
+
if (!this.isFile(formattedPath)) {
|
|
798
929
|
return;
|
|
799
930
|
}
|
|
800
931
|
this.#log(types.LogLevelLabel.TRACE, `Removing file: ${formattedPath}`);
|
|
@@ -814,7 +945,7 @@ var VirtualFileSystem = class {
|
|
|
814
945
|
*/
|
|
815
946
|
rmdirSync(path, options = {}) {
|
|
816
947
|
const formattedPath = toFilePath(path);
|
|
817
|
-
if (!this.
|
|
948
|
+
if (!this.isDirectory(formattedPath)) {
|
|
818
949
|
return;
|
|
819
950
|
}
|
|
820
951
|
this.#log(types.LogLevelLabel.TRACE, `Synchronously removing directory: ${formattedPath}`);
|
|
@@ -833,7 +964,7 @@ var VirtualFileSystem = class {
|
|
|
833
964
|
*/
|
|
834
965
|
async rmdir(path, options = {}) {
|
|
835
966
|
const formattedPath = toFilePath(path);
|
|
836
|
-
if (!this.
|
|
967
|
+
if (!this.isDirectory(formattedPath)) {
|
|
837
968
|
return;
|
|
838
969
|
}
|
|
839
970
|
this.#log(types.LogLevelLabel.TRACE, `Removing directory: ${formattedPath}`);
|
|
@@ -860,7 +991,7 @@ var VirtualFileSystem = class {
|
|
|
860
991
|
*/
|
|
861
992
|
async rm(path, options = {}) {
|
|
862
993
|
this.#log(types.LogLevelLabel.TRACE, `Removing: ${toFilePath(path)}`);
|
|
863
|
-
if (this.
|
|
994
|
+
if (this.isDirectory(path)) {
|
|
864
995
|
return this.rmdir(path, options);
|
|
865
996
|
}
|
|
866
997
|
return this.unlink(path, options);
|
|
@@ -904,12 +1035,12 @@ var VirtualFileSystem = class {
|
|
|
904
1035
|
/**
|
|
905
1036
|
* Lists files in a given path.
|
|
906
1037
|
*
|
|
907
|
-
* @param
|
|
1038
|
+
* @param pathOrId - The path to list files from.
|
|
908
1039
|
* @param options - Options for listing files, such as encoding and recursion.
|
|
909
1040
|
* @returns An array of file names in the specified path.
|
|
910
1041
|
*/
|
|
911
|
-
async readdir(
|
|
912
|
-
return this.resolveFS(
|
|
1042
|
+
async readdir(pathOrId, options = "utf8") {
|
|
1043
|
+
return this.resolveFS(pathOrId).promises.readdir(toFilePath(pathOrId), options);
|
|
913
1044
|
}
|
|
914
1045
|
/**
|
|
915
1046
|
* Asynchronously reads a file from the virtual file system (VFS).
|
|
@@ -921,7 +1052,7 @@ var VirtualFileSystem = class {
|
|
|
921
1052
|
if (!pathOrId) {
|
|
922
1053
|
return void 0;
|
|
923
1054
|
}
|
|
924
|
-
const filePath = this.
|
|
1055
|
+
const filePath = this.resolve(toFilePath(pathOrId), {
|
|
925
1056
|
type: "file"
|
|
926
1057
|
});
|
|
927
1058
|
if (filePath) {
|
|
@@ -950,7 +1081,7 @@ var VirtualFileSystem = class {
|
|
|
950
1081
|
if (!pathOrId) {
|
|
951
1082
|
return void 0;
|
|
952
1083
|
}
|
|
953
|
-
const filePath = this.
|
|
1084
|
+
const filePath = this.resolve(toFilePath(pathOrId), {
|
|
954
1085
|
type: "file"
|
|
955
1086
|
});
|
|
956
1087
|
if (filePath) {
|
|
@@ -967,137 +1098,80 @@ var VirtualFileSystem = class {
|
|
|
967
1098
|
/**
|
|
968
1099
|
* Writes a file to the virtual file system (VFS).
|
|
969
1100
|
*
|
|
970
|
-
* @param
|
|
1101
|
+
* @param path - The path to the file.
|
|
971
1102
|
* @param data - The contents of the file.
|
|
972
1103
|
* @param options - Optional parameters for writing the file.
|
|
973
1104
|
* @returns A promise that resolves when the file is written.
|
|
974
1105
|
*/
|
|
975
|
-
async writeFile(
|
|
976
|
-
const
|
|
977
|
-
if (!this.
|
|
978
|
-
await this.mkdir(filePathFns.findFilePath(
|
|
1106
|
+
async writeFile(path, data = "", options = "utf8") {
|
|
1107
|
+
const formattedPath = this.formatPath(path);
|
|
1108
|
+
if (!this.isDirectory(filePathFns.findFilePath(formattedPath))) {
|
|
1109
|
+
await this.mkdir(filePathFns.findFilePath(formattedPath), isPowerlinesWriteFileOptions(options) ? options : void 0);
|
|
1110
|
+
}
|
|
1111
|
+
let code = isPowerLinesWriteFileData(data) ? data.code : data;
|
|
1112
|
+
if ((!isPowerlinesWriteFileOptions(options) || !options.skipFormat) && isSetString.isSetString(code)) {
|
|
1113
|
+
const resolvedConfig = await prettier.resolveConfig(formattedPath);
|
|
1114
|
+
if (resolvedConfig) {
|
|
1115
|
+
code = await prettier.format(code, {
|
|
1116
|
+
absolutePath: formattedPath,
|
|
1117
|
+
...resolvedConfig
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
979
1120
|
}
|
|
980
|
-
|
|
981
|
-
this.#
|
|
982
|
-
this.
|
|
983
|
-
|
|
1121
|
+
const outputMode = this.resolveOutputMode(formattedPath, isPowerlinesWriteFileOptions(options) ? options : void 0);
|
|
1122
|
+
this.#log(types.LogLevelLabel.TRACE, `Writing ${formattedPath} file to the ${outputMode === "fs" ? "" : "virtual "}file system (size: ${prettyBytes.prettyBytes(new buffer.Blob(toArray.toArray(code)).size)})`);
|
|
1123
|
+
this.meta[formattedPath] = {
|
|
1124
|
+
path: formattedPath,
|
|
1125
|
+
code,
|
|
1126
|
+
mode: outputMode,
|
|
1127
|
+
variant: "normal",
|
|
1128
|
+
...isPowerLinesWriteFileData(data) ? data : {}
|
|
1129
|
+
};
|
|
1130
|
+
this.clearResolverCache(formattedPath);
|
|
1131
|
+
const ifs = this.resolveFS(formattedPath, isPowerlinesWriteFileOptions(options) ? options : void 0);
|
|
984
1132
|
if (isFunction.isFunction(ifs.promises.writeFile)) {
|
|
985
|
-
return ifs.promises.writeFile(
|
|
986
|
-
"mode"
|
|
987
|
-
]));
|
|
1133
|
+
return ifs.promises.writeFile(formattedPath, code, isNodeWriteFileOptions(options) ? options : "utf8");
|
|
988
1134
|
}
|
|
989
|
-
return ifs.writeFileSync(
|
|
990
|
-
"mode"
|
|
991
|
-
]));
|
|
1135
|
+
return ifs.writeFileSync(formattedPath, code, isNodeWriteFileOptions(options) ? options : "utf8");
|
|
992
1136
|
}
|
|
993
1137
|
/**
|
|
994
1138
|
* Synchronously writes a file to the virtual file system (VFS).
|
|
995
1139
|
*
|
|
996
|
-
* @param
|
|
1140
|
+
* @param path - The file to write.
|
|
997
1141
|
* @param data - The contents of the file.
|
|
998
1142
|
* @param options - Optional parameters for writing the file.
|
|
999
1143
|
*/
|
|
1000
|
-
writeFileSync(
|
|
1001
|
-
const
|
|
1002
|
-
if (!this.
|
|
1003
|
-
this.mkdirSync(filePathFns.findFilePath(
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
this
|
|
1007
|
-
this.
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1144
|
+
writeFileSync(path, data = "", options = "utf8") {
|
|
1145
|
+
const formattedPath = this.formatPath(path);
|
|
1146
|
+
if (!this.isDirectory(filePathFns.findFilePath(formattedPath))) {
|
|
1147
|
+
this.mkdirSync(filePathFns.findFilePath(formattedPath), isPowerlinesWriteFileOptions(options) ? options : void 0);
|
|
1148
|
+
}
|
|
1149
|
+
const code = isPowerLinesWriteFileData(data) ? data.code : data;
|
|
1150
|
+
const outputMode = this.resolveOutputMode(formattedPath, isPowerlinesWriteFileOptions(options) ? options : void 0);
|
|
1151
|
+
this.#log(types.LogLevelLabel.TRACE, `Writing ${formattedPath} file to the ${outputMode === "fs" ? "" : "virtual "}file system (size: ${prettyBytes.prettyBytes(new buffer.Blob(toArray.toArray(code)).size)})`);
|
|
1152
|
+
this.meta[formattedPath] = {
|
|
1153
|
+
path: formattedPath,
|
|
1154
|
+
code,
|
|
1155
|
+
mode: outputMode,
|
|
1156
|
+
variant: "normal",
|
|
1157
|
+
...isPowerLinesWriteFileData(data) ? data : {}
|
|
1158
|
+
};
|
|
1159
|
+
this.clearResolverCache(formattedPath);
|
|
1160
|
+
const writeStream = this.resolveFS(formattedPath, isPowerlinesWriteFileOptions(options) ? options : void 0).createWriteStream(formattedPath);
|
|
1011
1161
|
try {
|
|
1012
|
-
writeStream.write(
|
|
1162
|
+
writeStream.write(code);
|
|
1013
1163
|
} finally {
|
|
1014
1164
|
writeStream.close();
|
|
1015
1165
|
}
|
|
1016
1166
|
}
|
|
1017
1167
|
/**
|
|
1018
|
-
* Writes a runtime file to the virtual file system (VFS).
|
|
1019
|
-
*
|
|
1020
|
-
* @param id - The unique identifier for the runtime file.
|
|
1021
|
-
* @param path - The path to the runtime file.
|
|
1022
|
-
* @param contents - The contents of the runtime file.
|
|
1023
|
-
* @param options - Optional parameters for writing the runtime file.
|
|
1024
|
-
* @returns A promise that resolves when the file is written.
|
|
1025
|
-
*/
|
|
1026
|
-
async writeBuiltinFile(id, path, contents, options = {}) {
|
|
1027
|
-
const formattedId = this.formatRuntimeId(id);
|
|
1028
|
-
const absolutePath = this.formatAbsoluteFilePath(toFilePath(path));
|
|
1029
|
-
this.builtinIdMap.set(formattedId, absolutePath);
|
|
1030
|
-
let data = contents;
|
|
1031
|
-
if (!options.skipFormat) {
|
|
1032
|
-
data = await prettier.format(contents, {
|
|
1033
|
-
absolutePath,
|
|
1034
|
-
...await prettier.resolveConfig(absolutePath)
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
const _options = defu5__default.default(isSetString.isSetString(options) ? {} : options ?? {}, {
|
|
1038
|
-
encoding: isSetString.isSetString(options) ? options : "utf8",
|
|
1039
|
-
mode: "virtual"
|
|
1040
|
-
});
|
|
1041
|
-
this.#log(types.LogLevelLabel.DEBUG, `Writing runtime file ${absolutePath} (size: ${prettyBytes.prettyBytes(new buffer.Blob(toArray.toArray(data)).size)}) to ${this.resolveOutputMode(absolutePath, _options) === "fs" ? "disk" : "memory"}`);
|
|
1042
|
-
return this.writeFile(absolutePath, data, _options);
|
|
1043
|
-
}
|
|
1044
|
-
/**
|
|
1045
|
-
* Adds an entry file to the virtual file system.
|
|
1046
|
-
*
|
|
1047
|
-
* @param name - The file name or absolute path of the entry module.
|
|
1048
|
-
* @param contents - The contents of the entry file.
|
|
1049
|
-
* @param options - Optional parameters for writing the entry file.
|
|
1050
|
-
*/
|
|
1051
|
-
async writeEntryFile(name, contents, options = {}) {
|
|
1052
|
-
const absolutePath = this.formatAbsoluteFilePath(isType.isAbsolutePath(toFilePath(name)) ? toFilePath(name) : toFilePath(joinPaths.joinPaths(this.#context.entryPath, name)));
|
|
1053
|
-
let data = contents;
|
|
1054
|
-
if (!options.skipFormat) {
|
|
1055
|
-
data = await prettier.format(contents, {
|
|
1056
|
-
absolutePath,
|
|
1057
|
-
...await prettier.resolveConfig(absolutePath)
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
const _options = defu5__default.default(isSetString.isSetString(options) ? {} : options ?? {}, {
|
|
1061
|
-
encoding: isSetString.isSetString(options) ? options : "utf8",
|
|
1062
|
-
mode: "virtual"
|
|
1063
|
-
});
|
|
1064
|
-
this.#log(types.LogLevelLabel.DEBUG, `Writing entry file ${absolutePath} (size: ${prettyBytes.prettyBytes(new buffer.Blob(toArray.toArray(data)).size)}) to ${this.resolveOutputMode(absolutePath, _options) === "fs" ? "disk" : "virtual memory"}`);
|
|
1065
|
-
return this.writeFile(absolutePath, data, _options);
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* Writes a file to disk from the physical file system (on disk).
|
|
1069
|
-
*
|
|
1070
|
-
* @param path - The path to the file to write.
|
|
1071
|
-
* @param contents - The contents of the file to write.
|
|
1072
|
-
* @param options - Optional parameters for writing the file.
|
|
1073
|
-
* @returns A promise that resolves when the file is written.
|
|
1074
|
-
*/
|
|
1075
|
-
async writeFileToDisk(path, contents, options = {}) {
|
|
1076
|
-
const absolutePath = this.formatAbsoluteFilePath(toFilePath(path));
|
|
1077
|
-
let data = contents;
|
|
1078
|
-
if (!options.skipFormat) {
|
|
1079
|
-
const resolvedConfig = await prettier.resolveConfig(absolutePath);
|
|
1080
|
-
if (resolvedConfig) {
|
|
1081
|
-
data = await prettier.format(contents, {
|
|
1082
|
-
absolutePath,
|
|
1083
|
-
...resolvedConfig
|
|
1084
|
-
});
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
return this.writeFile(absolutePath, data, defu5__default.default({
|
|
1088
|
-
mode: "fs"
|
|
1089
|
-
}, isSetString.isSetString(options) ? {} : options ?? {}, {
|
|
1090
|
-
encoding: isSetString.isSetString(options) ? options : "utf8"
|
|
1091
|
-
}));
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
1168
|
* Synchronously checks if a file exists in the virtual file system (VFS).
|
|
1095
1169
|
*
|
|
1096
1170
|
* @param pathOrId - The path or ID of the file to check.
|
|
1097
1171
|
* @returns `true` if the file exists, otherwise `false`.
|
|
1098
1172
|
*/
|
|
1099
1173
|
existsSync(pathOrId) {
|
|
1100
|
-
return this.
|
|
1174
|
+
return this.resolve(pathOrId) !== false;
|
|
1101
1175
|
}
|
|
1102
1176
|
/**
|
|
1103
1177
|
* Checks if a file exists in the virtual file system (VFS).
|
|
@@ -1105,32 +1179,22 @@ var VirtualFileSystem = class {
|
|
|
1105
1179
|
* @remarks
|
|
1106
1180
|
* This is a base method used by {@link existsSync} - it does not try to resolve the path prior to checking if it exists or not.
|
|
1107
1181
|
*
|
|
1108
|
-
* @param
|
|
1182
|
+
* @param pathOrId - The path of the file to check.
|
|
1109
1183
|
* @returns `true` if the file exists, otherwise `false`.
|
|
1110
1184
|
*/
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1185
|
+
isFile(pathOrId) {
|
|
1186
|
+
const resolved = this.resolve(pathOrId);
|
|
1187
|
+
return !!(resolved && (this.#virtualFS.existsSync(resolved) && this.#virtualFS.lstatSync(resolved).isFile() || this.#fs.existsSync(resolved) && this.#fs.lstatSync(resolved).isFile() || this.resolveFS(resolved).existsSync(resolved) && this.resolveFS(resolved).lstatSync(resolved).isFile()));
|
|
1114
1188
|
}
|
|
1115
1189
|
/**
|
|
1116
1190
|
* Checks if a directory exists in the virtual file system (VFS).
|
|
1117
1191
|
*
|
|
1118
|
-
* @param
|
|
1192
|
+
* @param pathOrId - The path of the directory to check.
|
|
1119
1193
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
1120
1194
|
*/
|
|
1121
|
-
|
|
1122
|
-
const
|
|
1123
|
-
return this.#virtualFS.existsSync(
|
|
1124
|
-
}
|
|
1125
|
-
/**
|
|
1126
|
-
* Checks if a path exists in the virtual file system (VFS).
|
|
1127
|
-
*
|
|
1128
|
-
* @param path - The path to check.
|
|
1129
|
-
* @returns `true` if the path exists, otherwise `false`.
|
|
1130
|
-
*/
|
|
1131
|
-
pathExistsSync(path) {
|
|
1132
|
-
const formattedPath = this.formatAbsoluteFilePath(toFilePath(path));
|
|
1133
|
-
return this.isValidBuiltinId(formattedPath) || this.#virtualFS.existsSync(formattedPath) || this.#fs.existsSync(formattedPath) || this.resolveFS(path).existsSync(formattedPath);
|
|
1195
|
+
isDirectory(pathOrId) {
|
|
1196
|
+
const resolved = this.resolve(pathOrId);
|
|
1197
|
+
return !!(resolved && (this.#virtualFS.existsSync(resolved) && this.#virtualFS.lstatSync(resolved).isDirectory() || this.#fs.existsSync(resolved) && this.#fs.lstatSync(resolved).isDirectory() || this.resolveFS(resolved).existsSync(resolved) && this.resolveFS(resolved).lstatSync(resolved).isDirectory()));
|
|
1134
1198
|
}
|
|
1135
1199
|
/**
|
|
1136
1200
|
* Retrieves the status of a file in the virtual file system (VFS).
|
|
@@ -1139,7 +1203,7 @@ var VirtualFileSystem = class {
|
|
|
1139
1203
|
* @returns A promise that resolves to the file's status information, or false if the file does not exist.
|
|
1140
1204
|
*/
|
|
1141
1205
|
async stat(pathOrId, options) {
|
|
1142
|
-
return this.resolveFS(pathOrId).promises.stat(this.
|
|
1206
|
+
return this.resolveFS(pathOrId).promises.stat(this.resolve(toFilePath(pathOrId)) || toFilePath(pathOrId), options);
|
|
1143
1207
|
}
|
|
1144
1208
|
/**
|
|
1145
1209
|
* Synchronously retrieves the status of a file in the virtual file system (VFS).
|
|
@@ -1148,7 +1212,7 @@ var VirtualFileSystem = class {
|
|
|
1148
1212
|
* @returns The file's status information, or false if the file does not exist.
|
|
1149
1213
|
*/
|
|
1150
1214
|
statSync(pathOrId) {
|
|
1151
|
-
return this.resolveFS(pathOrId).statSync(this.
|
|
1215
|
+
return this.resolveFS(pathOrId).statSync(this.resolve(toFilePath(pathOrId)) || toFilePath(pathOrId));
|
|
1152
1216
|
}
|
|
1153
1217
|
/**
|
|
1154
1218
|
* Retrieves the status of a symbolic link in the virtual file system (VFS).
|
|
@@ -1157,7 +1221,7 @@ var VirtualFileSystem = class {
|
|
|
1157
1221
|
* @returns A promise that resolves to the symbolic link's status information, or false if the link does not exist.
|
|
1158
1222
|
*/
|
|
1159
1223
|
async lstat(pathOrId, options) {
|
|
1160
|
-
return this.resolveFS(pathOrId).promises.lstat(this.
|
|
1224
|
+
return this.resolveFS(pathOrId).promises.lstat(this.resolve(toFilePath(pathOrId)) || toFilePath(pathOrId), options);
|
|
1161
1225
|
}
|
|
1162
1226
|
/**
|
|
1163
1227
|
* Synchronously retrieves the status of a symbolic link in the virtual file system (VFS).
|
|
@@ -1166,23 +1230,7 @@ var VirtualFileSystem = class {
|
|
|
1166
1230
|
* @returns The symbolic link's status information, or false if the link does not exist.
|
|
1167
1231
|
*/
|
|
1168
1232
|
lstatSync(pathOrId, options) {
|
|
1169
|
-
return this.resolveFS(pathOrId).lstatSync(this.
|
|
1170
|
-
}
|
|
1171
|
-
/**
|
|
1172
|
-
* Resolves a path or ID to a runtime file id in the virtual file system.
|
|
1173
|
-
*
|
|
1174
|
-
* @param pathOrId - The path or id of the file to resolve.
|
|
1175
|
-
* @returns The resolved id of the runtime file if it exists, otherwise false.
|
|
1176
|
-
*/
|
|
1177
|
-
resolveId(pathOrId) {
|
|
1178
|
-
if (this.builtinIdMap.has(this.formatRuntimeId(toFilePath(pathOrId)))) {
|
|
1179
|
-
return this.formatRuntimeId(toFilePath(pathOrId));
|
|
1180
|
-
}
|
|
1181
|
-
const filePath = this.resolvePath(toFilePath(pathOrId));
|
|
1182
|
-
if (filePath) {
|
|
1183
|
-
return this.builtinIdMap.keys().find((id) => this.builtinIdMap.get(id) === filePath) || false;
|
|
1184
|
-
}
|
|
1185
|
-
return false;
|
|
1233
|
+
return this.resolveFS(pathOrId).lstatSync(this.resolve(toFilePath(pathOrId)) || toFilePath(pathOrId), options);
|
|
1186
1234
|
}
|
|
1187
1235
|
/**
|
|
1188
1236
|
* Resolves a path based on TypeScript's `tsconfig.json` paths.
|
|
@@ -1195,9 +1243,9 @@ var VirtualFileSystem = class {
|
|
|
1195
1243
|
resolveTsconfigPath(path) {
|
|
1196
1244
|
if (this.#context.tsconfig.options.paths) {
|
|
1197
1245
|
for (const tsconfigPathKey of Object.keys(this.#context.tsconfig.options.paths).filter((tsconfigPath) => path.startsWith(tsconfigPath.replaceAll("*", "")))) {
|
|
1198
|
-
const resolvedPath = this.#context.tsconfig.options.paths[tsconfigPathKey]?.find((tsconfigPath) => this.
|
|
1246
|
+
const resolvedPath = this.#context.tsconfig.options.paths[tsconfigPathKey]?.find((tsconfigPath) => this.resolvePath(joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, tsconfigPath.replaceAll("*", ""), path.replace(tsconfigPathKey.replaceAll("*", ""), ""))) || this.formatPath(tsconfigPath) === this.formatPath(path));
|
|
1199
1247
|
if (resolvedPath) {
|
|
1200
|
-
return this.
|
|
1248
|
+
return this.formatPath(resolvedPath) === this.formatPath(path) ? this.formatPath(resolvedPath) : this.resolvePath(joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, resolvedPath.replaceAll("*", ""), path.replace(tsconfigPathKey.replaceAll("*", ""), "")));
|
|
1201
1249
|
}
|
|
1202
1250
|
}
|
|
1203
1251
|
}
|
|
@@ -1227,7 +1275,7 @@ var VirtualFileSystem = class {
|
|
|
1227
1275
|
* @returns The resolved real path if it exists, otherwise undefined.
|
|
1228
1276
|
*/
|
|
1229
1277
|
realpathSync(pathOrId) {
|
|
1230
|
-
const filePath = this.
|
|
1278
|
+
const filePath = this.resolve(toFilePath(pathOrId));
|
|
1231
1279
|
if (!filePath) {
|
|
1232
1280
|
throw new Error(`File not found: ${toFilePath(pathOrId)}`);
|
|
1233
1281
|
}
|
|
@@ -1240,24 +1288,18 @@ var VirtualFileSystem = class {
|
|
|
1240
1288
|
* @param options - Optional parameters for resolving the path, such as whether to include the file extension.
|
|
1241
1289
|
* @returns The resolved file path if it exists, otherwise undefined.
|
|
1242
1290
|
*/
|
|
1243
|
-
|
|
1244
|
-
const
|
|
1245
|
-
const resolverKey = `${
|
|
1291
|
+
resolve(pathOrId, options = {}) {
|
|
1292
|
+
const formattedPathOrId = toFilePath(pathOrId);
|
|
1293
|
+
const resolverKey = `${formattedPathOrId}${options.withExtension ? "-ext" : ""}${options.paths ? `-${murmurhash.murmurhash(options.paths)}` : ""}${options.type ? `-${options.type}` : ""}`;
|
|
1246
1294
|
if (this.#cachedResolver.has(resolverKey)) {
|
|
1247
1295
|
return this.#cachedResolver.get(resolverKey);
|
|
1248
|
-
} else if (this.#cachedFS.has(formattedPath)) {
|
|
1249
|
-
return formattedPath;
|
|
1250
1296
|
}
|
|
1251
|
-
let result =
|
|
1252
|
-
if (
|
|
1253
|
-
result = this.
|
|
1254
|
-
} else {
|
|
1255
|
-
result = this.resolvePathName(formattedPath, options);
|
|
1297
|
+
let result = this.resolveId(formattedPathOrId);
|
|
1298
|
+
if (!result) {
|
|
1299
|
+
result = this.resolvePath(formattedPathOrId, options);
|
|
1256
1300
|
}
|
|
1257
1301
|
if (!result) {
|
|
1258
1302
|
result = false;
|
|
1259
|
-
} else {
|
|
1260
|
-
result = toFilePath(result);
|
|
1261
1303
|
}
|
|
1262
1304
|
if (result && options.withExtension === false) {
|
|
1263
1305
|
return result.replace(/\.[m|c]?[t|j]sx?$/, "");
|
|
@@ -1266,16 +1308,12 @@ var VirtualFileSystem = class {
|
|
|
1266
1308
|
return result;
|
|
1267
1309
|
}
|
|
1268
1310
|
/**
|
|
1269
|
-
*
|
|
1311
|
+
* Retrieves the partial metadata for all files in the virtual file system (VFS).
|
|
1270
1312
|
*
|
|
1271
|
-
* @
|
|
1272
|
-
* @returns The formatted file path.
|
|
1313
|
+
* @returns A record containing the partial metadata for all files.
|
|
1273
1314
|
*/
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
throw new Error(`Invalid path provided. Expected a string or a valid file path.`);
|
|
1277
|
-
}
|
|
1278
|
-
return path.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "");
|
|
1315
|
+
getPartialMeta() {
|
|
1316
|
+
return Object.fromEntries(Object.entries(this.#meta).filter(([_, data]) => isSetObject.isSetObject(data)));
|
|
1279
1317
|
}
|
|
1280
1318
|
/**
|
|
1281
1319
|
* Converts a relative path to an absolute path based on the workspace and project root.
|
|
@@ -1283,56 +1321,67 @@ var VirtualFileSystem = class {
|
|
|
1283
1321
|
* @param path - The relative path to convert.
|
|
1284
1322
|
* @returns The absolute path.
|
|
1285
1323
|
*/
|
|
1286
|
-
|
|
1287
|
-
const formattedPath =
|
|
1324
|
+
formatPath(path) {
|
|
1325
|
+
const formattedPath = toFilePath(path);
|
|
1288
1326
|
if (isType.isAbsolutePath(formattedPath) || formattedPath.startsWith(this.#context.workspaceConfig.workspaceRoot)) {
|
|
1289
1327
|
return formattedPath;
|
|
1290
1328
|
} else if (formattedPath.startsWith(this.#context.config.projectRoot)) {
|
|
1291
1329
|
return joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, formattedPath);
|
|
1292
1330
|
}
|
|
1293
1331
|
return formattedPath;
|
|
1294
|
-
}
|
|
1332
|
+
}
|
|
1295
1333
|
/**
|
|
1296
|
-
* Formats a
|
|
1334
|
+
* Formats a file id by removing the file extension and prepending the runtime prefix.
|
|
1297
1335
|
*
|
|
1298
|
-
* @param id - The
|
|
1299
|
-
* @returns The formatted
|
|
1336
|
+
* @param id - The file ID to format.
|
|
1337
|
+
* @returns The formatted file ID.
|
|
1300
1338
|
*/
|
|
1301
|
-
|
|
1302
|
-
|
|
1339
|
+
formatId(id) {
|
|
1340
|
+
const formattedId = toFilePath(id);
|
|
1341
|
+
return `${this.#context.config.output.builtinPrefix}:${formattedId.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "").replace(filePathFns.findFileExtensionSafe(formattedId), "")}`;
|
|
1303
1342
|
}
|
|
1304
1343
|
/**
|
|
1305
|
-
* Resolves
|
|
1344
|
+
* Resolves an id parameter to a corresponding virtual file path in the virtual file system (VFS).
|
|
1306
1345
|
*
|
|
1307
|
-
* @param
|
|
1308
|
-
* @returns The resolved file
|
|
1346
|
+
* @param id - The id to resolve.
|
|
1347
|
+
* @returns The resolved file id if it exists, otherwise undefined.
|
|
1309
1348
|
*/
|
|
1310
|
-
|
|
1311
|
-
if (
|
|
1312
|
-
return false;
|
|
1349
|
+
resolveId(id) {
|
|
1350
|
+
if (this.#ids[this.formatId(id)]) {
|
|
1351
|
+
return this.#ids[this.formatId(id)] || false;
|
|
1313
1352
|
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Resolves a path parameter to a corresponding virtual file path in the virtual file system (VFS).
|
|
1357
|
+
*
|
|
1358
|
+
* @param path - The path to resolve.
|
|
1359
|
+
* @param options - Optional parameters for resolving the path.
|
|
1360
|
+
* @returns The resolved file path if it exists, otherwise undefined.
|
|
1361
|
+
*/
|
|
1362
|
+
resolvePath(path, options = {}) {
|
|
1363
|
+
if (isType.isAbsolutePath(path)) {
|
|
1364
|
+
if (this.#existsSync(path)) {
|
|
1365
|
+
return path;
|
|
1317
1366
|
}
|
|
1318
|
-
const result = checkVariants(
|
|
1367
|
+
const result = this.checkVariants(path);
|
|
1319
1368
|
if (result) {
|
|
1320
1369
|
return result;
|
|
1321
1370
|
}
|
|
1322
1371
|
}
|
|
1323
|
-
for (const
|
|
1324
|
-
const request = joinPaths.joinPaths(
|
|
1325
|
-
if (
|
|
1372
|
+
for (const parentPath of this.resolveParentPaths(path, options.paths)) {
|
|
1373
|
+
const request = joinPaths.joinPaths(parentPath, path);
|
|
1374
|
+
if (this.#existsSync(request)) {
|
|
1326
1375
|
return request;
|
|
1327
1376
|
}
|
|
1328
|
-
const result = checkVariants(request
|
|
1377
|
+
const result = this.checkVariants(request);
|
|
1329
1378
|
if (result) {
|
|
1330
1379
|
return result;
|
|
1331
1380
|
}
|
|
1332
1381
|
}
|
|
1333
1382
|
return false;
|
|
1334
1383
|
}
|
|
1335
|
-
resolveParentPaths(request,
|
|
1384
|
+
resolveParentPaths(request, parents = []) {
|
|
1336
1385
|
let paths = [
|
|
1337
1386
|
this.#context.workspaceConfig.workspaceRoot,
|
|
1338
1387
|
joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, this.#context.config.projectRoot)
|
|
@@ -1350,7 +1399,7 @@ var VirtualFileSystem = class {
|
|
|
1350
1399
|
ret.push(path);
|
|
1351
1400
|
}
|
|
1352
1401
|
return ret;
|
|
1353
|
-
},
|
|
1402
|
+
}, parents.filter(Boolean).map((p) => this.formatPath(p)));
|
|
1354
1403
|
}
|
|
1355
1404
|
/**
|
|
1356
1405
|
* Select the file system module to use for the operation based on the path or URL.
|
|
@@ -1381,7 +1430,7 @@ var VirtualFileSystem = class {
|
|
|
1381
1430
|
} else if (options.mode === "fs" || this.#context.config.output.mode === "fs" || isParentPath.isParentPath(toFilePath(pathOrUrl), this.#context.dataPath) || isParentPath.isParentPath(toFilePath(pathOrUrl), this.#context.cachePath) || isParentPath.isParentPath(toFilePath(pathOrUrl), joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, this.#context.config.output.outputPath))) {
|
|
1382
1431
|
return "fs";
|
|
1383
1432
|
}
|
|
1384
|
-
return
|
|
1433
|
+
return void 0;
|
|
1385
1434
|
}
|
|
1386
1435
|
/**
|
|
1387
1436
|
* Clears the resolver cache for a given path.
|
|
@@ -1391,208 +1440,93 @@ var VirtualFileSystem = class {
|
|
|
1391
1440
|
clearResolverCache(path) {
|
|
1392
1441
|
this.#cachedResolver.keys().filter((key) => key.startsWith(toFilePath(path))).forEach((key) => this.#cachedResolver.delete(key));
|
|
1393
1442
|
}
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
chunkPK6SKIKE_cjs.__name(toFilePath, "toFilePath");
|
|
1407
|
-
var FS_METHODS = [
|
|
1408
|
-
"mkdir",
|
|
1409
|
-
"mkdirSync",
|
|
1410
|
-
"rmdir",
|
|
1411
|
-
"rmdirSync",
|
|
1412
|
-
"unlink",
|
|
1413
|
-
"unlinkSync",
|
|
1414
|
-
"existsSync",
|
|
1415
|
-
"realpathSync",
|
|
1416
|
-
"writeFileSync",
|
|
1417
|
-
"readFileSync",
|
|
1418
|
-
"readdirSync",
|
|
1419
|
-
"createWriteStream",
|
|
1420
|
-
"WriteStream",
|
|
1421
|
-
"createReadStream",
|
|
1422
|
-
"ReadStream"
|
|
1423
|
-
];
|
|
1424
|
-
var FS_PROMISE_METHODS = [
|
|
1425
|
-
"mkdir",
|
|
1426
|
-
"rm",
|
|
1427
|
-
"rmdir",
|
|
1428
|
-
"unlink",
|
|
1429
|
-
"writeFile",
|
|
1430
|
-
"readFile",
|
|
1431
|
-
"readdir",
|
|
1432
|
-
"stat",
|
|
1433
|
-
"lstat"
|
|
1434
|
-
];
|
|
1435
|
-
function cloneFS(originalFS) {
|
|
1436
|
-
const clonedFS = {
|
|
1437
|
-
...originalFS,
|
|
1438
|
-
promises: {
|
|
1439
|
-
...originalFS.promises ?? {}
|
|
1443
|
+
/**
|
|
1444
|
+
* Check if the file exists with different variants (index, extensions).
|
|
1445
|
+
*
|
|
1446
|
+
* @param request - The request path to check.
|
|
1447
|
+
* @param parentPath - An optional parent path to prepend to the request.
|
|
1448
|
+
* @returns The file path if it exists, otherwise false.
|
|
1449
|
+
*/
|
|
1450
|
+
checkVariants(request, parentPath) {
|
|
1451
|
+
const path = parentPath ? joinPaths.joinPaths(parentPath, request) : request;
|
|
1452
|
+
let file = this.checkExtensions(path);
|
|
1453
|
+
if (file) {
|
|
1454
|
+
return file;
|
|
1440
1455
|
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
clonedFS[method] = originalFS[method];
|
|
1456
|
+
file = this.checkIndex(path);
|
|
1457
|
+
if (file) {
|
|
1458
|
+
return file;
|
|
1445
1459
|
}
|
|
1460
|
+
return false;
|
|
1446
1461
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1462
|
+
/**
|
|
1463
|
+
* Check if the index file exists in the given request path.
|
|
1464
|
+
*
|
|
1465
|
+
* @param request - The request path to check.
|
|
1466
|
+
* @returns The index file path if it exists, otherwise false.
|
|
1467
|
+
*/
|
|
1468
|
+
checkIndex(request) {
|
|
1469
|
+
let file = joinPaths.joinPaths(request, "index");
|
|
1470
|
+
if (this.#existsSync(file)) {
|
|
1471
|
+
return file;
|
|
1453
1472
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
clonedFS[prop] = clonedFS[prop].bind(originalFS);
|
|
1458
|
-
if (isFunction.isFunction(clonedFS.promises[prop])) {
|
|
1459
|
-
clonedFS.promises[prop] = clonedFS.promises[prop].bind(originalFS);
|
|
1460
|
-
}
|
|
1473
|
+
file = this.checkExtensions(file);
|
|
1474
|
+
if (file) {
|
|
1475
|
+
return file;
|
|
1461
1476
|
}
|
|
1477
|
+
return false;
|
|
1462
1478
|
}
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1479
|
+
/**
|
|
1480
|
+
* Check if the file exists with different extensions.
|
|
1481
|
+
*
|
|
1482
|
+
* @param request - The request path to check.
|
|
1483
|
+
* @param vfs - The file system module to use for checking file existence.
|
|
1484
|
+
* @returns The file path if it exists with any of the checked extensions, otherwise false.
|
|
1485
|
+
*/
|
|
1486
|
+
checkExtensions(request) {
|
|
1487
|
+
let file = `${request}.ts`;
|
|
1488
|
+
if (this.#existsSync(file)) {
|
|
1489
|
+
return file;
|
|
1466
1490
|
}
|
|
1491
|
+
file = `${request}.mts`;
|
|
1492
|
+
if (this.#existsSync(file)) {
|
|
1493
|
+
return file;
|
|
1494
|
+
}
|
|
1495
|
+
file = `${request}.cts`;
|
|
1496
|
+
if (this.#existsSync(file)) {
|
|
1497
|
+
return file;
|
|
1498
|
+
}
|
|
1499
|
+
file = `${request}.tsx`;
|
|
1500
|
+
if (this.#existsSync(file)) {
|
|
1501
|
+
return file;
|
|
1502
|
+
}
|
|
1503
|
+
file = `${request}.js`;
|
|
1504
|
+
if (this.#existsSync(file)) {
|
|
1505
|
+
return file;
|
|
1506
|
+
}
|
|
1507
|
+
file = `${request}.mjs`;
|
|
1508
|
+
if (this.#existsSync(file)) {
|
|
1509
|
+
return file;
|
|
1510
|
+
}
|
|
1511
|
+
file = `${request}.cjs`;
|
|
1512
|
+
if (this.#existsSync(file)) {
|
|
1513
|
+
return file;
|
|
1514
|
+
}
|
|
1515
|
+
file = `${request}.jsx`;
|
|
1516
|
+
if (this.#existsSync(file)) {
|
|
1517
|
+
return file;
|
|
1518
|
+
}
|
|
1519
|
+
file = `${request}.json`;
|
|
1520
|
+
if (this.#existsSync(file)) {
|
|
1521
|
+
return file;
|
|
1522
|
+
}
|
|
1523
|
+
file = `${request}.d.ts`;
|
|
1524
|
+
if (this.#existsSync(file)) {
|
|
1525
|
+
return file;
|
|
1526
|
+
}
|
|
1527
|
+
return false;
|
|
1467
1528
|
}
|
|
1468
|
-
|
|
1469
|
-
}
|
|
1470
|
-
chunkPK6SKIKE_cjs.__name(cloneFS, "cloneFS");
|
|
1471
|
-
function patchFS(originalFS, vfs) {
|
|
1472
|
-
const clonedFS = cloneFS(originalFS);
|
|
1473
|
-
originalFS.mkdirSync = (file, options) => vfs.mkdirSync(toFilePath(file), options);
|
|
1474
|
-
originalFS.mkdir = (file, options, callback) => vfs.mkdir(toFilePath(file), options, callback);
|
|
1475
|
-
originalFS.promises.mkdir = async (file, options) => vfs.mkdir(toFilePath(file), options);
|
|
1476
|
-
originalFS.unlinkSync = (file) => vfs.unlinkSync(toFilePath(file));
|
|
1477
|
-
originalFS.promises.rm = async (file, options) => vfs.rm(toFilePath(file), options);
|
|
1478
|
-
originalFS.promises.unlink = async (file) => vfs.unlink(toFilePath(file));
|
|
1479
|
-
originalFS.existsSync = (file) => vfs.existsSync(toFilePath(file));
|
|
1480
|
-
Object.defineProperty(originalFS, "realpathSync", {
|
|
1481
|
-
value: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((file, options) => vfs.realpathSync(toFilePath(file), options), "value")
|
|
1482
|
-
});
|
|
1483
|
-
originalFS.writeFileSync = (file, data, options) => vfs.writeFileSync(toFilePath(file), data, options);
|
|
1484
|
-
originalFS.promises.writeFile = async (file, data, options) => vfs.writeFile(toFilePath(file), data, options);
|
|
1485
|
-
originalFS.readFileSync = (file, options) => vfs.readFileSync(toFilePath(file), options);
|
|
1486
|
-
originalFS.promises.readFile = (file, options) => vfs.readFile(toFilePath(file), options);
|
|
1487
|
-
originalFS.readdirSync = (file, options) => vfs.readdirSync(toFilePath(file), options);
|
|
1488
|
-
originalFS.promises.readdir = (file, options) => vfs.readdir(toFilePath(file), options);
|
|
1489
|
-
Object.defineProperty(originalFS, "statSync", {
|
|
1490
|
-
value: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((file, options) => vfs.statSync(toFilePath(file), options), "value")
|
|
1491
|
-
});
|
|
1492
|
-
originalFS.stat = (file, options) => vfs.statSync(toFilePath(file), options);
|
|
1493
|
-
originalFS.promises.stat = (file, options) => vfs.stat(toFilePath(file), options);
|
|
1494
|
-
Object.defineProperty(originalFS, "lstatSync", {
|
|
1495
|
-
value: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((file, options) => vfs.lstatSync(toFilePath(file), options), "value")
|
|
1496
|
-
});
|
|
1497
|
-
originalFS.lstat = (file, options) => vfs.lstatSync(toFilePath(file), options);
|
|
1498
|
-
originalFS.promises.lstat = (file, options) => vfs.lstat(toFilePath(file), options);
|
|
1499
|
-
return () => {
|
|
1500
|
-
originalFS.mkdirSync = clonedFS.mkdirSync;
|
|
1501
|
-
originalFS.mkdir = clonedFS.mkdir;
|
|
1502
|
-
originalFS.promises.mkdir = clonedFS.promises.mkdir;
|
|
1503
|
-
originalFS.unlinkSync = clonedFS.unlinkSync;
|
|
1504
|
-
originalFS.promises.rm = clonedFS.promises.rm;
|
|
1505
|
-
originalFS.promises.unlink = clonedFS.promises.unlink;
|
|
1506
|
-
originalFS.existsSync = clonedFS.existsSync;
|
|
1507
|
-
originalFS.realpathSync = clonedFS.realpathSync;
|
|
1508
|
-
originalFS.writeFileSync = clonedFS.writeFileSync;
|
|
1509
|
-
originalFS.promises.writeFile = clonedFS.promises.writeFile;
|
|
1510
|
-
originalFS.readFileSync = clonedFS.readFileSync;
|
|
1511
|
-
originalFS.promises.readFile = clonedFS.promises.readFile;
|
|
1512
|
-
originalFS.readdirSync = clonedFS.readdirSync;
|
|
1513
|
-
originalFS.promises.readdir = clonedFS.promises.readdir;
|
|
1514
|
-
Object.defineProperty(originalFS, "statSync", {
|
|
1515
|
-
value: clonedFS.statSync
|
|
1516
|
-
});
|
|
1517
|
-
originalFS.stat = clonedFS.stat;
|
|
1518
|
-
originalFS.promises.stat = clonedFS.promises.stat;
|
|
1519
|
-
Object.defineProperty(originalFS, "lstatSync", {
|
|
1520
|
-
value: clonedFS.lstatSync
|
|
1521
|
-
});
|
|
1522
|
-
originalFS.lstat = clonedFS.lstat;
|
|
1523
|
-
originalFS.promises.lstat = clonedFS.promises.lstat;
|
|
1524
|
-
};
|
|
1525
|
-
}
|
|
1526
|
-
chunkPK6SKIKE_cjs.__name(patchFS, "patchFS");
|
|
1527
|
-
function checkVariants(request, vfs, parentPath) {
|
|
1528
|
-
const path = parentPath ? joinPaths.joinPaths(parentPath, request) : request;
|
|
1529
|
-
let file = checkExtensions(path, vfs);
|
|
1530
|
-
if (file) {
|
|
1531
|
-
return file;
|
|
1532
|
-
}
|
|
1533
|
-
file = checkIndex(path, vfs);
|
|
1534
|
-
if (file) {
|
|
1535
|
-
return file;
|
|
1536
|
-
}
|
|
1537
|
-
return false;
|
|
1538
|
-
}
|
|
1539
|
-
chunkPK6SKIKE_cjs.__name(checkVariants, "checkVariants");
|
|
1540
|
-
function checkIndex(request, vfs) {
|
|
1541
|
-
let file = joinPaths.joinPaths(request, "index");
|
|
1542
|
-
if (vfs.fileExistsSync(file)) {
|
|
1543
|
-
return file;
|
|
1544
|
-
}
|
|
1545
|
-
file = checkExtensions(file, vfs);
|
|
1546
|
-
if (file) {
|
|
1547
|
-
return file;
|
|
1548
|
-
}
|
|
1549
|
-
return false;
|
|
1550
|
-
}
|
|
1551
|
-
chunkPK6SKIKE_cjs.__name(checkIndex, "checkIndex");
|
|
1552
|
-
function checkExtensions(request, vfs) {
|
|
1553
|
-
let file = `${request}.ts`;
|
|
1554
|
-
if (vfs.fileExistsSync(file)) {
|
|
1555
|
-
return file;
|
|
1556
|
-
}
|
|
1557
|
-
file = `${request}.mts`;
|
|
1558
|
-
if (vfs.fileExistsSync(file)) {
|
|
1559
|
-
return file;
|
|
1560
|
-
}
|
|
1561
|
-
file = `${request}.cts`;
|
|
1562
|
-
if (vfs.fileExistsSync(file)) {
|
|
1563
|
-
return file;
|
|
1564
|
-
}
|
|
1565
|
-
file = `${request}.tsx`;
|
|
1566
|
-
if (vfs.fileExistsSync(file)) {
|
|
1567
|
-
return file;
|
|
1568
|
-
}
|
|
1569
|
-
file = `${request}.js`;
|
|
1570
|
-
if (vfs.fileExistsSync(file)) {
|
|
1571
|
-
return file;
|
|
1572
|
-
}
|
|
1573
|
-
file = `${request}.mjs`;
|
|
1574
|
-
if (vfs.fileExistsSync(file)) {
|
|
1575
|
-
return file;
|
|
1576
|
-
}
|
|
1577
|
-
file = `${request}.cjs`;
|
|
1578
|
-
if (vfs.fileExistsSync(file)) {
|
|
1579
|
-
return file;
|
|
1580
|
-
}
|
|
1581
|
-
file = `${request}.jsx`;
|
|
1582
|
-
if (vfs.fileExistsSync(file)) {
|
|
1583
|
-
return file;
|
|
1584
|
-
}
|
|
1585
|
-
file = `${request}.json`;
|
|
1586
|
-
if (vfs.fileExistsSync(file)) {
|
|
1587
|
-
return file;
|
|
1588
|
-
}
|
|
1589
|
-
file = `${request}.d.ts`;
|
|
1590
|
-
if (vfs.fileExistsSync(file)) {
|
|
1591
|
-
return file;
|
|
1592
|
-
}
|
|
1593
|
-
return false;
|
|
1594
|
-
}
|
|
1595
|
-
chunkPK6SKIKE_cjs.__name(checkExtensions, "checkExtensions");
|
|
1529
|
+
};
|
|
1596
1530
|
function createVfs(context) {
|
|
1597
1531
|
const vfs = new VirtualFileSystem(context);
|
|
1598
1532
|
return vfs;
|
|
@@ -1600,7 +1534,8 @@ function createVfs(context) {
|
|
|
1600
1534
|
chunkPK6SKIKE_cjs.__name(createVfs, "createVfs");
|
|
1601
1535
|
|
|
1602
1536
|
// src/internal/contexts/context.ts
|
|
1603
|
-
var
|
|
1537
|
+
var configCache = /* @__PURE__ */ new WeakMap();
|
|
1538
|
+
var parseCache = /* @__PURE__ */ new WeakMap();
|
|
1604
1539
|
var PowerlinesContext = class _PowerlinesContext {
|
|
1605
1540
|
static {
|
|
1606
1541
|
chunkPK6SKIKE_cjs.__name(this, "PowerlinesContext");
|
|
@@ -1827,6 +1762,57 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1827
1762
|
return getWorkspaceRoot.relativeToWorkspaceRoot(this.config.projectRoot);
|
|
1828
1763
|
}
|
|
1829
1764
|
/**
|
|
1765
|
+
* The builtin module id that exist in the Powerlines virtual file system
|
|
1766
|
+
*/
|
|
1767
|
+
get builtins() {
|
|
1768
|
+
return Object.values(this.fs.meta).filter((meta) => meta && meta.variant === "builtin").map((meta) => meta?.id).filter(Boolean);
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Get the project root relative to the workspace root
|
|
1772
|
+
*/
|
|
1773
|
+
async getBuiltins() {
|
|
1774
|
+
return Promise.all(Object.entries(this.fs.meta).filter(([, meta]) => meta && meta.variant === "builtin").map(async ([path, meta]) => {
|
|
1775
|
+
const code = await this.fs.readFile(path);
|
|
1776
|
+
return {
|
|
1777
|
+
...meta,
|
|
1778
|
+
path,
|
|
1779
|
+
code
|
|
1780
|
+
};
|
|
1781
|
+
}));
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1785
|
+
*
|
|
1786
|
+
* @param code - The source code of the entry file
|
|
1787
|
+
* @param path - A path to write the entry file to
|
|
1788
|
+
* @param options - Optional write file options
|
|
1789
|
+
*/
|
|
1790
|
+
async writeEntry(code, path, options = {}) {
|
|
1791
|
+
return this.fs.writeFile(isType.isAbsolute(path) ? path : append.appendPath(path, this.entryPath), {
|
|
1792
|
+
code,
|
|
1793
|
+
variant: "entry"
|
|
1794
|
+
}, defu5__default.default(options, {
|
|
1795
|
+
mode: this.config.output.mode
|
|
1796
|
+
}));
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
1800
|
+
*
|
|
1801
|
+
* @param code - The source code of the builtin file
|
|
1802
|
+
* @param id - The unique identifier of the builtin file
|
|
1803
|
+
* @param path - An optional path to write the builtin file to
|
|
1804
|
+
* @param options - Optional write file options
|
|
1805
|
+
*/
|
|
1806
|
+
async writeBuiltin(code, id, path, options = {}) {
|
|
1807
|
+
return this.fs.writeFile(path ? isType.isAbsolute(path) ? path : join.joinPaths(this.builtinsPath, path) : append.appendPath(id, this.builtinsPath), {
|
|
1808
|
+
id,
|
|
1809
|
+
code,
|
|
1810
|
+
variant: "builtin"
|
|
1811
|
+
}, defu5__default.default(options, {
|
|
1812
|
+
mode: this.config.output.mode
|
|
1813
|
+
}));
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1830
1816
|
* Parses the source code and returns a {@link ParseResult} object.
|
|
1831
1817
|
*
|
|
1832
1818
|
* @param code - The source code to parse.
|
|
@@ -1835,12 +1821,31 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1835
1821
|
* @returns The parsed {@link ParseResult} object.
|
|
1836
1822
|
*/
|
|
1837
1823
|
async parse(code, id, options = {}) {
|
|
1838
|
-
|
|
1824
|
+
if (parseCache.has({
|
|
1825
|
+
code,
|
|
1826
|
+
options
|
|
1827
|
+
})) {
|
|
1828
|
+
return parseCache.get({
|
|
1829
|
+
code,
|
|
1830
|
+
options
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
const result = await oxcParser.parseAsync(id, code, defu5__default.default(options ?? {}, {
|
|
1839
1834
|
lang: filePathFns.hasFileExtension(id) ? void 0 : "ts",
|
|
1840
1835
|
astType: filePathFns.hasFileExtension(id) ? void 0 : "ts",
|
|
1841
1836
|
sourceType: "module",
|
|
1842
1837
|
showSemanticErrors: false
|
|
1843
1838
|
}));
|
|
1839
|
+
if (result.errors && result.errors.length > 0) {
|
|
1840
|
+
throw new Error(`Powerlines parsing errors in file: ${id}
|
|
1841
|
+
${result.errors.map((error) => ` [${error.severity}] ${error.message}${error.codeframe ? ` (${error.codeframe})` : ""}${error.helpMessage ? `
|
|
1842
|
+
Help: ${error.helpMessage}` : ""}`).join("\n")}`);
|
|
1843
|
+
}
|
|
1844
|
+
parseCache.set({
|
|
1845
|
+
code,
|
|
1846
|
+
options
|
|
1847
|
+
}, result);
|
|
1848
|
+
return result;
|
|
1844
1849
|
}
|
|
1845
1850
|
/**
|
|
1846
1851
|
* Update the context using a new user configuration options
|
|
@@ -1929,8 +1934,8 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1929
1934
|
configFile: config.configFile ?? this.config.configFile,
|
|
1930
1935
|
command: this.config.inlineConfig?.command
|
|
1931
1936
|
};
|
|
1932
|
-
if (
|
|
1933
|
-
const result =
|
|
1937
|
+
if (configCache.has(cacheKey)) {
|
|
1938
|
+
const result = configCache.get(cacheKey);
|
|
1934
1939
|
this.projectJson = result.projectJson;
|
|
1935
1940
|
this.packageJson = result.packageJson;
|
|
1936
1941
|
this.#checksum = result.checksum;
|
|
@@ -1955,7 +1960,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1955
1960
|
});
|
|
1956
1961
|
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile);
|
|
1957
1962
|
this.mergeUserConfig(userConfig.config);
|
|
1958
|
-
|
|
1963
|
+
configCache.set(cacheKey, {
|
|
1959
1964
|
projectJson: this.projectJson,
|
|
1960
1965
|
packageJson: this.packageJson,
|
|
1961
1966
|
checksum: this.#checksum,
|
|
@@ -2400,6 +2405,26 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
|
|
|
2400
2405
|
}
|
|
2401
2406
|
}
|
|
2402
2407
|
};
|
|
2408
|
+
function getBaseFileHeader(context) {
|
|
2409
|
+
return `
|
|
2410
|
+
// Generated with ${titleCase.titleCase(context.config.framework)}
|
|
2411
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
2412
|
+
`;
|
|
2413
|
+
}
|
|
2414
|
+
chunkPK6SKIKE_cjs.__name(getBaseFileHeader, "getBaseFileHeader");
|
|
2415
|
+
function getFileHeader(context, options = {}) {
|
|
2416
|
+
const { directive = null, prettierIgnore = false } = options;
|
|
2417
|
+
return `/* eslint-disable */
|
|
2418
|
+
// biome-ignore lint: disable
|
|
2419
|
+
${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `
|
|
2420
|
+
|
|
2421
|
+
${directive}
|
|
2422
|
+
` : "\n"}
|
|
2423
|
+
${getBaseFileHeader(context)}
|
|
2424
|
+
|
|
2425
|
+
`;
|
|
2426
|
+
}
|
|
2427
|
+
chunkPK6SKIKE_cjs.__name(getFileHeader, "getFileHeader");
|
|
2403
2428
|
function getString(code) {
|
|
2404
2429
|
if (!code) {
|
|
2405
2430
|
return "";
|
|
@@ -2434,7 +2459,7 @@ function resolveModulePath(nodePath, state) {
|
|
|
2434
2459
|
return;
|
|
2435
2460
|
}
|
|
2436
2461
|
const sourcePath = nodePath.node.value;
|
|
2437
|
-
const resolvedPath = state.context?.fs.
|
|
2462
|
+
const resolvedPath = state.context?.fs.resolve(sourcePath);
|
|
2438
2463
|
if (resolvedPath) {
|
|
2439
2464
|
nodePath.replaceWith(t__namespace.stringLiteral(
|
|
2440
2465
|
// Remove the file extension if it exists
|
|
@@ -2535,8 +2560,9 @@ var moduleResolverBabelPlugin = /* @__PURE__ */ chunkPK6SKIKE_cjs.__name((contex
|
|
|
2535
2560
|
async function generateTypes(context) {
|
|
2536
2561
|
context.log(types.LogLevelLabel.TRACE, `Preparing the TypeScript definitions for the Powerlines project.`);
|
|
2537
2562
|
context.log(types.LogLevelLabel.TRACE, "Transforming built-ins runtime modules files.");
|
|
2538
|
-
const builtinFiles = await
|
|
2539
|
-
|
|
2563
|
+
const builtinFiles = await context.getBuiltins();
|
|
2564
|
+
const builtinFilePaths = await Promise.all(builtinFiles.map(async (file) => {
|
|
2565
|
+
const result = await core.transformAsync(file.code.toString(), {
|
|
2540
2566
|
highlightCode: true,
|
|
2541
2567
|
code: true,
|
|
2542
2568
|
ast: false,
|
|
@@ -2564,14 +2590,14 @@ async function generateTypes(context) {
|
|
|
2564
2590
|
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
2565
2591
|
}
|
|
2566
2592
|
context.log(types.LogLevelLabel.TRACE, `Writing transformed built-in runtime file ${file.id}.`);
|
|
2567
|
-
await context.
|
|
2593
|
+
await context.writeBuiltin(result.code, file.id, file.path);
|
|
2568
2594
|
return file.path;
|
|
2569
2595
|
}));
|
|
2570
2596
|
const typescriptPath = await resolve.resolvePackage("typescript");
|
|
2571
2597
|
if (!typescriptPath) {
|
|
2572
2598
|
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
2573
2599
|
}
|
|
2574
|
-
const files =
|
|
2600
|
+
const files = builtinFilePaths.reduce((ret, fileName) => {
|
|
2575
2601
|
const formatted = replace.replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
2576
2602
|
if (!ret.includes(formatted)) {
|
|
2577
2603
|
ret.push(formatted);
|
|
@@ -2606,9 +2632,9 @@ async function generateTypes(context) {
|
|
|
2606
2632
|
const emitResult = program.emit(void 0, (fileName, text, _, __, sourceFiles, _data) => {
|
|
2607
2633
|
const sourceFile2 = sourceFiles?.[0];
|
|
2608
2634
|
if (sourceFile2?.fileName && !fileName.endsWith(".map")) {
|
|
2609
|
-
if (
|
|
2635
|
+
if (builtinFiles.some((file) => file.id === sourceFile2.fileName || file.path === sourceFile2.fileName)) {
|
|
2610
2636
|
builtinModules += `
|
|
2611
|
-
declare module "${context.fs.
|
|
2637
|
+
declare module "${context.fs.resolve(sourceFile2.fileName)}" {
|
|
2612
2638
|
${text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
2613
2639
|
}
|
|
2614
2640
|
`;
|
|
@@ -2647,7 +2673,9 @@ ${builtinModules}`.replace(
|
|
|
2647
2673
|
/import\s*(?:type\s*)?\{?[\w,\s]*(?:\}\s*)?from\s*(?:'|")@?[a-zA-Z0-9-\\/.]*(?:'|");?/g,
|
|
2648
2674
|
""
|
|
2649
2675
|
).replaceAll("#private;", "").replace(/__Ω/g, ""));
|
|
2650
|
-
await context.fs.
|
|
2676
|
+
await context.fs.writeFile(sourceFile.id, getString(sourceFile.code), {
|
|
2677
|
+
mode: "fs"
|
|
2678
|
+
});
|
|
2651
2679
|
}
|
|
2652
2680
|
chunkPK6SKIKE_cjs.__name(generateTypes, "generateTypes");
|
|
2653
2681
|
async function installPackage(context, packageName, dev = false) {
|
|
@@ -2811,7 +2839,9 @@ async function initializeTsconfig(context) {
|
|
|
2811
2839
|
const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
2812
2840
|
context.tsconfig.originalTsconfigJson = await json.readJsonFile(tsconfigFilePath);
|
|
2813
2841
|
context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
|
|
2814
|
-
await context.fs.
|
|
2842
|
+
await context.fs.writeFile(tsconfigFilePath, stormJson.StormJSON.stringify(context.tsconfig.tsconfigJson), {
|
|
2843
|
+
mode: "fs"
|
|
2844
|
+
});
|
|
2815
2845
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
|
|
2816
2846
|
}
|
|
2817
2847
|
chunkPK6SKIKE_cjs.__name(initializeTsconfig, "initializeTsconfig");
|
|
@@ -2935,7 +2965,7 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
|
|
|
2935
2965
|
context.log(types.LogLevelLabel.TRACE, `Powerlines configuration has been resolved:
|
|
2936
2966
|
|
|
2937
2967
|
${console.formatLogMessage(context.config)}`);
|
|
2938
|
-
context.fs[
|
|
2968
|
+
context.fs[chunk5XYGZ3DC_cjs.__VFS_INIT__]();
|
|
2939
2969
|
await writeMetaFile(context);
|
|
2940
2970
|
context.persistedMeta = context.meta;
|
|
2941
2971
|
if (!exists.existsSync(context.cachePath)) {
|
|
@@ -2947,11 +2977,6 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
2947
2977
|
await this.callPreHook(context, "prepare");
|
|
2948
2978
|
if (context.config.projectType === "application") {
|
|
2949
2979
|
context.log(types.LogLevelLabel.TRACE, "Generating built-in barrel file");
|
|
2950
|
-
await context.fs.writeBuiltinFile("index", joinPaths.joinPaths(context.builtinsPath, "index.ts"), `
|
|
2951
|
-
${getFileHeader(context)}
|
|
2952
|
-
|
|
2953
|
-
${(await context.fs.listBuiltinFiles()).filter((file) => !isParentPath.isParentPath(file.path, joinPaths.joinPaths(context.builtinsPath, "log")) && !isParentPath.isParentPath(file.path, joinPaths.joinPaths(context.builtinsPath, "storage"))).map((file) => `export * from "./${replace.replacePath(file.path, context.builtinsPath).replace(`.${filePathFns.findFileExtensionSafe(file.path)}`, "")}";`).join("\n")}
|
|
2954
|
-
`);
|
|
2955
2980
|
}
|
|
2956
2981
|
if (context.config.output.dts !== false) {
|
|
2957
2982
|
await generateTypes(context);
|
|
@@ -2963,7 +2988,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
2963
2988
|
}
|
|
2964
2989
|
await this.callPostHook(context, "prepare");
|
|
2965
2990
|
await writeMetaFile(context);
|
|
2966
|
-
context.fs[
|
|
2991
|
+
context.fs[chunk5XYGZ3DC_cjs.__VFS_REVERT__]();
|
|
2967
2992
|
});
|
|
2968
2993
|
this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
|
|
2969
2994
|
}
|
|
@@ -3122,7 +3147,7 @@ ${console.formatLogMessage(context.config)}`);
|
|
|
3122
3147
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
|
|
3123
3148
|
await this.#executeEnvironments(async (context) => {
|
|
3124
3149
|
await this.callHook(context, "finalize");
|
|
3125
|
-
context.fs[
|
|
3150
|
+
context.fs[chunk5XYGZ3DC_cjs.__VFS_REVERT__]();
|
|
3126
3151
|
});
|
|
3127
3152
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
|
|
3128
3153
|
}
|
|
@@ -3384,5 +3409,5 @@ Note: Please ensure the plugin package's default export is a class that extends
|
|
|
3384
3409
|
exports.PowerlinesAPI = PowerlinesAPI;
|
|
3385
3410
|
exports.createLog = createLog;
|
|
3386
3411
|
exports.getString = getString;
|
|
3387
|
-
//# sourceMappingURL=chunk-
|
|
3388
|
-
//# sourceMappingURL=chunk-
|
|
3412
|
+
//# sourceMappingURL=chunk-UTVZVGM3.cjs.map
|
|
3413
|
+
//# sourceMappingURL=chunk-UTVZVGM3.cjs.map
|